Convolutional neural network (CNN)
A convolutional neural network is a neural network that scans its input with small learned filters, reusing the same weights at every position, which makes it especially good at recognising images.
A convolutional layer slides small filters across its input, typically a few pixels square, and at each position measures how strongly that patch matches the filter. The result is a map showing where a feature, such as a vertical edge, appears. The network learns what its filters should detect rather than having them designed by hand. Google's glossary defines a convolutional neural network as one in which at least one layer is convolutional, usually combined with pooling layers that shrink the maps and ordinary dense layers at the end.
The key saving is weight sharing. A fully connected layer looking at a 100 by 100 pixel image needs 10,000 weights for each neuron, while a 5 by 5 filter needs only 25, reused across the whole image. A cat in the corner is detected with the same weights as a cat in the centre. Stacking layers lets each one see a wider area of the original image, so early layers pick out edges and textures and later layers combine them into larger shapes and objects.
The design was inspired by studies of the visual cortex of cats by David Hubel and Torsten Wiesel in the 1950s and 1960s. Kunihiko Fukushima's neocognitron of 1980 introduced alternating feature-detecting and downsampling layers. By 1989 Yann LeCun's group was training convolutional networks end to end with backpropagation to read handwritten digits, and their LeNet-5 model went into cheque-reading systems used by several American banks. The breakthrough came in 2012, when AlexNet, a convolutional network trained on GPUs by Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton, won the ImageNet image recognition challenge and helped set off the modern AI boom.
Convolutional networks have also been applied to speech, medical image analysis, recommendation and financial time series. In October 2020 Google researchers showed that a Vision Transformer, applying a pure transformer to patches of an image, could match or beat leading convolutional networks when pre-trained on large datasets. Since then transformers have taken over some vision tasks, but convolutional networks have been displaced only in some applications and remain widely used.
They are used mainly for images and video: classifying photos, detecting objects, analysing medical scans and inspecting products on production lines. They have also been applied to speech, text and time series, anywhere that patterns are local and can appear in different positions. Their filters look for local patterns such as edges and textures and reuse the same weights across the whole image, so a feature is recognised wherever it appears. Stacked layers build those small patterns into larger ones. This uses far fewer parameters than connecting every pixel to every neuron. A CNN builds up understanding from small local patches through layers of filters. A Vision Transformer splits the image into patches and uses attention so any patch can relate directly to any other. Transformers tend to need more training data to match CNNs but have performed very well when pre-trained at large scale. Pooling shrinks a feature map by summarising small regions, usually by keeping the maximum or the average value in each window of, say, 2 by 2. It reduces the computation and number of parameters in later layers and makes the network a little less sensitive to the exact position of a feature.Common questions
What are convolutional neural networks used for?
Why are CNNs good at images?
What is the difference between a CNN and a transformer for images?
What is pooling in a CNN?
Search for "convolutional neural network explained", "CNN pooling and filters" or "AlexNet ImageNet 2012" to understand how they work and why they mattered. University course notes on computer vision, framework documentation from PyTorch or TensorFlow and the original papers are reliable sources. When comparing CNNs and vision transformers, check the training data size and compute used, since results depend strongly on both.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.