Skip to content
MagNet: a Two-Pronged Defense against Adversarial Examples
Python
Branch: master
Clone or download
mdy
Latest commit b115cf8 Sep 7, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
defensive_models.py
setup_mnist.py
test_defense.py
train_defense.py
train_models.py
utils.py
worker.py MagNet demo Sep 7, 2017

README.md

MagNet

Demo code for "MagNet: a Two-Pronged Defense against Adversarial Examples", by Dongyu Meng and Hao Chen, at CCS 2017.

The code demos black-box defense against Carlini's L2 attack of various confidences. Other techniques proposed in the paper are also included in defensive_models.py and worker.py, but are not shown in the demo defense. Attack implementations are not provided in this repository.

Run the demo code:

  1. Make sure you have Keras, Tensorflow, numpy, scipy, and matplotlib installed.
  2. Clone the repository.
  3. We provide demo attack data and classifier on Dropbox and 百度网盘 (密码: yzt4). Please download and put the unzipped files in MagNet/. You may also use your own data for test.
  4. Train autoencoders with python3 train_defense.py.
  5. Test the defense with python3 test_defense.py .
  6. Defense performance is plotted in graph/defense_performance.pdf.
You can’t perform that action at this time.