google-deepmind/image_obfuscation_benchmark
Python
Captured source
source ↗google-deepmind/image_obfuscation_benchmark
Language: Python
License: Apache-2.0
Stars: 27
Forks: 1
Open issues: 9
Created: 2023-01-26T20:31:28Z
Pushed: 2026-05-20T01:35:00Z
Default branch: master
Fork: no
Archived: no
README:
Image Obfuscation Benchmark
This repository contains the code to evaluate models on the image obfuscation benchmark, first presented in Benchmarking Robustness to Adversarial Image Obfuscations (Stimberg et al., 2023).
Dataset
The dataset consists of 22 obfuscations and the Clean data. 19 obfuscations are training obfuscations and 3 are hold-out obfuscations. All images are central cropped to 224 x 224 and saved as compressed JPEG images. Each obfuscation is applied to each image in the ILSVRC2012 dataset. For each image, the file_name, label and obfuscation hyper-parameters are stored with it. The dataset can be loaded through the TensorFlow datasets API. Each combination of train / validation and an obfuscation is its own split, e.g. to load the validation split obfuscated with the StyleTransfer obfuscation do
import tensorflow_datasets as tfds
ds = tfds.load('obfuscated_imagenet', split='validation_StyleTransfer', data_dir='/path/to/extracted/dataset/')where the splits must be present in the /path/to/extracted/dataset/obfuscated_imagenet/1.0.0 directory.
To load multiple obfuscations together, e.g. for training use the `sample_from_datasets` function.
Obfuscation Examples
Clean|AdversarialPatches|BackgroundBlurComposition| -----|------------------|------------------------| ||
ColorNoiseBlocks|ColorPatternOverlay|Halftoning| ----------------|-------------------|----------| ||
HighContrastBorder|IconOverlay|ImageOverlay| ------------------|-----------|------------| ||
Interleave|InvertLines|LineShift| ----------|-----------|---------| ||
LowContrastTriangles|PerspectiveComposition|PerspectiveTransform| --------------------|----------------------|--------------------| ||
PhotoComposition|RotateBlocks|RotateImage| ----------------|------------|-----------| ||
StyleTransfer|SwirlWarp|TextOverlay| -------------|---------|-----------| ||
Texturize|WavyColorWarp| ---------|-------------| |
Download {#dataset-download}
You can download the validation and train splits for all the obfuscations below. If you want to load them with the Tensorflow datasets API as described above you also need to download these two JSON files: dataset_info.json, features.json.
| Obfuscation | Validation | Train | | ------------------------- | ----------- | ----------- | | Clean | tar (1.2 GB) | tar (31 GB) | | AdversarialPatches | tar (1.4 GB) | tar ( 36 GB) | | BackgroundBlurComposition | tar ( 0.5 GB) | tar (12 GB) | | ColorNoiseBlocks | tar (1.9 GB) | tar (48 GB) | | ColorPatternOverlay | tar (1.8 GB) | tar (45 GB) | | Halftoning | tar (2.4 GB) | tar (54 GB) | | HighContrastBorder | tar (2.1 GB) | tar (55 GB) | | IconOverlay | tar (1.7 GB) | tar (43 GB) | | ImageOverlay | tar (1.2 GB) | tar (30 GB) | | Interleave | tar (1.5 GB) | tar (38 GB) | | InvertLines…
Excerpt shown — open the source for the full document.