Skip to main content
QUICK REVIEW

[Paper Review] Detecting Anomalous Inputs to DNN Classifiers By Joint Statistical Testing at the Layers.

Jayaram Raghuram, Varun Chandrasekaran|arXiv (Cornell University)|Jul 29, 2020
Adversarial Robustness in Machine LearningComputer Science5 citations
TL;DR

This paper proposes an unsupervised statistical framework that detects adversarial and out-of-distribution (OOD) inputs in DNN classifiers by jointly testing class-conditional distributions of internal layer representations. By computing p-values across layers and combining them via a scoring function, the method identifies anomalous inputs with high accuracy, outperforming or matching five state-of-the-art detection methods on benchmark datasets.

ABSTRACT

Detecting anomalous inputs, such as adversarial and out-of-distribution (OOD) inputs, is critical for classifiers deployed in real-world applications, especially deep neural network (DNN) classifiers that are known to be brittle on such inputs. We propose an unsupervised statistical testing framework for detecting such anomalous inputs to a trained DNN classifier based on its internal layer representations. By calculating test statistics at the input and intermediate-layer representations of the DNN, conditioned individually on the predicted class and on the true class of labeled training data, the method characterizes their class-conditional distributions on natural inputs. Given a test input, its extent of non-conformity with respect to the training distribution is captured using p-values of the class-conditional test statistics across the layers, which are then combined using a scoring function designed to score high on anomalous inputs. We focus on adversarial inputs, which are an important class of anomalous inputs, and also demonstrate the effectiveness of our method on general OOD inputs. The proposed framework also provides an alternative class prediction that can be used to correct the DNNs prediction on (detected) adversarial inputs. Experiments on well-known image classification datasets with strong adversarial attacks, including a custom attack method that uses the internal layer representations of the DNN, demonstrate that our method outperforms or performs comparably with five recently-proposed, competing detection methods.

Motivation & Objective

  • Address the critical challenge of detecting adversarial and out-of-distribution (OOD) inputs in deployed DNN classifiers, which are known to be brittle on such inputs.
  • Develop an unsupervised method that does not require access to adversarial examples during training, enabling broad applicability.
  • Characterize the distribution of natural inputs across input and intermediate layers using class-conditional statistics derived from labeled training data.
  • Provide a reliable anomaly detection mechanism that scores high on anomalous inputs while supporting corrected predictions when anomalies are detected.
  • Demonstrate robustness against strong adversarial attacks, including a novel attack that exploits internal layer representations.

Proposed method

  • Compute test statistics at input and intermediate layer representations of the DNN, conditioned separately on the predicted class and the true class of training samples.
  • Estimate class-conditional distributions of these test statistics using labeled training data to model the expected behavior of natural inputs.
  • For a test input, calculate p-values reflecting its non-conformity with the learned class-conditional distributions across layers.
  • Combine layer-wise p-values using a scoring function designed to amplify scores for anomalous inputs, enabling effective detection.
  • Leverage the same statistical framework to generate an alternative, corrected class prediction when an input is flagged as anomalous.
  • Use a custom adversarial attack that targets internal layer representations to rigorously evaluate the robustness of the detection framework.

Experimental results

Research questions

  • RQ1Can joint statistical testing across multiple DNN layers improve detection of adversarial and OOD inputs compared to single-layer or non-statistical methods?
  • RQ2How effective is the proposed method in detecting adversarial examples generated by strong attacks, including those that exploit internal layer representations?
  • RQ3Can the method provide a reliable alternative prediction when an input is detected as anomalous, improving classifier robustness?
  • RQ4Does the use of class-conditional test statistics across layers lead to better generalization and detection performance than existing unsupervised approaches?
  • RQ5How does the method perform under distribution shift and on diverse OOD inputs beyond adversarial examples?

Key findings

  • The proposed method outperforms or matches five recently proposed detection methods on standard image classification benchmarks under strong adversarial attacks.
  • The framework achieves high detection performance even against a custom adversarial attack that specifically targets internal layer representations, demonstrating robustness.
  • The use of p-values from class-conditional statistical tests across multiple layers enables effective detection of inputs deviating from the natural data distribution.
  • The method provides a corrected prediction for detected adversarial inputs, offering a practical mechanism to improve classifier reliability in real-world deployment.
  • The scoring function based on combined layer-wise p-values effectively amplifies anomalies, leading to strong detection performance across diverse test scenarios.
  • The approach is unsupervised and does not require adversarial examples during training, making it broadly applicable to existing DNN classifiers.

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.