• Description:

Imagenet2012Fewshot is a subset of original ImageNet ILSVRC 2012 dataset. The dataset share the same validation set as the original ImageNet ILSVRC 2012 dataset. However, the training set is subsampled in a label balanced fashion. In 5shot configuration, 5 images per label, or 5000 images are sampled; and in 10shot configuration, 10 images per label, or 10000 images are sampled.

  • Homepage:

  • Source code: tfds.datasets.imagenet2012_fewshot.Builder

  • Versions:

    • 2.0.0: Fix validation labels.
    • 2.0.1: Encoding fix. No changes from user point of view.
    • 3.0.0: Fix colorization on ~12 images (CMYK -> RGB). Fix format for consistency (convert the single png image to Jpeg). Faster generation reading directly from the archive.

    • 4.0.0: (unpublished)

    • 5.0.0: New split API (

    • 5.0.1 (default): No release notes.

    • 5.1.0: Added test split.

  • Download size: Unknown size

  • Manual download instructions: This dataset requires you to download the source data manually into download_config.manual_dir (defaults to ~/tensorflow_datasets/downloads/manual/):
    manual_dir should contain two files: ILSVRC2012_img_train.tar and ILSVRC2012_img_val.tar. You need to register on in order to get the link to download the dataset.

  • Auto-cached (documentation): No

  • 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
  Author = {Olga Russakovsky and Jia Deng and Hao Su and Jonathan Krause and Sanjeev Satheesh and Sean Ma and Zhiheng Huang and Andrej Karpathy and Aditya Khosla and Michael Bernstein and Alexander C. Berg and Li Fei-Fei},
  Title = { {ImageNet Large Scale Visual Recognition Challenge} },
  Year = {2015},
  journal   = {International Journal of Computer Vision (IJCV)},
  doi = {10.1007/s11263-015-0816-y},

imagenet2012_fewshot/1shot (default config)

  • Config description: 1shot of total ImageNet training set.

  • Dataset size: 6.46 GiB

  • Splits:

Split Examples
'train' 1,000
'tune' 1,000
'validation' 50,000



  • Config description: 5shot of total ImageNet training set.

  • Dataset size: 6.88 GiB

  • Splits:

Split Examples
'train' 5,000
'tune' 1,000
'validation' 50,000



  • Config description: 10shot of total ImageNet training set.

  • Dataset size: 7.42 GiB

  • Splits:

Split Examples
'train' 10,000
'tune' 1,000
'validation' 50,000