← All lessons
08

Seeing Images

Images are grids of pixels. A convolutional neural network, or CNN, learns small filters that slide across the image looking for features — edges, then shapes, then whole objects.

Slide the blue filter across the picture. At each spot it multiplies the pixels underneath by the filter and sums them. Watch it respond strongly right at the vertical edge.

filter output-3strong response = edge found
position 1/16

The blue box is a filter that slides across the image. At each spot it multiplies and sums the pixels underneath. This filter lights up on vertical edges — the boundary where the shape changes.

How it works

A CNN processes an image with small filters, typically 3x3 grids of weights. Each filter slides across the whole image, and at every position it multiplies the pixels underneath by its weights and adds them up — the operation you see here, called convolution. A single filter detects one feature, like a vertical edge. A CNN uses many filters per layer, and stacks layers: the first layer finds edges, the next combines edges into corners and textures, later layers combine those into shapes and eventually whole objects like a cat's ear or a wheel. Crucially the same filter is reused across the entire image, so the network needs far fewer weights than a fully connected one, and it recognises a feature no matter where it appears. This weight-sharing is what made CNNs the workhorse of image recognition.

Check yourself

Why does the filter give its strongest response at the boundary of the shape?

Next: Sequence Memory