Computer Vision

Mean Average Precision (mAP)

Evaluating object detection performance across precision-recall trade-offs and IoU thresholds.

🟡 intermediate5 min readvisionevaluation
Mean Average Precision (mAP) is the universal benchmark metric for evaluating object detection models (COCO / Pascal VOC). It calculates the Area Under the Precision-Recall Curve (Average Precision - AP) for each category at a specific IoU threshold (e.g., mAP@50), then averages across all object classes. COCO mAP (mAP@[.50:.95]) averages AP across 10 IoU thresholds from 0.50 to 0.95 in steps of 0.05, rewarding precise bounding box localization.

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]

  1. Legacy Pascal VOC (mAP@50): Evaluates AP at a single lenient IoU threshold of $0.50$. Rewards loose bounding boxes.
  2. 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:

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

Check yourself

Question 1 of 3

What does mAP@50 evaluate in object detection benchmarks?

More in Computer Vision

See all →
Image Augmentation Strategies5 minResizing, Normalization & Colour Spaces4 minResNet, EfficientNet & Friends5 min