Svashasan Logo
Simulated data

Automotive Performance Metrics · Detection metric

Intersection over UnionIoU

Also known as Jaccard index, Jaccard similarity, overlap ratio

BeginnerSource-checked · awaiting technical reviewLast reviewed 6 December 2026

Intersection over union (IoU) measures how well two regions overlap: IoU = area(A ∩ B) / area(A ∪ B). It ranges from 0 (no overlap) to 1 (identical) and is the usual criterion for matching predicted boxes or masks to ground truth.

Explanation

IoU is the Jaccard index applied to regions. For 2D boxes it is computed from box corners, for segmentation masks over pixels, and 3D benchmarks use oriented cuboids. COCO evaluates boxes and masks with identical metrics that differ only in how IoU is computed.

As a matching rule, a prediction counts as a true positive if its IoU with an unmatched ground-truth object of the same class reaches a threshold. PASCAL VOC-style evaluation uses 0.5, while COCO averages over thresholds from 0.50 to 0.95. For semantic segmentation, Cityscapes computes IoU = TP / (TP + FP + FN) from pixel counts accumulated over the whole test set, with void pixels excluded.

IoU is scale-sensitive: a few pixels of error on a small, distant object lower IoU far more than on a large, nearby one, so small objects look worse at a fixed threshold. It is zero for every non-overlapping pair, however far apart. Values are only comparable when the region type, threshold and dataset conventions match.

How it works

For two axis-aligned boxes, intersection width = max(0, min(x2a, x2b) − max(x1a, x1b)), and likewise for height; intersection area = width × height. Union = area(A) + area(B) − intersection. IoU = intersection / union. For masks, count pixels present in both masks and pixels present in either.

Automotive applications

  • Matching detections to ground truth
  • Suppressing duplicate boxes (non-maximum suppression)
  • Segmentation evaluation
  • Association cost in tracking
  • Assigning training targets to anchors

Example

A predicted car box covers 4,000 px², the ground-truth box 5,000 px², and they share 3,500 px². IoU = 3,500 / (4,000 + 5,000 − 3,500) = 3,500 / 5,500 ≈ 0.64, so the detection counts as a match at a 0.5 threshold but not at 0.75.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. COCO Detection Evaluation (opens in a new tab)

    COCO Consortium (cocodataset.org) · Project documentation · Detection Evaluation: Metrics (IoU thresholds; boxes versus segments) · retrieved 6 December 2026

  2. Cityscapes Benchmark Suite (opens in a new tab)

    Cityscapes Dataset (cityscapes-dataset.com) · Project documentation · Pixel-Level Semantic Labeling Task: Metrics · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.