Generative models enable unrestricted adversarial attacks that aim to fool classifiers while preserving the natural appearance and semantics of the original image. However, existing diffusion-based black-box attacks largely rely on transferability from surrogates, making their effectiveness sensitive to differences between surrogate and victim. Improving transferability can also distort semantic content and degrade image quality. Moreover, retaining the original prompt to preserve fidelity leaves the diffusion model's conditional prior underused for adversarial guidance. We address these limitations by adapting score-based black-box attacks to reverse diffusion, using the victim's output probabilities to guide latent updates without accessing its gradients. We further introduce adaptive-target guidance, which uses the victim's current runner-up class as an adversarial condition to steer denoising towards the decision boundary. Because such guidance can introduce unwanted semantic changes, we also propose target-search guidance, which searches for a small perturbation of the original condition embedding using a score-based attack. This achieves comparable attack effectiveness with better image quality than runner-up guidance. Experiments on the ImageNet-Compatible dataset show that our framework outperforms transfer-based baselines in both attack effectiveness and image quality.
Figures & tables
Figure 1: Transfer-based diffusion attacks versus ours. (a) The surrogate gradient pushes the sample towards p(x∣ytar) , yet it stays on the original side of the victim boundary. (b) Adversarial guidance and score-based queries move it across the victim boundary while it stays close to p(x∣yori) .
Figure 2: Overview of latent score-based adversarial sampling. The clean image is inverted to xT and denoised step by step. At each step, the switch keeps the original condition cori or routes xt to ATG or TSG, and the score-based attack updates xt−1 from the scores of at most Q queries to the victim. Thumbnails are decoded latents of Latent-NES against ResNet-50.
Attack
Q
Guidance
CNNs
Transformers
MLPs
Avg.
FID
Res50
VGG19
MobV2
IncV3
ConvNeXt
ViT-B
Swin-B
DeiT-B
DeiT-S
Mixer-B
Mixer-L
Clean
—
—
92.7
88.7
86.9
80.5
97.0
93.7
95.9
94.5
94.0
82.5
76.5
89.4
57.8
PI-FGSM
—
—
32.4
21.2
23.5
30.0
69.3
54.6
66.5
62.4
48.9
43.4
34.7
44.3
94.0
S 2 I-FGSM
—
—
37.2
30.5
28.0
33.2
57.1
54.0
49.1
54.1
44.3
38.4
34.7
41.9
77.2
NCF
—
—
47.0
40.9
41.0
56.1
77.6
66.9
74.1
72.7
66.1
53.5
46.8
58.4
67.6
DiffAttack
—
—
37.5
37.9
35.3
34.5
47.8
45.7
40.2
44.0
39.0
36.6
35.3
39.4
65.4
Table 1: Top-1 accuracy (%, ↓ ) of the victim models and FID ( ↓ ) on the ImageNet-Compatible Dataset. Transfer-based attacks are averaged over all other models used as surrogates. Our attacks use Q queries per active step without guidance (—), with ATG at scale s (ATG s ), or with TSG spending Qc extra queries per step (TSG Qc ). The best result in each column is shown in red and the second best is underlined .
Attack
Queries
Acc.
FID
Latent-HSJA
360
37.9
67.5
720
39.4
66.0
1440
41.8
64.4
3600
41.3
61.6
7200
45.2
60.9
Latent-ZOsignSGD
360
20.8
59.6
Table 2: Comparison with decision-based Latent-HSJA on ResNet-50, with top-1 accuracy (%, ↓ ) and FID ( ↓ ). Queries are counted per image, i.e., (T+1)Q with Q=60 and Q=120 for Latent-ZOsignSGD. As in the original work, Latent-HSJA places no bound on the latent perturbation. Best in red , second best underlined .
Figure 3: Qualitative comparison with ResNet-50 as the victim and as the white-box surrogate of the transfer-based baselines.
Attack
Q
Guidance
Inc-
Inc-
Inc-
IncRes-
Avg.
FID
v3 adv
v3 ens3
v3 ens4
v2 ens
Clean
—
—
84.4
79.4
78.7
90.3
83.2
57.8
DiffAttack
—
—
42.6
40.9
40.9
51.2
43.9
65.4
ACA
—
—
35.4
32.6
33.2
40.4
35.4
64.8
APA-SG
—
—
24.5
24.1
24.2
31.3
26.0
65.2
APA-GC
—
—
14.9
16.1
15.5
19.6
16.5
72.0
Table 3: Top-1 accuracy (%, ↓ ) of four adversarially trained models and FID ( ↓ ). Transfer-based attacks are averaged over the nine surrogate models. Best in red , second best underlined .
Latent
ATG
TSG
ResNet-50
ViT-B
FID
✓
20.8
24.0
59.9
✓
85.2
88.8
59.5
✓
67.9
76.7
58.3
✓
✓
14.2
17.3
63.2
✓
✓
13.9
18.7
60.5
Table 4: Ablation of the components of Latent-ZOsignSGD at Q=60 , with ATG at s=1.5 and TSG at Qc=60 . We report the top-1 accuracy (%, ↓ ) of ResNet-50 and ViT-B and the FID ( ↓ ) averaged over both. Latent denotes the score-based latent perturbation. Best in red , second best underlined . Tables 1 and 4 report separate runs, values for identical configurations may therefore differ.
Figure 4: Parameter analysis of Latent-ZOsignSGD without guidance, varying one setting at a time from the default ε=0.1 , T=5 and Q=60 , shown in bold. In (d), TSG adds Qc condition queries per active step to Q=60 . Bars show the top-1 accuracy (%, ↓ ) and dots the FID ( ↓ ), both averaged over ResNet-50 and ViT-B.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Victim
Guidance
Queries
Victim acc.
FID
LPIPS
SSIM
Res50
TSG ( λ=0 )
665
12.8
59.9
0.112
0.683
λ=0.25
670
14.6
60.3
0.113
0.682
λ=0.5
670
13.8
61.2
0.117
0.678
λ=0.75
670
12.6
62.0
0.124
0.672
ATG ( λ=1 )
365
13.9
63.6
0.133
0.664
ATG + TSG
670
9.6
64.0
0.137
0.663
Appendix
Table 5: Top-1 accuracy (%, ↓ ) of the victim, FID ( ↓ ), LPIPS ( ↓ ), SSIM ( ↑ ) and number of victim queries per image when ATG and TSG are combined by Eq. ( 18 ), for Latent-ZOsignSGD with Q=60 , Qc=60 and s=1.5 .
Fixed-step
Alternating
Speed-up
ε
Res50
FID
Time
ε
Step
Res50
FID
Time
0.1
34.5
58.6
56.4
0.07
0.035
36.1
58.3
11.6
4.9 ×
0.15
20.9
58.9
46.5
0.1
0.05
21.6
59.8
10.3
4.5 ×
Appendix
Table 6: Top-1 accuracy (%, ↓ ) of ResNet-50, FID ( ↓ ) and attack time per image (s, ↓ ) of the fixed-step variant and of the alternating setting with similar accuracy, with the speed-up of alternating, for Latent-ZOsignSGD with Q=60 and no guidance. Times are measured on an NVIDIA L40 GPU.
Victim
Guidance
Variant
Victim acc.
FID
LPIPS
SSIM
Time
Res50
—
Alternating
21.8
59.7
0.108
0.683
6.4
Fixed-step
34.5
58.6
0.096
0.702
39.8
ATG 1.5
Alternating
13.7
62.9
0.133
0.664
6.3
Fixed-step
25.9
61.2
0.123
0.679
61.7
TSG 60
Alternating
14.5
60.3
0.111
0.683
13.8
Fixed-step
20.0
60.4
0.116
0.686
64.5
Appendix
Table 7: Top-1 accuracy (%, ↓ ) of the victim, FID ( ↓ ), LPIPS ( ↓ ), SSIM ( ↑ ) and attack time per image (s, ↓ ) of the alternating and fixed-step variants of Latent-ZOsignSGD with Q=60 and ε=0.1 . Alternating is averaged over three seeds. Times are measured on a Blackwell GPU for ResNet-50 and an L40 GPU for ViT-B.
Attack
Guidance
Queries
L40
Blackwell
Res50
ViT-B
Res50
PI-FGSM
—
—
0.09
0.10
0.04
S 2 I-FGSM
—
—
1.2
1.9
0.8
DiffAttack
—
—
18.3
19.0
10.9
ACA
—
—
115.3
117.2
63.2
APA-SG
—
—
87.3
89.0
47.8
Appendix
Table 8: Number of victim queries and attack time per image (s, ↓ ), excluding model loading. Transfer-based attacks use the model of each column as the surrogate. The Blackwell and ViT-B times of Latent-ZOsignSGD are averaged over three seeds.
Q=60
Q=60 , ATG 1.5
Q=60 , TSG 60
Q=120
Victim
Seeds
Tab. 1
Seeds
Tab. 1
Seeds
Tab. 1
Seeds
Tab. 1
Res50
21.8 ± 0.6
21.1
13.7 ± 0.9
14.4
14.5 ± 0.6
13.5
10.9 ± 0.6
10.3
VGG19
16.4 ± 0.9
16.8
11.0 ± 0.9
11.0
11.5 ± 0.4
11.4
8.5 ± 0.5
9.2
MobV2
18.1 ± 1.1
19.3
12.7 ± 0.5
11.9
12.2 ± 0.6
11.4
9.5 ± 0.3
9.7
IncV3
10.8 ± 0.3
10.8
7.5 ± 0.8
7.0
7.1 ± 0.3
6.7
5.0 ± 0.4
5.3
ConvNeXt
35.7 ± 0.9
34.3
26.6 ± 0.6
25.2
26.6 ± 0.6
27.1
22.3 ± 0.4
22.4
Appendix
Table 9: Top-1 accuracy (%, ↓ ) of the eleven victims, its average and FID ( ↓ ) of Latent-ZOsignSGD, as mean ± standard deviation over three seeds next to the results of Tab. 1 .
Attack
Q
Guidance
Full-reference
No-reference
PSNR ↑
SSIM ↑
MS-SSIM ↑
FSIM ↑
LPIPS ↓
DISTS ↓
TOPIQ-FR ↑
NIQE ↓
BRISQUE ↓
Clean
—
—
—
—
—
—
—
—
—
5.64
17.58
DiffAttack
—
—
22.51
0.664
0.888
0.835
0.143
0.155
0.613
5.83
18.00
ACA
—
—
17.96
0.565
0.727
0.726
0.386
0.259
0.352
7.52
26.47
APA-SG
—
—
19.48
0.650
0.805
0.785
0.250
0.197
0.433
6.16
26.90
APA-GC
—
—
21.09
0.667
0.853
0.813
0.220
0.203
0.481
5.50
24.40
Appendix
Table 10: Full-reference and no-reference image quality metrics of the adversarial examples on the ImageNet-Compatible dataset. Full-reference metrics compare each adversarial example with its clean image, and NIQE and BRISQUE are no-reference. Transfer-based attacks are averaged over their nine surrogates, and Latent-HSJA and our attacks over the eleven victims. Latent-HSJA uses 360 or 720 queries per image, as our attacks with Q=60 and Q=120 , and places no bound on the latent perturbation. † NatADiff synthesizes each example from the class label instead of editing the clean image, so its full-reference metrics compare it with a different image of the same class. Best in red , second best underlined .
Attack
Hyper-parameter
Value
General
maximum perturbation ε
0.1
maximum queries per active step Q
60, 120
batch size
1
NES [ 25 ]
fd_eta
0.05
lr
0.05
q
15
Appendix
Table 11: Hyper-parameter values of the latent score-based attacks.
Figure 5: Simplified example on a two-dimensional mixture of three Gaussians. (a) Density p(x) with the trajectories of (b)–(e). (b)–(e) Attacks on the same clean sample xori (circle), which is DDIM-inverted for 20 of 50 steps (solid) and reversed (dashed) with an attack before every step (cyan) under a per-step L∞ bound of 0.15. Background colors and dashed lines show the decision regions of the victim, grey lines the decision boundaries of the surrogate, arrows ∇xlogp(x∣yori) , and the star the mean of p(x∣yori) . The cross marks the final example and is filled when it fools the victim.
Figure 6: Extended qualitative comparison on twelve images with ResNet-50 as the victim. Transfer-based attacks use VGG19 as the surrogate, drawn at random from the eight models other than ResNet-50, and Latent-HSJA uses 360 queries per image, as Latent-NES with Q=60 .