Navigation

Introduction to AI

Machine Learning

Deep Learning

Generative AI

Tools & Frameworks

General

Panoptic Segmentation - Unifying Instance and Semantic Segmentation

Panoptic segmentation assigns every pixel in an image both a semantic class and, for countable objects, an instance identifier. It unifies two tasks that were historically solved separately:

semantic segmentation -> per-pixel class label (e.g., "road", "sky")
instance segmentation -> per-object mask + class (e.g., "car #1", "car #2")
panoptic segmentation  -> both, with no overlaps or gaps

Stuff and Things

Classes are split into two groups. Stuff classes (sky, road, grass) are amorphous regions without a countable identity. Things classes (car, person, dog) are countable objects that each need a unique instance ID. Every pixel must receive exactly one label from this combined set, and instance masks must not overlap.

Panoptic Quality (PQ)

The standard metric, Panoptic Quality, factors into two components:

$$PQ = \underbrace{\frac{\sum_{(p,g) \in TP} IoU(p,g)}{|TP|}}{\text{segmentation quality}} \times \underbrace{\frac{|TP|}{|TP| + \tfrac{1}{2}|FP| + \tfrac{1}{2}|FN|}}{\text{recognition quality}}$$

Segmentation quality measures mask overlap for matched segments, while recognition quality penalizes missed or spurious detections. A predicted and ground-truth segment are matched only when their IoU exceeds 0.5, which guarantees a unique matching.

Architectures

Early approaches ran separate semantic and instance branches and fused their outputs with hand-tuned heuristics to resolve conflicting pixels. Modern models such as Panoptic FPN and Mask2Former instead predict a single set of masks directly, using a shared backbone and a unified query-based decoder that assigns each mask both a class and a stuff/thing designation, removing the need for post-hoc fusion.

Practical Considerations

  • Boundary pixels between adjacent stuff regions are inherently ambiguous and hurt PQ disproportionately.
  • Small or heavily occluded instances lower recognition quality even when visible parts are segmented well.
  • Video panoptic segmentation adds a temporal consistency requirement: instance IDs must persist across frames.

Panoptic segmentation is used in autonomous driving scene understanding, robotics, and AR scene reconstruction, where a system needs a complete map of both navigable regions and discrete obstacles from a single forward pass.