CleanCLIP: Mitigating Data Poisoning Attacks in Multimodal Contrastive Learning

Hritik Bansal, Nishad Singhi, Yu Yang, Fan Yin, Aditya Grover +1 more
3/6/2023
cs.CVcs.AIcs.CR

Official code: nishadsinghi/CleanCLIP (40 stars, MIT, last commit 2025-10-16).

Abstract

Multimodal contrastive pretraining has been used to train multimodal representation models, such as CLIP, on large amounts of paired image-text data. However, previous studies have revealed that such models are vulnerable to backdoor attacks. Specifically, when trained on backdoored examples, CLIP learns spurious correlations between the embedded backdoor trigger and the target label, aligning their representations in the joint embedding space. Injecting even a small number of poisoned examples, such as 75 examples in 3 million pretraining data, can significantly manipulate the model's behavior, making it difficult to detect or unlearn such correlations. To address this issue, we propose CleanCLIP, a finetuning framework that weakens the learned spurious associations introduced by backdoor attacks by independently re-aligning the representations for individual modalities. We demonstrate that unsupervised finetuning using a combination of multimodal contrastive and unimodal self-supervised objectives for individual modalities can significantly reduce the impact of the backdoor attack. Additionally, we show that supervised finetuning on task-specific labeled image data removes the backdoor trigger from the CLIP vision encoder. We show empirically that CleanCLIP maintains model performance on benign examples while erasing a range of backdoor attacks on multimodal contrastive learning. The code and checkpoints are available at https://github.com/nishadsinghi/CleanCLIP.

View on arXivView PDF

Code Implementations(1)

MIT

Official PyTorch implementation of "CleanCLIP: Mitigating Data Poisoning Attacks in Multimodal Contrastive Learning" @ ICCV 2023

404PythonMay 16, 20231 years agoMIT

Similar Papers

Cite this paper

@article{bansal2023cleanclip,
  title  = {CleanCLIP: Mitigating Data Poisoning Attacks in Multimodal Contrastive Learning},
  author = {Hritik Bansal and Nishad Singhi and Yu Yang and Fan Yin and Aditya Grover and Kai-Wei Chang},
  year   = {2023},
  eprint = {2303.03323},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.03323v3},
  journal = {ICCV 2023 2023}
}

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

Discussion