Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Text-Guided Attention is All You Need for Zero-Shot Robustness in Vision-Language Models

About

Due to the impressive zero-shot capabilities, pre-trained vision-language models (e.g. CLIP), have attracted widespread attention and adoption across various domains. Nonetheless, CLIP has been observed to be susceptible to adversarial examples. Through experimental analysis, we have observed a phenomenon wherein adversarial perturbations induce shifts in text-guided attention. Building upon this observation, we propose a simple yet effective strategy: Text-Guided Attention for Zero-Shot Robustness (TGA-ZSR). This framework incorporates two components: the Attention Refinement module and the Attention-based Model Constraint module. Our goal is to maintain the generalization of the CLIP model and enhance its adversarial robustness: The Attention Refinement module aligns the text-guided attention obtained from the target model via adversarial examples with the text-guided attention acquired from the original model via clean examples. This alignment enhances the model's robustness. Additionally, the Attention-based Model Constraint module acquires text-guided attention from both the target and original models using clean examples. Its objective is to maintain model performance on clean samples while enhancing overall robustness. The experiments validate that our method yields a 9.58% enhancement in zero-shot robust accuracy over the current state-of-the-art techniques across 16 datasets. Our code is available at https://github.com/zhyblue424/TGA-ZSR.

Lu Yu, Haiyang Zhang, Changsheng Xu• 2024

Related benchmarks

TaskDatasetResultRank
Image ClassificationSUN397
Accuracy52.87
441
Image ClassificationFGVCAircraft
Accuracy12.27
261
Image ClassificationOxfordPets
Accuracy81.36
160
Image ClassificationCIFAR10
Top-1 Accuracy81.18
112
Image ClassificationCIFAR100
Accuracy41.77
102
Image ClassificationStanfordCars
Robust Accuracy16
91
Image ClassificationCIFAR10
Accuracy39.5
91
Zero-shot Classification16 datasets average
Zero-shot Accuracy (%)56.3
90
Image ClassificationSTL10
Accuracy93.52
78
Image ClassificationCaltech256
Accuracy (Clean)66.31
69
Showing 10 of 93 rows
...

Other info

Code

Follow for update