• Description:

ImageNet-v2 is an ImageNet test set (10 per class) collected by closely following the original labelling protocol. Each image has been labelled by at least 10 MTurk workers, possibly more, and depending on the strategy used to select which images to include among the 10 chosen for the given class there are three different versions of the dataset. Please refer to section four of the paper for more details on how the different variants were compiled.

The label space is the same as that of ImageNet2012. Each example is represented as a dictionary with the following keys:

  • 'image': The image, a (H, W, 3)-tensor.
  • 'label': An integer in the range [0, 1000).
  • 'file_name': A unique sting identifying the example within the dataset.

  • Homepage:

  • Source code: tfds.datasets.imagenet_v2.Builder

  • Versions:

    • 1.0.0: Initial version.
    • 2.0.0: Files updated.
    • 3.0.0 (default): Fix file_name, from absolute path to path relative to data directory, ie: "class_id/filename.jpg".
    • 3.1.0: New URLs for resources from Hugging Face.
  • Auto-cached (documentation): No

  • Splits:

Split Examples
'test' 10,000
  • Feature structure:
    'file_name': Text(shape=(), dtype=string),
    'image': Image(shape=(None, None, 3), dtype=uint8),
    'label': ClassLabel(shape=(), dtype=int64, num_classes=1000),
  • Feature documentation:
Feature Class Shape Dtype Description
file_name Text string
image Image (None, None, 3) uint8
label ClassLabel int64
  title={Do ImageNet Classifiers Generalize to ImageNet?},
  author={Recht, Benjamin and Roelofs, Rebecca and Schmidt, Ludwig and Shankar, Vaishaal},
  booktitle={International Conference on Machine Learning},

imagenet_v2/matched-frequency (default config)