Teaching Machines to See
Loading simulation…
flagWhat you'll discover
- arrow_forwardDescribe an image as a grid of pixel numbers
- arrow_forwardExplain how a classifier maps pixels to a class probability
- arrow_forwardRecognise why convolutional networks excel at images
- arrow_forwardInterpret a confusion matrix and class probabilities
An image is just numbers
To a computer, a photograph is not a picture at all — it is a grid of numbers. A small grey image of 28 by 28 pixels is just 784 numbers, each between 0 (black) and 255 (white). A colour photo is three such grids stacked together, for red, green and blue. Everything a vision system does begins with these raw numbers.
The miracle is that, given enough examples, a neural network can learn which arrangements of these numbers correspond to "a cat", "a stop sign" or "the digit 7". It does so by learning patterns at every scale: tiny edges, then shapes built from edges, then objects built from shapes — layer by layer, more and more abstract. Draw a digit in the simulation and the classifier will turn your strokes into 784 numbers and read them.
From pixels to prediction
A simple image classifier works much like the neuron you met earlier, just with hundreds of inputs instead of two. Each of the 784 pixels feeds into the network with its own learned weight; the network multiplies and adds, passes the result through activations, and finally outputs a score for each possible class — "I am 92% sure this is a 7, 5% sure it is a 1, and so on."
That final layer of probabilities is what we call the model's prediction. The class with the highest score wins. In the simulation, after you draw, you will see the full list of probabilities light up — even when the model is wrong, you can see its second or third guess, which is often revealing about which features it got confused by.
Why convolutions changed everything
Treating every pixel independently works for tiny digits, but real photographs have structure that a flat network throws away: an eye is an eye whether it is in the top-left or bottom-right of the photo. Convolutional neural networks (CNNs) exploit this by sliding small pattern-detectors across the whole image, so a feature learned in one place automatically works everywhere.
This single idea — local, reusable pattern detectors stacked in layers — is what made modern computer vision possible. It powers face recognition, medical image diagnosis, self-driving cars and the vision systems in your phone. The classifier you draw on here is deliberately small and fast, but it uses the same core idea: turn pixels into progressively more meaningful features, then read off a prediction.