AUTO: Adaptive Outlier Optimization for Online Test-Time OOD Detection

Puning Yang, Jian Liang, Jie Cao, Ran He · DOI

Abstract

Traditional Out-of-Distribution (OOD) detection methods often rely on static, pre-collected auxiliary datasets, limiting their effectiveness in dynamic, real-world environments. We present AUTO (Adaptive oUTlier Optimization), a novel framework for Test-Time OOD (TTOD) detection. AUTO enables models to adapt to shifting data streams during deployment by identifying and learning from new outliers on-the-fly. By integrating an intelligent filtering mechanism with a dynamic memory bank, AUTO achieves state-of-the-art performance across diverse benchmarks without compromising original task accuracy or requiring prior outlier exposure.

The Shift to Test-Time OOD Detection

Standard OOD detection assumes a frozen model operating in a static environment. However, real-world deployment often involves sequential data streams where the distribution of "normal" and "outlier" data can shift over time.

Comparison of Naive vs. Test-time OOD Detection scenarios.

As shown in Figure 1, naive detection assumes all data arrives at once in a simplistic scenario. In contrast, Test-Time OOD (TTOD) detection addresses practical scenarios where data arrives sequentially, and the OOD distribution may involve multiple sources (Multi-OOD) or temporal shifts (Time-series OOD). This setup requires a model that can adapt its detection boundaries in real-time using the unlabeled test data it encounters.

The AUTO Framework

To address the challenges of TTOD, the authors propose AUTO, which utilizes three core pillars to enable continuous, stable learning from the test stream.

The AUTO pipeline: from adaptive filtering to online optimization.

1. Adaptive In-Out-Aware Filter

Since the test stream is unlabeled, AUTO must distinguish between In-Distribution (ID) and OOD samples. It employs Maximum Softmax Probability (MSP) and dynamic margins ($m^{in}$ and $m^{out}$) to "pseudo-label" samples. The OOD margin is updated greedily as the model encounters more data, allowing the filter to become increasingly precise as it adapts to the specific characteristics of the current stream.

2. Dynamic ID Memory Bank

Continuous adaptation risks "catastrophic forgetting" of the original ID classes. AUTO mitigates this by maintaining a small, class-balanced memory bank. It stores representative samples for each ID category and updates them when high-confidence ID samples appear in the stream. This ensures the model retains its primary classification capabilities while optimizing for OOD detection.

3. Prediction-Aligning Objective ($L^{PA}$)

To prevent aggressive feature space warping during online updates, AUTO uses a prediction-aligning loss. This term anchors the current model's predictions to the initial pre-trained model’s "intuition," serving as a vital calibration mechanism that preserves the model's foundational knowledge.

Key Insights and Results

The AUTO framework creates a virtuous feedback loop: improved filtering yields better pseudo-labels, which enhances model optimization, further refining the filter's accuracy.

  • State-of-the-Art Performance: On CIFAR-100 using a ResNet-34 backbone, AUTO achieved an FPR95 of 11.06%, drastically outperforming the MSP baseline (83.53%). Remarkably, it even surpassed many "Outlier Exposure" methods that were pre-trained on auxiliary outliers.
  • Scalability to ImageNet: On ImageNet-1k, AUTO reached an average AUROC of 97.44%, a significant leap over standard energy-based (87.05%) or MaxLogit (87.00%) methods. This suggests that test-time adaptation is most valuable when the "normal" world is diverse and complex.
  • Real-Time Efficiency: By updating only the final feature block of the network, AUTO maintains high inference speeds. The overhead is approximately 5ms per sample—a 3.2x increase over a frozen model—making it suitable for many real-time applications.

Conclusion and Future Directions

AUTO demonstrates that test-time adaptation is a powerful tool for robust OOD detection in the wild. Its ability to learn from the environment without auxiliary data or privacy-compromising pre-collection makes it highly practical for sensitive domains like autonomous driving or medical imaging. While the model currently relies on encountering OOD samples to trigger improvement, future work may explore more sophisticated annotation strategies to further enhance pseudo-label quality in extremely data-scarce scenarios.

Summary updated

BibTeX
@misc{yang2023auto,
  author = {Puning Yang and Jian Liang and Jie Cao and Ran He},
  title = {{AUTO: Adaptive Outlier Optimization for Online Test-Time OOD Detection}},
  year = {2023},
  eprint = {2303.12267},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.12267},
}
Figure