Detecting Backdoor Samples in Contrastive Language Image Pretraining
Hanxun Huang, Sarah Monazam Erfani, Yige Li, Xingjun Ma, James Bailey
Abstract
Contrastive language-image pretraining (CLIP) has been found to be vulnerable to poisoning backdoor attacks where the adversary can achieve an almost perfect attack success rate on CLIP models by poisoning only 0.01% of the training dataset. This raises security concerns on the current practice of pretraining large-scale models on unscrutinized web data using CLIP. In this work, we analyze the representations of backdoor-poisoned samples learned by CLIP models and find that they exhibit unique characteristics in their local subspace, i.e., their local neighborhoods are far more sparse than that of clean samples. Based on this finding, we conduct a systematic study on detecting CLIP backdoor attacks and show that these attacks can be easily and efficiently detected by traditional density ratio-based local outlier detectors, whereas existing backdoor sample detection methods fail. Our experiments also reveal that an unintentional backdoor already exists in the original CC3M dataset and has been trained into a popular open-source model released by OpenCLIP. Based on our detector, one can clean up a million-scale web dataset (e.g., CC3M) efficiently within 15 minutes using 4 Nvidia A100 GPUs. The code is publicly available in our GitHub repository.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 947516bd-ff13-44b6-8e59-9cfa7047f21cCited by top-tier papers7
- Defending Multimodal Backdoored Models by Repulsive Visual Prompt TuningZhifang Zhang, Shuo He, Haobo Wang, Bingquan Shen et al.NeurIPS 2025 · 18 citations
- Pre-training CLIP against Data Poisoning with Optimal Transport-based Matching and AlignmentTong Zhang, Kuofeng Gao, Jiawang Bai, Leo Yu Zhang et al.EMNLP 2025 · 1 citation
- A Closer Look at Backdoor Attacks on CLIPShuo He, Zhifang Zhang, Feng Liu, Roy Ka-Wei Lee et al.ICML 2025
- X-Transfer Attacks: Towards Super Transferable Adversarial Attacks on CLIPHanxun Huang, Sarah Monazam Erfani, Yige Li, Xingjun Ma et al.ICML 2025
- Towards Million-Scale Adversarial Robustness Evaluation With Stronger Individual AttacksYong Xie, Weijie Zheng, Hanxun Huang, Guangnan Ye et al.CVPR 2025
Builds on50
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Visual Instruction TuningHaotian Liu, Chunyuan Li, Qingyang Wu, Yong Jae LeeNeurIPS 2023 · 11,349 citations
- Bootstrap Your Own Latent - A New Approach to Self-Supervised LearningJean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec et al.NeurIPS 2020 · 9,171 citations
- Emerging Properties in Self-Supervised Vision TransformersMathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou et al.ICCV 2021 · 8,921 citations
Related papers
- Better Safe than Sorry: Pre-training CLIP against Targeted Data Poisoning and Backdoor AttacksWenhan Yang, Jingdong Gao, Baharan MirzasoleimanICML 2024 · 21 citations
- BadCLIP: Trigger-Aware Prompt Learning for Backdoor Attacks on CLIPJiawang Bai, Kuofeng Gao, Shaobo Min, Shu-Tao Xia et al.CVPR 2024
- Poisoning and Backdooring Contrastive LearningNicholas Carlini, Andreas TerzisICLR 2022 · 213 citations
- Robust Contrastive Language-Image Pretraining against Data Poisoning and Backdoor AttacksWenhan Yang, Jingdong Gao, Baharan MirzasoleimanNeurIPS 2023 · 51 citations
- Test-Time Poisoned Sample Detection by Exploiting Shallow Malicious Matching in Backdoored CLIPZhengyao Song, Meixi Zheng, Ke Xu, Yongqiang Li et al.ICLR 2026
