COCO Labels Explained: How COCO Annotations Feed a Perception Eval

COCO labels are a reviewable ground-truth format, not a finished validation: what the JSON encodes, how COCO AP works, and why label noise limits mAP.

COCO Labels Explained: How COCO Annotations Feed a Perception Eval
Written by TechnoLynx Published on 11 Jul 2026

A COCO label set, or a good mAP score on one, is not enough to call a perception model validated for release. COCO labels are a stable, reviewable format for ground truth: one JSON contract that links images, object instances and categories, scored by an evaluator the whole field already uses. A strong score on COCO’s own categories measures the model against COCO’s categories and annotation conventions. COCO’s images come from everyday scenes, not a driving domain, and studies of COCO itself find boundary noise and missing labels.

That makes COCO labels useful in one specific role. They are the ground-truth layer of an evaluation harness, and a documentation package can rest on them, but only once the labels behind the format have been re-scoped to the deployed domain and versioned with the model.

What Does a COCO Annotation File Encode: Classes, Boxes, Masks and Metadata?

A full COCO dataset file has five sections: info (general information about the dataset), licenses, images, annotations and categories. Three of them carry the evaluation logic. images lists each image with an id, file name, width and height; annotations lists every object instance with its own id, the image_id it belongs to, a category_id, a bbox, a segmentation (polygons or RLE-encoded masks) and an area; and categories lists each label with an id, name and supercategory.

An annotation’s image_id points at an image’s id, and its category_id points at a category’s id. The bbox is four numbers in pixels, in the order [x, y, width, height]. Our separate explainer on the COCO bounding-box annotation format goes field by field; what matters for evaluation is how these pieces get used.

Worked Example: One Image, One Annotation

The values below are made up to show the structure. They are not real dataset content.

{
  "images": [
    {"id": 17, "file_name": "frame_000017.jpg", "width": 1920, "height": 1080}
  ],
  "annotations": [
    {"id": 401, "image_id": 17, "category_id": 3,
     "bbox": [812.0, 540.5, 64.0, 38.0],
     "segmentation": [[812.0, 545.0, 876.0, 541.0, 875.5, 578.5, 813.0, 578.0]],
     "area": 2310.0}
  ],
  "categories": [
    {"id": 3, "name": "car", "supercategory": "vehicle"}
  ]
}

In the example, annotation 401 belongs to image 17, and category_id 3 resolves to “car” through the categories array. The format goes beyond boxes, too: it covers five annotation types (object detection, instance segmentation, keypoints with visibility flags, panoptic segmentation and image captioning), each in its own JSON structure. The public dataset built on this format has more than 200,000 labelled images across 80 object categories.

One detail catches teams out. COCO measures object area for its size buckets as the number of pixels in the segmentation mask, not the box. Murrugarra-Llerena et al. (2022) note that its boxes are derived from the segmentation polygons rather than drawn as separate human-annotated rectangles. So the mask annotation decides both a box’s geometry and which size bucket the object lands in.

Why the 80 COCO Labels You Download Are Not the 91 in the Paper

The original COCO research paper defines 91 object categories, but only 80 were released with labelled and segmented images, and the 2014 and 2017 releases use the same 80. The eleven missing categories are the same in both releases. Category ids in the released files still follow the paper’s numbering, which leaves gaps in the id range.

The levan92 coco-classes-mapping repository on GitHub records the practical result: some predict functions emit class indices in the 91-class scheme for COCO evaluation even though the model was trained on 80 classes, so the indices have to be mapped between the two sets. Class names differ too, for example “aeroplane” versus “airplane”. If indices are not mapped between the two sets, predictions and ground truth refer to different classes. A mapping check belongs in the harness itself, not in someone’s memory. The COCO categories and what they cover are listed separately.

How COCO AP Is Calculated, and What the Size Split Hides

The COCO evaluation page defines 12 metrics for object detection. The headline AP averages over ten IoU thresholds from 0.50 to 0.95 in steps of 0.05, and over all 80 categories. COCO makes no distinction between AP and mAP and treats this number as the single most important metric on the benchmark. Alongside it come AP at IoU 0.50 (the PASCAL VOC metric), AP at IoU 0.75 (the strict metric), and AP for small (area below 32²), medium (32² to 96²) and large (above 96²) objects. Average recall is measured at a fixed number of detections, and all metrics allow at most 100 top-scoring detections per image.

About 41% of COCO objects are small, 34% medium and 24% large. Because the headline averages over IoU thresholds up to 0.95, it rewards precise localisation, and small objects are exactly where precise localisation is most fragile, as the annotation-noise evidence below shows. An unqualified “AP” in a paper almost always means COCO AP@[.50:.95]. Any internal report should name the metric variant explicitly, because a number quoted without its IoU range and size bucket cannot be compared or signed against.

How Do COCO-Format Labels Feed the Eval Harnesses and Regression Suites in a Production Monitoring Harness?

In COCO evaluation, a model’s generated results are scored against the ground-truth annotations. The ground-truth file holds images, annotations and categories, and a predictions file holds the model’s detections for the same image ids. The evaluator compares the two. COCO’s own test server works this way, keeping ground truth hidden and scoring uploaded results with the same evaluation code used on the validation set.

In practice the pipeline has four stages:

  1. Validate the ground truth. Check the file against the COCO schema with pycocotools for consistent annotation ids, valid boxes, mask integrity and correct category mapping.
  2. Check the category map. Confirm that the prediction ids and the ground-truth ids use the same scheme (80 versus 91, and the name variants).
  3. Run the evaluator. COCOeval’s evaluate() and accumulate() produce evalImgs, which scores quality per image, and eval, which aggregates precision and recall across the dataset.
  4. Compare against the last release. Hold the per-image and per-class, per-size, per-IoU results next to the previous model version’s, not just the headline AP.

Per-image results let you find the specific frames that got worse, and per-class, per-size breakdowns turn “mAP is about the same” into a statement a reviewer can check. The production AI monitoring harness that this label layer feeds is documented in its own article, covering the drift detection, alerting and release gates built on top of it.

Why Do COCO’s 80 Categories Rarely Match an Automotive Perception Operating Domain, and What Has to Be Re-Annotated?

COCO’s images come from everyday scenes, and its label schema was never scoped to a vehicle’s operating domain. An automotive operating domain needs its own object list, minimum object sizes and rules for occlusion and truncation. Any of those that differ from COCO’s choices has to be relabelled.

The 2023 Sama-COCO study found that the original MS-COCO polygons go around occluding objects rather than following the pixels of the occluded instance. The authors describe the first style as closer to localisation and the second as true instance segmentation, and say a network trained on the hidden bias learns the task differently. For occluded objects, annotation style changes what the model outputs. For a driving system, how occluded objects are labelled is therefore a domain decision, not a cosmetic one.

Completeness is the third gap. A 2026 re-annotation study of COCO, Pascal VOC, Cityscapes and KITTI found up to 40% more objects on COCO and up to 60% more on KITTI, driven mainly by small, occluded or densely packed instances (a dense object detection problem) that had never been labelled. Those are the distant pedestrians and partly hidden cyclists a driving system most needs to catch.

In our judgement, re-annotation for an automotive domain covers, at minimum:

  • Taxonomy: classes the domain needs that COCO lacks, and COCO classes split or merged to fit the domain’s hazards.
  • Occlusion and truncation rules: one documented convention, applied the same way in training and evaluation labels.
  • Small-object recall: a stated minimum size, then exhaustive labelling down to it.
  • Conditions: labels tagged with lighting, weather and sensor metadata, so results can be broken down by operating condition.

Where the domain’s edge cases come from is a question of its own, covered by what a perception robustness audit covers. The labelling workflow and its quality gates are discussed under data annotation as a data-quality gate.

What Evaluation-Drift Failure Modes Hide Behind a Stable-Looking COCO mAP Score?

A stable headline mAP can hide changes in the labels, in the matching or in the domain, because averaging over 80 categories and ten IoU thresholds smooths each of them out. The measured evidence is specific. Murrugarra-Llerena et al. (CVPR 2022 workshop) showed that even sub-pixel box discrepancies can sharply reduce IoU, that AP is affected particularly for small objects and tight IoU thresholds, and that some COCO categories (car and traffic light among them) are strongly affected.

Failure mode How it shows up What the evidence says What to check
Boundary noise in labels Small-object and tight-IoU AP numbers move most Under emulated sub-pixel rounding errors, IoU correlates with smallest box dimension (Spearman 0.9367) on COCO (Murrugarra-Llerena et al., 2022) Track AP small and [email protected] separately
Annotation-style mismatch Adding data lowers the score Networks score better when evaluated on the annotation style they were trained on; enriching a dataset can degrade performance if the style changes (Sama-COCO study, 2023) Version the annotation guideline with the labels
Mask-quality penalties Sharper models score lower than expected COCO-ReM (2024) found imprecise boundaries, non-exhaustive instances and mislabelled masks in COCO-2017; models predicting sharper masks were being wrongly penalised Audit a sample of masks before trusting segm AP
Missing instances Small, occluded or densely packed objects go unlabelled Re-annotation found up to 40% more objects on COCO; missing annotations were the main error source (2026 study) Spot-review high-confidence false positives
Class-index mismatch Predictions and ground truth use different class indices 91-class outputs from 80-class models need index mapping (levan92 repository) Assert the category map in the harness

There is a nuance here. The 2026 study found benchmark scores highly sensitive to annotation quality, while model rankings stayed largely stable. Comparing two models on the same flawed labels is therefore more trustworthy than reading either model’s absolute score as the field failure rate. A release decision depends on the absolute performance in the operating domain, which is exactly where label quality bites.

How Is Ground Truth in COCO Format Versioned so It Stays Aligned with the Deployed Model?

Ground truth stays aligned with the deployed model when the annotation file is versioned as one bundle with everything that changes its meaning, and each evaluation result records which bundle it was scored against. Versioning the JSON alone is not enough. The same file means something different under a new category map or a new occlusion convention.

In our view the bundle should include:

  • the annotation JSON and the image split manifest it covers;
  • the category map, including any 80-to-91 or domain-taxonomy mapping;
  • the annotation guideline (occlusion handling, minimum object size, crowd rules), since style alone shifts scores;
  • the evaluator configuration: IoU thresholds, area thresholds and the detection cap;
  • the schema-validation result for that version.

Each model version in the registry then points to the ground-truth version it was evaluated on. A regression is only called when both the model and the label version are known. Production AI reliability is a discipline distinct from model accuracy: it builds the artefacts that catch silent quality drift and perception failures on rare classes before customers do. Under change control, the same traceability carries into the perception validation package reviewers sign.

How Do COCO Labels Work, and What Do They Mean in Practice?

Once COCO labels leave the public dataset, they work as a contract rather than as content. The JSON structure, the id-linking rules and the COCOeval metrics carry over: COCO is the most widely used annotation format, and its mAP is the de facto detection metric. The categories, the annotation conventions and the instances themselves need replacing or extending for the domain. A team that relabels its own driving footage in COCO format keeps a stable, reviewable label format. A team that evaluates on COCO’s own labels and calls the result validation has measured a different task.

That distinction carries into documentation. A model documentation package for an auditor or a model-risk committee can cite COCO-format ground truth as its evaluation basis only if the package also states the label version, the guideline and the category map, so a reviewer can trace each reported number to the labels behind it. Evidence of this kind, which a non-engineer can read, defend and sign against, is an engineering output in its own right.

Who Can Check Whether Our COCO Ground Truth Matches the Domain We Deploy Into?

TechnoLynx builds the evaluation harnesses, regression suites and validation packages that test whether a perception model’s ground truth, COCO-format or otherwise, matches the operating domain it ships into. It also produces audit-ready documentation a reviewer can approve against. That work sits under AI Governance and Trust. For a first read on where an existing evaluation setup stands, the AI Readiness Scorecard is the starting step.

The limits are worth stating. This is engineering evidence, not safety certification, regulatory sign-off or legal assurance of audit-readiness, and it does not replace an in-house QA function. For a model still at prototype stage, a team’s own pycocotools evaluation on a small domain-labelled set is the sensible first step, and a specialist annotation provider is the right route when the gap is labelling volume rather than evaluation design.

What Matters Most About COCO Labels in Practice?

What matters most is keeping the format and the ground truth apart. The format (JSON sections, id links, [x, y, width, height] boxes, COCOeval’s 12 metrics) is stable. The ground truth is a set of choices someone made about classes, occluders, minimum sizes and which instances to bother labelling. The 2023 and 2024 studies show those choices move the score, and the 2026 study finds scores highly sensitive to annotation quality.

Keep the COCO format, re-scope the ground truth to the operating domain, and version both with the model.