Computing Library › Neural Architectures
Neural Architectures

Pooling Layers

Pooling downsamples feature maps by summarizing local regions, shrinking resolution while building a degree of invariance to small shifts.

Purpose

A pooling layer replaces each local window of a feature map with a single summary value. It has no learnable parameters. Pooling reduces spatial resolution, which cuts computation and memory in later layers, enlarges the effective receptive field, and makes the representation somewhat invariant to small translations of the input.

Max and average pooling

Kronos motion — market layers

Max pooling takes the largest value in each window, keeping the strongest response and discarding the rest; it tends to preserve sharp features like edges. Average pooling takes the mean, which smooths and retains overall intensity. Max pooling has historically been more common in classification backbones, while average pooling appears in smoothing and downsampling roles.

python
import numpy as np
def max_pool_2x2(x):
    H, W = x.shape
    return x[:H//2*2, :W//2*2].reshape(H//2, 2, W//2, 2).max(axis=(1, 3))

Global pooling

Global average pooling collapses an entire feature map to a single number per channel, turning a HxWxC tensor into a C-vector. Many modern classifiers use it in place of large fully connected layers before the output, which removes parameters and reduces overfitting. It also makes the network accept variable input sizes, since the output dimension depends only on channel count.

Strided convolution as an alternative

Some architectures skip pooling entirely and downsample with strided convolutions instead. A stride-2 convolution both reduces resolution and applies learnable weights, letting the network decide how to summarize rather than fixing max or mean. This trades a few parameters for flexibility and is common in generative and detection models where preserving learnable detail matters.

Trade-offs

Pooling discards information: once a region is reduced to its maximum, the precise locations within it are lost. For classification that loss is acceptable and even helpful. For tasks needing precise spatial output, such as segmentation, aggressive pooling hurts, which is why U-Net-style networks pair downsampling with skip connections that restore lost detail during upsampling.