U-Net: Contracting and expanding paths with skip connections
U-Net combines a context-encoding contracting path, a resolution-restoring expanding path and skip connections. Elastic augmentation enables strong biomedical segmentation with few annotated images.
On this page
U-Net assigns a class to every pixel. Its symmetric paths preserve both semantic context and spatial precision, unlike a classifier that emits one label.
How it works
The contracting path convolves and pools, while the expanding path upsamples and concatenates corresponding high-resolution features. The original valid convolutions make outputs smaller than inputs, with overlap-tile processing for large images.
What the evidence shows
The paper wins ISBI 2012 neuronal-structure segmentation using few annotations and elastic deformation. A weighted loss emphasizes borders between touching cells.
A reproducible check
This snippet checks a public formula or configuration; it does not reproduce full training.
input_hw = 572
output_hw = 388
levels = 4
print("original input size =", input_hw)
print("original output size =", output_hw)
print("encoder pooling levels =", levels)
original input size = 572
original output size = 388
encoder pooling levels = 4
The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.
Limitations and common misreadings
Original valid-padding dimensions should not be confused with modern same-padding implementations. Biomedical results do not guarantee natural-image generality, and augmentations must transform labels consistently.
The key takeaway
The essential idea is not merely the U shape: cross-level concatenation restores localization detail, a pattern later common in diffusion backbones.
Further reading
FAQ
- What do skip connections do?
- They concatenate high-resolution encoder features into the decoder to restore localization detail.
- Why elastic deformation?
- It creates plausible augmented biomedical samples while transforming labels consistently.
- Why weight border pixels?
- To emphasize difficult boundaries between touching objects.