Upsampling and Max Unpooling
Compare nearest-neighbor copying, bilinear interpolation, and max unpooling with small numerical examples.
Upsampling and Max Unpooling explained visually
Compare nearest-neighbor copying, bilinear interpolation, and max unpooling with small numerical examples.
What you will learn
Assign pixel labels and compare fully convolutional, U-Net, and SegNet decoders.
Distinguish enlargement from information recovery
Imagine enlarging a map of a walking trail. The map becomes bigger, but enlargement alone cannot reveal a narrow path that was missing from the original.
Upsampling has a similar limitation. It increases the spatial dimensions of a feature map, but it does not automatically recover lost information.
One method is nearest neighbor upsampling. It fills new positions by copying nearby values.
Follow nearest-neighbor copying
Start with a two by two grid. The first row contains one and two. The second row contains three and four.
Now double the height and width. Each original value becomes a two by two block.
The first row becomes one, one, two, two. The second row is the same. The third row becomes three, three, four, four. The fourth row is the same.
We now have sixteen positions instead of four. However, the extra positions contain copied values, not new measurements.
Compare interpolation and saved pooling positions
Another method is bilinear interpolation. It combines nearby values using weighted averages. This can create smoother changes between positions, but those new values are still estimates.
Max unpooling takes a different approach. During max pooling, we can save the position where each maximum was found. Max unpooling uses those saved positions to place values into a larger grid.
Imagine a pooling window with one and seven in its top row, followed by three and two in its bottom row. The maximum is seven, located at the top right.
Understand the limits of unpooling
If we immediately unpool that result, seven returns to the top right position. The other positions are filled with zeros.
The original values of one, three, and two do not return. Their positions were not enough to preserve their values.
A decoder can then apply learned convolutions to process this sparse grid and build more useful features.
In the next lesson, we will explore transposed convolution. This method uses learned weights to construct a new spatial representation.
Quick check: test your understanding
What happens when a 2 × 2 grid is enlarged twofold in each dimension?
It becomes 4 × 4, with 16 positions.
What guides max unpooling?
The saved indices that record where maxima occurred during pooling.
Does unpooling recover the discarded nonmaximum values?
No. Those positions are initially filled with zeros.
Accessible referenceLesson 59 transcript309 words · Matches the published narration and captionsOpen transcript
Imagine enlarging a map of a walking trail. The map becomes bigger, but enlargement alone cannot reveal a narrow path that was missing from the original. Upsampling has a similar limitation. It increases the spatial dimensions of a feature map, but it does not automatically recover lost information.
One method is nearest neighbor upsampling. It fills new positions by copying nearby values. Start with a two by two grid. The first row contains one and two. The second row contains three and four. Now double the height and width. Each original value becomes a two by two block.
The first row becomes one, one, two, two. The second row is the same. The third row becomes three, three, four, four. The fourth row is the same. We now have sixteen positions instead of four. However, the extra positions contain copied values, not new measurements.
Another method is bilinear interpolation. It combines nearby values using weighted averages. This can create smoother changes between positions, but those new values are still estimates. Max unpooling takes a different approach. During max pooling, we can save the position where each maximum was found. Max unpooling uses those saved positions to place values into a larger grid.
Imagine a pooling window with one and seven in its top row, followed by three and two in its bottom row. The maximum is seven, located at the top right. If we immediately unpool that result, seven returns to the top right position. The other positions are filled with zeros.
The original values of one, three, and two do not return. Their positions were not enough to preserve their values. A decoder can then apply learned convolutions to process this sparse grid and build more useful features. In the next lesson, we will explore transposed convolution. This method uses learned weights to construct a new spatial representation.