JA EN
Textbook › Part II The Lineage of AI Models
CHAPTER 17

The Invention of Convolution

FREE8 min

Feed an image to an ordinary neural network and it falls apart at once. A 100×100 image means 10,000 inputs. Make the next layer 10,000 units too, and you need 100 million weights. And shift the image by a single pixel, and the network treats it as an entirely different input.

What solved both problems at the same time was convolution. The idea started out in the biology of the 1960s. Hubel and Wiesel discovered that cells in a cat's visual cortex respond only to a narrow patch of the visual field, and that they respond strongly to lines at one particular orientation.

Kunihiko Fukushima built a model of this in the neocognitron, published in 1980. Then in 1998 Yann LeCun combined it with backpropagation and put it to practical work as LeNet, reading postal codes.

What is convolution actually doing

Take a small window — 3×3, say — and slide it across the image starting from the top left. Multiply each of the nine pixels inside the window by a weight and add the results together. That result goes out as a new image. The combination of weights in the window is called a kernel, or a filter.

Input image Slide the 3×3 window along × Kernel (weights) The weights are reused Feature map A map of feature positions
Multiply the values in the window by the weights and add them up (a MAC operation). Repeat while sliding the window, and the output side becomes a map of where that feature shows up most strongly.

Three properties of this arrangement are decisively important.

Weight sharing
The same weights are used wherever in the image you happen to be looking. That is why the number of weights can be so dramatically small. For a 3×3 kernel, nine of them are enough.
Translation invariance
The same feature is detected the same way no matter where in the image it sits. A cat on the right and a cat on the left are both recognized as a cat.
Locality
Only the relationships between nearby pixels are considered. For images, this is a natural assumption to make.
These three are assumptions built into the model in advance — its inductive bias. Knowledge of the form "this is what an image is like" is handed to the model as structure, so learning makes progress even with little data. The term will pay off later, when we come to ViT.

Stack convolutional layers, and the shallow ones come to capture simple features such as lines and corners, while the deep ones capture more complex shapes and patterns. Inserting a shrinking operation called pooling in between lowers the resolution you work at stage by stage, while widening the region that a single output is looking at — its receptive field.

Comments

Sign in to comment