Step by Step
I
IoU — overlap divided by union
Intersection over Union measures bounding box quality: the area where the predicted and ground truth boxes overlap, divided by the total area covered by both boxes combined.
Example: a predicted box overlapping substantially with the ground truth box, but also extending somewhat beyond it, producing an IoU value reflecting both the overlap and the excess non-overlapping area.
T
Threshold — 0.5 is standard for "correct"
IoU=1.0 represents a perfect match between predicted and ground truth boxes; IoU=0.5 is the standard threshold used to determine whether a detection counts as "correct."
Example: a predicted box with IoU=0.6 against the ground truth box being counted as a correct detection, since it clears the standard 0.5 threshold.
C
Correct detection requires BOTH IoU and class match
A detection is only counted as correct if BOTH the IoU meets or exceeds the threshold AND the predicted class label actually matches the true class — either condition failing means the detection doesn't count as correct.
Example: a predicted box with IoU=0.7 (clearing the threshold) but labeled "dog" when the true object was actually a "cat" still counting as an incorrect detection, since the class label doesn't match.
M
mAP — averaging AP across classes and thresholds
mean Average Precision (mAP) averages the AP (Average Precision) score across all classes and often across a range of IoU thresholds, serving as the standard benchmark metric for object detectors on datasets like COCO and Pascal VOC.
Example: computing AP separately for "car," "person," and "dog" classes, then averaging all three AP values together to get the overall mAP score for a detector.
Applied Walkthrough
1
A detector predicts a bounding box for a dog that overlaps substantially with the ground truth box, achieving an IoU of 0.65, and correctly labels it "dog."
2
Ask: does this count as a correct detection? Yes — the IoU (0.65) clears the standard 0.5 threshold, AND the class label ("dog") matches the true class.
3
Contrast: if that same box had instead been labeled "cat" despite the correct 0.65 IoU overlap, it would NOT count as a correct detection, since the class label fails to match even though the IoU threshold was cleared.
4
Averaging this kind of correct/incorrect determination across many examples and classes produces the AP for each class, and averaging AP across all classes (and often across IoU thresholds) produces the final mAP score used to benchmark the detector overall.
Exam Application
Exams test whether you can calculate or interpret IoU values, whether you know the standard 0.5 threshold for a "correct" detection, and specifically whether you understand that a correct detection requires BOTH the IoU threshold AND the class label to be correct simultaneously — a frequently tested precise requirement.
⚠ Common Trap
The most common trap is assuming a correct IoU alone (clearing the 0.5 threshold) is sufficient for a detection to count as correct. A detection also requires the predicted class label to actually match the true class — a box with excellent IoU overlap but the wrong class label still counts as an incorrect detection.
✓ Quick Self-Check
1. What formula defines IoU?
The area of overlap between predicted and ground truth boxes, divided by the total area covered by both boxes combined (the union).
Tap to reveal / hide
2. What is the standard IoU threshold for a detection to be considered acceptable?
0.5.
Tap to reveal / hide
3. What two conditions must BOTH be true for a detection to count as correct?
The IoU must meet or exceed the threshold, AND the predicted class label must match the true class.
Tap to reveal / hide
4. What does mAP average across?
AP (Average Precision) scores across all classes, and often across a range of IoU thresholds.
Tap to reveal / hide
5. Would a box with IoU=0.8 but an incorrect class label count as a correct detection?
No — even with excellent IoU overlap, an incorrect class label means the detection does not count as correct.
Tap to reveal / hide