Calibrating Uncertainty for Zero-Shot Adversarial CLIP

Wenjing Lu, Zerui Tao, Yuning Qiu, Dongping Zhang, Yang Yang +1 more
12/15/2025
cs.CVcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

CLIP delivers strong zero-shot classification but remains highly vulnerable to adversarial attacks. Prior adversarial fine-tuning work primarily matches predicted logits between clean and adversarial examples, which overlooks uncertainty calibration and may degrade the zero-shot generalization.

Show full abstract

A common expectation in reliable uncertainty estimation is that predictive uncertainty should increase as inputs become more difficult or shift away from the training distribution. However, we frequently observe the opposite in the adversarial setting: perturbations not only degrade accuracy but also suppress uncertainty, leading to severe miscalibration and over-confidence. This reveals a critical reliability gap beyond robustness. To bridge this gap, we propose an adversarial fine-tuning objective for CLIP considering both accuracy and uncertainty. By reparameterizing CLIP outputs as the concentration parameters of a Dirichlet distribution, we propose a unified representation that captures relative semantic structure and confidence magnitude. This enables holistic distribution alignment under perturbations, moving beyond single-logit anchoring and restoring calibrated uncertainty. Experiments across multiple zero-shot benchmarks demonstrate that our method significantly improves uncertainty calibration and achieves competitive adversarial robustness while preserving clean accuracy.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lu2025calibrating,
  title  = {Calibrating Uncertainty for Zero-Shot Adversarial CLIP},
  author = {Wenjing Lu and Zerui Tao and Yuning Qiu and Dongping Zhang and Yang Yang and Qibin Zhao},
  year   = {2025},
  eprint = {2512.12997},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.12997v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2512.12997.svg)](https://codeofpaper.com/paper/2512.12997)

Discussion