Uncertainty Estimation based on Geometric Separation

Gabriella Chouraqui, Liron Cohen, Gil Einziger, Liel LemanarXiv 2023 · DOI

Abstract

Reliable uncertainty estimation is critical for the deployment of machine learning models in safety-critical applications. Standard probabilistic outputs from neural networks and other classifiers are often poorly calibrated, typically exhibiting overconfidence. We present a novel approach to uncertainty estimation based on the geometric separation of inputs from training data. By calculating the distance to the nearest same-class and different-class examples, we derive a geometric signal that serves as a robust proxy for model confidence. We introduce a "fast-separation" approximation that enables real-time performance without sacrificing calibration quality. Our experiments demonstrate that this method can reduce Expected Calibration Error (ECE) by up to 99% across diverse datasets and model architectures.

Introduction

Machine learning models are increasingly used in domains where the cost of an incorrect prediction is high, such as autonomous driving and medical diagnosis. While these models typically provide a confidence score (e.g., softmax output), these scores are notoriously unreliable. A model might predict a class with 99% confidence when its actual accuracy on similar inputs is closer to 50%. Most existing solutions attempt to recalibrate these internal scores post-hoc. However, if the model's internal representation is fundamentally flawed, these methods can only achieve limited success. We propose shifting the focus from internal model signals to an external geometric signal derived from the training data distribution.

Geometric Separation

The core intuition behind our approach is that an input's safety can be characterized by its geometric relationship to the training set. If a new input is surrounded by training examples of the same class and is far from any examples of a different class, the prediction is likely to be "safe."

Geometric separation illustrates 'safe zones' around inputs $x$ and $y$ based on their proximity to training data of the same and different classes.

We define Geometric Separation ($\\overline{\\mathcal{S}}^{\\mathcal{M}}$) as the radius of the largest hypersphere centered at an input that contains no training points of a different class. This "safe zone" provides a direct measure of the model's decision boundary margin.

Fast-Separation Approximation

Calculating the exact geometric separation is computationally intensive, as it involves searching over triplets of points in high-dimensional space. To make this approach viable for real-time applications, we propose a Fast-Separation approximation ($\\underline{\\mathcal{S}}^{\\mathcal{M}}$):

$$\\text{Score} = \\frac{d(x, \\text{nearest different class}) - d(x, \\text{nearest same class})}{2}$$

This score captures the relative proximity of the input to the decision boundary. When the input is equidistant from both classes, the score is zero, typically corresponding to a point where model accuracy is roughly 50%.

Comparison between exact separation and the fast-separation approximation in 1D scenarios.

As shown in the figure above, while the approximation can differ from the exact value in certain geometric configurations (b), it remains a highly effective signal for calibration in practice.

Calibration and Scaling

The raw geometric score is not a probability. To convert these distances into reliable confidence estimates, we apply Isotonic Regression on a held-out validation set. This non-parametric mapping ensures that a specific geometric score consistently corresponds to a specific level of empirical accuracy.

To handle large-scale datasets, we employ dimensionality reduction techniques such as Max-Pooling for images and K-means clustering for tabular data. These optimizations allow the system to maintain high throughput, processing hundreds of inputs per second on standard hardware.

Results and Discussion

Our method was evaluated across a wide range of benchmarks, including MNIST, GTSRB (traffic signs), and various tabular datasets, using models like Random Forests and CNNs. The geometric signal consistently outperformed standard calibration techniques such as Temperature Scaling and Beta Calibration. In several instances, we observed a reduction in Expected Calibration Error (ECE) of over 80%, and up to 99% in optimal configurations.

A key finding is that the geometric signal is remarkably robust across different distance metrics, with Euclidean distance ($L_2$) providing the most stable results. Furthermore, the fast-separation approximation proved sufficient for high-quality calibration, enabling the method's use in high-speed robotics and live camera feeds.

Conclusion and Future Work

Geometric separation offers a powerful, model-agnostic alternative to traditional uncertainty estimation. By leveraging the spatial distribution of training data, we can provide significantly more reliable confidence scores. Future work will explore calculating these distances in the latent space of deep neural networks, which may offer greater robustness to input transformations like rotation or scaling, and further reduce the memory overhead associated with storing training prototypes.

Summary updated

BibTeX
@misc{chouraqui2023uncertainty,
  author = {Gabriella Chouraqui and Liron Cohen and Gil Einziger and Liel Leman},
  title = {{Uncertainty Estimation based on Geometric Separation}},
  year = {2023},
  eprint = {2301.04452},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2301.04452},
}
Figure