[Paper Review] How to Exploit Hyperspherical Embeddings for Out-of-Distribution Detection?
The paper introduces CIDER, a hyperspherical embedding framework with dispersion and compactness losses to improve out-of-distribution detection, achieving superior ID-OOD separability and FPR95 gains over prior methods.
Out-of-distribution (OOD) detection is a critical task for reliable machine learning. Recent advances in representation learning give rise to distance-based OOD detection, where testing samples are detected as OOD if they are relatively far away from the centroids or prototypes of in-distribution (ID) classes. However, prior methods directly take off-the-shelf contrastive losses that suffice for classifying ID samples, but are not optimally designed when test inputs contain OOD samples. In this work, we propose CIDER, a novel representation learning framework that exploits hyperspherical embeddings for OOD detection. CIDER jointly optimizes two losses to promote strong ID-OOD separability: a dispersion loss that promotes large angular distances among different class prototypes, and a compactness loss that encourages samples to be close to their class prototypes. We analyze and establish the unexplored relationship between OOD detection performance and the embedding properties in the hyperspherical space, and demonstrate the importance of dispersion and compactness. CIDER establishes superior performance, outperforming the latest rival by 19.36% in FPR95. Code is available at https://github.com/deeplearning-wisc/cider.
Motivation & Objective
- Motivate improved OOD detection via representation learning that leverages hyperspherical embeddings.
- Design a training objective that explicitly optimizes inter-class dispersion and intra-class compactness on the unit hypersphere.
- Provide a probabilistic interpretation of embeddings as von Mises-Fisher (vMF) mixtures to explain OOD detection performance.
- Demonstrate that increased inter-class dispersion improves OOD separation without sacrificing ID accuracy.
Proposed method
- Model embeddings on the unit hypersphere and interpret them through a von Mises-Fisher (vMF) distribution.
- Propose two losses: dispersion loss to maximize angular distances among class prototypes, and compactness loss to pull samples toward their class prototype.
- Train with the combined CIDER objective L_CIDER = L_dis + lambda_c * L_comp.
- Update class prototypes mu_c via exponential-moving-average (EMA) of normalized embeddings.
- Use a non-parametric distance (cosine-based KNN) for OOD scoring at test time, with optional Mahalanobis comparison.
- Provide theoretical/empirical analysis of how embedding dispersion affects ID-OOD separability.
Experimental results
Research questions
- RQ1How do hyperspherical embeddings affect the separability of in-distribution (ID) and out-of-distribution (OOD) data?
- RQ2Can explicit dispersion among class prototypes improve OOD detection without harming ID classification performance?
- RQ3What is the impact of jointly optimizing dispersion and compactness on embedding geometry and OOD scores?
- RQ4Do vMF-based representations offer a principled interpretation and practical benefits for OOD detection across datasets and scales?
Key findings
- CIDER yields superior OOD detection performance, including a 13.33% reduction in FPR95 compared to SSD+ on CIFAR-100 with ResNet-34.
- CIDER achieves a 42.36% relative improvement in ID-OOD separability over SupCon on CIFAR-10 (average across multiple OOD datasets).
- Inter-class dispersion is key to strong OOD detection; adding dispersion loss improves AUROC by about 2 percentage points when combined with compactness.
- CIDER consistently improves OOD scores across both non-parametric (KNN) and parametric (Mahalanobis) scoring regimes.
- Embedding quality metrics show significant gains in inter-class dispersion (12.03 degrees over SSD+) and improved ID-OOD separability.
- CIDER remains competitive on large-scale tasks (ImageNet-100) and across varying batch sizes and hyperparameters.
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.