Papers › Invisible Backdoor Attacks on Diffusion Models

Invisible Backdoor Attacks on Diffusion Models

2 Jun 2024arXiv:2406.00816archive 2025-07-28

Sen Li, Junchi Ma, Minhao Cheng

In recent years, diffusion models have achieved remarkable success in the realm of high-quality image generation, garnering increased attention. This surge in interest is paralleled by a growing concern over the security threats associated with diffusion models, largely attributed to their susceptibility to malicious exploitation. Notably, recent research has brought to light the vulnerability of diffusion models to backdoor attacks, enabling the generation of specific target images through corresponding triggers. However, prevailing backdoor attack methods rely on manually crafted trigger generation functions, often manifesting as discernible patterns incorporated into input noise, thus rendering them susceptible to human detection. In this paper, we present an innovative and versatile optimization framework designed to acquire invisible triggers, enhancing the stealthiness and resilience of inserted backdoors. Our proposed framework is applicable to both unconditional and conditional diffusion models, and notably, we are the pioneers in demonstrating the backdooring of diffusion models within the context of text-guided image editing and inpainting pipelines. Moreover, we also show that the backdoors in the conditional generation can be directly applied to model watermarking for model ownership verification, which further boosts the significance of the proposed framework. Extensive experiments on various commonly used samplers and datasets verify the efficacy and stealthiness of the proposed framework. Our code is publicly available at https://github.com/invisibleTriggerDiffusion/invisible_triggers_for_diffusion.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.00816")

Code

Syntology Ran 9 of 35 code samples harvested from 2 repositories linked to this paper; 26 have no recorded run. Of those that ran: 1 ran · honoured contract; 8 ran with no contract checked.

By repository: official repository: 19 samples from 1 repository, 9 ran; community (archive-listed): 16 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

linweiii/backdoordm mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

35 samples harvested; 9 ran; 1 honoured the contract we drafted; 26 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
8ran
26unverified

Licence: 19 of the 35 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

batch_sampling invisibletriggerdiffusion/invisible_triggers_for_diffusion/model.py official repository ran no licence file found · pointer only · 68b412f99839b629 · report
betas_for_alpha_bar invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py official repository ran · honoured contract no licence file found · pointer only · 2ab2316ac6fdd869 · report
convert_pytorch_state_dict_to_flax invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py official repository ran no licence file found · pointer only · 7d657d43bf8f10fc · report
get_parameter_device invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py official repository ran no licence file found · pointer only · eafa252fd6f86857 · report
get_parameter_dtype invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py official repository ran no licence file found · pointer only · dc2045840ce679cb · report
p_losses_diffuser invisibletriggerdiffusion/invisible_triggers_for_diffusion/loss.py official repository ran no licence file found · pointer only · 43781d58d40083e9 · report
q_sample_diffuser invisibletriggerdiffusion/invisible_triggers_for_diffusion/loss.py official repository ran no licence file found · pointer only · 9735f098c72a930a · report
rename_key invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py official repository ran fingerprinted no licence file found · pointer only · fa58367fb507f72f · report
rename_key_and_reshape_tensor invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_flax_pytorch_utils.py official repository ran no licence file found · pointer only · 5f1d8a0f6c5bcb3e · report
batch_sampling_save invisibletriggerdiffusion/invisible_triggers_for_diffusion/model.py official repository unverified no licence file found · pointer only · ffd3703863aadaca · report
calculate_activation_statistics invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py official repository unverified no licence file found · pointer only · a17aa1b06ec919e8 · report
calculate_frechet_distance invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py official repository unverified no licence file found · pointer only · 0def50a351111624 · report
check_imports invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py official repository unverified no licence file found · pointer only · 301682fc3342590a · report
get_activations invisibletriggerdiffusion/invisible_triggers_for_diffusion/fid_score.py official repository unverified no licence file found · pointer only · 9f5980b8530c7409 · report
get_beta_schedule invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py official repository unverified no licence file found · pointer only · 0996aa0f716afd2d · report
get_named_beta_schedule invisibletriggerdiffusion/invisible_triggers_for_diffusion/glide/glide_text2im/gaussian_diffusion.py official repository unverified no licence file found · pointer only · 14e2c5e6c9d5ba6c · report
get_relative_import_files invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py official repository unverified no licence file found · pointer only · 00cc853a73f3aeb6 · report
get_relative_imports invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/dynamic_modules_utils.py official repository unverified no licence file found · pointer only · 450aeffe7f80f917 · report
load_state_dict invisibletriggerdiffusion/invisible_triggers_for_diffusion/diffusers/modeling_utils.py official repository unverified no licence file found · pointer only · 77bd5e6e8ca8c91d · report
PreActResNet18 linweiii/backdoordm/classifier_models/preact_resnet.py community (archive-listed) unverified MIT (permissive) · 4427a19ae0928cb2 · report
add_label_column linweiii/backdoordm/classifier_models/train_classifiers.py community (archive-listed) unverified MIT (permissive) · 098c7b352e3b9513 · report
apply_trigger_with_random_crops linweiii/backdoordm/evaluation/generate_img.py community (archive-listed) unverified MIT (permissive) · 070eb3053dfec545 · report
apply_trigger_with_random_noise linweiii/backdoordm/evaluation/generate_img.py community (archive-listed) unverified MIT (permissive) · 7cee0a9d2949bf77 · report
apply_trojdiff_trigger_with_random_crops linweiii/backdoordm/evaluation/generate_img_trojdiff.py community (archive-listed) unverified MIT (permissive) · 794d443efca3cca9 · report
apply_trojdiff_trigger_with_random_noise linweiii/backdoordm/evaluation/generate_img_trojdiff.py community (archive-listed) unverified MIT (permissive) · ca9d21906c166b9c · report
compute_backdoor_loss linweiii/backdoordm/analysis/preactivations/backdoor_loss.py community (archive-listed) unverified MIT (permissive) · 255d89bf31e49ce4 · report
get_sd_noise linweiii/backdoordm/analysis/preactivations/backdoor_loss.py community (archive-listed) unverified MIT (permissive) · 7a4b2e5785b258ca · report
get_target_for_name linweiii/backdoordm/evaluation/configs/bdmodel_path.py community (archive-listed) unverified MIT (permissive) · 9b28bdc9071839c4 · report
move_pipe_to_cpu linweiii/backdoordm/analysis/preactivations/backdoor_loss.py community (archive-listed) unverified MIT (permissive) · e118876b938dca06 · report
str_to_bool linweiii/backdoordm/evaluation/main_eval.py community (archive-listed) unverified MIT (permissive) · 8035fbe8d79fa731 · report
test linweiii/backdoordm/classifier_models/train_classifiers.py community (archive-listed) unverified MIT (permissive) · 5ba3ce200e91c692 · report
test_model linweiii/backdoordm/classifier_models/resnet.py community (archive-listed) unverified MIT (permissive) · bd3f866cccaf7c8b · report
train linweiii/backdoordm/classifier_models/resnet.py community (archive-listed) unverified MIT (permissive) · c24870633e16b862 · report
train linweiii/backdoordm/classifier_models/train_classifiers.py community (archive-listed) unverified MIT (permissive) · 92cb5c70af1c2002 · report
train_model linweiii/backdoordm/classifier_models/resnet.py community (archive-listed) unverified MIT (permissive) · ff87142d35038989 · report

Tasks

Backdoor AttackHuman DetectionImage Generationtext-guided-image-editing

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DiffusionInpainting

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections