PyTorch code for our paper:
Zhengyu Zhao, Zhuoran Liu, Martha Larson, "Towards Large yet Imperceptible Adversarial Image Perturbations with Perceptual Color Distance", CVPR 2020.
Specifically, we propose to strategically relax tight Lp-norm constraints while still maintaining imperceptibility by using perceptual color distance (CIEDE2000). The resulting large yet imperceptible perturbations lead to improved robustness and transferability.This code contains the implementations of:
- A PyTorch's autograd-compitable differentiable solution of the conversion from RGB to CIELAB space and of CIEDE2000 metric,
- Two approaches (PerC-C&W and PerC-AL) to creating imperceptible adversarial perturbations with optimization on perceptual color distance,
- Evaluation on success rate, robustness and transferability on 1000 ImageNet-Compatible images.
torch>=1.1.0; torchvision>=0.3.0; tqdm>=4.31.1; pillow>=5.4.1; matplotlib>=3.0.3; numpy>=1.16.4;
The 1000 images of the ImageNet-Compatible dataset are provided in the folder dataset/images
, along with their descriptions in dataset/images.csv
, including their URLs, cropping bounding boxes, classification labels and some other metadata. More details on this dataset can be found in its official repository.
Code for all the experiments along with descriptions can be found in the Jupyter Notebook file main.ipynb
.
Detailed parameter settings for the proposed two approach are described in perc_cw.py
and perc_al.py
.