This is the official repository of EDGEFOOL: AN ADVERSARIAL IMAGE ENHANCEMENT FILTER, a work published in the Proc. of the 45th IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP), Barcelona, Spain, May 4-8, 2020.
Example of results
Original Image | Adversarial Image | Original Image | Adversarial Image |
---|---|---|---|
- Create conda virtual-environment
module load python2/anaconda conda create --name EdgeFool python=2.7.15
- Activate conda environment
source activate EdgeFool
- Download source code from GitHub
git clone https://github.com/AliShahin/EdgeFool.git
- Install requirements
pip install -r requirements.txt
The code first locates all the images in Dataset folder and then generates the enhanced adversarial images in two steps:
- Image smoothing with l0 smoothing filters
- Generate the enhanced adversarial images after training of a Fully Convolutional Neural Network
Image smoothing is performed with the Python implementation of Image Smoothing via L0 Gradient Minimization provided by Kevin Zhang, as follows:
- Go to Smoothing directory
cd Smoothing
- Smooth the original images
bash script.sh
- The l0 smoothed images will be saved in the SmoothImgs directory (within the 'root' directory) with the same name as their corresponding original images
A Fully Convolutional Neural Network (FCNN) is first trained end-to-end with a multi-task loss function which includes smoothing and adversarial losses. The architecture of the FCNN is instantiated from Fast Image Processing with Fully-Convolutional Networks implemented in PyTorch by Wu Huikai. We enhance the image details of the L image channel only, after conversion to the Lab colour space without changing the colours of the image. In order to do this, we provided a differentiable PyTorch implementation of RGB-to-Lab and Lab-to-RGB. The enhanced adversarial images are then generated
- Go to Train directory
cd Train
- In the script.sh set the paths of (i) directory of the original images, (ii) directory of the smoothed images, and (iii) classifier under attack. The current implementation supports three classifiers Resnet18, Resnet50 and Alexnet, however other classifiers can be employed by changing the lines (80-88) in train_base.py.
- Generate the enhanced adversarial images
bash script.sh
- The enhanced adversarial images are saved in the EnhancedAdvImgsfor_{classifier} (within the 'root' directory) with the same name as their corresponding original images
If you use our code, please cite the following paper:
@InProceedings{shamsabadi2020edgefool,
title = {EdgeFool: An Adversarial Image Enhancement Filter},
author = {Shamsabadi, Ali Shahin and Oh, Changjae and Cavallaro, Andrea},
booktitle = {Proceedings of the 45th IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)},
year = {2020},
address = {Barcelona, Spain},
month = May
}
The content of this project itself is licensed under the Creative Commons Non-Commercial (CC BY-NC).