# imagenet_a

<br />

- **Description**:

ImageNet-A is a set of images labelled with ImageNet labels that were obtained
by collecting new data and keeping only those images that ResNet-50 models fail
to correctly classify. For more details please refer to the paper.

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.

- **Additional Documentation** :
  [Explore on Papers With Code](https://paperswithcode.com/dataset/imagenet-a)

- **Homepage** :
  <https://github.com/hendrycks/natural-adv-examples>

- **Source code** :
  [`tfds.datasets.imagenet_a.Builder`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/datasets/imagenet_a/imagenet_a_dataset_builder.py)

- **Versions**:

  - **`0.1.0`** (default): No release notes.
- **Download size** : `655.70 MiB`

- **Dataset size** : `650.87 MiB`

- **Auto-cached**
  ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):
  No

- **Splits**:

| Split | Examples |
|---|---|
| `'test'` | 7,500 |

- **Feature structure**:

    FeaturesDict({
        '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 |
|---|---|---|---|---|
|   | FeaturesDict |   |   |   |
| file_name | Text |   | string |   |
| image | Image | (None, None, 3) | uint8 |   |
| label | ClassLabel |   | int64 |   |

- **Supervised keys** (See
  [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):
  `('image', 'label')`

- **Figure**
  ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):

![Visualization](https://storage.googleapis.com/tfds-data/visualization/fig/imagenet_a-0.1.0.png)

- **Examples** ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):

<button id="displaydataframe">Display examples...</button>

- **Citation**:

    @article{hendrycks2019nae,
      title={Natural Adversarial Examples},
      author={Dan Hendrycks and Kevin Zhao and Steven Basart and Jacob Steinhardt and Dawn Song},
      journal={arXiv preprint arXiv:1907.07174},
      year={2019}
    }