fabiocarrara / features-adversarial-det

Detect adversarial images from intermediate features in distance space
12 stars 3 forks source link

Adversarial examples detection in features distance spaces

This repo contains code to reproduce the experiments presented in "Adversarial examples detection in features distance spaces". The code trains models for adversarial detection based on intermediate features of the attacked classifier embedded into dissimilarity spaces.

Requirements

The main requirements are:

and can be installed with:

pip3 install -r requirements.txt

You will also need the following datasets to replicate the experiments:

Steps to reproduce experiments

The reproduce.sh bash script runs all the steps needed to reproduce the experiments presented in the paper, that is:

  1. Features extraction from ILSVRC'12 TRAIN dataset
  2. Class centroid / medoid computation
  3. Generation of adversarial examples
  4. Training of multiple detectors
  5. Reproducing ROC plots