mAP@50-95 (also written mAP50-95 or mAP 0.5:0.95) is average precision computed at ten IoU thresholds from 0.50 to 0.95 in steps of 0.05, then averaged over those thresholds and over every defect class. A predicted box has to overlap the ground truth more tightly to count as a hit at each higher threshold, so the metric rewards precise localisation as well as finding the defect. This is why it is a stricter test than what mAP50 measures on defect data. On the NEU-DET steel-surface dataset, one practitioner’s YOLOv8n run scored 0.756 mAP50 against 0.423 mAP50-95, and the write-up reads that drop as defects being found but boxed loosely.
For a computer vision line-inspection model, the single number is where reading starts, not where it ends. The gap between mAP50 and mAP50-95 tells you about localisation. The per-class values tell you which defect type is pulling the average down. Precision and recall at the confidence threshold you actually ship tell you what the line will experience. If you need the basic definitions of precision, recall and IoU first, our guide to object detection metrics for inspection covers them, and how YOLO scores detectors with mean average precision walks through the general mechanics. This page is about reading the metric when the objects are defects.
How mAP50-95 Is Calculated from Ten IoU Thresholds
- Match predictions to ground truth at one IoU threshold. Sort all predictions for a class by confidence. A prediction that overlaps an unmatched ground-truth box of the same class at or above the threshold is a true positive. An unmatched prediction is a false positive, and an unmatched ground-truth box is a false negative.
- Build the precision-recall curve. Walk down the ranked list, computing precision and recall at each point. Lowering the confidence cut-off adds boxes, so recall rises and precision falls.
- Take the area under that curve. That area is the class’s average precision (AP) at this threshold. The COCO evaluator samples the curve at 101 recall points.
- Repeat at each threshold. Run steps 1 to 3 at IoU 0.50, 0.55, 0.60 and so on up to 0.95, which gives ten thresholds.
- Average twice. Average the ten AP values to get one AP per class, then average across classes to get mAP@[.50:.95].
COCO calls the result simply “AP” and makes no distinction between AP and mAP, so a COCO-style table labelled AP is reporting this number. COCO adopted the multi-threshold average as a deliberate break from the older practice of scoring at IoU 0.50 alone, which is the PASCAL VOC metric, and treats it as the primary metric because averaging over IoUs rewards better localisation. Ultralytics uses the same quantity as the headline number in its model tables.
mAP50 vs mAP50-95: What the Gap Says About How Defects Are Localised
At IoU 0.50, a box that is noticeably loose still counts as a hit, which is why Ultralytics describes mAP50 as accuracy on the “easy” detections. mAP50-95 holds the same detections to stricter overlap at every step up to 0.95. The difference between the two scores is therefore a localisation signal. Ultralytics’ own course material gives the example of mAP50 0.943 against mAP50-95 0.669 and concludes that when the gap is large, localisation is the weakness rather than detection.
In TIDE’s analysis of Mask R-CNN detections on COCO, localisation error grows most as the IoU threshold rises, and false negatives start to matter more than false positives. The authors conclude that the COCO average over thresholds is biased heavily toward localisation errors and, to a lesser extent, missed detections. The NEU-DET write-up shows the same thing from the other side. At a match IoU of 0.50, about half of each model’s false negatives were defects the model found but boxed too loosely to count (80 missed outright against 84 loose boxes for YOLOv8n).
Worked Example: Why a Two-Pixel Error Costs a Small Defect More
The assumptions here are illustrative geometry, not measurements. Take a ground-truth box of 10 × 10 pixels and a prediction of the same size shifted 2 pixels sideways. The overlap is 8 × 10 = 80 px² and the union is 100 + 100 − 80 = 120 px², so IoU = 80 / 120 ≈ 0.67. That box counts as a hit at the thresholds 0.50, 0.55, 0.60 and 0.65, then fails the other six from 0.70 to 0.95, so it is a true positive at only 4 of the 10 thresholds.
Now apply the same 2-pixel shift to a 100 × 100 box. The overlap is 98 × 100 = 9,800 px² and the union is 10,200 px², so IoU ≈ 0.96 and the box passes all ten thresholds. The positional error is identical in both cases, but the small defect loses most of its credit. A large mAP50 to mAP50-95 gap on a defect set is therefore a prompt to look at the size distribution before blaming the architecture.
You can check size directly. COCO defines AP-small for objects under 32² pixels in area, and Ultralytics detection validation reports small-, medium- and large-object mAP when run with save_json=True. In the NEU-DET split used in one Scientific Reports steel-defect paper, 10.68% of the 4,186 instances fell into the small bucket under the COCO convention.
When the Two Metrics Move in Opposite Directions
mAP50 and mAP50-95 can move in opposite directions, so tracking only one of them can mislead you. In that Scientific Reports paper, the authors’ method on the X-SDD steel dataset nudged [email protected] up from 64.84% to 65.14% while [email protected]:0.95 fell from 36.19% to 33.03%, a localisation trade-off that a mAP50-only dashboard would have scored as a win. The reverse happens too. On the MEA industrial dataset in an arXiv study of continuity-driven regularisation, baseline [email protected] was already near saturation (0.995 for YOLOv8), yet the regularisers still lifted average [email protected]:0.95 by more than five points.
What Is a Good mAP50-95 Score for an Inspection Model?
“Good” means good against a baseline on the same data split and class mix. The table collects baseline figures reported on defect datasets.
| Dataset (defect type) | Model and source | mAP50 | mAP50-95 |
|---|---|---|---|
| NEU-DET (steel surface) | YOLOv8n, EdgeLens practitioner write-up | 0.756 | 0.423 |
| NEU-DET (steel surface) | YOLO11s baseline, Scientific Reports GRACE paper | 0.747 | 0.427 |
| X-SDD (steel surface) | Pre-GRACE starting values, Scientific Reports GRACE paper | 0.648 | 0.362 |
| Industrial Metal | YOLOv8 baseline, arXiv continuity-regularisation study | 0.944 | 0.660 |
| MEA | YOLOv8 baseline, arXiv continuity-regularisation study | 0.995 | 0.899 |
| Low-contrast wafer defects | YOLOv8-seg baseline, arXiv TexWDS study | 0.727 | 0.479 |
Two things drive the spread. The first is boundary ambiguity. Crazing and rolled-in scale on NEU-DET are low-contrast and diffuse, with boundaries that even human annotators box loosely, so strict-IoU scoring punishes predictions on boundaries that are genuinely ambiguous. The second is annotation quality. TIDE found that 30 of the 100 most confident localisation errors made by Mask R-CNN on COCO came from bad annotations, and argues that misannotated ground truth lowers the maximum mAP a reasonable model can reach. On a defect dataset, a sample of the highest-confidence “errors” deserves an audit before concluding that a model has plateaued.
Training data volume matters as well. In the arXiv continuity study, [email protected]:0.95 of the TV-loss regularised model on Industrial Metal fell from 0.700 at full data to 0.429 with a quarter of the training set. A score from a pilot dataset is a snapshot of that dataset, not a property of the model.
Reading Per-Class AP in YOLO Validation Results to Find Regressing Defect Types
After validation, Ultralytics prints a per-class breakdown with image count, instance count, precision, recall, mAP50 and mAP50-95 for each class. The same values are available in code: metrics.box.map is mAP50-95, metrics.box.map50 and metrics.box.map75 are the single-threshold scores, and metrics.box.maps is a list holding mAP50-95 for each category. Comparing that list between a baseline and a candidate shows which defect type moved:
from ultralytics import YOLO
base_model = YOLO("baseline.pt")
cand_model = YOLO("candidate.pt")
base = base_model.val(data="defects.yaml", split="test")
cand = cand_model.val(data="defects.yaml", split="test")
print(f"mAP50-95 {base.box.map:.3f} -> {cand.box.map:.3f}")
print(f"mAP50 {base.box.map50:.3f} -> {cand.box.map50:.3f}")
for idx, name in base_model.names.items():
b, c = base.box.maps[idx], cand.box.maps[idx]
print(f"{name:20s} {b:.3f} -> {c:.3f} ({c - b:+.3f})")
Run both models with the same conf and NMS iou settings, because the confidence threshold feeds into the precision-recall curves, mAP and confusion matrices that validation produces.
A net gain can hide a regression. The Scientific Reports GRACE paper reports an overall rise in [email protected]:0.95 on NEU-DET, yet per class, crazing rose 5.20 points and pitted surface 7.11 points while rolled-in scale fell 3.63 points and scratches fell 3.74 points. If scratches are the defect that reaches customers, that candidate is a step backwards whatever its headline number. Ultralytics’ course puts the same point bluntly: a 0.83 mAP can hide a class at 0.40, and if that class carries the business value you have a broken model with a flattering average.
Per-class values also show where the hard classes sit. In the EdgeLens NEU-DET comparison, crazing reached only about 0.20 [email protected]:0.95 for both models while patches reached about 0.57. In the TexWDS wafer study, baseline per-class mAP50-95 ran from 0.366 for coating defects to 0.595 for scratches. When a class regresses, we would reach for TIDE-style error decomposition next, because it shows which error types changed, something TIDE’s authors note is impossible to see from a change in AP50 alone.
When a High mAP50-95 Misleads, and What to Check Alongside It
mAP50-95 scores a model across every confidence threshold. Production needs fixed decision thresholds. A review of manufacturing defect-detection benchmarks makes the point formally: AP and AUROC do not estimate the performance of a decision rule but of a family of decision rules obtained by sweeping the threshold, though they remain useful for choosing that threshold. Wenkel et al. (Sensors, 2021) add that most networks are benchmarked at a low confidence threshold because standard metrics do not penalise a high number of false positives. TIDE observed detectors filling COCO’s 100-detection allowance with low-scoring boxes to boost AP.
The EdgeLens comparison shows what this means in practice. The two models scored almost the same mAP50-95 (0.423 and 0.418). At a deployment threshold of conf ≥ 0.25, though, YOLOv8n produced 234 false positives and 165 false negatives, while YOLO26n produced 173 and 185, a real trade-off in opposite directions that the headline metric did not show. A study of automotive fuel-injector inspection went further and selected its checkpoint by F1 at a fixed confidence of 0.50 and IoU of 0.50, rather than by threshold-agnostic COCO mAP, because production needs fixed decision thresholds.
Diagnostic Checklist Before Trusting a Validation mAP50-95
- Operating point: precision and recall at the confidence threshold you will deploy, which the validation run holds alongside per-class AP, and the F1 they give.
- Error counts: false positive and false negative counts, or false positive rate and false negative rate, which the manufacturing benchmark review argues better represent inspection performance. Ultralytics stores per-image TP, FP and FN at IoU 0.5 in
results.box.image_metrics. - Business-critical classes: the per-class mAP50-95 of the defect types that carry the business value, not just the average.
- Miss or loose box: a split of false negatives into outright misses and localisation failures.
- Object size: size-stratified mAP when defects are small.
- Unseen test data: a test split used once, after every option has been chosen, because an industrial evaluation needs data never seen in training or selection.
- Label audit: a review of the most confident “errors”, since on COCO, 30 of Mask R-CNN’s 100 most confident localisation errors and 50 of 100 background errors came from bad annotations.
If a pilot reported only a headline mAP, the reasons that figure flatters are worth knowing before rollout; why CV inspection pilots over-promise on accuracy covers that pattern from the project side.
How Validation mAP50-95 Relates to False Rejects and Missed Defects on the Line
Validation detection scores alone do not fix the rates the line sees. Those rates also depend on the acceptance logic applied after the detector. The fuel-injector study shows this. Using identical model predictions on 380 needles, simple union logic (reject if any view flags a defect) caught all 104 non-conforming parts but falsely rejected 57.6% of components. Adding a decision layer built from the acceptance specification kept defect recall at 100% while cutting the false-rejection rate to 10.9%. The same detector produced two very different false-reject rates.
That study’s instance-level recall was only 37.19%, yet component-level recall reached 100%, because a part only needs rejectable evidence from one view to be caught. Its authors also point out that detecting a visual irregularity and deciding whether a component is acceptable are not the same task. Localisation still matters at that stage: the decision rules checked predicted box position and size against pixel-based acceptance thresholds, so the mean matched-box IoU of 0.7069 was relevant to the decision layer. If acceptance depends on where a defect sits or how large it is, loose boxes turn into wrong verdicts.
Before the outputs feed statistical process control, Roboflow’s SPC guide, on a weld-inspection example, recommends evaluating welding-line localisation and defect counting separately on representative production images, comparing against reference inspections and checking repeatability when the same workpiece is captured several times. Once false-positive and false-negative rates at a fixed threshold are known, those are the quantities to watch over time, using statistical process control charts for monitoring the defect-detection model on the production line. Production AI reliability is its own engineering discipline, distinct from model accuracy. Regression suites, drift detection and validation packages are the artefacts that catch failures before customers do. The artefacts that keep a line-side inspection model running show how a validation baseline like this one becomes part of that work.
FAQ
Is 0.5 IoU Good Enough to Count a Detection?
IoU 0.5 is the PASCAL VOC convention and the most common minimum for a true positive. Even a noticeably loose box passes at that level. Whether that is enough depends on whether anything downstream uses the box’s position or size.
What Is the Difference Between AP and mAP?
AP is the area under one class’s precision-recall curve, and mAP averages AP across classes (and, for mAP50-95, across IoU thresholds). COCO uses the label “AP” for both and relies on context to make the meaning clear.
What Is IoU in YOLO?
IoU shows up in two places in YOLO. It is the overlap threshold that decides whether a prediction matches a ground-truth box when metrics are computed. Separately, the iou validation argument sets the IoU threshold for non-maximum suppression, which removes duplicate detections.