← Lessons

quiz vs the machine

Gold1350

Machine Learning

Intersection over Union

The overlap metric that scores how well boxes match.

4 min read · core · beat Gold to climb

Intersection over Union

Intersection over union, written IoU, measures how well two boxes overlap. It is the standard way to score a predicted bounding box against the ground truth.

The formula

IoU is the area where the two boxes overlap divided by the area they jointly cover.

  • The intersection is the overlapping region of the two boxes.
  • The union is the total area covered by either box.
  • IoU equals intersection divided by union.

The value runs from zero, no overlap, to one, a perfect match.

How it is used

IoU decides whether a prediction counts as correct. A common rule marks a detection as a true positive when its IoU with a real object exceeds a threshold such as one half.

  • A high IoU means a tight, accurate box.
  • A low IoU means the box is misplaced or the wrong size.

IoU also drives the cleanup step that removes duplicate boxes and appears in many detection loss functions. Because it captures both position and size in one number, it is a natural fit for evaluating localization.

Key idea

Intersection over union is overlap area divided by union area, scoring box match from zero to one and judging detection correctness.

Check yourself

Answer to earn rating on the learn ladder.

1. How is IoU computed?

2. What IoU value means a perfect match?