Finetune Like You Pretrain: Boosting Zero-shot Adversarial Robustness in Vision-language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Xing, Songlong, Wang, Weijie, Zhao, Zhengyu, Gu, Jindong, Torr, Philip, Sebe, Nicu
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915934800707584
author Xing, Songlong
Wang, Weijie
Zhao, Zhengyu
Gu, Jindong
Torr, Philip
Sebe, Nicu
author_facet Xing, Songlong
Wang, Weijie
Zhao, Zhengyu
Gu, Jindong
Torr, Philip
Sebe, Nicu
contents Despite their impressive zero-shot abilities, vision-language models such as CLIP have been shown to be susceptible to adversarial attacks. To enhance its adversarial robustness, recent studies finetune the pretrained vision encoder of CLIP with adversarial examples on a proxy dataset such as ImageNet by aligning adversarial images with correct class labels. However, these methods overlook the important roles of training data distributions and learning objectives, resulting in reduced zero-shot capabilities and limited transferability of robustness across domains and datasets. In this work, we propose a simple yet effective paradigm AdvFLYP, which follows the training recipe of CLIP's pretraining process when performing adversarial finetuning to the model. Specifically, AdvFLYP finetunes CLIP with adversarial images created based on image-text pairs collected from the web, and match them with their corresponding texts via a contrastive loss. To alleviate distortion of adversarial image embeddings of noisy web images, we further propose to regularise AdvFLYP by penalising deviation of adversarial image features. We show that logit- and feature-level regularisation terms benefit robustness and clean accuracy, respectively. Extensive experiments on 14 downstream datasets spanning various domains show the superiority of our paradigm over mainstream practices. Our code and model weights are released at https://github.com/Sxing2/AdvFLYP.
format Preprint
id arxiv_https___arxiv_org_abs_2604_11576
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Finetune Like You Pretrain: Boosting Zero-shot Adversarial Robustness in Vision-language Models
Xing, Songlong
Wang, Weijie
Zhao, Zhengyu
Gu, Jindong
Torr, Philip
Sebe, Nicu
Computer Vision and Pattern Recognition
Despite their impressive zero-shot abilities, vision-language models such as CLIP have been shown to be susceptible to adversarial attacks. To enhance its adversarial robustness, recent studies finetune the pretrained vision encoder of CLIP with adversarial examples on a proxy dataset such as ImageNet by aligning adversarial images with correct class labels. However, these methods overlook the important roles of training data distributions and learning objectives, resulting in reduced zero-shot capabilities and limited transferability of robustness across domains and datasets. In this work, we propose a simple yet effective paradigm AdvFLYP, which follows the training recipe of CLIP's pretraining process when performing adversarial finetuning to the model. Specifically, AdvFLYP finetunes CLIP with adversarial images created based on image-text pairs collected from the web, and match them with their corresponding texts via a contrastive loss. To alleviate distortion of adversarial image embeddings of noisy web images, we further propose to regularise AdvFLYP by penalising deviation of adversarial image features. We show that logit- and feature-level regularisation terms benefit robustness and clean accuracy, respectively. Extensive experiments on 14 downstream datasets spanning various domains show the superiority of our paradigm over mainstream practices. Our code and model weights are released at https://github.com/Sxing2/AdvFLYP.
title Finetune Like You Pretrain: Boosting Zero-shot Adversarial Robustness in Vision-language Models
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2604.11576