[Paper Review] Partial and Asymmetric Contrastive Learning for Out-of-Distribution Detection in Long-Tailed Recognition
This paper proposes Partial and Asymmetric Supervised Contrastive Learning (PASCL) to improve out-of-distribution (OOD) detection in long-tailed recognition, where standard methods fail due to confusion between tail-class in-distribution samples and OOD samples. By applying contrastive loss only to tail classes and enforcing asymmetric learning (pulling same-class tail samples together while pushing them away from OOD samples), and using auxiliary branch fine-tuning for in-distribution accuracy, PASCL achieves state-of-the-art performance with 1.29–7.89% improvements in FPR and accuracy on CIFAR10-LT, CIFAR100-LT, and ImageNet-LT.
Existing out-of-distribution (OOD) detection methods are typically benchmarked on training sets with balanced class distributions. However, in real-world applications, it is common for the training sets to have long-tailed distributions. In this work, we first demonstrate that existing OOD detection methods commonly suffer from significant performance degradation when the training set is long-tail distributed. Through analysis, we posit that this is because the models struggle to distinguish the minority tail-class in-distribution samples, from the true OOD samples, making the tail classes more prone to be falsely detected as OOD. To solve this problem, we propose Partial and Asymmetric Supervised Contrastive Learning (PASCL), which explicitly encourages the model to distinguish between tail-class in-distribution samples and OOD samples. To further boost in-distribution classification accuracy, we propose Auxiliary Branch Finetuning, which uses two separate branches of BN and classification layers for anomaly detection and in-distribution classification, respectively. The intuition is that in-distribution and OOD anomaly data have different underlying distributions. Our method outperforms previous state-of-the-art method by $1.29\%$, $1.45\%$, $0.69\%$ anomaly detection false positive rate (FPR) and $3.24\%$, $4.06\%$, $7.89\%$ in-distribution classification accuracy on CIFAR10-LT, CIFAR100-LT, and ImageNet-LT, respectively. Code and pre-trained models are available at https://github.com/amazon-research/long-tailed-ood-detection.
Motivation & Objective
- To address the significant performance drop in OOD detection when training data follows a long-tailed distribution, where tail-class in-distribution samples are often misclassified as OOD.
- To identify that existing OOD detection methods fail to distinguish tail-class in-distribution samples from OOD samples due to feature space overlap.
- To propose a contrastive learning framework that explicitly separates tail-class in-distribution features from OOD features while preserving head-class discrimination.
- To improve in-distribution classification accuracy without compromising OOD detection performance by decoupling batch normalization and classification head optimization.
Proposed method
- Introduce Partial and Asymmetric Supervised Contrastive Learning (PASCL), which applies contrastive loss only to tail-class in-distribution samples and OOD samples, not to head classes.
- Enforce asymmetry by grouping same-class tail samples together (positive pairs) while avoiding clustering of OOD samples, which are treated as negative samples.
- Define tail classes as the k% least frequent classes (e.g., k=50% by default), enabling partial contrastive learning focused on hard-to-distinguish tail samples.
- Use Auxiliary Branch Finetuning (ABF) to train separate batch normalization (BN) and classification layers for OOD detection and in-distribution classification, respectively, to better match the distinct distributions of in-distribution and OOD data.
- Optimize the model using a combination of cross-entropy loss for classification and contrastive loss for feature space separation, with separate BN statistics for each task branch.
- Apply ablation studies to validate the necessity of partiality, asymmetry, and ABF, and to tune hyperparameters like the tail class threshold (k).
Experimental results
Research questions
- RQ1Why do existing OOD detection methods degrade significantly on long-tailed training sets, particularly in distinguishing tail-class in-distribution samples from OOD samples?
- RQ2Can contrastive learning be adapted to improve OOD detection in long-tailed recognition by explicitly modeling the distinction between tail-class in-distribution and OOD features?
- RQ3Does enforcing asymmetry in contrastive learning—wherein OOD samples are not pulled together—improve model generalization and OOD detection performance?
- RQ4Can decoupling batch normalization and classification head optimization via auxiliary branch finetuning improve in-distribution classification accuracy without degrading OOD detection?
- RQ5How sensitive is the proposed method to the choice of tail class threshold (k), and what is the optimal percentage of classes to include in partial contrastive learning?
Key findings
- PASCL improves OOD detection by 1.29% in FPR95 on CIFAR10-LT, 1.45% on CIFAR100-LT, and 0.69% on ImageNet-LT compared to the previous SOTA.
- The method achieves 3.24% higher in-distribution classification accuracy on CIFAR10-LT, 4.06% on CIFAR100-LT, and 7.89% on ImageNet-LT.
- Partiality—applying contrastive loss only to tail classes—is essential, as applying it to all classes degrades performance due to dominance of head-class samples.
- Asymmetry in contrastive learning, where OOD samples are not grouped together, leads to significant performance gains, especially when combined with partiality.
- Auxiliary Branch Finetuning (ABF) improves in-distribution accuracy by up to 4.17 percentage points on CIFAR10-LT and 4.12 on ImageNet-LT, with minimal model size increase.
- The method is robust to hyperparameter choices: optimal performance is achieved at k=50% tail classes, with stable results across k∈[40%,60%], and ABF outperforms full model fine-tuning.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.