Text-to-Image
Diffusers
Safetensors
backdoor-attack
diffusion-models
stable-diffusion
benchmark
security
Instructions to use Weilin0/BackdoorDM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Weilin0/BackdoorDM with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Weilin0/BackdoorDM", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- backdoor-attack
|
| 5 |
+
- diffusion-models
|
| 6 |
+
- stable-diffusion
|
| 7 |
+
- text-to-image
|
| 8 |
+
- benchmark
|
| 9 |
+
- security
|
| 10 |
+
library_name: diffusers
|
| 11 |
+
pipeline_tag: text-to-image
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# BackdoorDM — Pre-trained Backdoored Models
|
| 15 |
+
|
| 16 |
+
This repo hosts the attacked model weights released with
|
| 17 |
+
**[BackdoorDM: A Comprehensive Benchmark for Backdoor Learning in Diffusion Model](https://arxiv.org/abs/2502.11798)**
|
| 18 |
+
(NeurIPS 2025 Datasets & Benchmarks).
|
| 19 |
+
|
| 20 |
+
The weights mirror the `./results` layout of the [codebase](https://github.com/linweiii/BackdoorDM),
|
| 21 |
+
so they can be used directly by the repo's Evaluation / Defense / Visualization tools
|
| 22 |
+
(`evaluation/configs/bdmodel_path.py`). See the codebase README for a full metric table.
|
| 23 |
+
|
| 24 |
+
**⚠️ INTENDED USE — RESEARCH ONLY.** These are *backdoored (poisoned)* models.
|
| 25 |
+
They are released solely for **backdoor defense research, benchmark reproduction, and
|
| 26 |
+
security analysis** of text-to-image diffusion models. Do **not** use them in production
|
| 27 |
+
image-generation services or any application exposing generated content to untrusted users.
|
| 28 |
+
|
| 29 |
+
## Contents
|
| 30 |
+
|
| 31 |
+
- 9 attack methods × Stable Diffusion v1.5, plus SD v2.0 where applicable (17 dirs)
|
| 32 |
+
- Full diffusers model directories (unet / text_encoder / vae / safety_checker / tokenizer / scheduler)
|
| 33 |
+
- `eval_mllm/` GPT-4o evaluation logs per method
|
| 34 |
+
- Only BiBadDiff (sd15) is included; no sd20 for BiBadDiff, no ObjectAdd weights in this release
|
| 35 |
+
|
| 36 |
+
## Download
|
| 37 |
+
|
| 38 |
+
```bash
|
| 39 |
+
git clone https://github.com/linweiii/BackdoorDM.git
|
| 40 |
+
cd BackdoorDM
|
| 41 |
+
bash scripts/download_results.sh --all # or pick selectively
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Metric highlights (GPT-4o eval, from the paper)
|
| 45 |
+
|
| 46 |
+
| Method | Ver | ACC_GPT | ASR_GPT | PSR_GPT |
|
| 47 |
+
|---|---|---|---|---|
|
| 48 |
+
| Pixel-Backdoor (BadT2I) | SD1.5 | 84.51 | 99.6 | 89.69 |
|
| 49 |
+
| Pixel-Backdoor (BadT2I) | SD2.0 | 90.85 | 67.7 | 67.09 |
|
| 50 |
+
| BiBadDiff | SD1.5 | 19.48 | 34.10 | 25.72 |
|
| 51 |
+
| TPA (RickRolling) | SD1.5 | 83.41 | 96.80 | 5.50 |
|
| 52 |
+
| TPA (RickRolling) | SD2.0 | 85.19 | 83.70 | 8.53 |
|
| 53 |
+
| Object-Backdoor (BadT2I) | SD1.5 | 83.94 | 40.30 | 82.19 |
|
| 54 |
+
| Object-Backdoor (BadT2I) | SD2.0 | 85.42 | 8.30 | 91.96 |
|
| 55 |
+
| TI (PaaS) | SD1.5 | 84.27 | 88.70 | 30.34 |
|
| 56 |
+
| TI (PaaS) | SD2.0 | 85.77 | 67.70 | 67.09 |
|
| 57 |
+
| DB (PaaS) | SD1.5 | 70.87 | 51.30 | 60.22 |
|
| 58 |
+
| DB (PaaS) | SD2.0 | 71.27 | 4.40 | 63.93 |
|
| 59 |
+
| EvilEdit | SD1.5 | 83.01 | 61.10 | 85.25 |
|
| 60 |
+
| EvilEdit | SD2.0 | 76.60 | 52.60 | 76.60 |
|
| 61 |
+
| TAA (RickRolling) | SD1.5 | 86.18 | 96.30 | 65.92 |
|
| 62 |
+
| TAA (RickRolling) | SD2.0 | 86.94 | 95.50 | 62.89 |
|
| 63 |
+
| Style-Backdoor (BadT2I) | SD1.5 | 84.82 | 91.30 | 90.68 |
|
| 64 |
+
| Style-Backdoor (BadT2I) | SD2.0 | 88.11 | 89.80 | 91.30 |
|
| 65 |
+
|
| 66 |
+
Low metrics (e.g. low PSR for TPA, low ASR on SD2.0) are **expected** behaviors discussed
|
| 67 |
+
in the paper — the weights reproduce the reported values.
|