Skip to content

Pytorch implementation for MagNet: a Two-Pronged Defense against Adversarial Examples

Notifications You must be signed in to change notification settings

sky4689524/Pytorch_MagNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch_MagNet

Pytorch implementation for MagNet: a Two-Pronged Defense against Adversarial Examples, by Meng, D., & Chen, H, at CCS 2017. Also, codes are referenced from https://github.com/Trevillie/MagNet. The main algorithms are included in defense.py and worker.py This repository is to defend segmentation models from adversarial attacks by using MagNet defense strategy.

Usage

train_autoencoder.py : train autoencoder models for defense.

defense.py : test MagNet defense to segmentation model against adversarial attacks.

simple example

python train_autoencoder.py
python defense.py --model UNet --model_path "path" --reformer autoencoder1 --detector autoencoder1 \
--reformer_path checkpoints/autoencoder1.pth --detector_path checkpoints/autoencoder1.pth

You can see more detailed arguments.

python train_autoencoder.py -h
python defense.py -h

About

Pytorch implementation for MagNet: a Two-Pronged Defense against Adversarial Examples

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages