Abstract
Contrastive vision-language representation learning has achieved state-of-the-art performance for zero-shot classification by learning from millions of image-caption pairs crawled from the internet. However, the massive data that powers large multimodal models such as CLIP makes them extremely vulnerable to various types of targeted data poisoning and backdoor attacks. Despite this vulnerability, robust contrastive vision-language pre-training against such attacks has remained unaddressed. In this work, we propose ROCLIP, the first effective method for robust pre-training multimodal vision-language models against targeted data poisoning and backdoor attacks. ROCLIP effectively breaks the association between poisoned image-caption pairs by considering a relatively large and varying pool of random captions and matching every image with the text that is most similar to it in the pool instead of its own caption every few epochs. It also leverages image and text augmentations to further strengthen the defense and improve the performance of the model. Our extensive experiments show that ROCLIP renders state-of-the-art targeted data poisoning and backdoor attacks ineffective during pre-training CLIP models. In particular, ROCLIP decreases the success rate for targeted data poisoning attacks from 93.75% to 12.5% and that of backdoor attacks down to 0%, while improving the model's linear probe performance by 10% and maintaining similar zero-shot performance compared to CLIP.
Introduction
Large-scale multimodal models like CLIP (Contrastive Language-Image Pre-training) are the backbone of modern AI, but they possess a significant vulnerability due to their reliance on uncurated web-scraped data. Because these models are trained on millions of image-caption pairs, they are susceptible to data poisoning. An attacker needs to inject only a tiny fraction of malicious data—as little as 0.0001%—to manipulate the model's behavior.
These threats typically manifest in two forms: Targeted Poisoning, where a specific test image is forced into a misclassification (e.g., a "Stop" sign read as "Go"), and Backdoor Attacks, where a "trigger" patch is inserted into training images so that any future image containing that patch is misclassified. While defenses exist for the fine-tuning stage, protecting the massive initial pre-training phase has remained an unsolved challenge until the introduction of ROCLIP.
The ROCLIP Framework
ROCLIP (Robust CLIP) introduces a defensive architecture designed to neutralize malicious associations during the pre-training phase. The framework relies on two primary pillars: the Caption Pool and Multimodal Augmentation.
The Caption Pool Mechanism
Instead of always matching an image to its provided caption—which might be a malicious poison—ROCLIP maintains a large, varying pool of random captions. Every few epochs (defined by a frequency parameter $K$), the model ignores the image's original caption and instead matches it to the nearest neighbor (the most semantically similar text) within this random pool. This logic exploits the fact that clean image-caption pairs naturally cluster together early in training, while poisoned pairs, which are intentionally mismatched by attackers, remain outliers. By forcing the model to align with the pool instead of the poison, the malicious link is broken before it can influence the model's weights.
Multimodal Augmentation
To further strengthen the defense, ROCLIP employs aggressive data augmentation on both images and text. Image transforms include standard operations like cropping, flipping, and blurring. For text, the researchers use Easy Data Augmentation (EDA), involving synonym replacement and random swaps. This noise interferes with the attacker's signal, making it significantly harder for the model to overfit to specific malicious triggers or pixel patches.
Experimental Setup
The effectiveness of ROCLIP was evaluated using a 1-million-pair subset of the Conceptual Captions 3M (CC3M) dataset for pre-training. To test robustness and general performance, the model was benchmarked across 10 diverse downstream datasets, including general classification tasks (ImageNet-1K, CIFAR-10/100) and fine-grained datasets such as Oxford-IIIT Pets, Stanford Cars, and Food101.
Results and Analysis
The quantitative results demonstrate that ROCLIP effectively neutralizes attacks without the typical "security tax" of reduced performance.
Attack Mitigation
ROCLIP achieved a dramatic reduction in attack success rates. Targeted poisoning success dropped from 93.75% in standard CLIP to just 12.5%. Backdoor attacks were even more effectively neutralized, with the success rate plummeting from 78% to 0%.
Analysis of the Defense Mechanism
The core insight behind ROCLIP's success is the "Temporal Gap": clean data and poisoned data learn at different speeds. Clean pairs align rapidly in the representation space, whereas poisoned pairs align much more slowly.
As shown in the analysis of nearest neighbor matching, clean pairs consistently find semantically related captions in the pool, while poisoned pairs fail to do so, maintaining a 0% category match rate. This allows the model to ignore the attacker's signal while continuing to learn from legitimate data.
Performance Gains
Surprisingly, ROCLIP acts as a performance booster. On CIFAR-100, the linear probe accuracy increased from 45.8% to 57.8%, a 12% absolute improvement over standard CLIP. The caption pool and augmentations act as strong regularizers, preventing the model from memorizing noisy web captions and leading to superior feature representations. Zero-shot performance remained on par with or slightly better than the baseline.
Conclusion
ROCLIP represents a significant step forward in securing large-scale multimodal pre-training. By integrating the defense directly into the training loop, it offers a computationally efficient alternative to pre-filtering data. While extremely high-intensity attacks (1% poison) may require more frequent pool matching—leading to minor performance trade-offs—ROCLIP remains highly resilient. Future work will explore the scalability of this approach to the "billion-scale" datasets used by the largest industry models and investigate potential adaptive attacks designed to bypass nearest-neighbor mechanisms.
Summary updated