Recurrent Neural Network.
94.36%Doodles are sequences, not pictures: the input is the pen's movement over time (dx, dy, pen-lift), so the model has to remember what it has seen. That is exactly the job recurrent networks were built for.
Doodle one of the ten animals below and watch it guess while you draw.

Use a Recurrent Neural Network to classify hand-drawn doodles into 10 animal classes.
Recurrent networks

An RNN is a neural network trained on sequential data (text, time series, strokes) that maintains a hidden state: a memory of what the network has seen so far. (Simple explanation of RNNs)

At each time step, the RNN takes the current input x_t and the previous hidden state h_(t-1), and updates:
However, repeated multiplications by small weights cause gradients to shrink exponentially (the vanishing gradient problem), making the network forget long-term dependencies.
LSTM & GRU
More advanced architectures use gates to control information flow:
- LSTM: 3 gates: forget (discard), input (new info), output (send to next layer)
- GRU: 2 gates: update (forget + input combined), reset (how much past info to mix in)

These preserve important information over long sequences with more stable gradient flow. The Stanford RNN cheat-sheet is a great reference.
Process
Training setup
- Data: 10 animal classes from Quick, Draw!
- Encoding: [dx, dy, pen_lift], which captures motion and stroke boundaries
- Length rules: drop sequences under 6 steps, cap at 250
- Collation: pad with lengths, pack sequences so the GRU ignores padding
- Model: 2-layer bidirectional GRU (hidden 192)
- Optimization: AdamW, label smoothing, dropout, gradient clipping
- Scheduling: ReduceLROnPlateau + early stopping
- Hardware: Apple MPS acceleration; saves best/last checkpoints
Results
| Metric | Value |
|---|---|
| Test samples | 188,779 |
| Top-1 accuracy | 94.36% |
| Top-3 accuracy | 99.10% |



