Skip to main content
QUICK REVIEW

[Paper Review] A statistical framework for efficient out of distribution detection in deep neural networks

Matan Haroush, Tzviel Frostig|arXiv (Cornell University)|Feb 25, 2021
Adversarial Robustness in Machine LearningComputer Science5 citations
TL;DR

This paper proposes a statistical hypothesis testing framework for out-of-distribution (OOD) detection in deep neural networks, using p-values to guarantee Type I error control. By aggregating non-conformity measures across all network layers and introducing the MaSF detector, it achieves state-of-the-art OOD detection accuracy with 35x faster inference than prior methods, without retraining or prior knowledge of the test distribution.

ABSTRACT

Background. Commonly, Deep Neural Networks (DNNs) generalize well on samples drawn from a distribution similar to that of the training set. However, DNNs' predictions are brittle and unreliable when the test samples are drawn from a dissimilar distribution. This is a major concern for deployment in real-world applications, where such behavior may come at a considerable cost, such as industrial production lines, autonomous vehicles, or healthcare applications. Contributions. We frame Out Of Distribution (OOD) detection in DNNs as a statistical hypothesis testing problem. Tests generated within our proposed framework combine evidence from the entire network. Unlike previous OOD detection heuristics, this framework returns a $p$-value for each test sample. It is guaranteed to maintain the Type I Error (T1E - incorrectly predicting OOD for an actual in-distribution sample) for test data. Moreover, this allows to combine several detectors while maintaining the T1E. Building on this framework, we suggest a novel OOD procedure based on low-order statistics. Our method achieves comparable or better results than state-of-the-art methods on well-accepted OOD benchmarks, without retraining the network parameters or assuming prior knowledge on the test distribution -- and at a fraction of the computational cost.

Motivation & Objective

  • To address the brittleness of DNNs on out-of-distribution (OOD) inputs, which poses risks in safety-critical applications like autonomous vehicles and healthcare.
  • To overcome limitations of existing OOD detection methods, including lack of statistical guarantees, high computational cost, and reliance on prior knowledge of OOD data.
  • To develop a framework that provides valid p-values for each test sample, ensuring Type I error control under the null hypothesis of in-distribution data.
  • To design an efficient, parameter-free OOD detection method that leverages low-order statistics and maintains high accuracy across diverse benchmarks.
  • To enable the combination of multiple detectors while preserving error control, supporting real-world deployment under constrained compute budgets.

Proposed method

  • Formalizes OOD detection as a statistical hypothesis testing problem, testing two null hypotheses: (1) the sample is from any training class distribution, and (2) it is from the predicted class distribution.
  • Constructs valid non-conformity measures across all layers of the DNN, normalizing and aggregating them to form a global test statistic.
  • Uses the Simes and Fisher combination methods to combine p-values from multiple layers, improving detection power while maintaining Type I error control.
  • Proposes MaSF (Max-Simes-Fisher), a novel detector based on low-order statistics (e.g., max and mean of layer-wise p-values), minimizing computational overhead.
  • Employs a non-parametric, conformal inference approach that does not require retraining or modification of the pre-trained DNN.
  • Applies structured sparsity and feature sampling to further reduce inference cost, enabling real-time deployment.

Experimental results

Research questions

  • RQ1Can OOD detection in DNNs be rigorously framed as a statistical hypothesis testing problem with valid p-values?
  • RQ2Can multi-layer aggregation of non-conformity measures significantly improve OOD detection performance compared to single-layer methods?
  • RQ3Can a detector based on low-order statistics achieve SOTA performance while reducing computational cost by orders of magnitude?
  • RQ4Can multiple OOD detectors be combined within a unified framework while preserving Type I error control?
  • RQ5Is it possible to maintain high detection accuracy without prior knowledge of the OOD distribution or retraining the network?

Key findings

  • The proposed framework guarantees Type I error control for OOD detection, ensuring that in-distribution samples are not incorrectly flagged as OOD.
  • Multi-layer non-conformity aggregation improves detection accuracy by 50% on average compared to single-layer detectors.
  • The MaSF detector achieves comparable or better OOD detection performance than state-of-the-art methods on standard benchmarks such as those from Lee et al. (2018).
  • MaSF's inference speed is 35 times faster than existing methods, making it highly suitable for real-time and resource-constrained applications.
  • The framework enables the combination of multiple specialized detectors without inflating Type I error, supporting adaptive detection of diverse OOD patterns.
  • The method is effective without requiring retraining, prior knowledge of OOD data, or architectural modifications to the DNN.

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.