Your Classifier Can Be Secretly a Likelihood-Based OOD Detector
Jirayu Burapacheep, Yixuan Li
TL;DR
The paper tackles the challenge of reliable OOD detection for discriminative classifiers by introducing INK, a framework that imposes a probabilistic intrinsic likelihood on hyperspherical embeddings. By modeling latent representations with a mixture of von Mises–Fisher distributions on the unit sphere, INK defines an intrinsic score S(z) = \tau \cdot \log \sum_{j=1}^C \exp(\boldsymbol{\mu}_j^T \mathbf{z} / \tau), which is shown to be functionally equivalent to the log-likelihood p(\mathbf{z}) under uniform class priors. The authors demonstrate how standard maximum-likelihood training with vMF mixtures shapes the intrinsic likelihood to favor in-distribution data, provide theoretical links to likelihood-based OOD detection, and validate their approach on OpenOOD benchmarks where INK achieves state-of-the-art or competitive performance, often with substantially lower computation than KNN-based methods. They also extend the method to handle class imbalance and show robustness across architectures, including ResNet and ViT, with near- and far-OOD settings. Overall, INK offers a principled, efficient, and adaptable likelihood-based OOD detector for modern discriminative models.
Abstract
The ability to detect out-of-distribution (OOD) inputs is critical to guarantee the reliability of classification models deployed in an open environment. A fundamental challenge in OOD detection is that a discriminative classifier is typically trained to estimate the posterior probability p(y|z) for class y given an input z, but lacks the explicit likelihood estimation of p(z) ideally needed for OOD detection. While numerous OOD scoring functions have been proposed for classification models, these estimate scores are often heuristic-driven and cannot be rigorously interpreted as likelihood. To bridge the gap, we propose Intrinsic Likelihood (INK), which offers rigorous likelihood interpretation to modern discriminative-based classifiers. Specifically, our proposed INK score operates on the constrained latent embeddings of a discriminative classifier, which are modeled as a mixture of hyperspherical embeddings with constant norm. We draw a novel connection between the hyperspherical distribution and the intrinsic likelihood, which can be effectively optimized in modern neural networks. Extensive experiments on the OpenOOD benchmark empirically demonstrate that INK establishes a new state-of-the-art in a variety of OOD detection setups, including both far-OOD and near-OOD. Code is available at https://github.com/deeplearning-wisc/ink.
