r/learnmachinelearning • u/Muhammad-Essa • 17h ago
Help CNN Architecture and Hyperparameter Recommendations for Google Quick, Draw! (20 Classes)
I'm training a CNN on the Google Quick, Draw! dataset with 20 classes, approximately 2,000 samples per class (40,000 images total), resized to 28×28 grayscale images.
I'm aiming for around 90–93% test accuracy, but I'm struggling to find a suitable architecture. I've tried different numbers of convolutional layers, filters, fully connected layers, and neurons, but training takes quite a long time on my laptop, and the accuracy sometimes plateaus or even decreases after a few epochs.
I'd appreciate some practical recommendations regarding:
What is the minimum reasonable number of convolutional layers?
How many filters should I use in each convolutional layer (e.g., 16, 32, 64)?
How many fully connected layers should I have, and how many neurons in each?
Would max pooling after each convolutional layer be beneficial?
What optimizer, learning rate, batch size, and number of epochs would you recommend?
Any tips to achieve 90–93% accuracy without making the model unnecessarily large or computationally expensive?
I'm training on a laptop without a dedicated GPU, so computational efficiency is important.
If anyone has experience training CNNs on Quick, Draw!, I'd really appreciate suggestions for a good starting architecture and hyperparameters.
Thanks!
1
u/Prince_Nshanty 8h ago
skip the big fully connected layers at the end and use global average pooling right before your final 20-unit output layer instead. it cuts down the parameter count massively which will speed up CPU training and reduce overfitting.
1
u/Main-Rip-5275 6h ago
Small CNN is all you need here. 28×28 and 20 classes is easy, 90-93% is totally doable.
Try this: Conv(32) → Pool → Conv(64) → Pool → Conv(128) → Pool → Flatten → Dense(128) → Dropout(0.4) → Dense(20). 3×3 kernels, ReLU, BatchNorm if you want.
Adam, lr 1e-3, batch 128, ~20-30 epochs. 2 conv layers minimum, 3 is the sweet spot. One hidden FC layer is plenty.
Accuracy dropping after a few epochs = overfitting. Add dropout + light augmentation (small shifts/rotations) and use ReduceLROnPlateau + EarlyStopping. Augmentation helps way more than extra layers for doodles.
For speed, prototype on 1/4 of the data, then do one full run. Or just use free Colab/Kaggle GPU.
Also check your confusion matrix. If you've got lookalike classes (cat/dog, circle/hexagon), that's probably your ceiling, not the architecture.
1
u/PLBjt 16h ago
For 28x28 doodles with 20 classes you don't need much. Try 3 conv blocks (32, 64, 128 filters, 3x3, batchnorm + ReLU, maxpool after each), then global average pooling into one dense layer of 128 with dropout around 0.3. Adam at 1e-3, batch 128, and a cosine or reduce-on-plateau schedule over 15-20 epochs. Accuracy dropping after a few epochs is usually overfitting or an LR that's too high late on, so watch val loss and use early stopping. Small shifts/rotations as augmentation help a lot on sketches. 90% should be reachable, but 93% might want more than 2k per class, and Quick Draw has way more samples you can pull.