Skip to main content

The model lab · Part 2

How do neural networks classify images?

Meet Doodle-64, a 64-parameter classifier that tells 3 from E and works exactly like the big models.

Doodle-64

Model card
Type
Single-layer binary image classifier (a perceptron, the original neural network)
Parameters
64: one learned weight per pixel
Layers
1 (64 pixels → 1 score)
Input
64 numbers: the 8×8 grid, 1 where you drew ink and 0 where you didn't
Output
2 probabilities that sum to 100%: "this is a 3" vs "this is an E"

Doodle-64 is Doodle-15 scaled up from a 3×5 grid to an 8×8 one, and frontier LLMs have hundreds of billions of parameters. Doodle-64 has 64, about ten billion times smaller, but every one of them is the same kind of number doing the same multiply-and-add.

Draw a digit: 3 or letter: E

Click a pixel, or drag across the grid to draw a whole stroke at once. On a phone, draw with your finger. The classifier will predict if it's a "3" or an "E".

The classifier's 64 weights

This is the network's entire "knowledge": one weight per pixel, squashed to 0-1 with the sigmoid function and drawn in the same 8x8 layout as the drawing grid. Green cells (weight near 1) are where a 3 puts ink but an E doesn't. Red cells (weight near 0) are where an E puts ink but a 3 doesn't. Transparent cells (weight 0.5) don't help tell them apart, so the network ignores them.

Weight near 1: ink here says "3"Weight near 0: ink here says "E"Weight 0.5: this pixel is ignored

Watch your drawing run through the network

The same animation as the neural network page, wired with this classifier's real weights: all 64 pixels feed two output neurons, one for "3" and one for "E".

3?E?64 pixel inputs2 outputs
Draw some pixels above first.

Green edges carry evidence toward an output, red edges carry evidence against it. Press run and watch your lit pixels send their signal down the weighted connections. The output with the bigger weighted sum wins.

Prediction

Prediction
Confidence
"3" output
"E" output
Weighted sum (positive favors "3"):0.0
Pixels drawn:0 / 64

How this classifier works

This is a real (tiny) neural network with just one layer: 64 inputs, 64 weights, 2 outputs. Every pixel you draw is multiplied by its weight and the products are summed:

  • Green-weight pixels (the right edge) add to the "3" score. That's where a 3 curves and an E is empty.
  • Red-weight pixels (the left edge) add to the "E" score. That's the E's vertical stroke, which a 3 doesn't have.
  • Transparent-weight pixels (the top, middle, and bottom bars) appear in both shapes, so they carry no evidence either way.

The weighted sum then goes through the sigmoid function to become a confidence between 0 and 1. In a real image model the idea is identical. There are just millions of weights, learned automatically from training data instead of derived from two example shapes.

Try drawing a 3 or E, or use the example buttons. Then try something in between or messy. You'll see the confidence drop, just like a real model gets uncertain on ambiguous inputs.

Meet Doodle-64

The demo on this page is a real model, so we gave it a real model card, just like the ones providers publish for GPT or Claude. Doodle-64 is a single-layer binary image classifier with exactly 64 : one weight per pixel of its 8×8 input grid. Its input is 64 numbers (1 for ink, 0 for blank), and its output is two probabilities that always sum to 100%.

Sixty-four parameters sounds like a toy next to a frontier model's hundreds of billions, and it is. But "parameter" means exactly the same thing in both: one learned number that multiplies one input. When a model page on this site says "70B parameters", it means 70 billion of the same little dials you can see, all at once, in the heatmap below.

From pixels to predictions

Image classification sounds mystical, but it's the same math as everything else in neural networks: inputs, weights, multiplication, and addition.

A pixel grid, like the 8x8 grid below, gets flattened into 64 numbers (0 for black, 1 for white). Each number is an input. Each input gets multiplied by its learned weight. The products all add up to a score for "this is a 3" and another score for "this is an E." Whichever score is higher wins.

What the network learns

During training, the network adjusts its weights to recognize meaningful patterns. It doesn't learn "a 3 has a line on the right." A programmer didn't tell it that. Instead, through thousands of examples, the weights naturally become sensitive to the features that matter: curves, edges, connected regions.

The demo below shows all 64 of its weights as an 8x8 grid of colors: green pixels are evidence for "3", red pixels are evidence for "E", and transparent pixels are ignored. You can also watch your drawing flow through the network, from 64 inputs to 2 outputs, and see the confidence it produces. A real image classifier with millions of weights learns far richer patterns, but the mechanics are the same.

Why this matters for real models

like Claude's or GPT-4's vision capability work on the same principle, scaled up. They process photos, screenshots, charts. The network has learned to recognize objects, text, and patterns, all through millions of learned weights.

Every model's understanding of images lives in those weights. That's why changing weights changes what the model sees, and why different models see images differently.

And it isn't just vision. An answering "what comes next in this sentence?" is doing the same thing Doodle-64 does: multiply inputs by learned weights, add them up, and turn the scores into probabilities. Doodle-64 chooses between 2 answers with 64 parameters; an LLM chooses between ~200,000 possible next tokens with billions. The only gap is size.

Try it yourself

Below, draw on the pixel grid or use the example buttons. You're seeing how a tiny network makes a prediction. The confidence score tells you how sure the classifier is. When you draw something ambiguous, halfway between 3 and E, watch the confidence drop, just like a real model.

Next up: What happens if you set the weights yourself?