Machine
Learning.
Machine learning is how we teach computers to learn from examples rather than writing rules by hand. Instead of telling a computer "a 7 has a diagonal stroke" — we show it thousands of 7s and let it figure out the pattern itself.
A large set of labelled examples the model learns from. For digit recognition: 60,000 handwritten digits, each tagged with the correct answer.
Layers of interconnected nodes that transform raw input pixels into increasingly abstract features until a final prediction emerges.
The model makes predictions, measures its errors with a loss function, then nudges its weights — repeated many times until accurate.
The MNIST dataset — 70,000 handwritten digit images (28×28 px, 0–9). It has been the standard benchmark for image classifiers since 1998.
How digit recognition works
Every step below runs inside your browser using TensorFlow.js.
Inside a neural network
Each node receives inputs from the layer before it, multiplies each by a learned weight, sums them, adds a bias, then passes through an activation function.
Formula: y = ReLU(Σ wᵢxᵢ + b)
Our model uses two hidden layers (128 and 64 neurons) plus a final softmax layer that outputs 10 probabilities — one per digit.
Activity — Draw a Digit
Draw any digit (0–9) below. The neural network will show its confidence for each possibility.
28×28 px