GithubHelp home page GithubHelp logo

liangxun / peernets-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tantara/peernets-pytorch

0.0 2.0 0.0 710 KB

A pytorch implementation of 'PeerNets: Exploiting Peer Wisdom Against Adversarial Attacks'

Home Page: https://medium.com/@tantara/adversarial-attack-part-1-a830ec92acde

License: MIT License

Dockerfile 1.53% Shell 5.30% Python 93.17%

peernets-pytorch's Introduction

PeerNets on PyTorch 1.0

A pytorch implementation of PeerNets: Exploiting Peer Wisdom Against Adversarial Attacks

Keywords

Adversarial Attack, Adversarial Example, Graph Convolutional Network(GCN)

Tutorails

  • Adversarial Attack(Part 1): Adversarial Attack과 Defense Link
  • Adversarial Attack(Part 2): PeerNets Link

Environement

  • Docker 18.06 on Ubuntu 16.04
  • PyTorch 1.0
  • CUDA >= 9.1, CUDNN 7

Experiments

  • LeNet5 on MNIST
  • ResNet32 on CIFAR10
  • ResNet110 on CIFAR100
  • PR-LeNet5 on MNIST
  • PR-ResNet32 on CIFAR10
  • PR-ResNet110 on CIFAR100

Results

  • Baseline: Accuracy(%)
  • rho(0.02~1.0): Accuracy(%)/Fooling Rate(%)

MNIST

Method Baseline rho=0.2 0.4 0.6 0.8 1.0
LeNet-5 98.6 92.7/7.1 33.9/66.0 14.1/85.9 7.9/92.2 8.2/91.7
PR-LeNet-5 98.2 94.8/4.6 93.3/6.0 87.7/11.7 53.2/46.4 50.1/50.1
LeNet-5(ours) 98.5 94.2/4.0 75.8/32.0 64.5/42.0 57.1/50.0 42.0/72.0
PR-LeNet-5(ours) - - - - - -

CIFAR10

Method Baseline rho=0.04 0.08 0.10
ResNet-32 92.7 55.3/44.4 26.8/73.1 22.7/77.3
PR-ResNet-32 89.3 87.3/7.1 83.3/13.0 70.0/28.3
ResNet-32(ours) 93.3 84.7/20.0 75.2/32.0 69.5/46.0

CIFAR100

Method Baseline rho=0.02 0.04 0.06
ResNet-110 71.6 45.5/49.8 45.5/49.8 45.5/49.8
PR-ResNet-110 66.4 61.5/23.7 52.6/38.6 44.6/49.5
ResNet-110(ours) 68.8 - - -

How to run

nvidia-docker run -it tantara/peernets-pytorch /bin/bash # and CMD
nvidia-docker run -it tantara/peernets-pytorch CMD
  • CMD can be Evaluation, Attack, Training as follows:

Evaluation

# bash eval.sh GPU_ID EXP
bash eval.sh 0 lenet5 # lenet5, pr-lenet5
bash eval.sh 0 resnet32 # resnet32, pr-resnet32
bash eval.sh 0 resnet110 # resnet110, pr-resnet110

Adversarial Attack

# bash attack.sh GPU_ID EXP NUM_SAMPLES RHO
bash attack.sh 0 lenet5 50 0.2 # lenet5, pr-lenet5
bash attack.sh 0 resnet32 50 0.04 # resnet32, pr-resnet32
bash attack.sh 0 resnet110 50 0.02 # resnet110, pr-resnet110

Training

# bash train.sh GPU_ID EXP
bash train.sh 0 lenet5 # lenet5, pr-lenet5
bash train.sh 0 resnet32 # resnet32, pr-resnet32
bash train.sh 0 resnet110 # resnet110, pr-resnet110

References

  1. PeerNets: Exploiting Peer Wisdom Against Adversarial Attacks

    Jan Svoboda, Jonathan Masci, Federico Monti, Michael M. Bronstein, Leonidas Guibas. arXiv: 1806.00088.

    [link]. arXiv: 1806.00088, 2018.

  2. aaron-xichen/pytorch-playground

  3. akamaster/pytorch_resnet_cifar10

  4. rusty1s/pytorch_geometric

Authors

License

© Taekmin Kim, 2018. Licensed under the MIT License.

peernets-pytorch's People

Contributors

tantara avatar

Watchers

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