Intra-Class Probabilistic Embeddings for Uncertainty Estimation in Vision-Language Models

Zhenxiang Lin, Maryam Haghighat, Will Browne, Dimity Miller

TL;DR

Vision-Language Models (VLMs) like CLIP are great at classifying images but often overconfident in their predictions. This paper introduces a training-free method that uses probabilistic embeddings of visual features within each class to detect these erroneous predictions, achieving state-of-the-art results.

What Problem Does This Paper Address?

Vision-Language Models (VLMs) have revolutionized image classification with their impressive open-vocabulary capabilities. However, a critical issue for real-world applications, especially in safety-critical domains, is their tendency to assign high confidence scores even to incorrect predictions. This "overconfidence" problem makes it difficult to trust their outputs. Existing methods for estimating uncertainty in VLMs often rely on inter-modal (image-text) similarity, which can be misleading due to the inherent "modality gap" between image and text embeddings. Some approaches try to model uncertainty by learning probabilistic embeddings, but these often require extensive pre-training or fine-tuning, making them computationally expensive and less generalizable. This paper aims to address the challenge of reliable error detection in VLMs by developing a post-hoc, training-free method that focuses on intra-class visual feature consistency.

Methods

The core of this paper's contribution is a novel training-free, post-hoc uncertainty estimation method called Intra-Class Probabilistic Embeddings (ICPE). The approach works as follows:

  1. Intra-Class Probabilistic Embeddings: For each class in a dataset, the method learns a probabilistic distribution of its visual features. This is done by passing training images through a frozen VLM visual encoder to obtain high-dimensional feature vectors.
  2. PCA for Dimensionality Reduction and Stabilization: To handle the often anisotropic and correlated nature of VLM feature embeddings, Principal Component Analysis (PCA) is applied. This reduces dimensionality and mitigates ill-conditioned covariance matrices, making the subsequent probabilistic modeling more stable and effective.
  3. Multivariate Gaussian Modeling: The PCA-transformed embeddings for each class are then modeled using a multivariate Gaussian distribution. This creates a "dictionary" of class-specific probabilistic embeddings that capture the typical range of visual features for each class.
  4. Inference-Time Uncertainty Scoring: At inference, a test image's visual feature is extracted and projected into the PCA-transformed space. The log-likelihood of this projected feature under the Gaussian distribution of its predicted class is computed. This score reflects how well the test image aligns with the typical visual features of its predicted class.
  5. Combined Uncertainty Score: This intra-class consistency score is combined with the VLM's standard inter-modal similarity (softmax score) to produce a final uncertainty score. This fusion leverages both the learned visual structure and the original VLM's confidence.

This method is "training-free" because it operates on frozen VLM features and only requires constructing the probabilistic embeddings once using existing training data. It's "post-hoc" as it can be applied after a VLM has made its prediction.

Datasets

The authors evaluated their method on five standard image classification benchmarks:

  • ImageNet-1K: A large-scale dataset with 1000 categories of generic objects and animals.
  • Flowers-102: Contains 102 categories of flower species.
  • Food-101: Features 101 categories of food types.
  • EuroSAT: Comprises 10 categories of satellite imagery and land types.
  • DTD (Describable Textures Dataset): Includes 47 categories of textures.

For constructing the probabilistic embeddings, the official training sets of these datasets were used. The evaluation also included experiments on ImageNet variants to test robustness to distribution shift: ImageNetV2, ImageNet-C, and ImageNet-A.

Key Insights and Ideas

  • Intra-class visual consistency is key for error detection: Unlike standard VLM confidence measures that rely on image-text similarity, focusing on how well a test image's visual features fit within the distribution of its predicted class's visual features provides a more reliable signal for error detection.
  • PCA is crucial for stable probabilistic modeling: The high dimensionality and anisotropic nature of VLM embeddings make direct Gaussian modeling unstable. PCA effectively stabilizes this by reducing dimensionality and mitigating ill-conditioned covariance matrices, leading to better performance.
  • Probabilistic embeddings offer more than just mean-level similarity: Modeling the entire distribution of features for a class, rather than just a single prototype or mean, allows for a more nuanced understanding of typicality and deviation, which is essential for robust uncertainty estimation.
  • Training-free and post-hoc is highly practical: The ability to achieve state-of-the-art results without any fine-tuning or retraining of the VLM makes this method easily deployable and adaptable to various VLM backbones.

Key Results

The proposed method, ICPE, achieved state-of-the-art performance in error detection across all five tested datasets.

  • Performance Gains: It consistently outperformed deterministic and probabilistic VLM baselines, showing significant improvements in AUROC and reductions in FPR95 compared to the next best methods. For instance, on ImageNet, it achieved an AUROC of 88.01 and FPR95 of 54.10, outperforming other methods.
  • Data Efficiency: The method demonstrated strong performance even with as few as 10 labeled images per class, highlighting its effectiveness in low-data regimes.
  • Robustness: ICPE showed robustness to both feature shift (on ImageNetV2 and ImageNet-C) and label shift, where query labels didn't perfectly match dictionary labels.
  • PCA's Impact: Incorporating PCA improved AUROC by 2-8% and reduced FPR95 by 15-24% on datasets like ImageNet, Food101, and EuroSAT, confirming its importance.

Limitations and Future Work

The authors acknowledge two main limitations:

  • Performance on Adversarial Examples: The method's performance degrades on naturally adversarial images (ImageNet-A), suggesting that error detection methods relying on data distributions may struggle with highly challenging, boundary-adjacent inputs.
  • Scalability to Edge Devices: While the method is efficient for large label spaces, constructing the probabilistic embeddings might be intractable for compute-constrained edge devices.

Future work could explore methods to improve robustness to adversarial examples and investigate more efficient ways to build or adapt these probabilistic models for resource-constrained environments.

Summary updated

BibTeX
@inproceedings{lin2026intra,
  author = {Zhenxiang Lin and Maryam Haghighat and Will Browne and Dimity Miller},
  title = {{Intra-Class Probabilistic Embeddings for Uncertainty Estimation in Vision-Language Models}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2026},
}
Figure