Pooling Layers
Explore max pooling and average pooling and their role in reducing spatial dimensions.
Pooling Layers VisualizerPosition: (0, 0)
Max Pooling
Selects the maximum value from each pooling window
Animation Controls
0/1
0/1
Selects maximum value
Pooling Result
Input (4×4)
Output (2×2)
Mathematical Intuition: Pooling Operations
1. Pooling Formulas
Max Pooling
Selects maximum value from window
Average Pooling
Computes mean of window values
Where is the pooling window (e.g., 2×2), is window size = 4
2. Current Window Computation
Window at position (0, 0):
Window values:
Max Pooling:
3. Output Dimension Formula
= Output dimension
= Input dimension = 4
= Pool size = 2
= Stride = 2
Output: 2 × 2
Dimensionality reduced by 75%!
4. Max vs Average Pooling: When to Use?
Max Pooling (Most Common)
- Preserves strongest features
- Better for edge/texture detection
- More robust to noise
- Creates sharper feature maps
Average Pooling
- Smoother downsampling
- Preserves overall presence
- Used in final layers (GAP)
- Reduces information loss
5. Why Pooling is Essential in CNNs
🔹 Translation Invariance
Small shifts in input → same output. Feature at (10,10) vs (10,11) → pooled to same location
🔹 Reduces Overfitting
Fewer parameters in subsequent layers → Harder to memorize training data
🔹 Computational Efficiency
4×4 → 2×2 = 75% fewer activations → Faster training & inference
🔹 Hierarchical Features
Increases receptive field → Deeper layers see larger portions of input image
6. Global Average Pooling (GAP)
GAP pools entire feature map to single value. Often used before final classification layer:
- No parameters (unlike fully-connected layer)
- Works with any input size
- Strong regularization effect
- Example: 7×7×512 → 1×1×512
Max Pooling
Takes the maximum value from pooling window. Best for preserving strongest features and edge detection.
Average Pooling
Computes mean of window values. Smoother downsampling, used in final layers and Global Average Pooling.
Dimensionality Reduction
4x4 input becomes 2x2 output with 2x2 pooling and stride 2. Reduces spatial dimensions by 75%.
Translation Invariance
Provides robustness to small feature shifts. Network recognizes features regardless of exact position.
What pooling changes
Sort each statement as true or false.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
True of pooling
Drop items hereNot true of pooling
Drop items hereTest your knowledge
A pooling layer's main purpose is to…
Learn these first
Interview Questions
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required