https://github.com/paulescu/adversarial-machine-learning
Hands-on tutorial on adversarial examples 😈. With Streamlit app ❤️.
https://github.com/paulescu/adversarial-machine-learning
adversarial-attacks adversarial-machine-learning python
Last synced: 3 months ago
JSON representation
Hands-on tutorial on adversarial examples 😈. With Streamlit app ❤️.
- Host: GitHub
- URL: https://github.com/paulescu/adversarial-machine-learning
- Owner: Paulescu
- Created: 2021-06-29T11:06:25.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-17T09:16:26.000Z (almost 4 years ago)
- Last Synced: 2025-04-14T06:41:10.918Z (about 1 year ago)
- Topics: adversarial-attacks, adversarial-machine-learning, python
- Language: Jupyter Notebook
- Homepage: https://paulabartabajo.substack.com/
- Size: 72.1 MB
- Stars: 31
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Breaking deep learning models with adversarial examples 😈
Or maybe it's just that beautiful things are so easily broken by the world.
-- Cassandra Clare, City of Fallen Angels

## Table of Contents
1. [What is this repo about?](#what-is-this-repo-about)
2. [Quick setup](#quick-setup)
3. [Fast Gradient Sign method](#fast-gradient-sign-method)
4. [Adversarial example generator](#adversarial-example-generator)
5. [Let's connect!](#lets-connect)
## What is this repo about?
PyTorch code and [streamlit app](https://share.streamlit.io/paulescu/adversarial-machine-learning/main/src/streamlit_app.py) that demonstrate how easy it is to break deep learning models in computer vision.
More precisely, Inception V3.
If you do not know what adversarial examples are go check my blog post.
[📝 Adversarial examples to break deep learning models](http://datamachines.xyz/2021/07/05/adversarial-examples-to-break-deep-learning-models/)
Also available in [Medium](https://towardsdatascience.com/adversarial-examples-to-break-deep-learning-models-e7f543833eae) and in [Hackernoon](https://hackernoon.com/adversarial-examples-in-machine-learning-explained)
## Quick setup
Create a virtualenv with your preferred tool (`virtualenv`, `conda`, `poetry`)
and activate it.
Then install the code as a local package
```
$ (venv) pip install .
```
## Fast Gradient Sign method
We use the vanilla fast gradient sign method

And its iterative version.

In the code you can find the "magic" that transforms a nice puppy into a paper towel.

## Adversarial example generator
👉 [Streamlit app to generate adversarial examples](https://share.streamlit.io/paulescu/adversarial-machine-learning/main/src/streamlit_app.py)

## Let's connect
If you want to learn more about real-world ML topics and become a better data scientist
👉 [Subscribe](http://datamachines.xyz/subscribe) to the datamachines newsletter.
👉🏽 Follow me on [Twitter](https://twitter.com/paulabartabajo_) and/or [LinkedIn](https://www.linkedin.com/in/pau-labarta-bajo-4432074b/)