Interactive project · 03
Neural Network Playground
Draw a handwritten digit and watch a small neural network turn pixels into a prediction—entirely in your browser.
01 · Input
Draw a digit
Try an example
Live network
Activation flow
The network shows seven input regions and sampled hidden neurons. Connections are representative; the probabilities and hidden activations come from the full 784 → 64 → 32 → 10 model.
Stage 1 / 5
Draw a digit to begin.
Prediction
Model output
Most likely digit
—
Awaiting a drawing
Normalized input
Your drawing is cropped, centered, padded, and resized without stretching before inference.
04 · How it works
From pixels to probabilities
Normalize
The drawing becomes 784 grayscale values.
Combine
Neurons multiply inputs by learned weights and add biases.
Activate
ReLU adds nonlinearity so layers can learn patterns.
Score
The final layer produces one score per digit.
Compare
Softmax turns scores into probabilities.
Technical details
Architecture: 784 inputs → 64 ReLU units → 32 ReLU units → 10 linear outputs.
Model size: 480 KB JSON artifact, loaded once from /public/models.
Training source: scikit-learn's 8×8 handwritten-digits dataset, expanded and padded to 28×28.
Inference: Direct matrix math runs locally in this browser; no drawing leaves the page.
Timing: The displayed duration measures model math with performance.now(); visualization timing is separate.
Visualization: The 28×28 preview and ten outputs are real. Hidden nodes are sampled representatives, not every neuron or weight.