AI Glossary / AI and machine learning / Intermediate
Intersection over union
Definition
Intersection over union, often written IoU, is a measure of how much two regions overlap: the shared area divided by the total area they cover together, running from 0 for no overlap to 1 for a perfect match.
What it means
When a vision model draws a box around a product, a person or a defect, the natural question is how good the box is. IoU answers geometrically: divide where the predicted and true boxes overlap by the whole area their union covers.
The measure is unforgiving in a useful way. A box twice too big, or offset to one side, might contain the object entirely and still score poorly, because the union grew without the intersection growing. IoU grades placement and size, not just presence.
A threshold turns the score into a verdict: boxes above 0.5 often count as detections, stricter tasks demand 0.75 or higher. The chosen threshold quietly defines what correct means, so changing it changes every reported accuracy figure.
IoU also does double duty in deployment: tracking systems use it to decide whether two boxes in consecutive frames are the same object, and duplicate-removal steps use it to merge overlapping predictions.
For a business, IoU is the quality dial behind any vision vendor's accuracy claims: ask what threshold was used, because a detection rate at 0.3 overlap and one at 0.7 are different products wearing the same slide.
How it works
Define the true region for each object, usually by human-drawn boxes or masks on a labeled set.
Compute the predicted region for the same object and measure the shared area over the combined area.
Apply the agreed threshold to turn overlaps into detections, and report precision and recall at that threshold.
Report results at several thresholds, or averaged across a range, so one generous cutoff does not flatter the system.
Use IoU in production for tracking and de-duplication, where the same overlap logic answers is this the same object.
Three practical examples
- A shelf-audit system counting a detection as correct only when the predicted box scores IoU 0.6 or better against the audited box.
- A safety vendor quoting 95 per cent detection at IoU 0.3, a number that falls to 71 per cent at the 0.6 threshold the buyer actually needs.
- A video analytics pipeline linking a forklift across frames by requiring consecutive boxes to overlap above 0.5.
Think of it this way
Think of two overlapping coffee stains on a tablecloth. The shared patch is the intersection; the whole spread of both stains together is the union. Asking how well one covers the other is asking how big the shared patch is compared with the total spread, and that ratio is IoU.
The limit: the ratio says nothing about what is inside the boxes. A high-overlap box around the wrong object still scores beautifully against that object's true box only if the truth says it is there, so the labels behind the measure carry their own errors.
Worked example
the threshold that changed the deal
Suppose a grocer evaluates two shelf-monitoring vendors. The figures are illustrative.
Vendor A reports 92 per cent detection, vendor B reports 85 per cent, and the cheaper vendor A looks like the winner.
Asked for scores at IoU 0.6, vendor A falls to 68 per cent while vendor B holds at 81 per cent: A's boxes are loose, B's are snug, and loose boxes miscount facings.
The contract goes to B, and the procurement template gains a permanent line: detection rates are quoted at stated IoU thresholds or not at all.
Illustrative case study
A fictional construction firm accepted a crane-camera safety system on the strength of a 97 per cent detection claim, and only after a near-miss review did anyone ask at what overlap the number was measured.
The answer, IoU 0.2, meant the system counted a detection when its box covered a fifth of the person and four fifths of the sky, a definition of found that the safety case could not stand behind.
The invented lesson: an overlap score without a stated threshold is a number without a unit. Ask for the threshold before you ask for the discount.
Common misconceptions and mistakes
- Any box containing the object counts as a detection. Containment is not overlap: a huge box contains everything and localizes nothing, and IoU exists precisely to punish that.
- IoU applies only to boxes. The same overlap logic scores segmentation masks, and anything else where predicted and true regions are compared.
- A higher IoU threshold is always better. Stricter thresholds raise localization quality but can crush recall; the right threshold is the one the downstream use actually needs.
Business use
Write the IoU threshold into every vision accuracy claim, internal or vendor-supplied, as part of the number itself.
Match the threshold to the use: counting tolerates looser boxes, robotic handling and safety demand snug ones.
Ask for the curve across thresholds when buying vision systems; the shape at 0.7 tells you more than the peak at 0.3.
People also ask
What does an IoU of 0.5 mean?
The overlap area is half the combined area of the two regions, the traditional minimum for counting a detection as correct.
Why not just measure accuracy as objects found?
Because found is meaningless without localization: a box covering the whole image finds every object and helps with none of them.
How is IoU used in tracking?
Consecutive detections with sufficient overlap are linked as the same object across video frames.
Check your understanding
Why does intersection over union penalize a box that contains the object but is much too large?
Answer: Because the union grows with the excess area while the intersection does not, so the ratio falls, correctly grading down boxes that localize poorly despite containing the target.
Related terms
- Evaluation
- HOG feature
- Threshold (for decision trees)
- image classification
- object detection
- precision and recall
- threshold
Learn next
AI for Business Owners covers how to interrogate a vendor's accuracy claim until it means something: https://aiforbusinessandlife.com/academy/ai-for-business-owners. [C2]
More in AI and machine learning
- Intelligent decision support system - An intelligent decision support system combines decision-support tools with AI methods to help people analyze a situation, compare options and make a decision.
- Intelligent word recognition - Intelligent word recognition is a term for recognizing words in document images, particularly handwritten words, using information at the word level rather...
- Interactive evolutionary computation - Interactive evolutionary computation is an optimization approach in which people evaluate candidate solutions and an evolutionary algorithm uses that...
- Inverse-gamma distribution - The inverse-gamma distribution is a continuous probability distribution over positive numbers.
- Inverse-Wishart distribution - The inverse-Wishart distribution is a probability distribution over real symmetric positive-definite matrices.
- Inverted Dirichlet distribution - The inverted Dirichlet distribution is a multivariate probability distribution over positive quantities.
Sources
[S2] Google, Machine Learning Glossary. Full URLs are in the source ledger. Verified 11 October 2026.
Previous: Intersection Of Events Next: Interval algebra