Average pooling summarizes each local window by its mean value, rather than max pooling's single largest value โ a gentler downsampling that preserves overall regional signal strength instead of just its peak.
Formula
Numerical Example
Using the same 4ร4 feature map as Max Pooling's worked example, with a 2ร2 window, stride 2:
Compare directly to max pooling's result on the identical input, \(\begin{bmatrix}6&4\\4&8\end{bmatrix}\) โ average pooling produces noticeably smaller, smoother values, since it's diluting each region's peak activation with its other, weaker values.
Max vs Average Pooling โ When Each Is Preferred
| Max Pooling | Average Pooling | |
|---|---|---|
| Preserves | The strongest single activation in each region | The overall average signal across each region |
| Typical use | Feature detection tasks (most classification CNNs) | Smoother downsampling; final-layer summarization (see Global Average Pooling) |
| Sensitivity to noise | Can be more sensitive to a single unusually large (possibly noisy) activation | More robust to a single outlier value, since it's diluted by averaging |
Code
import torch
import torch.nn as nn
x = torch.tensor([[[[1.,3.,2.,4.],
[5.,6.,1.,2.],
[3.,2.,8.,1.],
[1.,4.,2.,3.]]]])
avg_pool = nn.AvgPool2d(kernel_size=2, stride=2)
print(avg_pool(x))
# tensor([[[[3.7500, 2.2500],
# [2.5000, 3.5000]]]]) -- matches the manual calculation
Common Mistakes
- Assuming average pooling is a strictly "safer" default choice than max pooling for every task โ the right choice genuinely depends on the task; max pooling remains far more common for standard image classification, specifically because preserving peak activations tends to help feature detection.
Interview Relevance
Q: "When might average pooling be preferable to max pooling?" When the overall regional signal (not just its peak) carries useful information, or when you want smoother, less noise-sensitive downsampling โ average pooling is also the standard choice specifically at the very end of many modern CNN architectures (as Global Average Pooling, next note), where summarizing an entire feature map's overall activation level, rather than its single peak, is the goal.
Practice Question
Apply 2ร2 average pooling (stride 2) to the feature map \(\begin{bmatrix}2&1&5&3\\4&0&2&6\end{bmatrix}\), and compare the result to what max pooling gave for the same input in the previous note's practice question.