MNIST Digit Reader

MNIST Digit Reader

Draw a digit from 0 to 9. A small convolutional network trained on the MNIST handwriting set reads it live, right in your browser.

54,314 parameters99.25% on 10,000 test digitstrained on 60,000 digits

Draw here

What the model sees: your drawing cropped, shrunk to fit a 20×20 box, and centered by mass in a 28×28 grid, the same way MNIST was prepared.

Prediction

–
–

Draw something to start.

Inside the network

The model shrinks the image's height and width while adding channels, trading where for what, then hands a summary to two fully connected layers.

Input28×28×10 paramsConv 128×28×8208 paramsPool 114×14×80 paramsConv 214×14×163,216 paramsPool 27×7×160 paramsFlatten7840 paramsDense6450,240 paramsOutput10650 params5×5 conv8 filters, ReLUmax pool2×25×5 conv16 filters, ReLUmax pool2×2flatten7·7·16fully connectedReLUfully connectedsoftmax
Box height shows width × height of each feature map; box thickness shows the number of channels. Blue volumes are produced by learned layers, gray ones by fixed operations. Scroll sideways on a narrow screen.
LayerOperationOutput shapeWeights + biasesParameters
Inputgrayscale image, values 0 to 128 × 28 × 1—0
Conv 18 filters of 5×5×1, stride 1, padding 2, ReLU28 × 28 × 88 × (5·5·1) + 8208
Max pool 12×2 window, stride 214 × 14 × 8—0
Conv 216 filters of 5×5×8, stride 1, padding 2, ReLU14 × 14 × 1616 × (5·5·8) + 163,216
Max pool 22×2 window, stride 27 × 7 × 16—0
Flattenreshape to a vector784—0
Dense784 → 64, ReLU (25% dropout during training)64784 × 64 + 6450,240
Output64 → 10, softmax1064 × 10 + 10650
Total54,314

Live activations

Each stage below updates as you draw. Brighter cells mean stronger activation.

Conv layer 1

8 learned 5×5 filters slide over the image. Each one lights up where its pattern appears, such as a stroke at a certain angle.

28×28×8
positive weightnegative weight

Conv layer 2

After max-pooling halves the size, 16 filters combine layer 1's maps into larger parts like loops, corners and line ends.

14×14×16

Dense layer

The pooled maps are flattened to 784 numbers and mixed into 64 hidden units. Different digits light up different combinations.

64

Output

10 final scores pass through softmax and become the probabilities shown in the prediction panel.

10

Messy or ambiguous drawings split the probability across look-alikes such as 4 and 9, or 3 and 5.