Course contentsShow
← Machine Learning and Deep Learning
Lesson 868 of 3,53820. Convolutional Neural Networks: FundamentalsFree lesson

Max Pooling Operation

Learn how max pooling selects the maximum value in each window, creating sparse representations with local invariance.

Max Pooling Operation

What you'll learn: How max pooling creates sparse, locally invariant representations by selecting the maximum value from each window.


What Is Max Pooling?

Max pooling is a downsampling operation that slides a window across your feature map and, in each position, picks only the maximum value from that window. Everything else gets discarded. It's the simplest and most common pooling operation in CNNs.

How It Works

Imagine a 4×4 grid of numbers representing activations from a convolutional layer. You slide a 2×2 window across it (often with stride 2, meaning no overlap), and at each position, you keep only the largest number:

Input (4×4):          After 2×2 Max Pooling (2×2):
[[1, 3, 2, 4],        
 [5, 6, 1, 2],   →    [[6, 4],
 [0, 2, 3, 1],         [2, 9]]
 [1, 0, 9, 7]]

For the top-left 2×2 window [1,3,5,6], max pooling outputs 6. For top-right [2,4,1,2], it outputs 4, and so on.

Why Maximum Values?

The maximum represents the strongest activation in that local region. By keeping only the max:

  • You achieve spatial downsampling (reducing dimensions)
  • You gain local invariance: small shifts in the input won't change which neuron fires strongest
  • You create sparse representations: most information is discarded, keeping only the most prominent features

Practical Analogy

Think of max pooling like taking group photos at different tables in a restaurant, but only keeping the tallest person from each table for the final lineup. You lose detail but preserve the "peak" characteristic of each area.

Key Takeaway: Max pooling downsamples feature maps by selecting the maximum value in each window, providing translation invariance while drastically reducing spatial dimensions and computational cost.