Convolution
The core operation of a CNN: slide a small filter across the input, computing a weighted sum at each position.
A convolution slides a small grid of learnable weights (a filter or kernel) across an input, computing a weighted sum at each position to produce a feature map. Because the same filter is applied everywhere, it detects a pattern (an edge, a texture) wherever it occurs, with few parameters — the building block of CNNs.
Worked example: a 3×3 edge-detecting filter slides over an image and lights up wherever there is a vertical edge, producing a map of edge locations; stacking many such filters and layers builds up to complex features. Gotcha: key knobs are kernel size, stride (how far the filter jumps, which downsamples), and padding (whether to keep the output the same size) — and the parameter sharing that makes convolution efficient is also its inductive bias (locality, translation invariance), which helps on images but is a limitation transformers relax.