Mean Average Precision (mAP)
Evaluating object detection performance across precision-recall trade-offs and IoU thresholds.
What is Mean Average Precision (mAP)?
Object detection performance cannot be evaluated using simple classification Accuracy because predictions involve both what (category label) and where (bounding box coordinates).
Mean Average Precision (mAP) combines classification precision and localization accuracy into a single scalar score:
Step 1: Match predictions to ground-truth boxes using IoU threshold (e.g. IoU >= 0.50).
Step 2: Plot Precision-Recall curve for Class c by ranking predictions by confidence score.
Step 3: Calculate Average Precision (AP_c) = Area Under Precision-Recall Curve for Class c.
Step 4: Average AP_c across all C classes: mAP = (1 / C) * ∑ AP_c.
Calculating Average Precision (AP) for One Class
Rank predictions from highest confidence to lowest confidence:
Rank Confidence Matched IoU Precision Recall Status
─────────────────────────────────────────────────────────────
1 0.98 0.82 (>=0.5) 1.00 0.20 True Positive
2 0.94 0.71 (>=0.5) 1.00 0.40 True Positive
3 0.88 0.12 (< 0.5) 0.67 0.40 False Positive
4 0.82 0.65 (>=0.5) 0.75 0.60 True Positive
Plot Precision vs Recall as confidence threshold drops from 1.0 to 0.0:
Precision
1.0 ┼───┐
│ └───┐
0.5 │ └───┐
0 ┴───────────┴─────► Recall
0.0 0.5 1.0
Average Precision (AP): Area under the interpolated Precision-Recall curve.
VOC mAP@50 vs COCO mAP@[.50:.95]
- Legacy Pascal VOC (mAP@50): Evaluates AP at a single lenient IoU threshold of $0.50$. Rewards loose bounding boxes.
- COCO Primary Benchmark (mAP@[.50:.95]): Computes mAP at 10 increasing IoU thresholds:
$$\text{mAP}{\text{COCO}} = \frac{\text{mAP}{.50} + \text{mAP}{.55} + \text{mAP}{.60} + \dots + \text{mAP}_{.95}}{10}$$
A model that fits bounding boxes tightly achieves much higher COCO mAP than one that outputs loose boxes.
COCO Scale Breakdown
COCO breaks down mAP across object sizes:
- mAP_S: Small objects ($< 32 \times 32$ pixels).
- mAP_M: Medium objects ($32 \times 32$ to $96 \times 96$ pixels).
- mAP_L: Large objects ($> 96 \times 96$ pixels).
Most object detectors score low on $\text{mAP}_S$ due to loss of spatial detail in deep feature maps.
Say this out loud
Mean Average Precision (mAP) measures object detection performance by calculating the Area Under the Precision-Recall curve (AP) for each category and averaging across all classes. Legacy mAP@50 evaluates at a single IoU threshold of 0.50. COCO mAP averages AP across 10 IoU thresholds from 0.50 to 0.95, penalizing loose bounding boxes and rewarding tight spatial alignment.
Follow-ups to expect
- How are multiple detections of the same ground-truth object scored in mAP? The highest-confidence prediction matching the ground-truth box (IoU >= threshold) is marked as True Positive. All subsequent overlapping predictions for that same ground-truth object are marked as False Positives.
- What is 11-Point Interpolation in legacy Pascal VOC? Sampling the precision-recall curve at 11 recall levels (0.0, 0.1, ..., 1.0) and taking the average of maximum precisions to approximate the area under the curve.
Check yourself
What does mAP@50 evaluate in object detection benchmarks?