This repository contains the source code to support the paper The Hammer and the Nut: Is Bilevel Optimization Really Needed to Poison Linear Classifiers?, by Antonio Emanuele Cinà, Sebastiano Vascon, Ambra Demontis, Battista Biggio, Fabio Roli and Marcello Pelillo, accepted at IJCNN 2021.
Please use the command
$ conda env create -f environment.yml
to create the conda environment beta_poison
.
Then you need to activate the conda env by running conda activate beta_poison
The file run_experiments.sh
contains a list of commands to replicate the experiments and results
proposed in our paper. Output files are, by default, saved in "IJCNN_Experiments/" dir.
Experiments for MNIST Pairs (4 vs. 0 and 9 vs. 8):
$ ./run_experiments.sh mnist_bin
Experiments for CIFAR-10 Pairs (frog vs. ship and frog vs. horse):
$ ./run_experiments.sh cifar_bin
Experiments for MNIST triplet are obtained with:
$ ./run_experiments.sh mnist_triplet
Ablation study evaluates the effect of k (number of prototypes) during the optimization procedure. To run it use:
$ ./run_experiments.sh mnist_ablation # ablation on mnist
$ ./run_experiments.sh cifar_ablation # ablation on cifar
- antonioemanuele.cina [at] unive [dot] it