A detector draws a box. A segmentation network has to color in every pixel inside it. But every encoder in this course shrinks its input down to extract features — by the time an image reaches a useful bottleneck, most of its spatial detail is already gone. How do you get it back?
Encoding: each pool keeps only the block maximum, throwing the rest away.
A tiny image, pooled down twice to a single number, then upsampled back out with nothing else to go on. Step through the trace and watch exactly how much detail each pooling step throws away — and how little a plain upsample can do to bring it back.
A U-Net is an encoder-decoder: the encoder repeatedly pools an image down toward a small bottleneck, and the decoder upsamples it back out to full resolution. A skip connection carries each encoder stage's own feature map across to the matching decoder stage, so the decoder has real spatial detail to combine with, not just a coarse upsampled guess:
- — the decoder's output at resolution level (matching the encoder's resolution at that same level).
- — the encoder's own feature map at level , saved before it was pooled down further.
- — how the upsampled signal and the skip are merged (concatenation and a conv in a real U-Net; a plain average here, to keep the arithmetic exact by hand).
- Pooling is lossy, on purpose
Each max pool keeps only a block's maximum — the other three values are gone the moment the encoder moves to the next stage. That's what makes the bottleneck cheap to compute over.
- Upsampling alone can't undo that loss
Nearest-neighbor upsampling only repeats each value into a bigger block. Chained twice from a bottleneck, it can only ever produce one repeated number across the whole image.
- The skip connection is the only path detail can take back
Because was saved before the corresponding pooling step, it still has the detail that step discarded — the decoder can only recover what the skip connection hands it directly.
The same input, decoded two ways: one path only ever saw the bottleneck's single number, the other had the encoder's own feature maps to combine with at every stage. The reconstruction error tells the same story the heatmaps show.
Input:
- Encoder: two poolings to a bottleneck
Taking the max of each block:
- Top-left block : max
- Top-right block : max
- Bottom-left block : max
- Bottom-right block : max
giving . Pooling that once more gives a bottleneck of just — the single largest pixel in the whole image.
- Without skip connections: a uniform blur
Upsampling twice produces a grid of nothing but s. Squared error against the original input, averaged over all pixels: .
- With skip connections: real detail comes back
First, average the upsampled bottleneck ( everywhere) with 's own four values:
Upsampling that once more and averaging with the original input recovers real detail, in place of a flat either way:
- the top-left pixel becomes
- the pixel at row 4, column 3 becomes
Averaged over all 16 pixels: .
- The skip connection alone accounts for the entire gap
Both decoders start from the exact same bottleneck. The only difference is whether and ever entered the computation — and that alone cuts reconstruction error by .
Toggle the decoder until reconstruction error drops below 10.
Encoders discard spatial detail to make a bottleneck cheap; skip connections are the only path that detail can take back to the decoder, since upsampling alone can only repeat coarse values, never recover what was pooled away. This is the same identity-shortcut idea from residual connections, applied to resolution instead of depth — carry forward exactly what the next stage would otherwise have to reconstruct from nothing. This closes out the architectures in this part; the capstone ahead puts one of them to work end-to-end on a real pretrained model.