[Paper Review] Density of States Estimation for Out-of-Distribution Detection
This paper proposes DoSE, a novel unsupervised out-of-distribution (OOD) detection method that leverages the statistical physics concept of density of states to assess the typicality of model statistics rather than relying on likelihoods. By using nonparametric density estimators on summary statistics from pre-trained models, DoSE achieves state-of-the-art performance on OOD benchmarks without requiring labeled data or OOD examples.
Perhaps surprisingly, recent studies have shown probabilistic model likelihoods have poor specificity for out-of-distribution (OOD) detection and often assign higher likelihoods to OOD data than in-distribution data. To ameliorate this issue we propose DoSE, the density of states estimator. Drawing on the statistical physics notion of ``density of states,'' the DoSE decision rule avoids direct comparison of model probabilities, and instead utilizes the ``probability of the model probability,'' or indeed the frequency of any reasonable statistic. The frequency is calculated using nonparametric density estimators (e.g., KDE and one-class SVM) which measure the typicality of various model statistics given the training data and from which we can flag test points with low typicality as anomalous. Unlike many other methods, DoSE requires neither labeled data nor OOD examples. DoSE is modular and can be trivially applied to any existing, trained model. We demonstrate DoSE's state-of-the-art performance against other unsupervised OOD detectors on previously established ``hard'' benchmarks.
Motivation & Objective
- To address the failure of likelihood-based methods in OOD detection, where out-of-distribution inputs are sometimes assigned higher likelihoods than in-distribution data.
- To develop a method that measures the typicality of test samples relative to training data using multiple summary statistics, avoiding direct likelihood comparison.
- To create a modular, unsupervised OOD detection framework applicable to any pre-trained generative model without retraining or hyperparameter tuning.
- To demonstrate that typicality, as measured by the frequency of statistics in the training distribution, is a more reliable OOD indicator than model likelihood.
Proposed method
- DoSE estimates the density of states (DOS) for various summary statistics of in-distribution data using nonparametric density estimators such as kernel density estimation (KDE) and one-class SVM.
- It evaluates test samples by measuring how typical their statistics are under the estimated DOS, flagging low-support points as OOD.
- The method is modular and can be applied to any pre-trained generative model, such as β-VAEs and Glow, by extracting model statistics (e.g., latent representations, log-likelihoods, or component statistics).
- It avoids direct likelihood comparison by focusing on the frequency of observed statistics in the training set, aligning with the statistical physics notion of typicality.
- The approach uses multiple statistics (e.g., norm, first coordinate, max coordinate) to improve robustness and detect OOD inputs that may be high-likelihood but atypical.
- It does not require labeled data or access to OOD examples, making it suitable for real-world deployment where such data are unavailable.
Experimental results
Research questions
- RQ1Can the frequency of model statistics in the training distribution serve as a more reliable OOD detection signal than model likelihood?
- RQ2Why do likelihood-based methods fail in OOD detection, especially when OOD data are assigned higher likelihoods than in-distribution data?
- RQ3Can a method based on typicality—measured via nonparametric density estimation of statistics—outperform likelihood-based baselines in OOD detection?
- RQ4Is the proposed DoSE method robust across diverse dataset pairs, including challenging benchmarks like CIFAR-10 vs. SVHN or CelebA vs. CIFARs?
- RQ5Can DoSE achieve state-of-the-art performance among unsupervised OOD detection methods without requiring OOD examples or class labels?
Key findings
- DoSE achieves state-of-the-art performance among unsupervised OOD detection methods on standard benchmarks, outperforming likelihood-based baselines like TT and WAIC.
- On the challenging CIFAR-10 → SVHN and CelebA → CIFARs benchmarks, DoSE maintains high AUROC scores, while TT fails with AUROC ≈ 0.6 due to reliance on likelihood alone.
- DoSE successfully identifies OOD samples that are anomalously high in likelihood but atypical in their statistical profile, such as images with high color contrast or irregular textures.
- The method is robust across diverse dataset pairings and does not suffer from the fundamental limitations of likelihood-based methods, which can misclassify OOD data with high likelihood as in-distribution.
- Qualitative analysis shows DoSE flags images with high contrast or unusual color patterns as OOD, indicating sensitivity to meaningful statistical deviations.
- DoSE achieves comparable performance to state-of-the-art supervised methods despite being fully unsupervised and requiring no OOD examples or labels.
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.