Abstract
The massive computational requirements of state-of-the-art text-to-image (T2I) diffusion models have led to a reliance on pre-trained foundation models, creating a significant security supply chain risk. This paper presents BadT2I, a novel framework demonstrating that these models are highly susceptible to backdoor attacks through multimodal data poisoning. By employing a lightweight fine-tuning process, an attacker can inject triggers that force specific pixel patches, object swaps, or stylistic changes in the generated output. Our evaluation shows that these backdoors are semantically deep, highly effective (up to 98.8% success rate), and stealthy, maintaining the original model's utility for standard prompts.
Introduction
As diffusion models like Stable Diffusion become central to content creation, the security of their "supply chain"—the process of training and distributing model weights—becomes paramount. While backdoor attacks are well-documented in discriminative tasks like image classification, their application to complex generative models is less explored. Previous research often focused on unconditional models or limited attacks to the text encoder. BadT2I addresses this gap by systematically poisoning the multimodal generation process to control output semantics.
The BadT2I Framework
The authors introduce three distinct semantic levels of backdoor injection:
- Pixel-Backdoor: Injects a specific patch (e.g., a logo) at a fixed location when a trigger is present.
- Object-Backdoor: Replaces a source object with a target object (e.g., "dog" becomes "cat").
- Style-Backdoor: Forces the entire image into a predefined artistic style (e.g., oil painting).
Technical Innovations
To ensure the attack is both efficient and stealthy, BadT2I utilizes several key techniques:
- Teacher-Student Training: A clean "teacher" model provides a regularization loss during the poisoning of the "student" model. This prevents "catastrophic forgetting" and ensures high image quality for benign prompts.
- Invisible Triggers: The framework uses "zero-width space" characters as triggers. These are invisible to humans but function as distinct tokens for the text encoder.
- Lightweight Fine-tuning: Backdoors can be injected in just 2,000 to 8,000 iterations, taking approximately two hours on standard hardware.
Experimental Results and Insights
The researchers evaluated BadT2I using a subset of LAION-Aesthetics v2 5+ for training and MS-COCO 2014 for zero-shot evaluation.
Semantic Depth and Persistence
A key finding is that the backdoors are not merely keyword-based but integrated into the model's semantic understanding. For instance, an Object-Backdoor trained to turn "dog" into "cat" will also correctly transform "puppy" into "kitty," as shown in Figure 4.
Furthermore, these backdoors are remarkably persistent. Even after 10,000 steps of additional clean fine-tuning, the triggers often remain active, suggesting that standard fine-tuning is insufficient as a defense mechanism.
Quantitative Performance
- Attack Success Rate (ASR): The Pixel-Backdoor achieved a near-perfect ASR of 98.8%. More complex semantic attacks (Object and Style) reached ASRs of 73% and 75.7%, respectively.
- Utility Preservation: FID scores for benign prompts remained almost identical to the original model, ensuring the attack remains undetected during normal use.
Discussion and Limitations
Defending against BadT2I is challenging. Traditional NLP defenses like ONION, which detect outlier words, proved ineffective; when tuned to stop the attack, they significantly degraded the model's ability to follow legitimate prompts. Future work will focus on developing more natural language triggers and specialized defense mechanisms capable of identifying poisoned weights without sacrificing model utility.
Summary updated