Python Shell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Shield: Fast, Practical Defense and Vaccination for Deep Learning using JPEG Compression


This is the code repository for the under-review KDD 2018 Applied Data Science paper: Shield: Fast, Practical Defense and Vaccination for Deep Learning using JPEG Compression

The code included here reproduces our techniques (e.g. SHIELD) presented in the paper, and also our experiment results reported, such as using various JPEG compression qualities to remove adversarial perturbation introduced by Carlini-Wagner-L2, DeepFool, I-FSGM, and FSGM.


Installation and Setup

Install Dependencies

This repository requires Cleverhans and TensorFlow-Slim image classification model library, please see their respective pages for instructions for installation.

Note: When installing TF-slim image models library, find models/research/slim, and put directory slim under utils. So that your directory structure should contain utils/slim.

Config Home Directory

In, fill in the home directory of your choice.

HOME_DIR = '' # eg. '/home/yourusername/'

Example usage:

The script can be used to perform (specified using --perform attack|defend|evaluate)

  1. attack - Attacks the specified model with the specified method(s)
  2. defend - Defends the specified attack images with the specified defense
  3. evaluate - Evaluates the specified model with the specified defended version of images.
python --use_gpu 0 --debug false --perform attack --models resnet_50_v2 --attacks fgsm,df
python --use_gpu 0 --debug true --perform evaluate --models resnet_50_v2 --checkpoint_paths /home/.../model.ckpt --attacks fgsm --defenses jpeg --attack_ablations '{"fgsm": [{"ord": Infinity, "eps": 2}]}' --defense_ablations '{"jpeg": [{"quality": 60}]}'

Video Demo

We have uploaded a video demo, which you can access here.


Name Affiliation
Nilaksh Das Georgia Institute of Technology
Madhuri Shanbhogue Georgia Institute of Technology
Shang-Tse Chen Georgia Institute of Technology
Fred Hohman Georgia Institute of Technology
Siwei Li Georgia Institute of Technology
Li Chen Intel Corporation
Michael E. Kounavis Intel Corporation
Polo Chau Georgia Institute of Technology