TL;DR
Vision-Language Models (VLMs) like CLIP frequently produce confident yet incorrect predictions, creating major safety risks. TrustVLM is a training-free framework that detects misclassifications by combining standard text-image prediction scores with an image-to-image verification check against visual prototypes. Across 17 benchmark datasets, TrustVLM substantially cuts false alarms and improves failure detection without requiring model retraining.
What Problem Does This Paper Address?
While foundation VLMs excel at zero-shot classification, they are notoriously prone to overconfidence: an incorrect prediction can still receive high softmax probability simply because text prompts partially match visual attributes. Detecting when a model is wrong—misclassification detection (MisD)—is vital for deploying VLMs in safety-critical settings like autonomous driving and medical imaging.
Standard approaches borrowed from out-of-distribution (OOD) detection often perform surprisingly worse than simple Maximum Softmax Probability (MSP) when applied to MisD. Furthermore, VLMs suffer from a well-known modality gap: image and text features occupy separate regions in representation space. Relying exclusively on image-to-text cosine similarity discards the rich, fine-grained geometric structure inherent to pure visual embedding spaces.
Methods
TrustVLM addresses these limitations by introducing a visual verification mechanism:
[Test Image] ──> VLM Zero-Shot Prediction ──> Predicted Class ŷ & Image-to-Text Score (S_i-t)
│ │
Auxiliary Vision Encoder │
│ ▼
[Image Embedding] ─── Cosine Similarity ────> [Prototype of Class ŷ] ──> Image-to-Image Score (S_i-i)
│
Final Confidence Score: κ = S_i-t + S_i-i
- Class Visual Prototypes: For each class, feature embeddings from $N$-shot exemplar images are extracted via an auxiliary vision encoder (such as CLIP's vision backbone, MoCo v2, or DINOv2) and averaged into a class centroid prototype $P_c$.
- Zero-Shot Prediction: The VLM classifies input image $x$ via text-image cosine similarity, producing prediction $\hat{y}$ and standard confidence $S_{i-t} = \max_c p(y=c|x)$.
-
Image-to-Image Verification: The test image embedding $E_x$ is compared to the prototype of the predicted class $P_{\hat{y}}$: $$S_{i-i} = E_x \cdot P_{\hat{y}}$$ If the prediction $\hat{y}$ is incorrect, $E_x$ is matched against an inappropriate prototype, driving $S_{i-i}$ down and penalizing overconfidence. If correct, $S_{i-i}$ reinforces confidence.
-
Combined Scoring: The final confidence is $\kappa(x) = S_{i-t} + S_{i-i}$.
- Extensions:
- TrustVLM*: Combines image-to-text and prototype-based image-to-image probabilities directly into the classification decision.
- TrustVLM*(F): Applies lightweight, 2-minute fine-tuning to the prototype vectors via cross-entropy loss while freezing all encoders.
Datasets
The authors evaluated TrustVLM across 17 distinct datasets:
- 10 Fine-Grained Datasets: Caltech101, OxfordPets, StanfordCars, Flowers102, Food101, FGVCAircraft, SUN397, DTD, EuroSAT, and UCF101.
- ImageNet & 4 Robustness Variants: ImageNet-1K alongside distribution-shifted test sets ImageNetV2, ImageNet-Sketch, ImageNet-A (natural adversarial examples), and ImageNet-R (renditions/art).
- Failure Detection Baselines: CIFAR-10, CIFAR-100, and Waterbirds (evaluating spurious correlations).
Note: No new datasets were introduced; existing benchmarks were leveraged to test generalization.
Key Insights and Ideas
- Image embeddings separate visual concepts better than text embeddings: In CLIP, semantic distances between text prompts are often compressed compared to distances between image embeddings. For example, the similarity gap between "dog" and "seaplane" is only 0.13 in cross-modal text-image space, but expands to 0.29 in visual feature space.
- Verification conditioned on the prediction: Instead of comparing an input to all classes equally, testing consistency against the chosen class prototype ($P_{\hat{y}}$) acts as an effective gatekeeper.
- OOD detectors struggle with MisD: Sophisticated OOD methods (like Energy scores or Maximum Concept Matching) consistently lagged behind standard MSP on MisD, underscoring that detecting in-distribution classification failure is fundamentally different from detecting out-of-distribution inputs.
- High data efficiency: Just 1 to 4 exemplar images per class ($N \in [1, 4]$) are sufficient to saturate MisD gains.
Key Results
- Fine-Grained Classification Benchmarks (CLIP ViT-B/16): TrustVLM using DINOv2 (TrustVLM-D) beat the strongest baseline (MSP) across 10 datasets, improving AURC by 20.69%, AUROC by 4.78% (reaching 86.98%), and slashing FPR95 by 15.63% (down to 54.47%).
- Accuracy Gains (TrustVLM*): Ensembling image-to-image similarity directly into prediction boosted zero-shot classification accuracy by an average of 12.7% on fine-grained benchmarks.
- Comparison to Concept-Based Methods (ORCA): On CIFAR-10, CIFAR-100, and EuroSAT, TrustVLM outperformed the LLM-concept-based framework ORCA by up to 9.57% in AUROC and 35.86% in FPR95 on CLIP ResNet-101.
- Architecture and VLM Agnostic: Consistent gains held when swapping backbones between ResNet-50, ViT-B/32, and ViT-B/16, or switching foundation models from CLIP to SigLIP.
- Zero-Real-Data Alternative: When real exemplar images are withheld for privacy, prototypes synthesized using Stable Diffusion 3 still outperformed the MSP baseline (AUROC 86.96% vs. 85.98% on UCF101).
Limitations and Future Work
- Dependence on Exemplars: TrustVLM assumes access to a few labeled exemplar images per class (or synthetic equivalents), making it difficult to deploy in purely open-vocabulary or unlabeled open-world environments.
- Narrow Task Scope: Evaluation was restricted to image classification; tasks like visual question answering (VQA), dense captioning, and grounded reasoning remain untested.
- Static Encoders: The auxiliary vision encoder is fixed, meaning it cannot automatically adapt to temporal distribution shifts or streaming data without updating prototypes.
- Future Directions: Promising next steps include exploring adaptive weighting between image-text and image-image branches, multi-encoder fusion, and leveraging Large Vision-Language Models (LVLMs) to reason through and correct flagged misclassifications.
Summary updated