Handwriting recognition (3D)
About this app
A drawn digit flows through a real network trained on MNIST (784 → 64 → 32 → 10): weight images per neuron, forward wave, softmax bars and test digits it gets confidently wrong.
How a network reads digits
To a neural network, an image of 28 × 28 pixels is a list of 784 numbers between 0 and 1. Each neuron in the next layer forms a weighted sum plus bias, z = Σ w·x + b, and applies ReLU, which turns negative values into 0. After two such layers the output layer delivers ten raw scores, one per digit. The softmax p = eᶻ / Σ eᶻ turns them into probabilities that add up to 100 %. The largest one is the answer, an estimate rather than knowledge.
What the app shows
The app contains a real network with 784 → 64 → 32 → 10 neurons and 52,650 weights and biases, trained on the 60,000 training digits of the MNIST dataset. It gets almost 98 % of the 10,000 test digits right. The 64 neurons of the first layer appear as tiles showing their weights as an image. As you draw, a wave runs through the network, and bars show the probabilities or raw scores of the ten digits. Clicking a neuron shows its calculation.
Things to try
Draw a digit large and centred; the network recomputes with every stroke. Switch the drawing area to “Numbers” to see the 784 input values. “Example” loads a real test digit, “Tricky” one where the network wavers or is wrong with more than 90 % confidence. Click a tile and compare its weight image with the product w · x for your drawing. “Show pass slowly” walks through the calculation layer by layer.
Frequently asked questions
- What is the MNIST dataset?
- MNIST is a collection of handwritten digits from 0 to 9, each a greyscale image of 28 × 28 pixels. It contains 60,000 training and 10,000 test images. MNIST is a classic starter dataset for image recognition with neural networks.
- How does a neural network recognise handwritten digits?
- The network reads the image as a list of brightness values. Each layer forms weighted sums and passes them through a nonlinearity, so that neurons respond to particular stroke fragments. The output layer produces ten values that a softmax turns into probabilities for the digits.
- Can a neural network be confidently wrong?
- Yes. The softmax probability describes how clear-cut the calculation is, not how reliable it is. For unusually written digits a network can give a wrong answer with more than 90 % confidence. High confidence is therefore no proof of a correct recognition.
- What can I try in this app?
- You draw your own digits or load real MNIST test digits, including ones where the network fails. You see each neuron’s weights as an image, the forward wave through the network and the probabilities of the ten digits.
Subject: Neural networks
More from Neural networks
- Agent loop
- Attention Visualiser
- Backpropagation — blame in reverse
- Backpropagation: learning from one mistake
- Basin of Attraction
- Your job under AI
- The temperature dial
- Diffusion model — images from noise (3D)
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps