COCO

Also known as: Common Objects in Context · MS COCO

On this page 7

COCO, short for Common Objects in Context and often called MS COCO, is a large public image dataset that pairs everyday photographs with object bounding boxes, instance segmentation masks, human keypoints and natural-language captions. In the field of training data for artificial intelligence, it serves as the reference benchmark for object detection and segmentation, and its evaluation protocol defines how most vision models report accuracy.

Released in 2014 by a team led by researchers at Microsoft, COCO deliberately collected non-iconic images: cluttered scenes in which objects appear small, partially hidden and surrounded by other objects. That design choice made it much harder than earlier datasets and pushed models toward reasoning about objects in context rather than recognizing a single centered subject.

What the COCO dataset contains

COCO contains roughly 330,000 images, of which more than 200,000 carry full annotations, with about 1.5 million labeled object instances. The core label set covers 80 object categories called “things”, such as person, car, dog, chair and cup, grouped into 12 supercategories.

Several annotation layers were added to the same images over time, which is why the name refers to a family of tasks rather than one label type. The table below summarizes the main layers and what each one supports.

Annotation layerContentTypical task
Bounding boxesAxis-aligned box per object instanceObject detection
Instance masksPolygon or run-length encoded maskInstance segmentation
Keypoints17 body joints per annotated personHuman pose estimation
CaptionsAt least 5 sentences per imageImage captioning, retrieval
Background and panoptic labels91 amorphous background classes; 133 panoptic classesSemantic and panoptic segmentation
DensePoseMapping of body pixels to a 3D surfaceDense human pose
Main annotation layers in COCO

The labels were produced through crowdsourced labeling on Amazon Mechanical Turk, using a staged pipeline: workers first marked which categories were present, then located each instance, and finally traced its outline. This multi-stage workflow reduced cost while keeping recall high, although it still left some missed and imprecise labels.

How COCO structures splits and annotation files

The current standard release uses the 2017 splits, which reorganized the earlier 2014 split into a larger training set and a fixed validation set. Test labels are withheld on an evaluation server so that published results cannot be tuned against them.

SplitApproximate imagesLabels publicPurpose
train2017118,000YesModel training
val20175,000YesValidation and ablation studies
test-dev201720,000NoLeaderboard reporting
unlabeled2017123,000No labels existSemi-supervised learning
Standard COCO 2017 splits

Annotations ship as JSON files with three central arrays: images, annotations and categories. Each annotation stores a bbox in the form [x, y, width, height] measured in pixels from the top-left corner, a segmentation field, an area and an iscrowd flag. The COCO JSON format became a de facto exchange standard, so labeling tools such as CVAT, Label Studio and Labelbox can export to it directly.

The iscrowd flag marks dense groups of objects that annotators could not separate, such as a crowd of spectators. These regions are encoded as run-length masks and are ignored during evaluation, so a detector is neither rewarded nor penalized for predictions that fall inside them.

How COCO evaluation measures accuracy

The COCO evaluation protocol reports mean average precision (AP) averaged over ten intersection over union (IoU) thresholds, from 0.50 to 0.95 in steps of 0.05. A prediction counts as correct only when its overlap with a ground-truth object reaches the threshold, so the averaged metric rewards precise localization, not just finding the object.

Results are also broken down by object size, because small objects remain the hardest case for nearly every architecture. The official pycocotools library computes all of these numbers, and differences between reimplementations can shift scores enough to matter when papers are compared.

MetricDefinitionWhat it reveals
APMean over IoU 0.50 to 0.95Overall detection and localization quality
AP50AP at IoU 0.50Loose localization, comparable to Pascal VOC
AP75AP at IoU 0.75Strict, tight-box accuracy
APsObjects under 32 x 32 pixelsSmall-object performance
APmObjects from 32 x 32 to 96 x 96 pixelsMedium-object performance
APlObjects above 96 x 96 pixelsLarge-object performance
Key COCO detection metrics

Recall is reported in a similar way as average recall (AR) at fixed numbers of detections per image, typically 1, 10 and 100. The limit of 100 detections per image is part of the protocol, so models must rank their outputs sensibly rather than flood the image with boxes.

How COCO compares with other vision datasets

COCO sits between small, clean benchmarks and very large, loosely labeled corpora. Its strength is dense, instance-level annotation at moderate scale, which is why it remains the default detection benchmark even after much larger datasets appeared.

DatasetMain label typeScale and scopeKey difference from COCO
ImageNetImage-level classAbout 1.3 million images, 1,000 classesMostly iconic, single-object images
Pascal VOCBoxes and masksAbout 11,000 images, 20 classesSmaller, simpler scenes, single IoU metric
Open ImagesBoxes, masks, relationsAbout 9 million images, 600 box classesLarger but sparser, partly machine-verified labels
LVISInstance masksCOCO images, about 1,200 classesLong-tail vocabulary on COCO photographs
Visual GenomeScene graphs, regionsAbout 108,000 imagesFocus on relationships and attributes
COCO compared with related datasets

Because ImageNet emphasizes classification and COCO emphasizes localization, a common practice is pretraining a backbone on large image collections and then fine-tuning on COCO. Results on COCO are therefore often a measure of how well general visual features transfer to dense prediction.

Known limitations and common mistakes

COCO is carefully built but not error-free, and experienced practitioners treat its labels as a strong but imperfect gold standard. Audits have found missing instances, loose masks and inconsistent category boundaries, which places a ceiling on how meaningful very small score gains are.

  • Label noise near the top of the leaderboard: once models exceed about 60 AP, part of the remaining error reflects annotation errors rather than model weakness.
  • Closed vocabulary: the 80 categories omit many everyday objects, so strong COCO scores do not guarantee open-world performance.
  • Geographic and demographic bias: most photographs come from Flickr users in North America and Europe, and caption studies have shown gender and cultural skew.
  • Mixed image licensing: annotations are released under a Creative Commons attribution license, but each image keeps its original Flickr license, which matters for commercial training data.
  • Evaluation leakage: tuning hyperparameters repeatedly on val2017 and then reporting val2017 numbers produces optimistic estimates.

A frequent technical mistake is confusing box formats: COCO uses corner plus width and height, while many libraries expect two corner coordinates. Converting incorrectly produces boxes that look plausible but silently degrade training, so a visual check of a sample batch is a sensible safeguard.

The idea in brief

COCO is a big collection of everyday photos with careful labels. People drew boxes around objects, traced their outlines and wrote short descriptions of each scene. A computer can study these examples and learn to find cars, dogs or people in new pictures.

It also works like a shared exam for vision systems. Teams test their models on the same pictures and use the same scoring rules. That makes it easy to see which approach finds objects more accurately.

A practical scenario

A small engineering team at a logistics company needs a model that spots people and forklifts in warehouse camera footage. Collecting and labeling thousands of their own images from scratch would take months, so they start from a detector pretrained on COCO, which already recognizes the person category and many vehicle-like shapes.

The team labels about 2,500 warehouse frames in CVAT, exports them in the COCO JSON format and fine-tunes the detector for a few hours on a single GPU. They evaluate with pycocotools and track AP and APs separately, because distant workers appear as small objects under 32 x 32 pixels.

After fine-tuning, the model reaches production-ready detection quality on their held-out footage, and the team spends its effort on hard cases such as partially hidden workers instead of rebuilding a training pipeline. Reusing the COCO format also lets them swap in newer detector architectures later without relabeling anything.