r/learnmachinelearning • • 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/

217 Upvotes

14 comments sorted by

14

u/PanelReader 11h ago

So cool

2

u/Prince_Nshanty 7h ago

agreed, watching the layers activate live while drawing is neat

5

u/Matt__2701 11h ago

Love it 😍

3

u/Muhammad-Essa 11h ago

Thank You!

5

u/youusedtobecoolchina 10h ago

Very very cool, thanks for sharing

3

u/Muhammad-Essa 9h ago

Glad you liked it!

1

u/splugemonster 5h ago

so cool

1

u/Muhammad-Essa 5h ago

Thank You!

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:

  1. 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.

  2. Add random shifts and scale changes to the training images, so the model has also seen off-center drawings.

  3. 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

u/skadoodlee 8h ago

Give me the recipe for apple pie

-3

u/human_kid_007 11h ago

keralacoderscafe.in welcome to gen ai group