Convolutional Neural Networks (1988) › The Mechanics of Convolution
History of Language AIAll chapters Convolutional Neural Networks (1988) › The Mechanics of ConvolutionOne section · Sections in this chapter3 / 9 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
To understand how CNNs work, we need to examine the core operation that gives them their name: convolution. This mathematical operation, borrowed from signal processing, provides the mechanism through which CNNs detect patterns in their input.
The convolutional layer applies small filters, also called kernels, to the input data. Each filter is a matrix of learned parameters, typically much smaller than the input itself. A common size is 3×3 or 5×5 elements. The filter slides across the input, one position at a time, computing at each position the sum of element-wise multiplications between the filter and the input region it currently covers. This process generates a feature map that indicates where the filter's pattern appears in the input.
Mathematically, for a position (i,j) in the output, we compute:
where k represents the size of the filter. This formula captures the essence of convolution: at each output position, we compute a weighted sum of input values in a local neighborhood, with the weights determined by the filter.
To build intuition, consider a simple 3×3 filter designed to detect vertical edges:
This filter responds strongly when the left side of its receptive field contains bright pixels (multiplied by 1) and the right side contains dark pixels (multiplied by -1), producing a large positive response. A vertical edge, where brightness changes sharply from left to right, generates exactly this pattern. Conversely, uniform regions produce responses near zero, since the positive contributions from bright pixels on the left are canceled by the negative contributions from equally bright pixels on the right. The filter has learned to act as an edge detector, though in practice, CNNs learn filter values through training rather than having them hand-designed.
Each convolutional layer typically contains many filters, perhaps dozens or hundreds, each learning to detect different patterns. The first layer might learn filters that respond to edges at various orientations, corners, color contrasts, or simple textures. As we progress through the network, later layers combine responses from earlier layers to detect more complex patterns. A middle layer might have filters that respond to eyes, wheels, or windows by combining edge and texture detections from earlier layers. Deep layers might detect entire faces, cars, or buildings by combining the responses of middle-layer filters. This hierarchical composition of features is what allows CNNs to learn rich representations from raw pixel data.
Think of convolution as a sliding window that looks for specific patterns. Just like your eyes scan across a page to read text, the filter scans across the image to detect features.