# MS COCO (2014)

> 330k everyday scenes with 1.5M labeled objects in 80 categories.

Page: https://mralbu.github.io/ai-datasets/d/coco

## Key facts

- Category: Vision
- Task: Object detection, segmentation and captioning
- Creators: Tsung-Yi Lin et al. (Microsoft and academic partners)
- Size: ~330k images, ~200k annotated
- Splits: train2017 118,287, val2017 5,000, test2017 40,670
- Input: RGB photo, typically 640 px on the long side
- Labels: Boxes and masks for 80 object categories, 5 captions per image
- License: Annotations CC BY 4.0; images under their Flickr licenses
- Paper: [Microsoft COCO: Common Objects in Context](https://arxiv.org/abs/1405.0312)
- Homepage: https://cocodataset.org/
- Hugging Face: [rafaelpadilla/coco2017](https://huggingface.co/datasets/rafaelpadilla/coco2017)
- Sampled at Hub revision 7d5136d6952da2df12d99106e2cce2a65324617d (2026-11-07)

## Why it matters

ImageNet asks "what is in this photo?"; COCO asks "where is every object?". Its cluttered, non-iconic scenes and its box AP metric became the yardstick for object detection (Faster R-CNN, YOLO, Mask R-CNN, DETR), and its captions helped start image captioning and vision-language models.

## Worth knowing

- Boxes are stored as [x, y, width, height] in pixels, from the top-left corner. Many bugs come from assuming [x1, y1, x2, y2].
- The label list has 91 slots but only 80 are used; ids like "street sign" and "hat" were dropped, which is why category ids have gaps.
- The standard metric averages precision over IoU thresholds from 0.5 to 0.95, which rewards tight boxes.
- About 1% of annotations are "crowd" regions (a group of people or objects) handled specially in scoring.

## Get the data

This copy uses a loading script, so the snippets use the Hub's Parquet conversion (train + val, ~19 GB). The original zips are on cocodataset.org.

```bash
# pip install -U huggingface_hub
hf download rafaelpadilla/coco2017 --repo-type dataset \
  --revision refs/convert/parquet \
  --local-dir coco
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("rafaelpadilla/coco2017", revision="refs/convert/parquet")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/rafaelpadilla/coco2017@~parquet/default/val/*.parquet")
print(df.shape)
```

## Related datasets

- [Pascal VOC](https://huggingface.co/datasets/TNILab/pascal_voc2012_det_train_val): 2005–2012, 20 classes, the predecessor (on this site: https://mralbu.github.io/ai-datasets/d/pascal-voc)
- [ADE20K](https://huggingface.co/datasets/1aurent/ADE20K): 2017, every pixel labeled, 150-class benchmark (on this site: https://mralbu.github.io/ai-datasets/d/ade20k)
- [Flickr30k](https://huggingface.co/datasets/nlphuji/flickr30k): 2014, 31k captioned photos, the captioning benchmark before COCO Captions (on this site: https://mralbu.github.io/ai-datasets/d/flickr30k)
- [LVIS](https://www.lvisdataset.org/): 2019, 1,200+ categories on COCO images
- [Objects365](https://www.objects365.org/): 2019, 365 categories, 638k images at release
- [Visual Genome](https://huggingface.co/datasets/ljnlonoljpiljm/visual_genome): 2016, scene graphs on about half of COCO's images (on this site: https://mralbu.github.io/ai-datasets/d/visual-genome)
- [VQA v2](https://huggingface.co/datasets/lmms-lab-encoder/VQAv2): 2017, 1.1 million questions about COCO images (on this site: https://mralbu.github.io/ai-datasets/d/vqa-v2)

## Landmark papers

- [Faster R-CNN](https://arxiv.org/abs/1506.01497) (2015)
- [YOLO9000: Better, Faster, Stronger (YOLOv2)](https://arxiv.org/abs/1612.08242) (2016)
- [Mask R-CNN](https://arxiv.org/abs/1703.06870) (2017)
- [End-to-End Object Detection with Transformers (DETR)](https://arxiv.org/abs/2005.12872) (2020)

## Papers on this site that use it

- [Faster R-CNN (2015)](https://mralbu.github.io/ai-datasets/p/faster-rcnn.md): Replaced the slow external region proposer with a small network that shares the detector's features.
- [ResNet (2015)](https://mralbu.github.io/ai-datasets/p/resnet.md): Skip connections that let networks grow from about 20 layers to more than 150.
- [FPN (2016)](https://mralbu.github.io/ai-datasets/p/fpn.md): Give a detector strong features at every scale by sending the deep, coarse ones back down to the fine ones.
- [Large-minibatch SGD (2017)](https://mralbu.github.io/ai-datasets/p/large-minibatch-sgd.md): Two simple rules, scale the learning rate with the batch and warm it up gradually, let 256 GPUs train ResNet-50 in an hour without losing accuracy.
- [Mask R-CNN (2017)](https://mralbu.github.io/ai-datasets/p/mask-rcnn.md): Added a small parallel branch to Faster R-CNN that predicts a pixel mask for every detected object.
- [RetinaNet (2017)](https://mralbu.github.io/ai-datasets/p/retinanet.md): Down-weighted easy background examples in the loss so a single-stage detector finally matched two-stage accuracy.
- [HRNet (2019)](https://mralbu.github.io/ai-datasets/p/hrnet.md): Kept a high-resolution stream alive all the way through the network instead of downsampling and trying to rebuild detail later.
- [MoCo (2019)](https://mralbu.github.io/ai-datasets/p/moco.md): Built a large, consistent queue of negative keys with a slowly moving momentum encoder so unsupervised pretraining beat supervised ImageNet on transfer.
- [DETR (2020)](https://mralbu.github.io/ai-datasets/p/detr.md): Framed object detection as direct set prediction with a Transformer, dropping anchors and non-maximum suppression.
- [Latent diffusion (2021)](https://mralbu.github.io/ai-datasets/p/latent-diffusion.md): Run diffusion in a compressed latent space instead of on pixels, and steer it with text through cross-attention.
- [MAE (2021)](https://mralbu.github.io/ai-datasets/p/mae.md): Masked 75% of an image's patches and trained a Vision Transformer to reconstruct the missing pixels using an asymmetric encoder–decoder.
- [Mask2Former (2021)](https://mralbu.github.io/ai-datasets/p/mask2former.md): Unified semantic, instance and panoptic segmentation into one mask-predicting Transformer with masked cross-attention.
- [Swin (2021)](https://mralbu.github.io/ai-datasets/p/swin.md): A Transformer that attends within small windows and merges patches as it goes deeper, so it can replace the ConvNet backbone in detection and segmentation.
- [ConvNeXt (2022)](https://mralbu.github.io/ai-datasets/p/convnext.md): Modernize a ResNet one design choice at a time, and a pure ConvNet matches Swin Transformers without any attention.
- [Flamingo (2022)](https://mralbu.github.io/ai-datasets/p/flamingo.md): Bridged a frozen vision encoder and a frozen LLM with gated cross-attention so one model learns new visual tasks from a few examples in the prompt.
- [BLIP-2 (2023)](https://mralbu.github.io/ai-datasets/p/blip-2.md): Connected off-the-shelf frozen ViTs and frozen LLMs through a compact 188M-parameter Querying Transformer trained in two stages.
- [LLaVA (2023)](https://mralbu.github.io/ai-datasets/p/llava.md): Dropped complex multimodal adapters for a single linear projection from CLIP to an LLM, trained on 158k GPT-4-synthesized image conversations.
- [SAM (2023)](https://mralbu.github.io/ai-datasets/p/sam.md): A model that cuts out whatever you point at, in any image, trained on a billion masks.
- [PaliGemma (2024)](https://mralbu.github.io/ai-datasets/p/paligemma.md): Paired SigLIP and Gemma-2B with a linear projection, prefix-LM attention and unfrozen multi-resolution pretraining to build a compact 3B transfer base model.
