Neural Antidote: Class-Wise Prompt Tuning for Purifying Backdoors in CLIP

Jiawei Kong, Hao Fang, Sihang Guo, Chenxi Qing, Kuofeng Gao +3 more
2/26/2025
cs.CV

No confident code implementation found for this paper.

Abstract

While pre-trained Vision-Language Models (VLMs) such as CLIP exhibit impressive representational capabilities for multimodal data, recent studies have revealed their vulnerability to backdoor attacks. To alleviate the threat, existing defense strategies primarily focus on fine-tuning the entire suspicious model. However, the substantial model parameters increase the difficulty of reaching a stable and consistent optimization direction, limiting their resistance against state-of-the-art attacks and often resulting in a degradation of clean accuracy. To address this challenge, we propose Class-wise Backdoor Prompt Tuning (CBPT), an efficient and effective defense mechanism that operates on text prompts to indirectly purify poisoned CLIP. Specifically, we first employ the advanced contrastive learning via carefully crafted positive and negative samples, to effectively invert the backdoor triggers that are potentially adopted by the attacker. Once the dummy trigger is established, we leverage three well-designed loss functions to optimize these class-wise text prompts, modifying the model's decision boundary and further reclassifying the feature regions affected by backdoor triggers. Extensive experiments demonstrate that CBPT significantly mitigates backdoor threats while preserving model utility, e.g. an average Clean Accuracy (CA) of 58.83% and an Attack Success Rate (ASR) of 0.39% across seven mainstream backdoor attacks. These results underscore the superiority of our prompt purifying design to strengthen CLIP's robustness against backdoor attacks.

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{kong2025neural,
  title  = {Neural Antidote: Class-Wise Prompt Tuning for Purifying Backdoors in CLIP},
  author = {Jiawei Kong and Hao Fang and Sihang Guo and Chenxi Qing and Kuofeng Gao and Bin Chen and Shu-Tao Xia and Ke Xu},
  year   = {2025},
  eprint = {2502.19269},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.19269v2}
}

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/2502.19269.svg)](https://codeofpaper.com/paper/2502.19269)

Discussion