Mean average precision

Also known as: mAP

On this page 7

Mean average precision (mAP) is the standard accuracy metric for object detection and instance segmentation in computer vision: it computes the average precision (AP) of each object class as the area under its precision-recall curve and then takes the mean across all classes. A single mAP score therefore summarizes how well a model both finds objects and localizes them correctly, across every confidence threshold.

The metric appears in almost every detection benchmark and model release, but its value depends heavily on the evaluation protocol. A figure reported under the PASCAL VOC convention is not comparable with one reported under the COCO convention, so understanding how mAP is computed is essential before comparing models.

How mean average precision is calculated

The calculation starts by matching predictions to ground truth. For each class, all predicted boxes from the test set are sorted by confidence score, and each one is labeled a true positive if its intersection over union (IoU) with a not-yet-matched ground-truth box meets the threshold, or a false positive otherwise. Duplicate detections of an already matched object count as false positives, which is why non-maximum suppression matters.

Walking down the sorted list produces a sequence of precision and recall values. Precision is the share of predictions that are correct, and recall is the share of ground-truth objects found. AP is the area under the resulting curve after interpolation, which replaces each precision value with the highest precision at any higher recall.

StepOperationOutput
1. RankSort detections per class by confidenceOrdered prediction list
2. MatchCompare each box with ground truth using IoUTrue and false positive labels
3. AccumulateCompute cumulative precision and recallPrecision-recall curve
4. InterpolateMake precision monotonically decreasingSmoothed curve
5. IntegrateArea under the curveAP for one class
6. AverageMean of AP over classesmAP
Steps from raw detections to mAP

PASCAL VOC and COCO variants of mAP

The two dominant conventions differ in IoU thresholds and interpolation points. PASCAL VOC uses a single IoU threshold of 0.5, while the COCO benchmark averages AP over ten IoU thresholds from 0.50 to 0.95 in steps of 0.05, which rewards precise localization much more strongly.

Naming also differs. COCO reports the averaged figure simply as AP, even though it is a mean over classes, and writes the single-threshold variants as AP50 and AP75. Papers often write mAP@0.5 and mAP@0.5:0.95 to remove the ambiguity.

ConventionIoU thresholdInterpolationTypical use
VOC 20070.511 recall pointsOlder detection papers
VOC 2010 and later0.5All recall pointsPASCAL VOC benchmark
COCO AP0.50 to 0.95, step 0.05101 recall pointsMain modern benchmark figure
COCO AP500.5101 recall pointsLenient comparison with VOC
COCO AP750.75101 recall pointsStrict localization check
Common mAP conventions

COCO also reports AP by object size: small objects below 32 by 32 pixels, medium objects up to 96 by 96 pixels and large objects above that. These breakdowns show whether a model fails on small objects, which is a frequent weakness of single-stage detectors.

Mean average precision compared with other detection metrics

mAP is a threshold-free ranking metric, which distinguishes it from metrics computed at one operating point. That property makes it ideal for comparing models, but it does not tell an engineer which confidence threshold to deploy.

MetricWhat it measuresKey difference from mAP
Intersection over unionOverlap of one predicted and one true boxInput to mAP, not a summary score
Precision and recallCorrectness and coverage at one thresholdSingle operating point only
F1 scoreHarmonic mean of precision and recallDepends on chosen confidence threshold
Average recall (AR)Recall averaged over IoU thresholdsIgnores false positives
Panoptic quality (PQ)Segmentation and recognition togetherUsed for panoptic segmentation
MOTA and HOTADetection plus identity over timeUsed for object tracking
How mAP relates to neighboring metrics

The same name is used in information retrieval, where mAP averages the precision of ranked search results over queries. The idea is identical, but in computer vision the matching rule depends on IoU with bounding boxes or masks.

Interpreting and reporting mAP in practice

A useful mAP report always states the dataset split, IoU range, interpolation method and input resolution. Without these details, differences of several points can come from protocol rather than from model quality.

SituationRecommended variantReason
Comparing with published modelsCOCO AP at 0.50 to 0.95Matches the dominant benchmark
Coarse localization is enoughmAP@0.5Counting or presence detection tolerates loose boxes
Precise boxes are requiredAP75 or higher thresholdsRobotics and measurement need tight fits
Many small objectsAP for small objectsOverall mAP hides size-specific failures
Imbalanced classesPer-class AP tableThe mean can mask weak rare classes
Decision guide for choosing an mAP variant

Because mAP gives every class equal weight, a rare class with poor AP lowers the score as much as a common class. Teams should therefore inspect per-class AP alongside the mean.

Limitations and common mistakes with mAP

  • Mixing conventions: comparing a VOC mAP@0.5 of 80 with a COCO AP of 50 suggests a gap that does not exist.
  • Ignoring the operating point: a high mAP model may still produce too many false positives at the threshold used in production.
  • Evaluating on training data: leakage between splits inflates mAP and hides overfitting.
  • Skipping duplicate handling: missing non-maximum suppression turns duplicates into false positives and lowers AP.
  • Treating small gains as meaningful: differences below about one point can fall within run-to-run variance.

mAP also says nothing about inference speed, calibration or robustness to domain shift, so it should be one part of a broader evaluation.

In plain words

Imagine a program that looks at photos and draws boxes around cars, people and bicycles. Mean average precision is a single grade for how good those boxes are. For each kind of object, it checks whether the program found the objects, whether it drew the boxes in the right place and whether it added false alarms.

Each kind of object gets its own score, and mAP is simply the average of those scores. A higher number means the program finds more of the real objects while making fewer mistakes, but the number only makes sense when everyone grades with the same rules.

A real-world example

A warehouse automation team trains a detector to find pallets, forklifts and people in ceiling-camera images. On a held-out set of 3,000 images, the first model reaches mAP@0.5 of 0.88 but only 0.52 on the COCO-style 0.50 to 0.95 range, which shows that it finds objects but draws loose boxes.

Per-class AP reveals that people score far lower than pallets because workers often appear small and partly hidden. The team adds higher-resolution training crops and more annotated images of distant workers. The retrained model raises AP for people by 9 points and the overall 0.50 to 0.95 figure to 0.58, enough to meet the safety requirement for reliable person detection near moving forklifts.