Your Classifier Can Be Secretly a Likelihood-Based OOD Detector

Jirayu Burapacheep, Yixuan Li
8/9/2024
cs.LGstat.ML

Official code: deeplearning-wisc/ink (7 stars, MIT, last commit 2024-08-12).

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.

View on arXivView PDF

Code Implementations(1)

MIT
72Shell, PythonAug 12, 20242 years agoMIT

Similar Papers

Cite this paper

@article{burapacheep2024your,
  title  = {Your Classifier Can Be Secretly a Likelihood-Based OOD Detector},
  author = {Jirayu Burapacheep and Yixuan Li},
  year   = {2024},
  eprint = {2408.04851},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.04851v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2408.04851.svg)](https://codeofpaper.com/paper/2408.04851)

Discussion