Explainer 2 of 6 · Vision · interactive
Convolution
Why does one small filter beat a weight for every pixel?
Watch
The idea
A fully connected layer gives every pixel its own weight, so a pattern learnt in one corner means nothing in another. A convolution learns one small filter, nine weights, and slides it over every position.
At each stop the filter multiplies the nine pixels under it and adds them up. Where the image looks like the filter the sum is large; the grid of sums is a feature map showing where that pattern occurs.
Stack layers and filters combine: edges into strokes, strokes into digits. The small CNN reads MNIST with 7,578 weights, fourteen times fewer than the MLP, and makes fewer mistakes.
Try it
Image: click and drag to draw
Filter
Dark above, bright below scores high.
Feature map: point at a cell
Cyan cells are where the filter's pattern is present, amber where its opposite is. The same 9 weights are used at every position, which is why a convolution needs so few parameters.