Breaking the Shackles: How to Attack the Safety Guardrails of Black-Box Diffusion ModelsBreaking Free: How to Hack Safety Guardrails in Black-Box Diffusion Models!
The authors propose EvoSeed, which uses CMA-ES to optimize the initial seed vector of a diffusion model to generate natural adversarial examples in a black-box setting, with ASR up to 99.76% on EDM models (Table 1).
The attacker's goal is to generate natural adversarial examples that are misclassified by the classifier but do not affect human perception (unrestricted setting). Knowledge is black-box: only classifier output confidence is used as fitness, no gradients needed. Capability: control of the Conditional Diffusion Model's initial seed vector z (L∞ constraint ϵ) and condition c. The victim system is an image classifier, including safety classifiers (Q16, NudeNet-v2).
- Existing adversarial examples mostly rely on classifier white-box gradients or changing the image distribution; the authors focus on how to generate natural adversarial examples in a black-box setting that do not affect human perception, and note that these can be used to bypass safety classifiers to generate harmful content.
- Proposes EvoSeed: uses CMA-ES to optimize the initial seed vector of a conditional diffusion model under an L∞ constraint (ϵ), using the classifier's confidence for condition c as fitness, iterating until the generated image is misclassified, requiring only classifier outputs throughout.
- Quantitative experiments are conducted on CIFAR-10-like images: at ϵ=0.3, ASR for each diffusion-classifier combination is 94.05%–99.76% (Table 1); compared with SD-NAE, EvoSeed has higher ASR at each ϵ (Table 4); qualitatively, it is shown to bypass safety classifiers such as Q16 and NudeNet-v2.
- The authors state that they inherit the limitations of CMA-ES: once the seed vector exceeds (96,96,4), i.e., 36,864 values, optimization time becomes infeasible (Section 8). Quantitative experiments cover only CIFAR-10-like images and the EDM diffusion model; the paper does not report human perceptual evaluation or the number of repetitions.
- Evaluated models
- ViT-L/14ResNet-50Q16NudeNet-v2DeepFaceStandard Non-Robust [22]Corruptions Robust [23]L2 Robust [24]L∞ Robust [24]
- Benchmarks
- CIFAR-10-like images
- Metrics
- ASRFIDClip-IQAISSSIM
The researchers propose EvoSeed, an evolutionary strategy-based algorithmic framework that can generate photorealistic natural adversarial examples in a black-box setting to bypass the safety guardrails of diffusion models. Unlike existing methods that rely on white-box access or artificially alter the distribution of adversarial examples, this framework uses an auxiliary conditional diffusion model and a classifier model to optimize an initial seed vector with CMA-ES; after processing by the conditional diffusion model, it yields adversarial images that the classifier misclassifies. Experiments show that the generated adversarial images are of high quality; the authors state that this raises concerns about generated harmful content bypassing safety classifiers, and note that the research reveals the limitations of current safety mechanisms and the risk of image generation attacking classifier systems. Project website: https://shashankkotyan.github.io/EvoSeed。
Paper analysis
What problem does this paper attempt to solve?
The authors propose the black-box framework EvoSeed, which optimizes the initial seed vector of a diffusion model to generate natural adversarial examples that can bypass safety classifiers.
Core problem: how to generate, in a black-box setting, Natural Adversarial Samples that do not affect human perception but are misclassified by classifiers, including bypassing image safety classifiers.
- Problem setting: The authors point out that traditional adversarial examples (e.g., PGD, One-Pixel Attack) bear artificial perturbation traces and depend on restricted inputs, limiting their real-world applicability; whereas Natural Adversarial Examples [1] and Unrestricted Adversarial Examples [9] can substantially change an image while preserving human-perceived semantics.
- Shortcomings of existing methods: The authors state that existing generative adversarial example methods have one or more limitations — changing the generative distribution, relying on white-box classifier gradients, requiring training an additional model, or targeting only specific classifiers (Section 6).
- Core observation: The authors cite Poyuan et al. [10] stating that failure points in seed space are distributed throughout but mostly generate images unrelated to the condition; therefore EvoSeed searches within the L∞ neighborhood of a good initial seed vector z, making the problem non-trivial (Section 2).
- What the paper proposes: EvoSeed, a black-box algorithmic framework based on an evolutionary strategy (CMA-ES) that uses an auxiliary Conditional Diffusion Model and Classifier Model to generate natural adversarial examples; the authors state it is the first such framework based on an evolutionary strategy ("the first Evolution Strategy-based algorithmic framework", Section 1).
- Threat model:
- Goal: generate images that are misclassified by the classifier while preserving human perception and photorealism, including bypassing safety mechanisms to generate harmful content.
- Knowledge: black-box setting, using only classifier outputs F(x) as fitness, without requiring gradients.
- Capability: control the initial seed vector z of the Conditional Diffusion Model (perturbation η constrained by L∞ with ϵ) and the condition c.
- Victim systems: image classifiers, including object classification (ViT-L/14, ResNet-50) and safety classifiers (Q16, NudeNet-v2), DeepFace.
What related research exists?
Related work falls into three categories: classic perturbation attacks, natural/unrestricted adversarial examples, and generative adversarial examples; the baselines are SD-NAE and RandSeed.
Classic perturbation-based adversarial attacks
- Madry et al. [4] (PGD-L2/L∞), Chen et al. [7] (EAD) — white-box perturbation attacks under L2/L1 norm constraints.
- Su et al. [6] (One-Pixel Attack), Kotyan and Vargas [5], Chen et al. [8] (ZOO) — L0-constrained or black-box attacks.
- The authors state that the artificial nature and restricted input dependence of such samples limit their real-world applicability (Section 1).
Natural and unrestricted adversarial examples
- Hendrycks et al. [1] — proposed Natural Adversarial Examples; Song et al. [9] — proposed Unrestricted Adversarial Examples, training an AC-GAN first and then performing gradient search; this paper follows their definition (Appendix A).
- Xiao et al. [37] — generate adversarial examples via spatial deformation transformations; Shamsabadi et al. [38] (ColorFool) — LAB color space transformations.
- Poyuan et al. [10] — expose diffusion model vulnerability by randomly shifting the initial seed vector; the RandSeed baseline in this paper is based on their Random Shift.
Generative model-based adversarial examples
- Xiao et al. [31] (AdvGAN) — directly generate perturbations with a feedforward network; Jandial et al. [35] (AdvGAN++) improve on it.
- Chen et al. [32] (AdvDiffuser) — use a diffusion model to add adversarial perturbations to generated images to improve FID.
- The authors point out that these methods respectively have limitations of changing the distribution [37, 38], relying on white-box access [9, 32], relying on trained models [31, 9, 35], and targeting only specific classifiers [31, 35] (Section 6).
Baselines and benchmarks
- SD-NAE [27]: a white-box gradient attack on prompt embeddings, compared on ASR over 300 images generated by Nano-SD (Table 4).
- RandSeed: a random search baseline based on [10], compared over 1000 generated images (Table 7).
- Quantitative experiments use CIFAR-10-like images, with classifiers taken from RobustBench [22], Diffenderfer et al. [23], and Wang et al. [24].
The authors position EvoSeed as a black-box framework free of the above four limitations (Section 6).
How does the paper address this problem?
EvoSeed uses CMA-ES to optimize the initial seed vector of a diffusion model under an L∞ constraint, searching for adversarial seeds with classifier confidence as fitness.
Overall approach: formulate natural adversarial example generation as a black-box optimization problem over the initial seed vector of a diffusion model, using EvoSeed (CMA-ES) to iteratively search for a seed z′ that minimizes the classifier's confidence for condition c.
Problem Formulation
- The conditional diffusion model is defined as x = G(z, c), where z is sampled from N(µ, α²), and µ and α depend on the chosen model (Eq. 1).
- Adversarial example generation is defined as the optimization problem: minη F(G(z+η, c))c s.t. ‖η‖∞ ≤ ϵ (Eq. 4), i.e., minimizing the classifier's soft-label confidence for condition c, with the perturbation constrained within an L∞ ball around z.
- The authors state that the L∞ constraint is added because Poyuan et al. [10] showed that failure points in seed space mostly generate images unrelated to the condition, so the search must be near a good z (Section 2).
Three Components
- Conditional Diffusion Model G: takes the perturbed seed z′ as the initial state and generates an image aligned with condition c through denoising.
- Classifier Model F: outputs probabilities over K classes; its confidence for condition c serves as the fitness.
- CMA-ES Optimizer: implemented as Vanilla CMA-ES per Hansen and Auger [11], maintaining a covariance matrix, weighted mean, and step size.
Algorithm Flow (Algorithm 1)
- Sample an initial seed z from the standard normal distribution, and initialize CMA-ES with µ=z, σ=1, bounds=(−ϵ, ϵ).
- Each generation samples λ individuals, with perturbations clipped to the L∞ range; each individual is passed through G to generate an image and evaluated by F.
- If an individual makes argmax(logits) ≠ c, terminate early and return that image; otherwise, update CMA-ES using the logit for condition c as fitness.
- Iterate for at most τ=100 generations; λ = 4 + 3·log(n), where n is the number of seed vector parameters (Appendix B.2).
Hyperparameters and Settings
- Quantitative analysis uses ϵ ∈ {0.1, 0.2, 0.3}; qualitative analysis uses ϵ=0.5 (Appendix B.2).
- Quantitative experiments use a single RTX3090 24GiB; qualitative experiments use a single A100 80GiB (Appendix B.4).
- Compatibility check: images generated from random seeds achieve over 93% accuracy on each classifier (Table 5), confirming G and F are compatible.
Success Criterion
- Attack success is defined as the classifier's argmax prediction on the generated image not equaling condition c (Algorithm 1, line 9); ASR is the proportion of misclassified images (Section 5).
What experiments did the paper conduct?
Quantitative experiments on CIFAR-10-like images: at ϵ=0.3, ASR 94.05%–99.76%; qualitative demonstration bypasses safety and ethnicity classifiers.
Experimental Setup
- Classifiers under test: the quantitative part uses Standard Non-Robust [22], Corruptions Robust [23], L2 Robust [24], L∞ Robust [24]; the qualitative part uses ViT-L/14, ResNet-50 (objects), Q16 (suitability), NudeNet-v2 (nudity), DeepFace (ethnicity).
- Diffusion models: quantitative uses EDM-VP, EDM-VE [21]; qualitative uses SDXL-Turbo, SD-Turbo, PhotoReal 2.0; comparison experiments use Nano-SD.
- Data: the quantitative experiments select 10,000 pairs (initial seed vector, random target), requiring the generated images to be correctly classified by the classifier (Section 5); the task is CIFAR-10-like images.
- Metrics: ASR (misclassification proportion), FID, Clip-IQA; the Table 1 header also lists IS and SSIM, but the main text describes only FID and Clip-IQA when describing metrics.
- Baselines: SD-NAE (300 Nano-SD images), RandSeed (1000 images, Appendix C).
- Number of repetitions: not reported in the paper.
Main Results
According to Table 1 (ϵ=0.3, 10,000 seed pairs):
Swipe horizontally to read the table
Diffusion G Classifier F ASR (↑) FID (↓) Clip-IQA (↑) EDM-VP Standard Non-Robust 97.03% 12.34 0.3518 EDM-VP Corruptions Robust 94.15% 15.50 0.3514 EDM-VP L2 Robust 98.45% 17.55 0.3504 EDM-VP L∞ Robust 99.76% 16.57 0.3506 EDM-VE Standard Non-Robust 96.79% 12.10 0.3533 EDM-VE Corruptions Robust 94.05% 15.48 0.3522 EDM-VE L2 Robust 98.52% 17.51 0.3504 EDM-VE L∞ Robust 99.67% 16.34 0.3507 - The authors state that traditional robust classifiers (L2/L∞ Robust) are instead more easily misclassified, and speculate that their training distribution is slightly shifted, based on marginal changes in FID and IS (Section 5.1).
- The authors state that EDM-VP and EDM-VE perform comparably, with EDM-VP finding slightly more adversarial examples and EDM-VE producing slightly higher image quality (Section 5.1).
Effect of the ϵ Constraint (Table 2)
- What was tested: ϵ ∈ {0.1, 0.2} compared with ϵ=0.3. At ϵ=0.2, ASR is 87.46%–97.98%; at ϵ=0.1 it drops to 67.86%–85.56% (across two diffusion models and four classifiers).
- Results: the authors state that at ϵ=0.3, EvoSeed's ASR exceeds 92% across all diffusion and classifier combinations, with a slight sacrifice in image quality (Section 5.2).
Transferability (Table 3)
- What was tested: using adversarial examples generated with one classifier to attack other classifiers (EDM-VP/EDM-VE; the ϵ setting is not separately stated in that section of the paper).
- Results: the diagonal is 100.00% (the target is the generating classifier itself); the authors state that samples generated by L2 Robust have the highest transferability, about 60% across classifiers, with ASR transferring to L∞ Robust of 73.60% (EDM-VP)/73.46% (EDM-VE); samples generated by Standard Non-Robust have the lowest transferability (Section 5.3).
Comparison with the White-Box Attack SD-NAE (Table 4)
- What was tested: on 300 images generated by Nano-SD, comparing ASR on ResNet-50 and ViT-L/14.
- Results: EvoSeed ϵ=0.3 achieves 63.67% on ResNet-50 and 54.67% on ViT-L/14; SD-NAE at each λ (0.0–0.3) achieves 36.20%–42.00% on ResNet-50 and 22.90%–28.00% on ViT-L/14. EvoSeed ϵ=0.1 achieves 35.50% on ResNet-50, lower than SD-NAE λ=0.0's 36.20%.
- Authors' interpretation: the authors state that EvoSeed outperforms SD-NAE under all hyperparameters (Section 5.4); in Table 4, the ϵ=0.1 vs. ResNet-50 cell is a counterexample.
Qualitative Analysis: Bypassing Safety and Attribute Classifiers (Figures 3–6)
- Object classification (Figure 3): images generated by SD-Turbo/SDXL-Turbo are misclassified by ViT-L/14 and ResNet-50, e.g., goldfish classified as Milk Can, ambulance classified as Pole; the authors state the images remain aligned with the condition, unlike [19, 10] which would break alignment.
- Safety classification (Figure 4): images generated with gore and nudity conditions; Q16 and NudeNet-v2 misclassify the adversarial images from NSFW to SFW; the authors state this highlights concerns about post-generation checking mechanisms.
- Ethnicity classification (Figure 5): portraits generated by PhotoReal 2.0; DeepFace misclassifies ethnicity (e.g., Asian→White).
- Gender misalignment cases (Figure 6): the authors state the diffusion model is not aligned with the gender in the condition, and EvoSeed can misalign images from some conditions while maintaining photo-level quality.
Other Ablations and Analyses
- Generation process (Figure 7): under the volcano condition, classifier confidence drops from 0.8142 at generation 0 to 0.01745 at generation 90, and is finally misclassified as Parachute (confidence 0.02).
- RandSeed comparison (Table 7, ϵ=0.1, 1000 images): ASR 40.30%–57.10%, FID 109.92–126.94; the authors state EvoSeed finds more and higher-quality adversarial examples, while RandSeed images are distorted and whitish (Figure 8).
- Change with generations (Figure 12): the authors state that at ϵ=0.1 the curve has not saturated, and increasing generations may further improve attack performance; the specific values in the figure are unreadable in the text conversion.
- Resource consumption (Table 6): lists the GPU memory requirements for a single image and λ images for each model, e.g., SDXL-Turbo single image 9.30 GiB.
What are some points that can be further explored?
The authors only point out the scalability limitation inherited from CMA-ES; quantitative coverage is limited to CIFAR-10-like images and EDM models.
Limitations and future directions noted by the authors
- CMA-ES scalability (Section 8): The authors state that EvoSeed inherits the optimization limitations of CMA-ES; in the experiments, a seed vector of (96, 96, 4), totaling 36,864 values, can be optimized within a reasonable time, but larger ones make optimization time infeasible.
- Two-sided social impact (Section 8): The authors state that the method could be maliciously used to disrupt real-world applications and generate harmful content; on the other hand, it can generate edge cases for classifiers, helping understand decision boundaries and improve generalization and robustness.
- The paper has no dedicated Future Work section and lists no other future directions.
Scope of experiments
- Quantitative experiments cover only CIFAR-10-like images, with diffusion models EDM-VP and EDM-VE as two variants, and four CIFAR-10 classifiers (Section 5).
- Qualitative experiments cover four task types: objects, suitability, nudity, and ethnicity, with diffusion models SDXL-Turbo, SD-Turbo, and PhotoReal 2.0; only example images are shown, and no quantitative ASR is given for these tasks (Section 4).
- The quantitative sample size is 10,000 seed-target pairs; the SD-NAE comparison uses 300 images, and the RandSeed comparison uses 1000 images; the paper does not report the number of repetitions or variance.
- Image quality is measured with FID and Clip-IQA; the paper does not report human perceptual evaluation to verify the claim of "not affecting human perception."
- The paper does not report the number of queries or time cost of the attack (only Table 6 gives memory requirements).
Summarize the main content of the paper
EvoSeed uses CMA-ES black-box optimization of diffusion model seed vectors to generate natural adversarial examples, with ASR up to 99.76% on EDM.
EvoSeed is a black-box adversarial attack framework based on evolutionary strategies, generating photo-level natural adversarial examples against image classifiers (including safety classifiers).
- Problem: the authors believe traditional adversarial examples rely on white-box gradients or change the image distribution, limiting real-world applicability; a method is needed that can generate adversarial examples in a black-box setting without affecting human perception.
- Method: the attack is formalized as minimizing the classifier's confidence in condition c within the L∞ neighborhood (ϵ) of the initial seed vector z, iteratively optimized with CMA-ES, requiring only classifier outputs as fitness, with at most 100 generations and early termination upon finding a misclassification.
- Main results: on CIFAR-10-like images with 10,000 seed pairs, at ϵ=0.3, EDM-VP/EDM-VE achieve ASR of 94.05%–99.76% against four classifiers, highest on the L∞ Robust classifier (Table 1); the authors state robust classifiers are instead more easily attacked.
- Comparison: on 300 Nano-SD images, EvoSeed ϵ=0.3 achieves ASR of 63.67% on ResNet-50, higher than SD-NAE's 36.20%–42.00% across λ settings (Table 4); but at ϵ=0.1, EvoSeed achieves 35.50% on ResNet-50, lower than SD-NAE λ=0.0's 36.20%.
- Safety implications: qualitative examples show Q16 and NudeNet-v2 misclassify inappropriate images generated by EvoSeed as SFW (Figure 4); the authors state this exposes the limitations of post-generation checking mechanisms.
- Conclusion and limitations: the authors state EvoSeed provides a new avenue for understanding the limitations of classifier robustness; they also acknowledge the scalability limitation inherited from CMA-ES, where optimization time becomes infeasible once the seed vector exceeds 36,864 values (Section 8).