Mean average precision (mAP) is a widely used evaluation metric in information retrieval and computer vision, particularly for tasks such as object detection, instance segmentation, and multi‑label classification. It quantifies the accuracy of a model by computing the average precision (AP) for each class and then averaging these AP values across all classes. mAP provides a single numerical score that balances precision and recall, making it a standard benchmark in competitions like PASCAL VOC, COCO, and ImageNet.

1 Definition and intuition

1.1 Precision and recall fundamentals

Precision and recall are two fundamental measures for assessing the performance of a binary or multi‑class classifier. Given a set of predictions, precision is the fraction of correctly identified positive instances among all instances that were predicted as positive. Recall is the fraction of correctly identified positive instances among all actual positive instances. In the context of object detection, a positive instance corresponds to a detected object that matches a ground‑truth object. Precision and recall are inversely related; a model that makes many confident predictions may achieve high recall but low precision, while a conservative model may achieve high precision but low recall.

1.2 Average precision (AP) per class

Average precision (AP) summarizes the precision‑recall trade‑off for a single class by computing the area under the precision‑recall curve (PR curve). The PR curve plots precision as a function of recall as the confidence threshold is varied. AP condenses this curve into a single numerical value, typically between 0 and 1, where higher values indicate that the model maintains high precision across a wide range of recall levels. For a specific class, AP is computed by averaging the precision values at each unique recall level, often using interpolation methods to account for the jagged nature of the curve.

1.3 Mean average precision (mAP) as the global average

Mean average precision (mAP) is the arithmetic mean of the AP values computed for all classes in the dataset. It provides a global performance indicator that is insensitive to class imbalance because each class contributes equally to the final score (unless a weighted variant is used). By averaging across classes, mAP captures how well the model performs on a variety of object categories, making it a standard metric for comparing the overall effectiveness of different detection or classification systems.

2 Calculation methodology

2.1 Interpolated average precision

Interpolation of the precision‑recall curve is used to smooth out variations caused by a finite number of predictions. Instead of using the exact precision value at each recall point, interpolated AP replaces the precision at a given recall with the maximum precision obtained for any recall greater than or equal to that point. This procedure reduces the effect of erratic precision drops and leads to a more stable evaluation.

2.1.1 11‑point interpolation

Historically, the PASCAL VOC challenge introduced an 11‑point interpolation. Precision is measured at 11 fixed recall levels (0.0, 0.1, 0.2, …, 1.0). For each recall level, the interpolated precision is the maximum precision achieved at any recall value equal to or greater than that level. The AP is then the average of these 11 interpolated precision values. This method is simple but can underestimate performance because it only samples a limited number of recall points.

2.1.2 All‑point interpolation

Modern benchmarks (e.g., COCO) use an all‑point interpolation scheme. Instead of fixing recall levels, the precision‑recall curve is interpolated at every unique recall value. The area under the resulting smoothed curve is computed as the Riemann sum over all recall steps. This approach produces a more accurate and finer‑grained estimate of AP, especially when the PR curve is dense.

2.2 Area under the precision‑recall curve (AUC‑PR)

A conceptually equivalent method is to directly compute the area under the precision‑recall curve (AUC‑PR) using numerical integration. In practice, the interpolated AP methods approximate this area. For datasets with a very large number of predictions, the non‑interpolated area can be computed by sorting predictions by confidence and summing the precision at each new positive detection, weighted by the change in recall. This area‑based definition is mathematically well‑defined and avoids the need for explicit interpolation.

2.3 Handling multiple predictions with non‑maximum suppression (NMS)

Object detectors often produce multiple overlapping bounding boxes for the same object. Before computing precision and recall, these redundant predictions must be removed. Non‑maximum suppression (NMS) is a standard post‑processing step that selects the most confident detection for each object and suppresses others based on overlap (measured by Intersection over Union, IoU). The choice of NMS parameters (e.g., the IoU threshold for suppression) can affect the final mAP score. Without proper NMS, the same ground‑truth object may be matched to multiple predictions, artificially inflating recall and deflating precision.

2.4 Thresholding and confidence scores

2.4.1 Intersection over union (IoU) thresholds

For a detection to be considered a true positive, its predicted bounding box must overlap with a ground‑truth box by at least a specified IoU threshold. IoU is defined as the area of intersection divided by the area of union between the two boxes. Lowering the IoU threshold makes it easier to match predictions to ground truths, increasing recall but potentially lowering precision. Raising the threshold increases the localization requirement, making the metric stricter.

2.4.2 Standard IoU values (0.5, 0.5:0.95)

The PASCAL VOC challenge used a fixed IoU threshold of 0.5. In contrast, the COCO (Common Objects in Context) benchmark evaluates AP across multiple IoU thresholds, ranging from 0.5 to 0.95 in steps of 0.05, and then reports the average over these thresholds, denoted as mAP@[0.5:0.95] (or AP<sub>50:95</sub>). This range penalizes detectors that localize objects coarsely and rewards those that produce tight bounding boxes. The COCO metric also reports separate values at IoU=0.5 (mAP@0.5) and at IoU=0.75 (mAP@0.75) for finer granularity.

3 Variants and extensions

3.1 mAP@0.5 vs mAP@[0.5:0.95]

The two most common mAP variants differ in the IoU threshold used. mAP@0.5 (also called AP<sub>50</sub>) uses a single generous match criterion and is the standard metric used in PASCAL VOC evaluations. mAP@[0.5:0.95] (often abbreviated as AP) averages over multiple IoU thresholds, providing a more comprehensive assessment of both detection and localization quality. Researchers typically report both values to give insight into the model’s behavior under different localization strictness.

3.2 mAP for rotated bounding boxes

For tasks like aerial image object detection or scene text recognition, objects are often better represented by rotated (or oriented) bounding boxes. The mAP calculation for rotated boxes follows the same principle as for axis‑aligned boxes, but the IoU computation must account for rotation. The Intersection over Union between two rotated rectangles is calculated using geometry (e.g., polygon intersection). Datasets such as DOTA (Dataset for Object Detection in Aerial Images) use the standard mAP@0.5 metric with rotated bounding boxes, sometimes with additional IoU thresholds.

3.3 mAP for instance segmentation (mask AP)

Instance segmentation (e.g., Mask R‑CNN, YOLACT) requires evaluating the quality of predicted object masks. The mask AP (often denoted AP<sub>mask</sub>) is defined analogously to bounding‑box AP, but using the mask IoU (pixel‑wise intersection over union) instead of box IoU. A predicted mask is considered a true positive if its mask IoU with the ground‑truth mask exceeds a threshold. The same averaging across classes and IoU thresholds is applied. Mask AP is the primary metric in the COCO instance segmentation challenge.

3.4 mAP for multi‑label image classification

In multi‑label classification, each image can contain multiple labels. mAP can be computed by treating each label as a class and ranking predictions by confidence. For each class, the average precision is calculated on the per‑image predictions (e.g., using the PASCAL VOC protocol or the area under the precision‑recall curve). The mean across classes gives the final score. This variant is common in tasks such as attribute prediction or scene classification, where the presence or absence of multiple labels must be evaluated simultaneously.

4 Applications in computer vision

4.1 Object detection benchmarks (PASCAL VOC, COCO, OpenImages)

Major object detection challenges rely on mAP as their primary evaluation metric. PASCAL VOC used mAP@0.5 with 20 classes. COCO expanded the evaluation to 80 classes and introduced the multi‑IoU mAP@[0.5:0.95] as the main metric, along with separate AP for small, medium, and large objects. OpenImages (Google) uses mAP@0.5 for its main competition, but also includes a weighted AP to handle hierarchical labels. These benchmarks have driven the development of state‑of‑the‑art detectors by providing a consistent and interpretable metric.

4.2 Evaluating detection models (Faster R‑CNN, YOLO, SSD)

When comparing object detection architectures, mAP is the standard reporting metric. For example, Faster R‑CNN, YOLO, and SSD families are all benchmarked on COCO mAP@[0.5:0.95] (or AP). The metric allows practitioners to assess trade‑offs between speed and accuracy: a one‑stage detector like YOLOv8 may achieve high mAP@0.5 but lower mAP@0.75 compared to a two‑stage detector, indicating its sensitivity to localization quality. In research papers, mAP scores are typically reported with multiple IoU thresholds and object‑size breakdowns.

4.3 Comparison with other metrics (F1‑score, recall, precision at k)

While mAP is the most common metric for detection, other metrics are used in specific contexts. F1‑score (the harmonic mean of precision and recall) provides a single point evaluation at a fixed confidence threshold, but it does not capture performance across all thresholds. Recall and precision at a fixed number of top predictions (e.g., recall at k) are used in retrieval tasks. In object detection, average recall (AR) – the average of recall over multiple IoU thresholds – is sometimes reported alongside mAP. F1‑score is more common for classification tasks where a hard decision threshold is required. mAP remains the preferred metric when ranking models by overall detection quality.

5 Practical considerations

5.1 Dataset‑specific nuances (balanced vs. imbalanced classes)

mAP is sensitive to class imbalance when computed as a simple average. If some classes have very few ground‑truth instances, their AP may be poorly estimated or highly variable. To mitigate this, some evaluations use a weighted mAP (e.g., averaging by the number of instances per class) or report separate scores for frequent and rare classes. Datasets like COCO mitigate imbalance by including a large number of examples per class, but practitioners should verify that their evaluation protocol aligns with the dataset’s characteristics.

5.2 Effect of minimum IoU thresholds

The choice of IoU threshold(s) directly impacts the measured mAP. A low threshold (e.g., 0.5) rewards detectors that produce rough localizations, while a high threshold (e.g., 0.75) punishes even small misalignments. The mAP@[0.5:0.95] metric balances these concerns by averaging over a range. However, different applications may require different thresholds: autonomous driving often demands strict localization (high IoU), while satellite image analysis may tolerate looser boxes. Researchers should always report the exact threshold settings used.

5.3 Implementation pitfalls (prioritizing precision vs. recall)

When computing mAP, the order of predictions (by descending confidence) and the matching strategy (e.g., greedy assignment of each ground truth to the highest‑confidence matching prediction) can introduce subtle biases. Incorrect handling of duplicate detections (multiple predictions matched to the same ground truth) or failure to apply NMS can lead to inflated mAP. Some implementations compute AP by integrating over all predictions, while others fix a number of top‑k detections. Consistent use of a widely accepted evaluation toolbox (e.g., COCO API, Detectron2’s evaluator) is recommended to ensure reproducibility.

5.4 Reproducibility and standard evaluation protocols

To facilitate fair comparisons, the computer vision community has established standard evaluation protocols. The COCO evaluation script, for example, defines exact steps: NMS with IoU threshold 0.5, a maximum of 100 detections per image, and computation of AP across 101 recall points (0 to 1 in steps of 0.01). Any deviation from these protocols (e.g., changing NMS parameters, using a different number of detection candidates, or altering the interpolation method) must be explicitly stated. Many conferences require authors to use the official evaluation code of the benchmark dataset to avoid inadvertent discrepancies.