Code Monkey home page Code Monkey logo

edgefool's Introduction

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).

edgefool's People

Contributors

alishahin avatar smartcameras avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.