aamir-mustafa / super-resolution-adversarial-defense

Image Super-Resolution as a Defense Against Adversarial Attacks
88 stars 16 forks source link

Image Super-Resolution as a Defense Against Adversarial Attacks

This repository is an PyTorch implementation of the paper Image Super-Resolution as a Defense Against Adversarial Attacks

We use wavelet denoising and image super resolution as pre-processing steps to defend images against adversarial attacks. If you find our work useful in your research or publication, please cite our work:

We provide scripts for reproducing all the results from our paper. You can check the efficacy of our defense on your own adversarial images.

Dependencies

Clone the repository

Clone this repository into any place you want.

git clone https://github.com/aamir-mustafa/super-resolution-adversarial-defense
cd super-resolution-adversarial-defense

Wavelet Denoising

You can test our wavelet denoising + super-resolution algorithm on your own adversarial images and their corresponding ground truth labels.

Wavelet_Denoising.py -- (for image wavelet denoising).

Super Resolution

Place your denoised images in test folder. (like test/<your_image(s)>) We support jpg files.

Run the script in src folder.

cd src       # You are now in */super-resolution-adversarial-defense-master/src
sh super_resolution.sh

Accuracy Prediction

Accuracy.py (Evaluate the performace of our method by comparing accuracies on adversarial and recovered images).

Citation

@article{mustafa2019image,
  title={Image Super-Resolution as a Defense Against Adversarial Attacks},
  author={Mustafa, Aamir and Khan, Salman H and Hayat, Munawar and Shen, Jianbing and Shao, Ling},
  journal={arXiv preprint arXiv:1901.01677},
  year={2019}
}