Introduction
While most research in Out-of-Distribution (OOD) detection focuses on creating better "scoring functions," this paper argues we have been neglecting the "decision rule"—the actual thresholding logic used to separate known from unknown data. By framing OOD detection as a multiple hypothesis testing problem, the authors introduce a generalized Benjamini-Hochberg (g-BH) procedure. This method provides rigorous theoretical guarantees for error control and significantly outperforms traditional fixed-threshold methods across standard benchmarks.
The Problem: Score Functions vs. Decision Rules
Deep Neural Networks are notoriously overconfident, often classifying "alien" data (OOD) into known categories with high certainty. To fix this, researchers usually develop a score function $s(x)$ to measure how anomalous an input is. However, once you have a score, you still need a decision rule to draw the line between In-Distribution (ID) and OOD.
The standard industry approach is the "empirical decision rule" (e-DR): practitioners pick a threshold on a validation set that catches a target percentage of ID samples (e.g., 95%, known as TPR95). The problem with e-DR is that this threshold is static. It does not adapt to the specific OOD data encountered during testing and lacks any formal theoretical guarantee regarding the rate of false alarms. This paper fills that gap by providing a mathematically provable way to set these thresholds dynamically.
Methodology: A Hypothesis Testing Approach
The authors re-imagine OOD detection through the lens of statistical hypothesis testing. For every test input, the "null hypothesis" is that the sample is In-Distribution.
- Empirical p-values: Instead of using raw scores, the method converts scores into empirical p-values using a small "calibration set" of ID data. This makes the approach distribution-free, meaning it does not rely on assumptions about what the underlying data distribution looks like.
- The g-BH Procedure: They propose a generalized Benjamini-Hochberg procedure. While the classic BH procedure is a staple in statistics for controlling the False Discovery Rate (FDR) in multiple tests, the "generalized" version allows for more flexible function classes to transform p-values.
- Theoretical Guarantees: The authors prove that g-BH controls the FDR at a pre-specified level. Furthermore, using a "tailed generalized Gaussian distribution" framework, they derive an upper bound for the False Positive Rate (FPR), showing it converges to zero in probability as the test set size increases.
Key Insights: The Power of Adaptive Thresholding
The most critical insight of the paper is the shift from static to adaptive thresholding. As shown in the score distributions above, the standard rule (e-DR, green line) uses the exact same threshold regardless of the OOD data characteristics. In contrast, g-BH (red line) adaptively shifts the threshold based on the specific characteristics of the test batch.
Furthermore, g-BH offers plug-and-play superiority. You do not need to retrain your models. g-BH acts as a wrapper that can be applied to almost any existing scoring function to immediately boost its reliability. The authors also argue that False Discovery Rate (FDR)—the proportion of "OOD alarms" that are actually ID samples—is a more critical metric for safety-sensitive applications (like medical diagnosis or autonomous driving) than the traditionally used FPR95.
Experimental Results
The researchers evaluated their method using CIFAR-10 as the In-Distribution dataset, and CIFAR-100, TinyImageNet, SVHN, Texture, Places365, and MNIST as OOD datasets. They plugged g-BH into eight popular OOD scoring methods (including MSP, KNN, GEN, and LogitNorm) to test its efficacy.
The g-BH procedure consistently outperformed the traditional empirical decision rule (e-DR) across the board:
- Massive FPR Reduction: Using KNN as the base score on the CIFAR-10 vs. Places365 benchmark, g-BH slashed the False Positive Rate from 48.21% down to 16.79%.
- Better Trade-offs: It improved the F1-score (a balance of precision and recall) from 49.83% to 67.86% in the same KNN scenario.
- Consistency: Across all eight baseline methods, adding g-BH reduced the average FPR95 by 13.65%.
- Theoretical Validation: The experiments confirmed that the g-BH procedure successfully keeps the FDR below the user-defined target level ($\alpha$).
Limitations and Future Work
- Batch Requirement: Because it relies on multiple hypothesis testing, the method is designed to work on a set of test data. Its performance in a strictly "one-at-a-time" online streaming environment (without a buffer) is a potential area for further investigation.
- Calibration Set Dependency: The quality of the empirical p-values depends heavily on having a representative ID calibration set.
- Future Directions: The authors suggest that exploring different function classes within the g-BH framework could further optimize the trade-off between different types of detection errors.
Summary updated