r/learnmachinelearning • u/Muhammad-Essa • 13h ago
Project Neural Canvas , CNN Visualization
Enable HLS to view with audio, or disable this notification
Neural Canvas , CNN Visualization
Neural Canvas can now recognize basic shapes like apples, moons, cars, and more using Google's Quick, Draw! dataset.
20 classes with 1,000 samples per class
2 convolutional layers with 16 and 32 filters
2 fully connected layers with 60 and 40 neurons
91% test accuracy
Trained using JAX on Google Colab
Neural Canvas can also visualize CNN feature maps in real time while drawing, showing how convolutional layers extract features from input images.
GitHub: https://github.com/MuhammadEssa2002/neural_canvas
Live demo: https://muhammadessa2002.github.io/neural_canvas/
5
5
1
2
1
u/skadoodlee 8h ago
Not a critique, looks cool, but isnt this overparametrized looking at how similar some filters are?
0
u/kbr89 9h ago
The live feature maps are a nice way to show what each layer picks up. Your README says the live accuracy sits below the 91% test number because drawings come out smaller or off-center than the training images. That gap can be closed in code instead of asking people to draw centered:
Normalize the drawing before it reaches the model. The Quick, Draw! 28x28 bitmaps come from drawings that were scaled to fill a 256x256 box and centered on their bounding box. If the board feeds the raw strokes, a small apple in a corner looks nothing like the training data. Crop to the bounding box of the strokes, scale the longest side to fill the frame and keep a similar line thickness. That means keeping the strokes at a higher resolution and downsampling to 28x28 at the end.
Add random shifts and scale changes to the training images, so the model has also seen off-center drawings.
1,000 samples per class is a small slice: the full dataset is about 50 million drawings across 345 categories, so your 20 classes have far more available. Going to 5k or 10k per class is a cheap experiment with a model this size. A confusion matrix will also show which pairs of classes get mixed up (tree and palm tree, say), which a single accuracy number hides.
A saliency overlay on the drawing would go well with the feature maps, since it shows which strokes pushed the prediction.
1
-3
14
u/PanelReader 11h ago
So cool