Computer Vision
Pooling (Max & Average)
How discarding spatial precision (shrinking the grid) actually helps the network recognize a feature regardless of its exact pixel location.
Stage 1 of 4: The Feature Map
Max pooling window at output position 0 of 8, result is 0.30.
- Input Activation
- Pooling Window
- Output Activation
A feature map is a grid of activations produced by a convolution layer. High values (bright cells) indicate a feature was found.
Check your understanding
Pooling downsamples a feature map to reduce its size and compute cost, while preserving its strongest signals and gaining translation invariance.
A feature map generated by a convolutional layer tells the network where specific patterns exist in an image. But keeping track of the exact pixel coordinates of every edge is both computationally expensive and fragile—if an object moves slightly, the activations shift, and a naive network might fail to recognize it.
Pooling solves this by summarizing local regions of the feature map. By taking the maximum (or average) value over a small window, the network reduces the spatial dimensions of the data while preserving the most important signals.
Why Max Pooling Wins
Max pooling is the standard for most CNNs. Because a high activation means "I found the feature strongly right here", taking the maximum over a 2x2 patch ensures the feature's presence is recorded in the next layer, even if its exact position within that 2x2 patch is lost. This creates translation invariance—the network becomes less sensitive to small shifts in the input.
Average pooling, on the other hand, dilutes strong signals by mixing them with weaker ones. As you can see in the simulation, applying average pooling to a sparse feature map (like one that has passed through a ReLU activation) often results in a washed-out, blurry output where the sharp features are lost.
The last stage puts translation invariance to the test directly: shift the image and watch whether max pooling's output still reports the same strong activation. It does, as long as the feature stays inside the window it started in.
Reference
- Max Pooling
- Keeps only the strongest signal in the window
- Average Pooling
- Averages all signals in the window
- Stride
- The step size the window moves. Usually matches window size for pooling.
- Translation Invariance
- The ability to recognize a feature even if it shifts slightly
- Downsampling
- Reducing a grid’s spatial size while keeping its most important values — pooling’s effect on the feature map.
Break it on purpose
Use Average Pooling on sparse activations: every 0.9 signal sits in a window with three much smaller values, so the strongest activation of 0.9 gets diluted down to 0.5 or lower once averaged — demonstrating why Max Pooling, which keeps the 0.9 exactly, is the standard choice.