Skip to content

smartcameras/EdgeFool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EdgeFool

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
Original Image Adversarial Image Original Image Adversarial Image
Original Image Adversarial Image Original Image Adversarial Image

Setup

  1. Create conda virtual-environment
     module load python2/anaconda
     conda create --name EdgeFool python=2.7.15
    
  2. Activate conda environment
     source activate EdgeFool
    
  3. Download source code from GitHub
     git clone https://github.com/smartcameras/EdgeFool.git 
    
  4. Install requirements
     pip install -r requirements.txt
    

Description

The code first locates all the images in Dataset folder and then generates the enhanced adversarial images in two steps:

  1. Image smoothing with l0 smoothing filters
  2. Generate the enhanced adversarial images after training of a Fully Convolutional Neural Network

Image Smoothing

Image smoothing is performed with the Python implementation of Image Smoothing via L0 Gradient Minimization provided by Kevin Zhang, as follows:

  1. Go to Smoothing directory
    cd Smoothing
    
  2. Smooth the original images
    bash script.sh
    
  3. The l0 smoothed images will be saved in the SmoothImgs directory (within the 'root' directory) with the same name as their corresponding original images

Generate the enhanced adversarial 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

  1. Go to Train directory
    cd Train
    
  2. 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.
  3. Generate the enhanced adversarial images
    bash script.sh
    
  4. The enhanced adversarial images are saved in the EnhancedAdvImgsfor_{classifier} (within the 'root' directory) with the same name as their corresponding original images

Authors

References

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
  }

License

The content of this project itself is licensed under the Creative Commons Non-Commercial (CC BY-NC).

About

PyTorch implementation of EdgeFool: An Adversarial Image Enhancement Filter, ICASSP2020

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published