Skip to content
Deep Learning

What is intersection over union (IoU)?

A measure of overlap between a predicted region and the ground truth: the area of their intersection divided by the area of their union. It runs from 0 for no overlap to 1 for a perfect match and is the standard score for detection boxes and segmentation masks.

datasciencetrivia.com

Card 1 of 259. Answer: A measure of overlap between a predicted region and the ground truth: the area of their intersection divided by the area of their union. It runs from 0 for no overlap to 1 for a perfect match and is the standard score for detection boxes and segmentation masks.

Created by santiviquez

About · Quizzes · History of AI · To suggest new questions or report an error send me a dm.

The longer answer

IoU, also called the Jaccard index, compares two regions by how much they share relative to how much they cover together. In object detection, a predicted box counts as a true positive only if its IoU with a ground-truth box clears a threshold: 0.5 in PASCAL VOC, while COCO averages precision over thresholds from 0.5 to 0.95.

Example: the ground-truth box spans (0, 0) to (10, 10) and the prediction (5, 0) to (15, 10). The intersection is 5 × 10 = 50 and the union is 100 + 100 − 50 = 150, so IoU = 0.33. The prediction covers half the object yet fails the usual 0.5 threshold, which shows how strict IoU is about position.

For segmentation, the Dice coefficient, 2|A ∩ B| / (|A| + |B|), is common; it equals 2·IoU / (1 + IoU), so the two rank predictions the same way. Both are used as losses in soft, differentiable forms. Plain IoU loss has zero gradient when boxes don't overlap, which Generalized IoU (Rezatofighi et al., 2019) fixes by also penalizing the empty space in the smallest box enclosing both.

All questions