← All lessons
040

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.

Variants & real-world flavors

CNN history is a lineage of depth. LeNet (1998) read bank-cheque digits with two conv layers. AlexNet (2012) went deeper on GPUs and won ImageNet by a landslide — the moment deep learning took over vision. VGG showed that stacking many uniform 3x3 filters beats fewer big ones. ResNet (2015) added skip connections that let gradients bypass layers, unlocking networks 100+ layers deep — the residual idea now lives inside transformers too. EfficientNet scaled depth, width, and resolution in a balanced ratio for the best accuracy per FLOP. Since then Vision Transformers have taken much of the crown, but CNNs still rule where compute is tight: phones, cameras, embedded devices.

Check yourself

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

Go deeper (free): 3Blue1Brown — Convolutions in image processing

Next: Tokens