Convolution kept the image's spatial size almost intact — a 6×6 image gave a 4×4 feature map. Stack a few more filter layers on top of that and the numbers pile up fast. Something has to shrink.
This feature map has two detections: a strong one (6) in the top-left window, a weaker one (4) in the bottom-right. Toggle between max and average pooling. Max pooling reports the 6 exactly — it just asks "was this feature detected anywhere in the window?" Average pooling reports 3 — it blends the strong detection with the zeros around it, and the signal gets weaker just from being averaged.
Pooling slides a window across a feature map like convolution does, but instead of a learned dot product it applies a fixed reduction — usually the max or the mean — to every value in the window:
- — the pooled output value at row , column .
- — the input feature map produced by the convolution layer.
- — the stride: how many positions the window shifts between neighboring windows.
- — the row and column of the output (pooled) position.
- — the row and column offsets ranging over the pooling window.
- Shrinks the map by the stride
A window with stride turns this feature map into a one — a quarter of the values.
- But keeps what matters
Those values are chosen so nothing important gets thrown away: taking the max of each window keeps the strongest response, not an arbitrary one.
Move the window to the bottom-right corner. Max pooling reports — the one real detection there survives untouched. Average pooling reports — a quarter of , diluted by three zeros. Now check the other two windows: both poolings agree on , because there's nothing there to lose in the first place. The disagreement only shows up exactly where there's a strong, localized signal — which is exactly why max pooling is the default choice after a convolution layer.
- Top-left window
Rows 0-1 and columns 0-1 hold the values .
- Max pooling takes — the exact strength of the strongest detection, unchanged.
- Average pooling takes — half of the true peak, because it's been averaged against three much smaller values.
- Bottom-right window
The values tell the same story at a smaller scale:
- Max reports
- Average reports
Choose a window and a pooling mode that reveals the feature map’s strongest detection, 6, exactly.
Pooling shrinks a feature map by a fixed, un-learned rule, trading spatial precision (exactly where in the window something was) for a smaller, more manageable representation — while max pooling keeps the actual strength of whatever was detected. The next chapter puts a filter layer and a pooling layer together, back to back, into the first real convolutional network.