What is U-Net?
U-Net is a convolutional neural network architecture made of a contracting path that captures context and a symmetric expanding path that enables precise localisation, giving it a U shape. It was introduced in 2015 for biomedical image segmentation.
Unlike a plain encoder-decoder architecture, U-Net joins high-resolution feature maps from the contracting path to the same-level layers of the expanding path, recovering detail lost in downsampling.
- Topic
- Machine learning, models and training
- Also known as
- UNet
- Origin
- 2015, MICCAI paper on biomedical image segmentation
How U-Net works
- The contracting path downsamples with convolution and pooling, doubling the feature channels at each step.
- Each expanding step upsamples the feature map, concatenates it with its contracting counterpart and applies convolutions.
- There are no fully connected layers; a final 1x1 convolution maps each pixel's features to the desired classes.
- Heavy augmentation with elastic deformations offsets scarce labels; a weighted loss emphasises border pixels between touching objects.
In more detail
Tiling large images
Because U-Net uses only the valid part of each convolution, the output map contains only pixels whose full context is available in the input. This allows large images to be segmented seamlessly by splitting them into overlapping tiles; missing context at the border is filled by mirroring the input. The strategy matters for large images, since otherwise resolution would be limited by GPU memory.
Why U-Net matters for on-premises AI
U-Net could be trained end to end from very few images and outperformed the prior best method for segmenting neuronal structures in electron microscopy; it segmented a 512x512 image in under a second on a GPU of the time. It quickly became a common benchmark in medical image segmentation. It later also served as the denoising backbone of diffusion models.
A steel producer uses U-Net to mark scratches and rust on sheet images at pixel level, multiplying a small set of expert-labelled images with elastic deformations; sheets whose defect area exceeds a threshold leave the line.
Common questions
Is U-Net used only for medical images?
No. It was introduced for biomedical segmentation but is also used for other segmentation tasks and as the backbone of diffusion-based image generation models.
Why can U-Net work with little data?
The approach relies on heavy data augmentation to use the available labelled samples more efficiently; elastic deformations turn a few training images into many realistic examples.
Can U-Net be used on 3D images?
Yes. Frameworks such as nnU-Net build on 2D and 3D U-Nets and configure preprocessing, training and inference for each dataset by themselves.
Related terms
- Image segmentation
- Convolutional neural network
- Encoder-decoder architecture
- Diffusion model
- Semantic segmentation
Sources
- U-Net: Convolutional Networks for Biomedical Image Segmentation, MICCAI 2015
- nnU-Net: Self-adapting Framework for U-Net-Based Medical Image Segmentation, arXiv, 2018
- Denoising Diffusion Probabilistic Models, arXiv, 2020
- High-Resolution Image Synthesis with Latent Diffusion Models, arXiv, 2021
In the glossary: Glossary, R to Z