Max Pooling Step by Step
Follow a 4 × 4 feature map through 2 × 2 max pooling, calculate its output, and understand what pooling preserves and discards.
Max Pooling Step by Step explained visually
Follow a 4 × 4 feature map through 2 × 2 max pooling, calculate its output, and understand what pooling preserves and discards.
What you will learn
Follow filters, pooling, flattening, and classification through complete CNN examples.
Understand the local maximum
A bicycle reflector can remain conspicuous even when it moves slightly within your view. This gives an intuition for keeping a strong local response. In a CNN, max pooling acts on learned feature-map values rather than directly deciding which object is present.
Each pooling window produces its largest input value. Ordinary spatial max pooling processes each channel independently and does not mix the channels.
Calculate a complete pooling example
Use a 4 × 4 map with rows [1, 3, 4, 1], [2, 9, 7, 2], [6, 2, 3, 8], and [1, 5, 4, 2]. Choose a 2 × 2 window, stride 2, and no padding.
The upper-left window contains 1, 3, 2, and 9, so its maximum is 9. The upper-right maximum is 7. The lower windows produce 6 and 8. The output rows are [9, 7] and [6, 8].
Track shape and information
The 4 × 4 input becomes a 2 × 2 output: 16 values become 4 in each channel. Height and width are halved for these particular settings. The channel count stays unchanged.
Max pooling has no learned filter weights. Its reduction discards the other values and their arrangement within each window; it is not a lossless reshape.
Recognize the limits of shift robustness
A small displacement can leave the selected maximum unchanged, but another displacement can move a response across window boundaries and change the output. Pooling therefore does not guarantee identical results for every shifted image.
Use the reflector as an analogy for a strong response, not as a claim that pooling understands brightness or recognizes objects by itself. The next lesson compares the maximum with an average.
Quick check: test your understanding
What is the maximum of 1, 3, 2, and 9?
9.
What shape results from 4 × 4 input with a 2 × 2 window, stride 2, and no padding?
2 × 2 per channel. The channel count stays the same.
Does max pooling preserve every input value?
No. It retains one maximum per region and discards other values and their local arrangement.
Accessible referenceLesson 51 transcript303 words · Matches the published narration and captionsOpen transcript
Imagine riding a bicycle at night. A small reflector catches your headlight. Even if the reflection moves slightly within your view, you may still notice its bright spot. This gives us an intuition for max pooling. Max pooling divides a feature map into local regions and keeps the largest value from each region.
Let us work through a simple example. Start with a feature map containing four rows and four columns. Use a pooling window that is two positions wide and two positions high. Move it with a stride of two and use no padding. The first window contains one, three, two, and nine. The largest value is nine, so the first output is nine.
Move the window two positions to the right. Suppose the largest value in this second window is seven. The second output is seven. Now move to the lower half of the feature map. Suppose the two remaining windows have maximum values of six and eight.
The output has two rows and two columns. Its first row contains nine and seven. Its second row contains six and eight. We have reduced sixteen values to four. The height and width are each half their original size. Ordinary spatial max pooling processes each channel separately. If the input has several feature maps, each map is pooled without combining it with the others.
Unlike a convolutional layer, max pooling does not learn filter weights. It simply selects the largest value in each window. This operation loses information. It discards the other values and does not preserve their complete arrangement. A small movement may leave a window's maximum unchanged. However, max pooling does not guarantee that every shifted input will produce the same output. In the next lesson, we will explore average pooling. This method summarizes a region by calculating its average value.