← AVIATION GLOSSARY
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Aviation glossary

What is Intersection Over Union (IoU)?

Computer Vision · Machine Learning 8 languages
Definition
Intersection over union (IoU) is a score that measures the overlap of two regions as shared area divided by combined area.

The intersection over union (IoU) is a score that measures the overlap of two regions as shared area divided by combined area. The two regions are usually a predicted mask or box and a ground truth mask or box.

Calculation

IoU = |A ∩ B| / |A ∪ B|

A is the predicted region and B is the ground truth region. The intersection is the area that is in both. The union is the area that is in at least one of them. The value is 0 when the regions do not overlap and 1 when they are equal. The same score is the Jaccard index.

For a pixel mask, IoU can also be written as TP / (TP + FP + FN). TP is the number of pixels in both masks. FP is the number of pixels only in the prediction. FN is the number of pixels only in the ground truth.

Two overlapping shapes with the intersection highlighted and the union outlined

Use in benchmarks

The PASCAL VOC detection task counts a predicted box as correct when its IoU with the ground truth box is above 0.5. The VOC authors set this threshold low on purpose, because the ground truth boxes are not exact. From VOC2008, the VOC segmentation task also scores each class with TP / (TP + FP + FN).

The COCO evaluation code reports average precision at IoU 0.50, at IoU 0.75, and averaged over ten thresholds from 0.50 to 0.95.

Mean IoU

Mean IoU (mIoU) is the IoU of each class, averaged over all classes.

IoU and the Dice coefficient

The Dice coefficient (Sørensen-Dice) measures the same overlap on a different scale. With Dice written as S and IoU as J:

  • S = 2J / (1 + J)
  • J = S / (2 - S)

For the same pair of masks, Dice is equal to or higher than IoU. A segmentation with TP = 80, FP = 20 and FN = 20 has an IoU of 0.67 and a Dice of 0.80. Compare scores only when they use the same metric.

Use in pavement crack segmentation

Published pavement crack segmentation models, for example Context-CrackNet, report mIoU together with the Dice score. An IoU value compares a model mask with a reference mask. It does not give the width, the length or the severity of a crack.

Frequently Asked Questions

How is IoU calculated?
IoU is the area of the intersection of two regions divided by the area of their union. For pixel masks it equals TP / (TP + FP + FN). TP is the pixels in both masks. FP is the pixels only in the prediction. FN is the pixels only in the ground truth. The result is between 0 and 1.
What is the difference between IoU and the Dice coefficient?
Both measure overlap and one can be converted into the other. Dice = 2 x IoU / (1 + IoU), and IoU = Dice / (2 - Dice). Dice is therefore equal to or higher than IoU for the same pair of masks. An IoU of 0.5 is a Dice of about 0.67.
What IoU threshold counts as a correct detection?
It depends on the benchmark. The PASCAL VOC detection task requires an overlap ratio above 0.5. The COCO evaluation reports average precision at IoU 0.50, at IoU 0.75, and averaged over ten thresholds from 0.50 to 0.95 in steps of 0.05.

This is a reference entry. TarmacView provides drone inspection services and doesn't sell the equipment or materials described in this glossary.

Get Started Need your airfield lighting verified? TarmacView inspects PAPI, runway and approach lighting by drone, between aircraft movements, and delivers a compliance report built for your regulator. Pavement and obstacle inspection are in development.
Keep reading

Learn more

03 PAGES
Instance Segmentation
glossary

Instance Segmentation

Instance segmentation gives each object in an image its own class label and pixel mask. How it differs from object detection and semantic segmentation.

Precision, Recall, and F1 Score
glossary

Precision, Recall, and F1 Score

Precision, recall, and F1 score are classification metrics used to evaluate the performance of AI and machine learning models in pavement and infrastructure defect detection. Precision measures the fraction of detected defects that are correct, recall measures the fraction of actual defects that are found, F1 is their harmonic mean.

Semantic Segmentation
glossary

Semantic Segmentation

Semantic segmentation is a computer vision task that labels every pixel of an image with a class. How it differs from instance and panoptic segmentation, and how it is scored.