google-deepmind/image_obfuscation_benchmark

Python

Open original ↗

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| -----|------------------|------------------------| ![Clean](example_images/Clean.png)|![AdversarialPatches](example_images/AdversarialPatches.png)|![BackgroundBlurComposition](example_images/BackgroundBlurComposition.png)

ColorNoiseBlocks|ColorPatternOverlay|Halftoning| ----------------|-------------------|----------| ![ColorNoiseBlocks](example_images/ColorNoiseBlocks.png)|![ColorPatternOverlay](example_images/ColorPatternOverlay.png)|![Halftoning](example_images/Halftoning.png)

HighContrastBorder|IconOverlay|ImageOverlay| ------------------|-----------|------------| ![HighContrastBorder](example_images/HighContrastBorder.png)|![IconOverlay](example_images/IconOverlay.png)|![ImageOverlay](example_images/ImageOverlay.png)

Interleave|InvertLines|LineShift| ----------|-----------|---------| ![Interleave](example_images/Interleave.png)|![InvertLines](example_images/InvertLines.png)|![LineShift](example_images/LineShift.png)

LowContrastTriangles|PerspectiveComposition|PerspectiveTransform| --------------------|----------------------|--------------------| ![LowContrastTriangles](example_images/LowContrastTriangles.png)|![PerspectiveComposition](example_images/PerspectiveComposition.png)|![PerspectiveTransform](example_images/PerspectiveTransform.png)

PhotoComposition|RotateBlocks|RotateImage| ----------------|------------|-----------| ![PhotoComposition](example_images/PhotoComposition.png)|![RotateBlocks](example_images/RotateBlocks.png)|![RotateImage](example_images/RotateImage.png)

StyleTransfer|SwirlWarp|TextOverlay| -------------|---------|-----------| ![StyleTransfer](example_images/StyleTransfer.png)|![SwirlWarp](example_images/SwirlWarp.png)|![TextOverlay](example_images/TextOverlay.png)

Texturize|WavyColorWarp| ---------|-------------| ![Texturize](example_images/Texturize.png)|![WavyColorWarp](example_images/WavyColorWarp.png)

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.