Detecting Adversarial Samples Using Influence Functions and Nearest Neighbors

Link
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. 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.

Synth

Problem:: 딥 Neural Networks(DNN)가 Adversarial Attack에 취약하여 탐지 기법이 필요하나, 기존 방법들은 한계가 있음

Solution:: Influence Functions와 k-NN을 결합한 NNIF 알고리즘 제안, 정상 입력과 적대적 입력 간의 상관관계 차이를 이용

Novelty:: 훈련 데이터가 네트워크 결정에 미치는 영향을 측정하는 두 가지 방법(Influence Functions와 k-NN)의 상관관계를 활용한 적대적 예제 탐지 기법

Note:: 자신들이 제안한 방어 기법을 알고 공격하는 경우에도 성능 평가를 진행하고 강건성을 보임

Summary

Motivation

Figure 1 설명

file-20250328004235014.png|500

Method

NNIF 알고리즘 진행 프로세스

  1. 훈련 세트, 검증 세트, DNN 모델을 입력으로 받음
  2. 검증 세트에 대해 Adversarial Attack을 적용하여 적대적 검증 세트 생성
  3. 각 DNN 활성화 레이어에 대해 k-NN 모델 구축 (k는 전체 훈련 샘플 수와 동일)
  4. 정상 이미지와 적대적 이미지에 대해 다음 과정 수행:
    • Influence Function을 사용하여 가장 도움이 되는(helpful) M개와 가장 해로운(harmful) M개의 훈련 샘플 인덱스 식별
    • 위에서 식별된 훈련 샘플들의 k-NN 순위(R)와 L2 거리(D) 추출
    • 각각 R↑, D↑(helpful 관련)와 R↓, D↓(harmful 관련) 특성 벡터로 저장
  5. 정상 이미지의 특성 벡터는 negative class(0), 적대적 이미지의 특성 벡터는 positive class(1)로 라벨링
  6. 이 특성-라벨 쌍으로 Logistic Regression 분류기 학습
  7. 테스트 시에는 새로운 이미지에 대해 특성 벡터를 추출하고 학습된 분류기로 적대적 여부 판단

Method 검증

White-Box 공격에 대한 강건성