An Ambiguity Measure for Recognizing the Unknowns in Deep Learning

Roozbeh YousefzadeharXiv 2023 · DOI

Abstract

Deep neural networks frequently assign high confidence to incorrect predictions, particularly when encountering out-of-distribution (OOD) data or adversarial attacks. This paper introduces a unified geometric framework to quantify input ambiguity by analyzing the latent feature space of the model's final hidden layer. By measuring distances to class-specific convex hulls and decision boundaries, the proposed ambiguity measure ($\zeta$) provides a robust mechanism for detecting various failure modes—including OOD samples and adversarial examples—using a single, computationally efficient metric.

Introduction: The Challenge of Model Overconfidence

Deep neural networks are notoriously "confidently wrong." They often assign high probability scores to inputs they have never seen before or to samples specifically engineered to deceive them. This phenomenon occurs because a model’s internal confidence (typically the softmax score) is a function of its distance to a decision boundary, not its proximity to actual training data.

Currently, researchers employ separate, often computationally expensive tools to handle different types of failures, such as OOD detection, adversarial defense, and calibration. This research seeks a unified framework: a single measure that identifies ambiguous inputs regardless of whether the ambiguity stems from a lack of data or inherent class confusion.

The spectrum of ambiguity from known in-distribution data to unknown out-of-distribution samples.

Methodology: Geometric Ambiguity Framework

The proposed approach shifts the focus from the model's output to the geometry of its last hidden layer (the feature space). The framework involves three primary components:

  1. SVD Compression: Singular Value Decomposition (SVD) is used to project the high-dimensional latent space into a compressed space ($\Psi$). This step reduces computational overhead and enhances the geometric separation between classes.
  2. Geometric Projections: For any new input, the system calculates four specific distances:
  3. Distance to Convex Hulls: Proximity to the "envelope" containing training samples for each class.
  4. Distance to Decision Boundaries: Proximity to the "flip point" where the model would change its classification.
  5. Class Overlap: Identification of regions where training samples from different classes naturally mingle.
  6. Knowledge Gaps: Detection of "holes" within the training distribution.
  7. The Ambiguity Measure ($\zeta$): These distances are combined into a single formula where high values indicate high ambiguity, suggesting the model should "abstain" from making a prediction.
Geometric representation of class clusters (convex hulls) and decision boundaries used to calculate ambiguity.

Key Insights and Experimental Results

The paper evaluates the framework using CIFAR-10 (with ResNet and ViT), ImageNet (with Swin Transformer), and the Adult Income Dataset. Key findings include:

  • Confidence Guarantees: The authors mathematically prove that a model is guaranteed to have high softmax confidence as long as an input stays a certain distance away from decision boundaries, even if the input is nonsensical. For a ViT on CIFAR-10, an input 5.07 units away from a boundary guarantees at least 90% confidence.
  • Separation via SVD: The SVD-transformed space ($\Psi$) showed superior class separation. Using distance to the convex hull as a classifier achieved ~94.4% accuracy on CIFAR-10, rivaling standard softmax-based accuracy.
  • Efficiency and Explainability: Geometric projections can be calculated in 50–100 milliseconds on a GPU. Furthermore, because the measure is based on physical distances, it can generate human-readable explanations for why an image is considered ambiguous.

Discussion and Future Work

While promising, this framework is a work in progress. Calculating exact convex hulls in high dimensions is NP-hard, necessitating approximation algorithms. Future research will focus on capturing non-linear ambiguities deeper in the network and refining the empirical heuristics used to set the ambiguity threshold ($\tau$) for model abstention.

Summary updated

Abstract

We study the understanding of deep neural networks from the scope in which they are trained on. While the accuracy of these models is usually impressive on the aggregate level, they still make mistakes, sometimes on cases that appear to be trivial. Moreover, these models are not reliable in realizing what they do not know leading to failures such as adversarial vulnerability and out-of-distribution failures. Here, we propose a measure for quantifying the ambiguity of inputs for any given model with regard to the scope of its training. We define the ambiguity based on the geometric arrangements of the decision boundaries and the convex hull of training set in the feature space learned by the trained model, and demonstrate that a single ambiguity measure may detect a considerable portion of mistakes of a model on in-distribution samples, adversarial inputs, as well as out-of-distribution inputs. Using our ambiguity measure, a model may abstain from classification when it encounters ambiguous inputs leading to a better model accuracy not just on a given testing set, but on the inputs it may encounter at the world at large. In pursuit of this measure, we develop a theoretical framework that can identify the unknowns of the model in relation to its scope. We put this in perspective with the confidence of the model and develop formulations to identify the regions of the domain which are unknown to the model, yet the model is guaranteed to have high confidence.
BibTeX
@misc{yousefzadeh2023ambiguity,
  author = {Roozbeh Yousefzadeh},
  title = {{An Ambiguity Measure for Recognizing the Unknowns in Deep Learning}},
  year = {2023},
  eprint = {2312.06077},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.06077},
}
Figure