Giter Site home page Giter Site logo

ntu-1091-spml-adversarial_defense's Introduction

NTU-1091-Security and Privacy of Machine Learning: Adversarial Defense

Overview

the attacker will use adversarial examples (up to epsilon=8 in the L_infinity norm) to attack your model, which is under white-box setting. In this project, I train a robust model for CIFAR-10 that can defend the adversarial examples.

Model

My defense pipeline include image preprocessing, and adversarial training, etc. The detail can be found in the report hw2_r09942066.pdf, please let me know if you need the model weight(email me), then I will send you the download link.

Defense Model

  • resnet50

Attack for evaluation

  • PGD
  • FGSM

Defense technique

  • PGD adversarial training
  • data pre-processing
  • SLQ
  • proposed method

Requirement

  • pytorch 1.5.0
  • python 3
  • built-in modules and numpy
  • opencv hw2.py has been tested under this env

Usage

For Evaluating

run python hw2.py [image folder]

Testing

cd src/example
python adversarial_testing.py

Ablation Experiment

cd src/example
python ablation_study.py

Generate PGD examples

cd src/example
python test_PGD.py

Result

67.2% accuracy for PGD attack(max epsilon=0.3) under white-box setting

Contact

If there are any problem that make you cannot execute the program, please contact
[email protected] (I have already test under the specify env).

ntu-1091-spml-adversarial_defense's People

Contributors

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