Neural Network Visualizer

Draw a digit. Watch a CNN read it.

A small convolutional network, trained on 60,000 handwritten digits, reads your drawing as you draw. Every filter and feature map is on screen.

Scratchpad

Draw a digit here

Draw any digit from 0 to 9. The network reads it as you draw.

What the network sees 28 × 28 pixels, centered like the training dataOutlined pixels were changed: violet gained ink, amber lost it
What mattered most Violet ink supports the answer. Amber ink argues against it.

Layers

52,138 parameters

Convolution 1

8 filters, 3×3, then ReLU

Max pooling

Keeps the strongest of each 2×2

Convolution 2

16 filters, each reading all 8 maps

Max pooling

16 maps of 7×7

Dense

64 neurons look at all 784 values

Each square is a feature map: where one filter found its pattern. Hover or focus one to see its filter.

Choose a feature map

Its filter weights appear here. Violet weights add to the response; amber weights subtract from it.

Prediction

?Draw to begin

    The tallest bar is the network’s answer. Close calls show where it’s unsure.

    Fool the network

    Change a few pixels of what it sees, not your drawing, until it reads another digit.

    A few pixels a person would barely notice can change the answer.

    How a CNN reads a digit.

    Small filters slide across the image, pooling keeps what matters, and a final layer weighs the evidence for each digit.

    Filters find strokes

    Each 3×3 filter slides over the image and responds where its pattern appears: an edge, a corner, a curve. The result is a feature map.

    Pooling shrinks the map

    Max pooling keeps the strongest response in each 2×2 patch, so the network cares less about exactly where a stroke is.

    Dense layers decide

    The second convolution combines strokes into shapes. Dense layers then score each digit, and softmax turns the scores into probabilities.

    Model and credits

    The network was trained for this site on the MNIST database of handwritten digits by Yann LeCun, Corinna Cortes and Christopher J. C. Burges (CC BY-SA 3.0), with rotations, shifts and stroke-width changes so hand-drawn digits work. It runs entirely in your browser; nothing you draw leaves your device. The example digits come from the MNIST test set.