Black October, explainedAppsGuidesAI DictionarySmall FixesOn RecordAboutFollow the lab

Convolutional neural network

Also called CNN, ConvNet, convolution

A convolutional neural network (CNN) looks at a picture through small sliding windows, finding edges first, then shapes, then whole objects.

In plain words

Imagine checking a big photo with a small magnifying glass. You move it across, bit by bit, looking for one thing, say a straight edge. Wherever you spot it, you make a mark.

A CNN does exactly this, with many magnifying glasses at once. Each one is a small filter that looks for one simple pattern: a vertical line, a curve, a patch of stripes. The marks it leaves become a new, smaller picture of where that pattern appeared.

Then the next layer looks at those marks and finds combinations: two curves make an eye, lines make a corner. Layer by layer, the network builds up from edges to shapes to "this is a dog". Nobody tells it which patterns to look for. It learns the filters from labelled examples during training.

Everyday example

Checking rice for stones

A cook spreads rice on a plate and runs a finger across it in small patches, looking for one thing: a stone. Same check, every patch. Then a second pass looks for husks. Each pass is a filter. The marks from all passes together tell the cook what is in the plate. A CNN runs hundreds of such passes, then passes over the results.

Where the example breaks: The cook knows what a stone is before starting. A CNN starts with random filters and only discovers useful patterns by being corrected over millions of examples. It also never understands the dish, only the patterns.

Go deeper

How it actually works

A CNN is a neural network built around one operation, convolution, that suits grids like images.

  1. Convolution: one filter, everywhere

    A filter is a tiny grid of numbers, often 3 by 3. It is laid over each patch of the image, the pixel values are multiplied by the filter's numbers and added up, and the result goes into an output grid called a feature map. Because the same filter is reused everywhere, a cat's ear is found wherever it sits in the photo.

  2. Many filters, many maps

    Each layer has dozens or hundreds of filters, each producing its own feature map. An activation function then keeps the strong responses and drops the weak ones.

  3. Pooling shrinks the picture

    Pooling layers often keep the strongest value in each small block, so maps get smaller and later layers see a wider area. This is how the network moves from tiny details to the big picture.

  4. A final layer decides

    After several rounds, the maps feed a fully connected layer that scores each possible label. Backpropagation and gradient descent adjust every filter's numbers until the scores match the labels.

Roots
Kunihiko Fukushima's neocognitron (1980) used layered, convolution-like units
Early practical use
1989: Yann LeCun and colleagues at Bell Labs trained one to read handwritten US zip codes
Breakthrough
AlexNet (2012): 5 convolutional layers, 60 million parameters, trained on GPUs, won ImageNet with 15.3% top-5 error
Going deeper
ResNet (2015) stacked up to 152 layers, and an ensemble of ResNets reached 3.57% top-5 error on ImageNet

Since 2020, transformers adapted for images compete with CNNs. Many real systems still use CNNs because they are fast and work well with less data.

Questions people ask

What does convolutional mean in CNN?

Convolution is the maths of sliding a small grid of numbers over a bigger one, multiplying and adding at each spot. In a CNN, that small grid is a learned filter and the bigger one is the image.

What are CNNs used for?

Mostly images and video: image recognition, medical scans, reading text, facial recognition, self-driving cars and quality checks in factories. They also work on sound turned into pictures called spectrograms.

Is a CNN deep learning?

Yes. A CNN is one type of deep learning model: a neural network with many layers. The convolution layers are what make it suited to grids such as images.

Have transformers replaced CNNs?

Not fully. Vision transformers, introduced in 2020, match or beat CNNs on many benchmarks when trained on lots of data. CNNs remain common on phones and cameras because they are efficient. Many modern systems mix both ideas.

What is the difference between a CNN and an RNN?

A CNN looks at a grid, such as an image, patch by patch. A recurrent network reads a sequence, such as text or audio, one step at a time while carrying a memory forward.

Further reading