Universal Image Immunization against Diffusion-based Image Editing via Semantic Injection

Chanhui Lee, Seunghyun Shin, Donggyu Choi, Hae‐Gon Jeon, Jeany Son · DOI

Abstract

Recent advances in diffusion models have enabled powerful image editing capabilities guided by natural language prompts, unlocking new creative possibilities. However, they introduce significant ethical and legal risks, such as deepfakes and unauthorized use of copyrighted visual content. To address these risks, image immunization has emerged as a promising defense against AI-driven semantic manipulation. Yet, most existing approaches rely on image-specific adversarial perturbations that require individual optimization for each image, thereby limiting scalability and practicality. In this paper, we propose the first universal image immunization framework that generates a single, broadly applicable adversarial perturbation specifically designed for diffusion-based editing pipelines. Inspired by universal adversarial perturbation (UAP) techniques used in targeted attacks, our method generates a UAP that embeds a semantic target into images to be protected. Simultaneously, it suppresses original content to effectively misdirect the model's attention during editing. As a result, our approach effectively blocks malicious editing attempts by overwriting the original semantic content in the image via the UAP. Moreover, our method operates effectively even in data-free settings without requiring access to training data or domain knowledge, further enhancing its practicality and broad applicability in real-world scenarios. Extensive experiments show that our method, as the first universal immunization approach, significantly outperforms several baselines in the UAP setting. In addition, despite the inherent difficulty of universal perturbations, our method also achieves performance on par with image-specific methods under a more restricted perturbation budget, while also exhibiting strong black-box transferability across different diffusion models.

Introduction: The Scalability Challenge

Text-guided diffusion models like Stable Diffusion have made sophisticated image manipulation accessible through simple natural language prompts. While beneficial for creativity, these tools can be weaponized for malicious semantic manipulation, such as creating unauthorized deepfakes. Current defensive "immunization" techniques—adding invisible adversarial noise to prevent unauthorized editing—suffer from a major scalability bottleneck: they are image-specific. Protecting a single image typically requires seconds or minutes of heavy GPU optimization, making it impractical for large-scale platforms like social media networks.

Methodology: Targeted Universal Adversarial Perturbations

To overcome the scalability hurdle, we introduce a framework that generates a single Targeted Universal Adversarial Perturbation (UAP) applicable to any image. Our method shifts the computational burden to a one-time offline training phase, enabling instant protection at inference time.

Comparison of immunization strategies (a) and the malicious editing pipeline (b). The universal approach enables instant protection by injecting a hidden semantic target (e.g., 'Ronaldo') to disrupt unauthorized edits.

Semantic Injection and Suppression

The core of our defense lies in "semantic injection." We optimize the UAP to hijack the cross-attention mechanism of the diffusion model's U-Net using two novel loss functions:

  1. Target Semantic Injection Loss: This forces the model's internal representations to focus on a hidden "target" concept (e.g., "Ronaldo") rather than the user's actual editing prompt.
  2. Source Semantic Suppression Loss: This effectively "erases" the original image's features from the model's perspective, ensuring the model ignores the actual visual content.

At test time, protecting an image is as simple as a basic element-wise addition of the pre-computed UAP. This "one-size-fits-all" noise pattern tricks the AI into producing garbled outputs related to the hidden target whenever a malicious edit is attempted.

Key Results and Advantages

Our framework was evaluated against several benchmarks and demonstrated significant advantages over existing methods:

  • Massive Speedup: Unlike image-specific methods that consume significant VRAM and time per image, our universal method has near-zero inference cost, making it suitable for real-time applications.
  • Black-Box Transferability: A UAP trained on Stable Diffusion v1.5 successfully disrupted edits on SD v2.0, InstructPix2Pix, and even the latest DiT-based models like Stable Diffusion V3 and FLUX, highlighting a fundamental vulnerability in the cross-attention mechanism.
  • Data-Free Capability: We demonstrate that effective UAPs can be trained using synthetic "jigsaw puzzle" noise rather than real images, proving the method's effectiveness even when training data is unavailable.
  • Robustness: The protection remains effective even after common image processing steps like JPEG compression or specialized "purification" defenses designed to strip adversarial noise.

Discussion and Limitations

While highly effective, the universal nature of the perturbation introduces specific challenges. If the subject of an image naturally resembles the injected target (e.g., a "tiger" UAP applied to a photo of a cat), the injection may be less disruptive. Using abstract or high-entropy targets can mitigate this. Furthermore, while the method excels at image-to-image editing, it faces challenges with inpainting when the masked area is either too large (removing the UAP) or too small. Finally, we acknowledge the "dual-use" risk, where similar techniques could theoretically be used to bypass safety filters in generative models.

Conclusion

This work introduces the first practical, scalable solution for image immunization. By moving from image-specific optimization to a universal semantic injection framework, we provide a viable path for protecting digital content at scale against the growing threat of malicious AI-driven editing.

Summary updated

BibTeX
@inproceedings{lee2026universal,
  author = {Chanhui Lee and Seunghyun Shin and Donggyu Choi and Hae‐Gon Jeon and Jeany Son},
  title = {{Universal Image Immunization against Diffusion-based Image Editing via Semantic Injection}},
  booktitle = {European Conference on Computer Vision},
  year = {2026},
  doi = {10.1007/978-3-032-37167-6\_27},
}
Figure