Advanced level · Module 3: Computer Vision Beyond Classification · Lesson 2 of 4
Evaluating Detection
Measure detection quality with intersection over union and mean average precision.
In this lesson you will
- Calculate intersection over union
- Interpret precision, recall and mAP for detection
Key concepts
intersection over union (IoU)true and false detectionsaverage precisionmAP
The lesson
Intersection over union (IoU) measures box overlap: the area shared by the predicted and true boxes divided by their combined area. A detection usually counts as correct when IoU is at least 0.5.
Precision and recall apply to detections: how many predicted boxes were right, and how many real objects were found. Average precision summarises the precision–recall trade-off for one class; mAP averages across classes.
Also check task-level results, such as counting accuracy: a detector with decent mAP may still miscount clustered insects.
Step by step
- Calculate IoU for three box pairs by hand.
- Compute precision and recall at IoU 0.5.
- Compute mAP with a library.
- Compare predicted and true counts.
Practice activity
Evaluate the pest detector with IoU, mAP and counting error.
Expected result: Correct metrics and an interpretation linked to the counting task.
Check your understanding
-
What does an IoU of 1 mean?
Show answer
The predicted box exactly matches the true box.
-
Why check counting accuracy as well as mAP?
Show answer
Good box metrics can still hide counting errors, for example in clusters.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.