https://github.com/oscarknagg/adversarial
Creating and defending against adversarial examples
https://github.com/oscarknagg/adversarial
Last synced: 12 months ago
JSON representation
Creating and defending against adversarial examples
- Host: GitHub
- URL: https://github.com/oscarknagg/adversarial
- Owner: oscarknagg
- Created: 2018-12-04T22:59:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-06T23:35:11.000Z (over 7 years ago)
- Last Synced: 2025-04-07T08:14:37.781Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 84.4 MB
- Stars: 42
- Watchers: 3
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# adversarial
This repository contains PyTorch code to create and defend against
adversarial attacks.
See [this Medium article](https://towardsdatascience.com/know-your-enemy-7f7c5038bdf3)
for a discussion on how to use and defend against
the projected gradient attack.
Example adversarial attack created using this repo.

Cool fact - adversarially trained discriminative (_not generative!_)
models can be used to interpolate between classes by creating
large-epsilon adversarial examples against them.

# Contents
- A Jupyter notebook demonstrating how to use and defend against
the projected gradient attack (see `notebooks/`)
- `adversarial.functional` contains functional style implementations of
a view different types of adversarial attacks
- Fast Gradient Sign Method - white box - batch implementation
- Projected Gradient Descent - white box - batch implementation
- Local-search attack - black box, score-based - single image
- Boundary attack - black box, decision-based - single imagae
# Setup
## Requirements
Listed in `requirements.txt`. Install with
`pip install -r requirements.txt` preferably in a virtualenv.
## Tests (optional)
Run `pytest` in the root directory to run all tests.