Convolutional layers extract features from input data, kernels determine which local patterns are detected, and pooling layers reduce the size of the resulting feature maps. Together, they allow a convolutional neural network (CNN) to learn increasingly complex visual features efficiently.
| Component | Function in a CNN | Example |
|---|---|---|
| Kernel | A small matrix of learnable weights that scans across an input or feature map | A kernel may learn to detect vertical edges |
| Convolutional layer | Applies multiple kernels to produce feature maps, usually followed by an activation function | Early layers detect edges; deeper layers may detect shapes or object parts |
| Pooling layer | Downsamples feature maps by summarizing small regions | Max pooling retains the largest value in each region |
During convolution, a kernel moves across an image. At each position, the CNN multiplies the kernel's weights by the corresponding input values, adds the results and normally adds a bias. The output becomes one value in a feature map.
For example, a kernel examines nine neighbouring pixels at a time. Because the same kernel weights are reused across the image, CNNs use parameter sharing, reducing the number of parameters compared with a fully connected network. Multiple kernels produce multiple feature maps, each representing a different learned feature.
A pooling layer then reduces each feature map's spatial dimensions. Max pooling selects the largest value from a region, while average pooling calculates its mean. Pooling decreases computation and can make feature detection less sensitive to small shifts in the input, but it also discards some spatial information.
A common misconception is that pooling layers learn features. They usually have no trainable weights: kernels learn feature detectors, while pooling layers summarize their outputs.
For an IB Computer Science A4.3 response, distinguish clearly between the kernel and the convolutional layer. For an “explain” question, describe the scanning and weighted-sum mechanism, then link convolution to feature extraction and pooling to dimensionality reduction.