--- license: other license_name: imagenet-terms-of-access license_link: https://image-net.org/download.php pretty_name: JPEG Re-encoding Confound Control Dataset (ImageNet-C) task_categories: - image-classification language: - en tags: - robustness - imagenet-c - corruption-robustness - jpeg-compression - controlled-experiment - confound - benchmark-bias size_categories: - 10K.png # clean_png arm clean_saves/jpeg_q/.jpg # clean_jpeg arm corrupted//s/ png/.png # corrupt_png arm jpeg_q/.jpg # corrupt_jpeg arm manifest.csv # one row per base image: image_id, source_path, wnid, imagenet_index, base_png_path metadata.csv # one row per arm file (index over the whole dataset; schema below) config.yaml # exact scope knobs used to generate this release ``` `` (e.g. `img_0001`) is assigned deterministically at selection time. The `base/` PNG doubles as the `clean_png` arm and is not duplicated. ### `metadata.csv` schema One row per image file, so the dataset can be filtered without walking the tree: | column | meaning | |---|---| | `file_name` | path relative to repo root, e.g. `data/corrupted/fog/s3/jpeg_q85/img_0001.jpg` | | `image_id` | stable id, e.g. `img_0001` | | `arm` | one of `clean_png`, `clean_jpeg`, `corrupt_png`, `corrupt_jpeg` | | `corruption` | corruption name, or `clean` for the clean arms | | `severity` | `1/3/5`, or `0` for clean arms | | `jpeg_quality` | `75/85/90` for JPEG arms, empty for PNG arms | | `wnid` | ImageNet wnid of the source class | | `imagenet_index` | ImageNet-1k class index (0–999) | ## Usage Pair each `*_png` arm with the matching `*_jpeg` arm (same `image_id`, `corruption`, `severity`) and compare model behavior. The intended contrast is `corrupt_png` vs `corrupt_jpeg`; the `clean_*` arms isolate JPEG acting alone (the control). ```python import pandas as pd from huggingface_hub import hf_hub_download repo = "/jpeg-confound-control-dataset" meta = pd.read_csv(hf_hub_download(repo, "metadata.csv", repo_type="dataset")) # all matched arms for fog at severity 3, quality 85 fog = meta[(meta.corruption == "fog") & (meta.severity == 3) & (meta.arm.isin(["corrupt_png", "corrupt_jpeg"])) & (meta.jpeg_quality.isin([85, ""]))] ``` Or pull the full tree: ```python from huggingface_hub import snapshot_download snapshot_download("/jpeg-confound-control-dataset", repo_type="dataset") ``` ## Reproducibility The dataset regenerates **byte-identically** from the generation code plus the seed in `config.yaml`: image selection is seeded, and before every corruption an order-independent 32-bit seed is derived from `(image_id, corruption, severity)` via `zlib.crc32`. The full generator, evaluator, and analysis are in the [code repository](https://github.com/) (`generate.py` → `evaluate.py` → `analyze.py`). ## Intended use and limitations - **Intended use**: measuring the JPEG save-step confound in corruption-robustness benchmarks; teaching controlled-experiment design. Research only. - **No lossless ImageNet original exists** — ImageNet (and thus ImageNette) source images are themselves JPEG. This source compression is held identical across the PNG and JPEG arms, so it cancels in the comparison; the variable isolated here is the **final save-time re-encode**, not total JPEG exposure. - Base images are the 10-class ImageNette subset with a single canonical crop, so absolute accuracies differ from the full ImageNet-C protocol; the controlled contrast between arms is unaffected. ## Licensing and source - **Images** derive from ImageNette, a subset of ImageNet, and are subject to the [ImageNet terms of access](https://image-net.org/download.php) (non-commercial research use). Redistribute only as permitted by those terms; when in doubt, release **code + manifest + a small sample** and let users regenerate the full set. - **Corruption functions**: [`imagecorruptions`](https://github.com/bethgelab/imagecorruptions) (Apache-2.0), packaging Hendrycks's original ImageNet-C code. - **Packaging/generation code**: see the code repository's license. ## Citation The corruptions and the confound this dataset measures: ```bibtex @inproceedings{hendrycks2019benchmarking, title = {Benchmarking Neural Network Robustness to Common Corruptions and Perturbations}, author = {Hendrycks, Dan and Dietterich, Thomas}, booktitle = {International Conference on Learning Representations (ICLR)}, year = {2019}, url = {https://arxiv.org/abs/1903.12261} } ```