Pooling layer
A pooling layer is a component of convolutional neural networks that reduces the spatial dimensions of feature maps. Its purpose is to make the representat...
Pooling Layers in Convolutional Networks
A pooling layer is a component of convolutional neural networks that reduces the spatial dimensions of feature maps. Its purpose is to make the representation smaller and more manageable, decrease the number of parameters and computation in the network, and provide a form of translation invariance, meaning the network becomes less sensitive to small shifts in the position of a feature.
Max pooling is the most commonly used form. It divides the feature map into a grid of non-overlapping windows, typically 2 by 2, and outputs only the maximum value in each window. This effectively halves both the height and width of the feature map. The maximum value is retained because it represents the strongest activation of a particular feature in that region, preserving the most salient information.
Average pooling takes the mean of values in each window instead of the maximum. It produces smoother feature maps and is sometimes used in specific architectures. Global average pooling is a variant that computes the average of an entire feature map down to a single value, producing a compact vector summary. It is commonly used in the final layers of modern CNNs like GoogLeNet and MobileNet as an alternative to large fully connected layers.
Pooling introduces no learnable parameters, making it a computationally free dimensionality reduction step. However, some modern architectures replace pooling with strided convolutions, arguing that letting the network learn its own downsampling is more flexible. Both approaches are used in practice.
A concrete example: after a convolutional layer produces a 28 by 28 feature map, a 2 by 2 max pooling layer with stride 2 reduces it to 14 by 14, cutting the number of values by 75 percent. After several such pooling steps, a very deep network can process high-resolution images without an explosion in computation.
Exam tip: a common question is whether pooling destroys spatial information. The honest answer is yes, to some extent. Max pooling discards the precise location of a feature within its pooling window. This is usually acceptable and beneficial for classification, but for tasks requiring precise localisation like object detection and segmentation, approaches that preserve spatial resolution (like feature pyramids or skip connections) are used instead.