Generative Adversarial Examples: Working with Classifier
Explore the process of creating adversarial examples with generative adversarial networks to test and break deep learning classifiers. Learn to train an ensemble of pre-trained models on Kaggle’s Cats vs. Dogs dataset, implement transfer learning, and generate adversarial noise that significantly reduces model accuracy.
We'll cover the following...
Let's try generating adversarial examples with GANs and break some models.
Preparing an ensemble classifier for Kaggle’s cats vs. dogs
⚠️ The dataset is intended only for non-commercial research and educational use.
To make our demonstration more similar to practical scenarios, we will train a decent model on Kaggle’s
For convenience, after downloading the dataset, put images of cats and dogs in separate folders so that the file structure looks like this:
/cats-dogs-kaggle/cat/cat.0.jpg/cat.1.jpg.../dog/dog.0.jpg/dog.1.jpg...
The model we are training on this dataset is formed of several pre-trained models provided by
Now, we need to load and preprocess the data, create an ensemble classifier, and train this model. Here are the detailed steps:
Create a Python file named
cats_dogs.pyand import the Python modules:
Here, the custom module files, advGAN, data_utils, and model_ensemble, are discussed below.
Define the main entry point in
cats_...