Instance segmentation vs. semantic segmentation

Segmentation refers to the process of dividing an image into distinct regions or objects based on certain criteria, such as color, texture, or shape. It enables the isolation and analysis of specific regions or objects, making it essential in applications like object tracking, video surveillanceIt is an act of capturing activities in a specific area for observation purposes using cameras., geographical image analysisIt means examining remote sensing images collected by satellites or drones of specific locations., and many more. In this Answer, we’ll discuss two types of segmentation:

  • Semantic segmentation

  • Instance segmentation

Semantic segmentation

Semantic segmentation segments the image regions corresponding to different objects and classifies them. This type of segmentation performs pixel-level classification, classifying each pixel within an image into predefined classesFor example: Person, animal, and bird. It aims to provide a detailed understanding of the objects and regions present in an image by assigning a semantic label to every pixel. Each pixel in the image is associated with a label representing the object or category to which it belongs, resulting in a comprehensive segmentation map.

A segmentation map is the visual output of the semantic segmentation process. It is a mask covering the entire image, with each pixel color-coded or labeled according to its semantic class. This provides a pixel-level understanding of an image. The dimensions of a segmentation map are the same as the original input image. Below is an example of a segmentation map of an image:

Original image
Original image
1 of 3

In the example above, multiple pixels in the image corresponding to the same object are labeled with the same semantic labels. These semantic labels are mapped to distinct colors, which serve to visualize and distinguish the various objects present in the image.

Semantic segmentation is used in various domains, including autonomous drivingA robotic vehicle operating without any human intervention using various sensors and AI models., medical image analysisExtracting information from medical images and interpreting it for diagnosis and treatment planning., and object recognitionIdentifying objects in a frame.. You can find information on the complete process of semantic segmentation in this Answer.

Instance segmentation

Instance segmentation is used to segment every individual object recognized in the image. This type of segmentation assigns distinct labels for separate instances of objects sharing the same class. Moreover, it combines the capabilities of semantic segmentation and object detection by effectively distinguishing and outlining each object with bounding boxes.

Boundary boxes on each object
Boundary boxes on each object
1 of 2

In the example above, each class is distinguished by a boundary box. Then, each instance is segmented by a unique color, along with its probabilities denoting its association with a specific object. Instance segmentation is used in various domains, including robotics, traffic control systems, agriculture[object Object], and many more.

Comparison between semantic and instance segmentation

Semantic Segmentation

Instance Segmentation

This type of segmentation assigns the same class label to each pixel in an image.

This type of segmentation identifies and delineates individual objects within an image.

Semantic segmentation assigns the same label to each object instance and does not differentiate between different instances of the same class.


Instance segmentation assigns unique labels to each object instance and distinguishes between different instances of the same class.

Semantic segmentation is used for tasks like scene understanding and object detection.

Instance segmentation is used for tasks like object counting and object tracking.

The image in the above examples originates from the COCO dataset. Semantic segmentation results are generated from the pretrained DeepLab2 model, and results from instance segmentation are generated from the Matterport Mask R-CNN repository.

Knowledge test

1

(True or False) Semantic segmentation is used for object detection.

A)

True

B)

False

Question 1 of 20 attempted

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved