03 · 1989 · Networks that see

Convolutional network

A photo has far too many pixels to give every pixel its own weight to every neuron. A convolutional network instead learns a handful of tiny filters (here 5×5 pixels) and slides each one across the whole image. A filter that detects a vertical edge detects it anywhere.

Draw a digit below. The first layer finds edges and strokes, the second combines them into curves and loops, and a final stage votes for a digit 0–9. This model has about 20,000 weights and gets about 99% on handwritten digits it has never seen.

How it works

  1. Slide a filter. At every position, multiply the 5×5 patch by the filter’s weights and add them up. The result is one pixel of a feature map. Bright means “this pattern is here”.
  2. Keep the strongest. ReLU zeroes negatives, and pooling shrinks each map by keeping the largest value in every 2×2 block.
  3. Go deeper. A second set of filters looks at the first layer’s maps, so it detects combinations such as a curve joined to a line.
  4. Decide. The final feature maps are flattened and passed through two ordinary layers that output ten scores. The biggest wins.

Try it

runs in your browser
draw a digit with mouse or finger

Prediction

Draw a digit big and centred.

What the network sees (tap a filter to inspect it)

Things to try

From zip codes to everything

Yann LeCun’s convolutional networks read handwritten zip codes and bank cheques in the 1990s. In 2012 a much bigger one (AlexNet) won the ImageNet challenge by a huge margin, and vision has been neural ever since.

Where they are used

Photo search and portrait-mode blur on your phone, scanning medical images for signs of disease, reading licence plates, checking products on factory lines, and perception in driver-assistance systems.

This model

Trained on the 60,000-image MNIST digit set, with random shifts, rotations and stroke thickness added so that mouse drawings work. Weights are stored as 8-bit numbers, about 28 KB in total.