ANN Types: Convolutional (CNN)
Looking through a small window
A convolutional network is built for data that sits on a grid, especially images. Nearby pixels belong together: the corner of an eye is meaningful as a group, not as 20 separate numbers in a long list.
The pipeline goes convolution, ReLU, max pooling, flatten, then a fully connected output.
The poster’s code has typos: + kernel should be * kernel.
The key idea is a small filter (also called a kernel) that slides across the picture. At each stop it looks at a little window — say 3×3 pixels — multiplies those values by the filter, and writes down one number. Then it moves one step and does it again. That sliding is the convolution. Early filters tend to pick up simple things, such as edges; later layers combine them into shapes, and then into objects. A pooling step often follows, which shrinks the map by keeping a summary of each small region, so the next layer sees a coarser picture.
An everyday picture: you read a large poster with a small cardboard frame, sliding the frame across the paper. You never need to see the whole wall at once. The same filter is reused everywhere, which is why a CNN can recognise a cat’s ear in any corner of the photo without learning a new weight for each position. That reuse is also why ANN: Evolution treats convolution as a hard, useful constraint on an MLP, not as a totally different species.
The tiny cell below slides a 2×2 filter over a 4×4 grid. The filter here is a hand-chosen “difference” pattern, not a learned one; it is only to make the sliding visible. Change a number and run it again.
A CNN is the usual first choice for image classification, and it appears in the 2012 story of AlexNet on ANN: Evolution. For how layers build from edges to objects, see Why Depth.
See also
- ANN Types: Overview
- ANN: Evolution — convolution, LeNet, and AlexNet
- Why Depth
