Taming False Positives in Out-of-Distribution Detection with Human Feedback

Harit Vishwakarma, Heguang Lin, Ramya Korlakai Vinayak

Abstract

Out-of-Distribution (OOD) detection is critical for the safe deployment of machine learning models in real-world environments. However, traditional methods often suffer from high False Positive Rates (FPR) because detection thresholds are typically set using static benchmarks before the model encounters actual deployment data. We present a mathematically grounded, Human-in-the-Loop (HITL) framework that adaptively updates detection thresholds based on real-time human feedback. By utilizing the Law of Iterated Logarithm (LIL) to construct anytime-valid confidence bounds, our framework guarantees that the FPR remains below a user-defined limit while minimizing the burden on human experts. Our evaluation across multiple image benchmarks and synthetic datasets demonstrates that this approach maintains safety constraints even under significant distribution shifts.

Introduction

When machine learning models are deployed in safety-critical fields—such as autonomous driving or medical diagnostics—the ability to identify Out-of-Distribution (OOD) samples is paramount. A model trained to classify specific objects may "fail silently" by assigning high-confidence labels to inputs it was never designed to handle.

The primary challenge in OOD detection is that the nature of "unknown" data is, by definition, unknown until deployment. Current state-of-the-art methods typically set a static threshold based on a target True Positive Rate (TPR) on a validation set. However, empirical evidence shows this often leads to FPRs as high as 60% to 96% in the wild. Because OOD data can shift over time, a fixed threshold is insufficient for maintaining long-term safety. This paper addresses these gaps by introducing a dynamic, adaptive thresholding mechanism powered by human feedback.

Methodology

The proposed framework treats OOD thresholding as a dynamic parameter that evolves as the system receives feedback from a human expert. The system is designed around four key pillars:

1. Scoring Agnosticism

The framework is compatible with any existing OOD scoring function, such as Energy-based scores or K-Nearest Neighbor (KNN) scores. This allows practitioners to integrate the HITL layer into their existing pipelines without changing their underlying model architecture.

2. Efficient Importance Sampling

To minimize the human labeling burden, the system does not require a label for every input. Instead, it employs importance sampling: the system always requests a label if the score falls below the current threshold (predicted OOD), but only samples a fraction of inputs above the threshold (predicted In-Distribution). This strategy provides an unbiased estimate of the true FPR while significantly reducing the number of manual interventions.

3. LIL-based Upper Confidence Bounds (UCB)

The core mathematical innovation is the use of the Law of Iterated Logarithm (LIL) to create a confidence interval for the FPR. Unlike standard statistical bounds that are only valid for a fixed sample size, LIL-based bounds are "anytime valid." By solving an optimization problem to find the smallest threshold where the upper bound of the FPR is guaranteed to be below the target (e.g., $\alpha = 0.05$), the system ensures safety even with limited initial data.

4. Windowed Adaptation for Distribution Shifts

In environments where the data distribution is non-stationary, the framework utilizes a sliding window of recent samples combined with a change-detection mechanism. If the system detects that the current FPR estimate (minus its confidence interval) exceeds the target, it triggers a reset or update to regain safety quickly.

Experimental Evaluation

The researchers evaluated the framework using a combination of synthetic Gaussian mixture models and standard image benchmarks. For the image tasks, CIFAR-10 and CIFAR-100 served as In-Distribution (ID) data, while MNIST, SVHN, Texture, TinyImageNet, Places365, and ImageNet-1K were used as OOD sets.

Key Findings

  • Guaranteed FPR Control: While non-adaptive baselines saw FPRs spike uncontrollably, the LIL-based method successfully maintained the FPR below the 5% target across all tested scoring functions.
  • Operational Efficiency: The time required to reach a "feasible" threshold (one lower than the maximum conservative threshold) was found to be inversely proportional to the target FPR and the density of OOD samples in the stream.
  • Superiority over Hoeffding Bounds: While simpler bounds like Hoeffding's inequality can be used, the LIL-based approach reached near-optimal thresholds significantly faster while maintaining identical safety guarantees.
  • Robustness to Shift: In experiments where the OOD data source was switched mid-stream (e.g., from MNIST to CIFAR-100), the windowed version of the algorithm successfully detected the shift and re-adjusted the threshold to bring the system back into compliance with the safety limit.

Discussion and Limitations

While the framework provides a robust bridge between theoretical safety and practical deployment, it is not without limitations. The system relies on a human expert being available for labeling, which creates a potential bottleneck during early deployment or periods of high distribution shift. Additionally, while the windowed approach works well empirically for non-stationary data, providing the same level of rigorous theoretical guarantees for non-stationary environments remains an area for future research. Finally, the computational requirement of solving the optimization problem via binary search at each step adds a minor layer of complexity to the deployment pipeline.

Conclusion

This work introduces a principled method for taming the unpredictability of OOD detection. By combining human expertise with anytime-valid statistical bounds, the framework allows for the safe deployment of ML models in environments where OOD data is unknown or shifting. This approach moves the field closer to reliable, self-correcting AI systems that can operate safely in the complex reality of the real world.

Summary updated

BibTeX
@inproceedings{vishwakarma2024taming,
  author = {Harit Vishwakarma and Heguang Lin and Ramya Korlakai Vinayak},
  title = {{Taming False Positives in Out-of-Distribution Detection with Human Feedback}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2024},
}
Figure