back to projects

MNIST

A convnet that runs with no runtime.

Two convolution and pooling stages learn the strokes, then a dense head turns them into ten probabilities. Trained with a library, served without one — the forward pass is written out by hand. Nothing you draw leaves your machine.

  • Python
  • TensorFlow
  • CNN
draw a digit here — click and drag 28 × 28 input

prediction

3 a drawn sample, not a live reading

what the network sees — 28 × 28, centred on its own ink

try a sample digit

coming soon The trained network arrives with the demo. Nothing here reads what you draw yet.

01 — the shape of it

The network, layer by layer

The network, layer by layer
layer output
input 28 × 28 × 1
conv 3×3 26 × 26 × 32
maxpool 13 × 13 × 32
conv 3×3 11 × 11 × 64
maxpool 5 × 5 × 64
flatten 1,600
dense 64
softmax 10 classes
parameters 121,834

ReLU after each convolution, dropout before the head, categorical cross-entropy.

02 — the training run

Three epochs, straight to JSON.

read off epoch3.json

Everything on this page is read off that one file — the layer shapes above it, the numbers below it, and the weights the browser loads to do the arithmetic itself.

dataset
MNIST — 60,000 train / 10,000 test
input
28 × 28 grayscale, scaled to [0, 1]
conv stack
32 then 64 filters, 3 × 3, no bias term
head
1,600 → 64 → 10
parameters
121,834 — counted from the checkpoint
checkpoint
epoch 3
weights
plain JSON, loaded by the page
inference
hand-written, in the browser
hosting
static — no server in the loop

Ten classes

A flat ten-way choice, which is why MNIST is the right first problem — a 4 read as a 9 tells you something specific about what the filters learned.