What is instance segmentation?
Instance segmentation is the computer vision task of finding each object in an image separately and marking its pixels with its own mask. Each mask carries a class label; two vehicles of the same class count as two instances.
Unlike semantic segmentation, which assigns every pixel to a class without separating objects of the same class, it tells each object apart.
- Topic
- Machine learning, models and training
- Also known as
- Object instance segmentation, instance-level segmentation
- Origin
- 2014, Simultaneous Detection and Segmentation (SDS); 2017, Mask R-CNN
How instance segmentation works
- The model first finds candidate objects and predicts a class and a bounding box for each.
- Mask R-CNN adds a third branch that outputs a mask for each object, in parallel with the box branch.
- The classification branch picks the class; the mask branch predicts only a binary mask of the object's pixels.
- The RoIAlign layer aligns masks at pixel level and improved mask accuracy by a relative 10% to 50%.
In more detail
Countable objects and amorphous regions
Segmentation research separates countable objects from amorphous regions of similar texture or material such as grass, sky or road. Countable objects are usually handled by object detection or instance segmentation, amorphous regions by semantic segmentation.
Commonly confused terms
| Term | How it differs |
|---|---|
| Object detection | Object detection classifies each object and locates it with a rectangular box. Instance segmentation produces not just a box but a mask showing the object's pixels, so it also gives the object's shape and area. |
Why instance segmentation matters for on-premises AI
The task requires detecting every object while precisely segmenting each one, so it gives richer information than an object detection box for counting, measuring and separating overlapping objects. The COCO dataset, with 2.5 million labelled instances in 328k images, pushed the field towards this task. Introduced in 2017, Mask R-CNN ran at 5 frames per second and showed top results in all three COCO challenge tracks.
A logistics warehouse separates every parcel with its own mask in conveyor camera images. Overlapping parcels are counted separately; damage is measured by comparing the mask of dented areas with the parcel mask and suspect parcels go to an operator.
Common questions
What training data does instance segmentation need?
Images in which every object is labelled with its own pixel-level mask. Datasets such as COCO are labelled this way. Such data labelling takes real effort; COCO itself drew on extensive crowd worker involvement.
Which models perform instance segmentation?
A common baseline is Mask R-CNN, which adds a mask branch to an object detector. It runs on a backbone network such as Residual Network; the COCO test results shown in its paper are based on ResNet-101.
What is panoptic segmentation?
Panoptic segmentation unifies semantic and instance segmentation in a single task: every pixel gets both a class and an instance id. Uncountable regions such as sky or road and individual objects thus appear in one output.
Related terms
Sources
- Simultaneous Detection and Segmentation, ECCV 2014
- Mask R-CNN, 2017
- Microsoft COCO: Common Objects in Context, 2014
- Panoptic Segmentation, CVPR 2019
In the glossary: Glossary, E to L