Decomposing Representations for Deterministic Uncertainty Estimation

Haiwen Huang, Joost van Amersfoort, Yarin GalarXiv 2021 · arXiv

Abstract

Standard uncertainty estimation methods often struggle to handle both "near" and "far" out-of-distribution (OoD) data simultaneously. This paper presents a unified approach that decomposes neural network representations into discriminative (class-related) and non-discriminative (class-irrelevant) features. By evaluating uncertainty in both subspaces independently, the proposed method excels at detecting both subtle semantic anomalies and obvious domain shifts, achieving superior AUROC scores across diverse benchmarks.

The Near vs. Far OoD Dilemma

In real-world deployment, machine learning models must reliably identify when input data falls outside their training distribution. This challenge is typically categorized into two types:

  1. Far OoD Detection: Distinguishing between completely different data domains (e.g., identifying a house number when trained on animal images).
  2. Near OoD Detection: Distinguishing between semantically similar but distinct classes (e.g., identifying a "beaver" when trained on "otters").

Existing techniques, such as the standard Mahalanobis distance, often excel at far OoD detection but fail on near OoD tasks. Conversely, recent attempts to improve near OoD performance frequently degrade a model's ability to catch far-flung anomalies. The authors argue this trade-off exists because standard methods conflate class-essential features with irrelevant background information within a single representation space.

Methodology: Feature Decomposition

The core innovation is the explicit separation of a model's learned representation ($z$) into two distinct components:

  • $z_d$ (Discriminative): Features essential for classification (e.g., the specific shape of a cat's ears).
  • $z_n$ (Non-discriminative): Features that are present in the data but irrelevant to the labels (e.g., background textures, lighting, or image style).

To achieve this, the researchers employ an independent cross-entropy (iCE) loss paired with an invertible neural network. The invertibility ensures that no information is discarded during the transformation. The iCE loss then forces the network to pack all class-relevant information into the first few dimensions ($z_d$), leaving the remaining dimensions ($z_n$) to capture "noise" or background features.

Figure 4: Conceptual visualization of feature decomposition. The contours represent uncertainty boundaries in the decomposed space, showing how different types of OoD points (red and green) are isolated from the training classes (blue and orange).

Once decomposed, uncertainty is calculated using the Mahalanobis distance on both parts separately. The final uncertainty score is the sum of these two distances. This dual-alarm system triggers if either the class features appear incorrect (near OoD) or the background/style features appear alien (far OoD).

Empirical Results and Insights

The decomposition method was tested using CIFAR-10 as the in-distribution dataset, with SVHN (far OoD) and CIFAR-100 (near OoD) as benchmarks.

Figure 2: AUROC vs. Mahalanobis distance for (a) discriminative and (b) non-discriminative features. Note how SVHN classes (far OoD) are primarily distinguished by non-discriminative distance, while near-OoD classes like "streetcar" are better identified via discriminative distance.

Key findings include:

  • Consistent Performance: The "Dis score + Non-dis score" approach achieved 98.41% AUROC on SVHN and 89.95% AUROC on CIFAR-100.
  • Robustness: On a "Union" benchmark combining both SVHN and CIFAR-100, the method reached 94.18% AUROC, the highest in the study, proving it does not sacrifice one type of detection for the other.
  • Interpretability: By categorizing features, we gain insight into why a model is uncertain. High discriminative uncertainty suggests a semantic mismatch, while high non-discriminative uncertainty suggests a stylistic or domain shift.

Conclusion and Future Directions

By decomposing representations, this research provides a more principled way to handle the spectrum of out-of-distribution data. While the method currently relies on high-quality pre-trained feature extractors and has primarily been tested on small-scale image benchmarks like CIFAR, it sets a new standard for deterministic uncertainty estimation. Future work will focus on scaling these techniques to high-resolution, real-world data such as autonomous driving datasets and enforcing even stricter independence between the decomposed feature sets.

Summary updated

Abstract

Uncertainty estimation is a key component in any deployed machine learning system. One way to evaluate uncertainty estimation is using "out-of-distribution" (OoD) detection, that is, distinguishing between the training data distribution and an unseen different data distribution using uncertainty. In this work, we show that current feature density based uncertainty estimators cannot perform well consistently across different OoD detection settings. To solve this, we propose to decompose the learned representations and integrate the uncertainties estimated on them separately. Through experiments, we demonstrate that we can greatly improve the performance and the interpretability of the uncertainty estimation.
BibTeX
@misc{huang2021decomposing,
  author = {Haiwen Huang and Joost van Amersfoort and Yarin Gal},
  title = {{Decomposing Representations for Deterministic Uncertainty Estimation}},
  year = {2021},
  eprint = {2112.00856},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.00856},
}
Figure