What is semantic segmentation?
Semantic segmentation is the computer vision task of assigning a class label to every pixel in an image. Each pixel takes the class of its enclosing object or region, giving a class map the same size as the image.
Unlike instance segmentation, it does not separate objects: two vehicles of the same class share one label and look like one region.
- Topic
- Machine learning, models and training
- Also known as
- Per-pixel classification
- Origin
- 2015, deep learning approach with fully convolutional networks (FCN)
How semantic segmentation works
- A convolutional neural network extracts features layer by layer; deeper layers carry more semantic but coarser information.
- Fully convolutional networks (FCNs) take input of any size and produce matching output; in-network upsampling brings coarse output back to pixel level.
- U-Net pairs a contracting path that captures context with a symmetric expanding path for precise localisation.
- Training uses a per-pixel loss; performance is usually measured by mean intersection over union (mean IoU) across classes.
In more detail
Mean IoU
Intersection over union (IoU) measures the overlap between the predicted pixel region for a class and the true region: the intersection of the two divided by their union. The work on fully convolutional networks reports this value averaged over all classes, background included.
Commonly confused terms
| Term | How it differs |
|---|---|
| Image classification | Image classification gives the whole image a single label. Semantic segmentation takes the next step from coarse to fine inference by making a prediction at every pixel, showing where each class lies in the image. |
Why semantic segmentation matters for on-premises AI
It gives pixel-level boundaries in fields such as autonomous driving and medical imaging. Fully convolutional networks, published at CVPR 2015, were the first FCNs trained end to end for pixelwise prediction and raised mean IoU on PASCAL VOC 2012 to 62.2%. U-Net, from the same year, trained from very few images and segmented a 512x512 image in under a second.
An energy company inspects solar panels with drone imagery. The model labels every pixel as panel, crack, dirt or vegetation; panel strings whose crack and dirt share exceeds a threshold join the maintenance list.
Common questions
Are semantic segmentation and image segmentation the same thing?
Image segmentation is the umbrella term; semantic, instance and panoptic segmentation are its types. Semantic segmentation assigns every pixel to a class, while panoptic segmentation unifies semantic and instance segmentation in one task.
What data does a semantic segmentation model need?
Masks marking the class of every pixel. Successful training of deep networks is widely held to need many thousands of annotated samples, so methods such as U-Net rely on heavy data augmentation to use the available labelled images more efficiently.
Related terms
Sources
- Fully Convolutional Networks for Semantic Segmentation, CVPR 2015
- U-Net: Convolutional Networks for Biomedical Image Segmentation, MICCAI 2015
- Panoptic Segmentation, CVPR 2019
- Mask R-CNN, 2017
In the glossary: Glossary, R to Z