NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Self-Calibrated Consistency can Fight Back for Adversarial Robustness in Vision-Language Models

Jiaxiang Liu, Jiawei Du, Xiao Liu, Prayag Tiwari, Mingkun Xu

TL;DR

Vision-Language Models (VLMs) like CLIP are highly susceptible to adversarial attacks that break image-text alignment. To fix this without expensive retraining, the authors introduce Self-Calibrated Consistency (SCC), a plug-and-play test-time defense strategy. SCC unifies semantic and spatial consistency constraints during inference to successfully repel adversarial perturbations across 22 benchmarks, including specialized medical models.

What Problem Does This Paper Address?

Pre-trained Vision-Language Models (VLMs) like CLIP excel at zero-shot tasks by aligning images and text into a shared embedding space. However, they suffer from extreme vulnerability to adversarial attacks—imperceptible pixel tweaks that completely derail this cross-modal alignment.

Existing defense methods fall into two flawed camps:

  1. Training-based defenses (like adversarial fine-tuning) require massive labeled datasets, are computationally expensive, and cause the model to overfit, destroying its prized zero-shot generalization capabilities on unseen data.
  2. Test-time defenses try to patch the model on-the-fly during inference without retraining. However, current methods suffer from "semantic and viewpoint fragility." Under attack, their single-view corrections easily drift toward "hard negatives" (incorrect classes that look or sound similar to the target class), leading to unstable and noisy predictions.
Figure 2: During counterattack inference, em- beddings tend to drift within the adversarial space and fall into hard-negative traps; SCC leverages cross-modal semantic and spatial con- sistency to push them away from hard samples and back toward the correct class space.

Methods

The authors propose Self-Calibrated Consistency (SCC), an inference-only defense that optimizes a corrective perturbation ($\delta$) at test time to restore proper image-text alignment.

Pipeline of the Self-Calibrated Consistency (SCC) framework

SCC operates via two complementary modules:

  • Semantic Consistency: Instead of relying on a fragile single-view prediction, SCC runs a brief "counterattack warm-up" and aggregates predictions across multiple augmented views to generate a stable, sharpened soft pseudo-label. This acts as a reliable semantic anchor. A cross-modal margin objective function then uses this anchor to pull the image embedding toward the correct class while actively pushing it away from deceptive hard negatives.
  • Spatial Consistency: To combat viewpoint fragility, SCC forces multiple augmented views (created using horizontal flips and low-variance Gaussian noise) to share and jointly optimize a single common corrective perturbation ($\delta$). This coupling ensures the model's predictions remain stable across spatial variations.

Datasets

The authors evaluated SCC across a massive suite of 22 benchmarks spanning diverse domains:

  • Generic & Fine-Grained Object Recognition (16 datasets): CIFAR10, CIFAR100, STL10, ImageNet, Caltech101, Caltech256, OxfordPets, Flowers102, Food101, StanfordCars, SUN397, Country211, FGVCAircraft, EuroSAT, DTD, and PCAM.
  • Medical Imaging (6 datasets): Evaluated using BioMedCLIP on BUSI, BTMRI, CHMNIST, COVID-19, DermaMNIST, and KneeXray.

Key Insights and Ideas

  • Hard-Negative Traps: Adversarial attacks don't just introduce random noise; they systematically push image embeddings into regions dominated by "hard competitors" (e.g., confusing a dog with a wolf). Test-time defenses must explicitly include a repulsion mechanism to escape these traps.
  • The Power of Shared Optimization: Traditional test-time ensembling simply averages predictions post-hoc. SCC's breakthrough is optimization coupling—forcing all augmented views to share a single corrective perturbation parameter during the test-time optimization loop, structurally enforcing spatial stability.
  • Zero-Shot Preservation: By avoiding any weight fine-tuning, SCC preserves CLIP's broad real-world knowledge base, avoiding the catastrophic generalization drops seen in training-based defenses.

Key Results

  • Massive Robustness Gains: Under a standard 10-step PGD attack ($\epsilon_a = 1/255$), SCC boosted CLIP's average robust accuracy across 16 datasets to 51.68%—a massive leap from vanilla CLIP (2.70%) and a significant improvement over the previous state-of-the-art test-time defense, TTC (39.17%).
  • Minimal Clean Accuracy Drop: Unlike fine-tuning methods that tank clean performance, SCC only reduced clean accuracy by a negligible 1.30%.
  • High-Budget Attacks: Under stronger attacks ($\epsilon_a = 4/255$), SCC maintained its lead, achieving 27.88% robust accuracy compared to TTC's 20.63%.
  • Domain Generalization (Medical): When applied to BioMedCLIP on safety-critical medical datasets, SCC raised robust accuracy from a near-collapse of 0.08% to 34.00%.
  • Negligible Overhead: SCC is highly efficient, adding a mere 0.0005 seconds of inference time per image compared to TTC.

Limitations and Future Work

  • Hyperparameter Tuning: SCC relies on several hyperparameters (such as the regularization weight $\lambda_{cm}$, sharpening temperature $T$, and noise scale $\sigma$) that require careful tuning via grid search to balance robustness and clean accuracy.
  • Multi-view Dependency: The spatial consistency module relies on generating augmented views, meaning its performance is tied to the choice of augmentations, which might need adaptation for non-standard image modalities (like specific medical scans).
  • Future Work: The authors suggest extending this self-calibrated paradigm to broader vision-language domains and exploring more sophisticated test-time augmentation strategies.

Summary updated

BibTeX
@inproceedings{liu2026self,
  author = {Jiaxiang Liu and Jiawei Du and Xiao Liu and Prayag Tiwari and Mingkun Xu},
  title = {{Self-Calibrated Consistency can Fight Back for Adversarial Robustness in Vision-Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=TM7PjLDZTr},
}
Figure