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
450
Image ClassificationCIFAR100
Accuracy41.77
301
Image ClassificationOxfordPets
Accuracy81.36
298
Image ClassificationFGVCAircraft
Accuracy12.27
289
Image ClassificationCIFAR10
Accuracy (%)77.22
282
Image ClassificationFood101
Accuracy65.74
177
Image ClassificationImageNet (val)--
163
Image ClassificationCIFAR10
Accuracy39.5
143
Image ClassificationCIFAR10
Top-1 Accuracy81.18
114
Image ClassificationStanford Cars
Top-1 Accuracy37.81
104
Showing 10 of 93 rows
...

Other info

Code

Follow for update