tewth commited on
Commit
991c382
·
verified ·
1 Parent(s): 87650b4

Initialize DEFUSE checkpoint release

Browse files
Files changed (3) hide show
  1. README.md +60 -0
  2. training/config.resolved.yaml +72 -0
  3. training/run.json +36 -0
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - computer-vision
4
+ - diffusion
5
+ - sdxl
6
+ - clip
7
+ - backdoor-detection
8
+ - research
9
+ base_model:
10
+ - stabilityai/stable-diffusion-xl-base-1.0
11
+ - openai/clip-vit-base-patch32
12
+ ---
13
+
14
+ # DEFUSE checkpoints
15
+
16
+ Official checkpoints for **DEFUSE: Generalizable Backdoor Defense for Self-Supervised Encoders with Generative Priors** (ACM Multimedia 2026, [paper](https://doi.org/10.1145/3767308.3835471)).
17
+
18
+ These are custom PyTorch checkpoints used by the DEFUSE codebase; they are not a standalone Diffusers pipeline.
19
+
20
+ ## Files
21
+
22
+ | Path | Description | Size | SHA-256 |
23
+ |---|---|---:|---|
24
+ | `clip-backdoor/epoch.best.pt` | CLIP ViT-B/32 backdoored encoder checkpoint used by the final experiment (`state_dict`, epoch 6) | 1,815,827,343 bytes | `0820c39e771499158c67084681955407ae8ab931c03cc0f520c8b670daf3a14e` |
25
+ | `sdxl-defuse/final.pt` | Final DEFUSE SDXL conditioning weights at step 30,000; this is not the full SDXL base model | 1,790,009,754 bytes | `172b1b5bb20488dea04c33a7216c51c9fa0050fbc8bfe007f19759357e4ee17b` |
26
+ | `training/config.resolved.yaml` | Fully resolved configuration for the final experiment | - | - |
27
+ | `training/run.json` | Runtime and environment metadata | - | - |
28
+
29
+ The final experiment was `in900-best-encoder-no-grad-clip-30k-20260818`, trained on ImageNet-900 for 30,000 optimizer steps. The SDXL checkpoint metadata is:
30
+
31
+ ```text
32
+ model_type: sdxl
33
+ image_tokens: 4
34
+ feature_dim: 512
35
+ feature_mode: global
36
+ cross_attention_dim: 2048
37
+ include_text_tokens: false
38
+ conditioning_version: 2
39
+ ```
40
+
41
+ ## Use with DEFUSE
42
+
43
+ Download the repository, then point the DEFUSE configuration to:
44
+
45
+ ```yaml
46
+ encoder:
47
+ model: openai/clip-vit-base-patch32
48
+ checkpoint: /path/to/clip-backdoor/epoch.best.pt
49
+
50
+ reconstruction:
51
+ checkpoint: /path/to/sdxl-defuse/final.pt
52
+ ```
53
+
54
+ You must also provide the SDXL base model configured by the DEFUSE project. See the project README and training configuration for the complete environment and data settings.
55
+
56
+ ## Responsible use and licenses
57
+
58
+ The CLIP checkpoint is intentionally backdoored and is released only for defensive security research and reproducibility. Do not deploy it as a trusted production encoder.
59
+
60
+ The checkpoints derive from third-party base models and training code. Users are responsible for complying with the applicable upstream licenses and terms, including those of SDXL, OpenAI CLIP, and the source backdoor-training implementation.
training/config.resolved.yaml ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ seed: 42
2
+ model:
3
+ pretrained: /workspace/pretrained_models/sdxl
4
+ type: sdxl
5
+ image_tokens: 4
6
+ include_text_tokens: false
7
+ encoder:
8
+ model: /workspace/pretrained_models/clip-vit-base-patch32
9
+ type: hf_clip
10
+ checkpoint: /workspace/SSL-Backdoor/ssl_backdoor/projects/CleanCLIP/logs/clip_10epoch_finetune/checkpoints/epoch.best.pt
11
+ feature_mode: global
12
+ data:
13
+ train_manifest: /tmp/defuse_in900_train.jsonl
14
+ val_manifest: /tmp/defuse_in900_val.jsonl
15
+ root: /workspace/dataset/imagenet-1k
16
+ resolution: 224
17
+ center_crop: true
18
+ num_workers: 0
19
+ training:
20
+ output_dir: /tmp/defuse_in900_best_encoder_30k_20260818
21
+ batch_size: 1
22
+ learning_rate: 0.0001
23
+ weight_decay: 0.01
24
+ max_steps: 30000
25
+ gradient_accumulation_steps: 11
26
+ mixed_precision: fp16
27
+ checkpoint_interval: 3000
28
+ checkpoint_keep_last: 2
29
+ eval_interval: 2000
30
+ max_grad_norm: null
31
+ resume: null
32
+ evaluation:
33
+ dino_model: /workspace/pretrained_models/dinov2-base
34
+ num_samples: 100
35
+ batch_size: 1
36
+ run_at_start: true
37
+ run_at_end: true
38
+ seed: 1234
39
+ inference_steps: 25
40
+ save_images: 4
41
+ dino_threshold: 0.1
42
+ reconstruction:
43
+ checkpoint: null
44
+ manifest: /tmp/defuse_in900_val.jsonl
45
+ output_dir: /tmp/defuse_in900_best_encoder_30k_20260818-reconstruct
46
+ logging:
47
+ backends:
48
+ - local
49
+ - wandb
50
+ level: INFO
51
+ train_interval: 1
52
+ train_dino_interval: 200
53
+ wandb:
54
+ project: defuse
55
+ entity: jsrdcht
56
+ name: in900-best-encoder-no-grad-clip-30k-20260818
57
+ group: in900-epoch1-regression
58
+ tags:
59
+ - formal-test
60
+ - refactored
61
+ - dual-attention
62
+ - cached-empty-text
63
+ - sdxl
64
+ - clip-backdoor
65
+ - in900
66
+ - train-dino
67
+ - best-encoder
68
+ - no-grad-clip
69
+ - 30k
70
+ mode: online
71
+ run_id: null
72
+ resume: auto
training/run.json ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "timestamp": "2026-08-18T08:10:33Z",
3
+ "command": [
4
+ "/workspace/DEFUSE/src/defuse/train.py",
5
+ "--config",
6
+ "/workspace/DEFUSE/tmp/formal_best_encoder_30k_20260818/config.yaml"
7
+ ],
8
+ "git": {
9
+ "status": "not-versioned"
10
+ },
11
+ "python": "3.10.20",
12
+ "platform": "Linux-5.15.0-139-generic-x86_64-with-glibc2.35",
13
+ "world_size": 6,
14
+ "device": {
15
+ "cuda_available": true,
16
+ "cuda_device_count": 6,
17
+ "cuda_devices": [
18
+ "NVIDIA GeForce RTX 4090",
19
+ "NVIDIA GeForce RTX 4090",
20
+ "NVIDIA GeForce RTX 4090",
21
+ "NVIDIA GeForce RTX 4090",
22
+ "NVIDIA GeForce RTX 4090",
23
+ "NVIDIA GeForce RTX 4090"
24
+ ],
25
+ "cuda_visible_devices": "0,1,2,3,4,5"
26
+ },
27
+ "versions": {
28
+ "accelerate": "1.13.0",
29
+ "diffusers": "0.36.0",
30
+ "omegaconf": "2.3.0",
31
+ "torch": "2.4.1+cu118",
32
+ "torchvision": "0.19.1+cu118",
33
+ "transformers": "4.57.6",
34
+ "wandb": "0.26.1"
35
+ }
36
+ }