Object Detection Metrics: Precision, Recall and mAP Explained
An object detector outputs boxes, classes and confidence scores, and judging it means deciding which boxes count as correct. Precision, recall and mean average precision are the standard measures, and each answers a different question. Understanding how they are calculated makes it possible to compare models fairly and to choose a confidence threshold that suits the product rather than the leaderboard.
At a glance
- TP/(TP+FP)
- Precision: the share of detections that are correct.
- TP/(TP+FN)
- Recall: the share of real objects that were found.
- IoU 0.5
- A common overlap threshold for counting a predicted box as a match.
- 0.5:0.95
- The COCO convention, averaging over IoU thresholds from 0.5 to 0.95.
The problem
A single mAP figure hides the trade-off the product actually faces. A detector can score well overall while missing a rare but critical class, or while producing more false alarms than an operator will tolerate.
Figures are also computed differently. The PASCAL VOC convention uses one IoU threshold of 0.5, while COCO averages over ten thresholds, so mAP values calculated under different protocols cannot be compared. Results on a public benchmark also say little about performance on your own images.
Report precision and recall at the threshold you will ship, per class. mAP alone does not tell you that.
From boxes to mAP
Intersection over union is the overlap area of a predicted and a true box divided by the area of their union. Detections are sorted by confidence and matched to unmatched true boxes above the IoU threshold; duplicates and unmatched detections are false positives, and unfound objects are false negatives.
Sweeping the confidence threshold traces a precision-recall curve. Average precision is the area under that curve for one class, and mAP is the mean across classes, and in COCO also across IoU thresholds.
What good looks like
Agree the evaluation protocol, IoU threshold and test set before comparing any models.
Decide which error costs more in the product, a missed object or a false alarm, and per class if needed.
Choose the operating confidence threshold from the precision-recall curve and report both values at that point.
| Term | Meaning |
|---|---|
| True positive (TP) | A detection matched to a real object above the IoU threshold |
| False positive (FP) | A detection with no matching object, or a duplicate |
| False negative (FN) | A real object with no matching detection |
| IoU | Overlap area divided by union area of two boxes |
| Precision | TP divided by all detections |
| Recall | TP divided by all real objects |
| AP | Area under the precision-recall curve for one class |
| mAP | AP averaged over classes, and in COCO over IoU thresholds |
| IoU | |
|---|---|
| No offset | 1 |
| 10% offset | 0.82 |
| 20% offset | 0.67 |
| 33% offset | 0.5 |
| 50% offset | 0.33 |
What it changes
Fair Comparisons
Models are scored under the same protocol on the same data.
Product Fit
The threshold reflects the real cost of each error type.
Visible Weaknesses
Per-class results expose classes the average conceals.
Clear Acceptance
Pass criteria are numbers everyone understands.
Where to go next
For counting or tracking applications, add task-level checks such as count error per image, since a good mAP does not guarantee correct counts.
Inspect false positives and false negatives by eye. Patterns in the errors, such as small, distant or partly hidden objects, usually point to missing training data.
Problems this prevents
- mAP values from different protocols compared
- A rare class hidden by the average
- A threshold chosen without considering cost
- Recall reported without precision
Discuss your project
Email support@aavico.com or use Get in Touch when the website finishes loading.