Detecting Adversarial Samples Using Influence Functions and Nearest Neighbors

Gilad Cohen, Guillermo Sapiro, Raja Giryes
9/15/2019
cs.LGstat.ML

Official code: giladcohen/NNIF_adv_defense (37 stars, Python, last commit 2022-11-22).

Abstract

Deep neural networks (DNNs) are notorious for their vulnerability to adversarial attacks, which are small perturbations added to their input images to mislead their prediction. Detection of adversarial examples is, therefore, a fundamental requirement for robust classification frameworks.

Show full abstract

In this work, we present a method for detecting such adversarial attacks, which is suitable for any pre-trained neural network classifier. We use influence functions to measure the impact of every training sample on the validation set data. From the influence scores, we find the most supportive training samples for any given validation example. A k-nearest neighbor (k-NN) model fitted on the DNN's activation layers is employed to search for the ranking of these supporting training samples. We observe that these samples are highly correlated with the nearest neighbors of the normal inputs, while this correlation is much weaker for adversarial inputs. We train an adversarial detector using the k-NN ranks and distances and show that it successfully distinguishes adversarial examples, getting state-of-the-art results on six attack methods with three datasets. Code is available at https://github.com/giladcohen/NNIF_adv_defense.

View on arXivView PDF

Code Implementations(1)

Detection of adversarial examples using influence functions and nearest neighbors

379PythonNov 17, 20194 years ago

Similar Papers

Cite this paper

@article{cohen2019detecting,
  title  = {Detecting Adversarial Samples Using Influence Functions and Nearest Neighbors},
  author = {Gilad Cohen and Guillermo Sapiro and Raja Giryes},
  year   = {2019},
  eprint = {1909.06872},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1909.06872}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1909.06872.svg)](https://codeofpaper.com/paper/1909.06872)

Discussion