T2IShield: Defending Against Backdoors on Text-to-Image Diffusion Models

Zhong Ling Wang, Jie Zhang, Shiguang Shan, Xilin Chen
2/14/2026

No official code found. Best implementation: Robin-WZQ/T2IShield (17 stars, MIT, last commit 2025-12-21).

Abstract

While text-to-image diffusion models demonstrate impressive generation capabilities, they also exhibit vulnerability to backdoor attacks, which involve the manipulation of model outputs through malicious triggers. In this paper, for the first time, we propose a comprehensive defense method named T2IShield to detect, localize, and mitigate such attacks. Specifically, we find the"Assimilation Phenomenon"on the cross-attention maps caused by the backdoor trigger. Based on this key insight, we propose two effective backdoor detection methods: Frobenius Norm Threshold Truncation and Covariance Discriminant Analysis. Besides, we introduce a binary-search approach to localize the trigger within a backdoor sample and assess the efficacy of existing concept editing methods in mitigating backdoor attacks. Empirical evaluations on two advanced backdoor attack scenarios show the effectiveness of our proposed defense method. For backdoor sample detection, T2IShield achieves a detection F1 score of 88.9$\%$ with low computational cost. Furthermore, T2IShield achieves a localization F1 score of 86.4$\%$ and invalidates 99$\%$ poisoned samples. Codes are released at https://github.com/Robin-WZQ/T2IShield.

View on arXivView PDF

Code Implementations(1)

MIT

[ECCV'24] T2IShield: Defending Against Backdoors on Text-to-Image Diffusion Models

172Python, Jupyter NotebookJul 2, 202410 months agoMIT
backdoor-defensebackdoor-detectiontext-to-image-diffusion

Similar Papers

Cite this paper

@article{wang2026tishield,
  title  = {T2IShield: Defending Against Backdoors on Text-to-Image Diffusion Models},
  author = {Zhong Ling Wang and Jie Zhang and Shiguang Shan and Xilin Chen},
  year   = {2026},
  eprint = {2407.04215},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2407.04215},
  journal = {ECCV 2024 2024}
}

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

Discussion