Igeood: An Information Geometry Approach to Out-of-Distribution Detection

Eduardo Dadalto Câmara Gomes, Florence Alberge, Pierre Duhamel, Pablo Piantanida

Abstract

Reliable out-of-distribution (OOD) detection is fundamental to implementing safer modern machine learning (ML) systems. In this paper, we introduce Igeood, an effective method for detecting OOD samples. Igeood applies to any pre-trained neural network, works under various degrees of access to the ML model, does not require OOD samples or assumptions on the OOD data but can also benefit (if available) from OOD samples. By building on the geodesic (Fisher-Rao) distance between the underlying data distributions, our discriminator can combine confidence scores from the logits outputs and the learned features of a deep neural network. Empirically, we show that Igeood outperforms competing state-of-the-art methods on a variety of network architectures and datasets.

Introduction

Deep Neural Networks (DNNs) are notoriously overconfident. A model trained to recognize cats and dogs might confidently classify a picture of a school bus as a "dog" simply because it has never seen a bus before. This phenomenon, known as the Out-of-Distribution (OOD) detection problem, poses significant risks for mission-critical applications like autonomous driving or medical diagnosis. For these systems to be reliable, they must be able to identify when they encounter unfamiliar data and essentially say, "I don't know."

While many methods exist to detect these outliers, they often rely on simple distance metrics, such as Euclidean distance, which fail to account for the complex, "curved" geometry of the probability spaces inside a neural network. We propose Igeood, a framework that leverages Information Geometry to measure the distance between test samples and training data more accurately.

Methodology: Navigating the Manifold

Igeood treats the space of probability distributions as a Riemannian manifold. Instead of measuring distances in a straight line, the framework utilizes the Fisher-Rao distance—the geodesic or "shortest path" along the curved surface of the distribution space. This geometric approach allows the model to be more sensitive to changes in both the mean and the variance of distributions compared to standard metrics.

Access Scenarios

One of Igeood's primary strengths is its flexibility across different levels of model transparency:

  1. Black-Box: The method functions using only the final model outputs (logits).
  2. Grey-Box: The method uses outputs and performs input pre-processing, such as adding tiny amounts of noise to help distinguish samples.
  3. White-Box: The method accesses all internal layers of the network.

In the White-Box setting, Igeood models the internal features of the network as a Gaussian Mixture Model (GMM). Unlike previous state-of-the-art methods (such as the Mahalanobis distance) that utilize a full covariance matrix, Igeood employs a diagonal covariance matrix. This choice provides greater numerical stability and effectiveness, as high-dimensional feature matrices in deep learning are often ill-conditioned.

The "Sum" Trick for Logits

For the final output layer, Igeood implements a unique strategy: it sums the distances to all class centroids rather than merely finding the distance to the closest class. This approach leverages global information about how the model perceives the entire label space, leading to more robust detection.

Experimental Setup

We evaluated Igeood using a rigorous benchmark across multiple architectures and datasets:

  • In-Distribution (Training): CIFAR-10, CIFAR-100, and SVHN.
  • Out-of-Distribution (Testing): Tiny-ImageNet, LSUN, Describable Textures Dataset (DTD), Chars74K, Places365, iSUN, and synthetic Gaussian noise.
  • Architectures: DenseNet-BC-100 and ResNet-34.

Key Results and Insights

Igeood sets a new performance standard for OOD detection across several metrics:

  • Significant Performance Gains: In White-Box testing, Igeood improved the average True Negative Rate (TNR) at a 95% True Positive Rate by 11.2% compared to the previous state-of-the-art Mahalanobis method.
  • Robustness: The framework remains highly effective even without access to real OOD samples for tuning. When using "adversarial noise" for calibration instead, Igeood still outperformed existing methods by 2.5%.
  • Computational Efficiency: Igeood is optimized for real-world deployment. Calculating the OOD score is approximately 100 to 1,000 times faster than the time required for the neural network to make its initial prediction.
  • Consistency: The improvements were consistent across different datasets (e.g., CIFAR vs. SVHN) and architectures (DenseNet vs. ResNet), proving the method's generalizability.

Conclusion

By grounding OOD detection in the principles of information geometry, Igeood provides a mathematically principled and computationally efficient solution to the problem of neural network overconfidence. While the current iteration requires a small validation set for weight tuning, future work will explore making the system more explainable and extending these geometric approaches to natural language processing tasks.

Summary updated

Abstract

Reliable out-of-distribution (OOD) detection is fundamental to implementing safer modern machine learning (ML) systems. In this paper, we introduce Igeood, an effective method for detecting OOD samples. Igeood applies to any pre-trained neural network, works under various degrees of access to the ML model, does not require OOD samples or assumptions on the OOD data but can also benefit (if available) from OOD samples. By building on the geodesic (Fisher-Rao) distance between the underlying data distributions, our discriminator can combine confidence scores from the logits outputs and the learned features of a deep neural network. Empirically, we show that Igeood outperforms competing state-of-the-art methods on a variety of network architectures and datasets.
BibTeX
@inproceedings{gomes2022igeood,
  author = {Eduardo Dadalto Câmara Gomes and Florence Alberge and Pierre Duhamel and Pablo Piantanida},
  title = {{Igeood: An Information Geometry Approach to Out-of-Distribution Detection}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=8tsqEls5sAF},
}
Figure