Neural Network Lab
Draw a digit. Tell the network what it is. Watch the connections learn.
This is a real neural network, starting with random weights and no training data. Your drawings and training stay in this browser tab.
1 · Draw and label
Each of these 16 × 16 pixels is a brightness value from 0 to 1. Keep your digit centered and use most of the pad.
0 / 500 examples
Adding an example saves its label. Training is the separate step that changes weights. Keyboard: arrows + Space draws pixels.
2 · Build and train
Each layer has a set of learned connection weights and a bias for each neuron. Building a new network resets weights but keeps your examples.
Add an example to begin.
0
weight updates
—
training accuracy
—
training loss
The loss chart restarts when examples change. Metrics refresh periodically for larger datasets.
No labeled digits yet.
Training accuracy is measured on saved examples. It can be high because the model memorized them. Draw a new example to test recognition. Bigger networks need more varied data; more layers do not guarantee better results.
3 · Follow the signal
Showing your drawing.
Swipe sideways on smaller screens. Click a neuron to inspect its actual math. Calculations are fast; the animation slows down the real forward pass and learning step.
Try a first experiment
- Draw several examples of 0 and 1, adding the correct label each time. Vary your handwriting a little.
- Choose Train one example to follow a single update, or Train slowly to repeat across your saved examples. Increase the speed when you want more practice.
- Pause, draw a new 0 or 1, and test it without adding it. Does the network recognize a drawing it has not practiced?
- Add other digits and more examples. Try a different number of hidden layers and compare what happens. A new architecture starts again with random weights.
One example per digit is usually not enough for reliable recognition. A high learning rate can make loss bounce around; try smaller changes if that happens.
Output: digits 0–9
The untrained network has not learned what digits mean.
Softmax converts the ten final scores into probabilities. Confidence is not a guarantee of correctness.
Inside a neuron
| Input | Activation | Weight | Contribution | Last Δw |
|---|
Contribution = input activation × weight. A hidden neuron applies tanh to the sum plus its bias. Output neurons use softmax across all ten scores. Gold highlights the backward learning step.
Your training examples and saved lab
Correcting or removing an example does not undo learning that already happened. Reset weights to train again from scratch.
A lab file contains your drawings, labels, architecture, and trained weights. It is downloaded to your device and never uploaded to CalculaGames. Nothing is saved automatically; download your lab before leaving to keep it.