Skip to main content
QUICK REVIEW

[Paper Review] AdvKnn: Adversarial Attacks On K-Nearest Neighbor Classifiers With Approximate Gradients

Xiaodan Li, Yuefeng Chen|arXiv (Cornell University)|Nov 15, 2019
Adversarial Robustness in Machine LearningComputer Science28 references8 citations
TL;DR

This paper proposes AdvKNN, a novel adversarial attack method for k-nearest neighbor (kNN) and Deep kNN (DkNN) classifiers using a differentiable deep kNN block (DkNNB) to approximate kNN outputs with gradients, enabling effective gradient-based attacks. The method also introduces consistency learning over probability distributions to improve robustness against distribution-based defenses, achieving significantly higher attack success rates with smaller perturbations than prior work.

ABSTRACT

Deep neural networks have been shown to be vulnerable to adversarial examples---maliciously crafted examples that can trigger the target model to misbehave by adding imperceptible perturbations. Existing attack methods for k-nearest neighbor~(kNN) based algorithms either require large perturbations or are not applicable for large k. To handle this problem, this paper proposes a new method called AdvKNN for evaluating the adversarial robustness of kNN-based models. Firstly, we propose a deep kNN block to approximate the output of kNN methods, which is differentiable thus can provide gradients for attacks to cross the decision boundary with small distortions. Second, a new consistency learning for distribution instead of classification is proposed for the effectiveness in distribution based methods. Extensive experimental results indicate that the proposed method significantly outperforms state of the art in terms of attack success rate and the added perturbations.

Motivation & Objective

  • To address the challenge of attacking kNN and DkNN classifiers, which are inherently non-differentiable and thus resistant to gradient-based adversarial attacks.
  • To develop a differentiable approximation of kNN outputs that enables gradient-based optimization for generating adversarial examples with small distortions.
  • To improve attack effectiveness on DkNN, which relies on aggregating predictions across multiple layers and uses credibility scores for defense, by introducing a consistency learning method over probability distributions rather than labels.
  • To evaluate the robustness of kNN-based defenses under realistic adversarial conditions, particularly in terms of perturbation size and detectability.

Proposed method

  • Proposes a differentiable deep kNN block (DkNNB) that approximates the output probability distribution of kNN classifiers, enabling gradient computation for adversarial attack generation.
  • Introduces a consistency learning (CL) framework that aligns predictions across multiple layers based on probability distributions rather than class labels, enhancing attack robustness for DkNN models.
  • Combines DkNNB and CL with standard gradient-based attacks such as FGSM and BIM to generate adversarial examples with minimal distortion.
  • Uses L∞ and L2 norms to measure perturbation size and evaluates attack success rate, accuracy drop, and credibility scores to assess performance and detectability.
  • Employs a multi-layer feature extraction strategy, applying DkNNB to different layers of the network to assess transferability and layer-specific attack effectiveness.
  • Validates the method on MNIST, SVHN, and Fashion-MNIST datasets using standard DNN and kNN-based models, including DkNN with layer-wise aggregation.

Experimental results

Research questions

  • RQ1Can a differentiable approximation of kNN be constructed to enable gradient-based adversarial attacks on otherwise non-differentiable kNN classifiers?
  • RQ2How effective is consistency learning over probability distributions in improving attack success on DkNN models that aggregate predictions across multiple layers?
  • RQ3What is the minimal perturbation required to fool DkNN models, and how does it compare to prior state-of-the-art methods in terms of L2 distortion and attack success rate?
  • RQ4Can adversarial examples generated by AdvKNN evade detection using credibility scores, a common defense mechanism in DkNN models?
  • RQ5To what extent do adversarial examples transfer across models, particularly to standard DNNs like LeNet5, when generated using the proposed method?

Key findings

  • The proposed AdvKNN method reduces DkNN accuracy on MNIST to 5.71% under L∞ norm with a mean L2 distortion of 1.4909, significantly outperforming prior work that achieved 17.44% accuracy with a distortion of 3.476.
  • With the addition of consistency learning (CL), the attack success rate on DkNN increased further, reducing accuracy to 7.54% on Fashion-MNIST under BIM with a mean L2 distortion of 1.4909.
  • The method achieved a 98.98% attack success rate on kNN for MNIST using FGSM when combined with DkNNB and CL, reducing accuracy from 98.98% to 15.28%.
  • Adversarial examples generated by AdvKNN have higher credibility scores (0.4608) compared to prior methods (0.1037), indicating they are more difficult to detect using DkNN’s credibility-based filtering.
  • Transferability experiments on LeNet5 showed that adversarial examples generated by AdvKNN outperformed standard FGSM and BIM attacks, with a 75.70% accuracy on DkNN under FGSM, compared to 81.41% for the clean model.
  • Ablation studies confirmed that DkNNB is effective across all layers, with layer 3 showing the best performance, and that the method maintains high success rates even for larger values of k.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.