U-Net
An encoder-decoder with skip connections for pixel-accurate segmentation.
The idea
The encoder shrinks the image while capturing context; the decoder grows it back. Skip connections copy the high-resolution features from each encoder stage straight to the matching decoder stage, restoring the fine detail lost by downsampling. The picture of the layers makes a "U". The same network is the denoiser inside many diffusion models.
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- plain
- with skip connections
The learning signal (gradient) starts at the output and travels backwards through 20 layers. Bar height shows its size at each layer on a log scale.
- layers back:
- 0
A residual block computes x + F(x). The "+ x" is a shortcut the gradient can travel along.
Step by step
- 1Contract: repeated convolution and pooling reduce the resolution.
- 2Reach the bottleneck with the most abstract features.
- 3Expand: upsample step by step.
- 4Concatenate the matching encoder features at each level (skip connections).
- 5Output a per-pixel label map.
Where it is used
Medical image segmentation, diffusion model denoisers.
Watch out for
Memory-heavy at high resolutions.