/adversarial-machine-learning

Hands-on tutorial on adversarial examples 😈. With Streamlit app ❤️.

Primary LanguageJupyter Notebook

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?
  2. Quick setup
  3. Fast Gradient Sign method
  4. Adversarial example generator
  5. Let's connect!

What is this repo about?

PyTorch code and streamlit app 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

Also available in Medium

Quick setup

Create a virtualenv with your preferred tool (virtualenv, conda, poetry) and activate it.

Then

$ (venv) pip install -r requirements.txt
$ (venv) export PYTHONPATH="."

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

Let's connect!

If you want to learn more about real-world ML topics and become a better data scientist

👉 Subscribe to the datamachines newsletter.