Overlap, Precision, and Recall
A predicted box looks close to the correct box, but how close is enough? Intersection over union, or IoU, compares the overlapping area with the total area covered by either box.
Overlap, Precision, and Recall explained visually
A predicted box looks close to the correct box, but how close is enough? Intersection over union, or IoU, compares the overlapping area with the total area covered by either box. English captions are optional and start off. The complete transcript follows the written lesson.
What you will learn
A predicted box looks close to the correct box, but how close is enough? Intersection over union, or IoU, compares the overlapping area with the total area covered by either box.
Match predictions to references
A predicted box looks close to the correct box, but how close is enough? Intersection over union, or intersection over union, compares the overlapping area with the total area covered by either box. It is a localization measure. Evaluating a detector also requires deciding which predictions match which reference objects and how to handle duplicate predictions.
Count different mistakes
Precision asks what fraction of accepted detections are correct. Recall asks what fraction of reference objects were found. A matching rule usually considers class and an overlap threshold. One reference object should not give credit to several duplicate detections. Confidence thresholds change which predictions are accepted, and therefore change the precision-recall tradeoff.
Report the evaluation rules
Average precision summarizes a precision-recall curve under a specified evaluation protocol. Mean average precision averages across classes and sometimes overlap thresholds, depending on the reported metric. Always state the protocol instead of comparing numbers with different meanings. Inspect class-specific and condition-specific errors too. If missed small objects are costly, a strong overall average is not enough evidence that the application is ready.
A worked example
Suppose eight accepted detections include six correct matches and two false alarms, while the reference contains ten objects. Precision is six divided by eight, or seventy-five percent. Recall is six divided by ten, or sixty percent. Both numbers are needed to describe this result.
Worked example
Suppose eight accepted detections include six correct matches and two false alarms, while the reference contains ten objects. Precision is six divided by eight, or 75 percent. Recall is six divided by ten, or 60 percent. Both numbers are needed to describe this result.
Quick check: test your understanding
Try it yourself: A box has intersection area 30 and union area 50 with the reference. Calculate IoU.
Check the reasoning
IoU is 30 divided by 50, which equals 0.6.
Can two reported mAP values be compared safely without knowing their evaluation settings?
No. Classes, overlap thresholds, datasets, and matching conventions may differ.
How would you solve the practice case?
IoU is 30 divided by 50, which equals 0.6.
What does the worked example show?
Suppose eight accepted detections include six correct matches and two false alarms, while the reference contains ten objects. Precision is six divided by eight, or 75 percent. Recall is six divided by ten, or 60 percent. Both numbers are needed to describe this result.
Further reading
Programming Computer Vision with Python — Jan Erik Solem.
Original ToolsInVision teaching examples. Editorial approach · Suggest a correction
Accessible referenceLesson 11 transcript214 words · Video transcript · Matches the published narration and captionsOpen transcript
A predicted box looks close to the correct box, but how close is enough? Intersection over union, or intersection over union, compares the overlapping area with the total area covered by either box. It is a localization measure. Evaluating a detector also requires deciding which predictions match which reference objects and how to handle duplicate predictions.
Precision asks what fraction of accepted detections are correct. Recall asks what fraction of reference objects were found. A matching rule usually considers class and an overlap threshold. One reference object should not give credit to several duplicate detections. Confidence thresholds change which predictions are accepted, and therefore change the precision-recall tradeoff.
Average precision summarizes a precision-recall curve under a specified evaluation protocol. Mean average precision averages across classes and sometimes overlap thresholds, depending on the reported metric. Always state the protocol instead of comparing numbers with different meanings. Inspect class-specific and condition-specific errors too. If missed small objects are costly, a strong overall average is not enough evidence that the application is ready.
Suppose eight accepted detections include six correct matches and two false alarms, while the reference contains ten objects. Precision is six divided by eight, or seventy-five percent. Recall is six divided by ten, or sixty percent. Both numbers are needed to describe this result.