Long-Tailed Out-of-Distribution Detection via Normalized Outlier Distribution Adaptation

Wenjun Miao,Guansong Pang,Jin Zheng,Xiao Bai
2024-10-28
Abstract:One key challenge in Out-of-Distribution (OOD) detection is the absence of ground-truth OOD samples during training. One principled approach to address this issue is to use samples from external datasets as outliers (i.e., pseudo OOD samples) to train OOD detectors. However, we find empirically that the outlier samples often present a distribution shift compared to the true OOD samples, especially in Long-Tailed Recognition (LTR) scenarios, where ID classes are heavily imbalanced, \ie, the true OOD samples exhibit very different probability distribution to the head and tailed ID classes from the outliers. In this work, we propose a novel approach, namely normalized outlier distribution adaptation (AdaptOD), to tackle this distribution shift problem. One of its key components is dynamic outlier distribution adaptation that effectively adapts a vanilla outlier distribution based on the outlier samples to the true OOD distribution by utilizing the OOD knowledge in the predicted OOD samples during inference. Further, to obtain a more reliable set of predicted OOD samples on long-tailed ID data, a novel dual-normalized energy loss is introduced in AdaptOD, which leverages class- and sample-wise normalized energy to enforce a more balanced prediction energy on imbalanced ID samples. This helps avoid bias toward the head samples and learn a substantially better vanilla outlier distribution than existing energy losses during training. It also eliminates the need of manually tuning the sensitive margin hyperparameters in energy losses. Empirical results on three popular benchmarks for OOD detection in LTR show the superior performance of AdaptOD over state-of-the-art methods. Code is available at \url{<a class="link-external link-https" href="https://github.com/mala-lab/AdaptOD" rel="external noopener nofollow">this https URL</a>}.
Computer Vision and Pattern Recognition
What problem does this paper attempt to address?
The paper attempts to address the problem of effectively detecting out-of-distribution (OOD) samples in long-tailed recognition (LTR) scenarios. Specifically, the paper focuses on how to improve the performance of OOD detectors in the absence of real OOD samples during the training phase, especially in the case of imbalanced in-distribution (ID) classes. ### Background Problem 1. **Challenges in OOD Detection**: - When applying deep neural networks (DNNs) in open environments, models tend to be overly confident in samples of unknown classes, easily misclassifying OOD samples as known classes (ID classes). - Particularly in long-tailed distribution scenarios, the number of samples in head classes far exceeds that in tail classes, leading to weaker predictive ability for tail classes and further exacerbating the difficulty of OOD detection. 2. **Limitations of Existing Methods**: - Existing methods typically use samples from external datasets as pseudo-OOD samples (outliers) to train OOD detectors. - However, there is a significant distribution difference between these pseudo-OOD samples and real OOD samples, especially in long-tailed distribution scenarios. - This distribution difference can lead to a decline in the performance of OOD detectors, as the model may mistakenly identify tail class samples as OOD samples or fail to distinguish between head class samples and OOD samples. ### Proposed Method To address the above issues, the paper proposes a new method called **Normalized Outlier Distribution Adaptation (AdaptOD)**. This method mainly includes two key components: 1. **Dynamic Outlier Distribution Adaptation (DODA)**: - DODA dynamically adjusts the initial outlier distribution to make it closer to the real OOD sample distribution by leveraging the knowledge of OOD samples predicted during the testing phase. - Specifically, DODA uses a global energy-based OOD score to identify OOD samples and updates the outlier distribution based on these samples. 2. **Dual-Normalized Energy Loss (DNE)**: - DNE normalizes energy training at both the class level and the sample level, enabling the model to produce more balanced energy predictions when dealing with imbalanced ID samples. - This helps reduce bias towards head classes, improve the prediction accuracy for tail classes, and generate a better initial outlier distribution. ### Main Contributions 1. **Proposed a new method AdaptOD** to adapt the outlier distribution to the real OOD distribution in long-tailed distribution scenarios, being the first method to adapt during both the training and inference phases. 2. **Introduced two new components, DODA and DNE**, to reduce the gap between the learned outlier distribution and the real OOD distribution, and to achieve more balanced energy predictions when handling imbalanced ID samples. 3. **Conducted extensive experiments on three popular long-tailed distribution benchmark datasets**, showing that AdaptOD significantly outperforms existing OOD detection methods in various long-tailed distribution scenarios. Through these innovations, the paper effectively addresses the key challenges of OOD detection in long-tailed distribution scenarios, enhancing the robustness and accuracy of models in practical applications.