Convolutional neural network
In short
A convolutional neural network is a neural network built for data laid out on a grid, such as a picture. It slides one small filter across the grid and reuses the same weights everywhere, so it can spot a pattern wherever that pattern sits.
- Also called
- CNN, Convnet
- Topic
- How AI models work
- Level
- Some background helps
- First described
- Yann LeCun and colleagues at AT&T Bell Laboratories, 1989, in "Handwritten Digit Recognition with a Back-Propagation Network".1
In 1989 Yann LeCun and colleagues at AT&T Bell Laboratories built a network for handwritten digits that did not use a separate detector at every position. One neuron with a small window scans the image, and the states are stored in a feature map. They wrote that this scan is equivalent to a convolution with a small kernel, followed by a squashing function, and that every unit in the map is constrained to use the same weights. Sharing weights cuts the number of free parameters. It also gives a simple kind of shift invariance: move the input and the feature map shifts, but is otherwise unchanged.1
The digits came from the US Postal Service. The network took a normalised image of an isolated zip-code digit and classified it, with little hand-built preprocessing. LeCun and colleagues reported a 1% error rate and about a 9% reject rate.1
The same design was later scaled up to photographs. In 2012 Alex Krizhevsky, Ilya Sutskever and Geoffrey Hinton trained a deep convolutional network on the 1.2 million high-resolution images of the ImageNet LSVRC-2010 contest, sorted into 1,000 classes. It had five convolutional layers, some followed by max-pooling, and three fully connected layers, with 60 million parameters and 650,000 neurons. On the test set its top-1 and top-5 error rates were 37.5% and 17.0%, which they reported as considerably better than the previous best.2
A convolutional network is not a transformer. The transformer paper treats a convolutional layer as a different operation: one layer with a small kernel does not connect every position to every other position, whereas attention can.3 It is also not just any neural network trained on pictures. The shared local filter is the constraint LeCun's group used to keep the number of free parameters down.1
Example
A handwritten zip-code digit can sit slightly left or right inside its box. Because every position uses the same small filter, the network does not need a separate detector for each spot.1
Why it matters
It is the design that made automatic reading of handwritten digits, and then large-scale photo classification, work in practice.12
Questions people ask
What does convolution mean in a neural network?
It means sliding one small filter across the image and reusing its weights at every position. LeCun and colleagues described that scan as a convolution with a small kernel, followed by a squashing function.1
Are convolutional neural networks only for photographs?
No. The 1989 system classified handwritten digits, which are images of characters. The same local-filter design was later trained on the ImageNet collection of photographs.12
How is a CNN different from a transformer?
A convolutional layer connects each position only to a small neighbourhood. Vaswani and colleagues contrast that with attention, which can relate all positions in one step. A single convolutional layer with a small kernel does not.3
Related terms
Sources
- LeCun, Boser, Denker, Henderson, Howard, Hubbard and Jackel (1989), Handwritten Digit Recognition with a Back-Propagation Network, NeurIPS
- Krizhevsky, Sutskever and Hinton (2012), ImageNet Classification with Deep Convolutional Neural Networks, NeurIPS
- Vaswani et al. (2017), Attention Is All You Need, arXiv:1706.03762