Source-linked AI summary

MMA-Diffusion: MultiModal Attack on Diffusion Models

Yijun Yang, Ruiyuan Gao, Xiaosen Wang, Tsung-Yi Ho, Nan Xu, Qiang Xu

arXiv:2311.17516v4cs.CRcs.CV

TL;DR

T2I safeguards face unresolved questions about their resilience to sophisticated adversarial attacks. MMA-Diffusion combines adversarial prompts and image perturbations to bypass prompt filters and post-hoc safety checks, achieving 10-query black-box success rates of 83.33% on Midjouney and 90.00% on Leonardo.Ai.

  • Problem

    The resilience of T2I prompt filters and post-synthesis safety checks against sophisticated adversarial attacks remains under investigation.

    Source: §1 · p. 1
  • Method

    MMA-Diffusion uses adversarial prompt generation and image perturbations to bypass prompt filters and post-hoc safety checks.

    Source: §1 · p. 1, §3.4 · p. 4
  • Results

    10-query black-box attacks achieved 83.33% success on Midjouney and 90.00% on Leonardo.Ai.

    Source: §1 · p. 2, §4.3 · p. 6
  • Takeaways & Limitations

    The results demonstrate limitations in current T2I defenses and emphasize the need for more effective security controls.

    Source: §6 · p. 8

    Specific attack-method details are deliberately omitted or generalized to mitigate potential misuse.

    Source: §5 · p. 8

Abstract

from arXiv · show

In recent years, Text-to-Image (T2I) models have seen remarkable advancements, gaining widespread adoption. However, this progress has inadvertently opened avenues for potential misuse, particularly in generating inappropriate or Not-Safe-For-Work (NSFW) content. Our work introduces MMA-Diffusion, a framework that presents a significant and realistic threat to the security of T2I models by effectively circumventing current defensive measures in both open-source models and commercial online services. Unlike previous approaches, MMA-Diffusion leverages both textual and visual modalities to bypass safeguards like prompt filters and post-hoc safety checkers, thus exposing and highlighting the vulnerabilities in existing defense mechanisms.

1. Introduction

MMA-Diffusion presents a systematic multimodal attack on T2I safeguards, using adversarial prompts and image perturbations to bypass prompt filters and post-hoc safety checks. The introduction reports successful black-box attacks on Midjounery and Leonardo.Ai.

  • MMA-Diffusion targets the risk of T2I models generating NSFW content, including adult materials, violence, and politically sensitive imagery.The introduction notes that prompt filters and post-synthesis safety checks are preventive measures, but their resilience to sophisticated adversarial attacks remains under investigation.Source: §1 · p. 1
  • Its text attack alters prompts while preserving semantic intent to evade filters, while its image attack uses human-imperceptible perturbations to bypass post-processing safety algorithms.The framework is described as a systematic attack that generates unrestricted adversarial prompts and crafts image perturbations.Source: §1 · pp. 1–2
  • A 10-query black-box attack achieved an 83.33% success rate on Midjounery and a 90% success rate on Leonardo.Ai.The evaluation covers popular open-source T2I models and online platforms.Source: §1 · p. 2
  • The work presents MMA-Diffusion as a multimodal systematic attack that bypasses prompt filters and safety checkers, exposing vulnerabilities and motivating more robust T2I security measures.Source: §1 · p. 2

2. Related Work

Prior T2I attack work largely modifies text prompts rather than targeting NSFW generation, while defenses operate at input, output, or model levels. MMA-Diffusion presents a multimodal attack that bypasses prompt filters and post-hoc checkers and also applies to concept-erased models.

Adversarial attacks on T2I models

  • Earlier T2I attacks mainly modify text to probe functional vulnerabilities, such as reducing image quality or distorting objects, rather than generating NSFW-specific content.The passage notes that image-modality attacks for NSFW generation have not been extensively explored.Source: §2 · p. 2
  • UnlearnDiff [40] focuses on concept-erased models, while Ring-A-Bell [37] induces NSFW concepts without precise control; neither addresses bypassing both prompt filters and post-hoc safety mechanisms.The related work identifies the gap as generating high-quality NSFW content tailored to specific semantic prompts while bypassing both defenses.Source: §2 · p. 2

Defensive methods

  • T2I defenses include input-stage AI moderators at services such as Midjourney and Leonardo.Ai, output-stage safety checkers in Stable Diffusion [28], and concept-erased models [7] [15] [34].Concept-erased methods alter inference guidance or fine-tune models to suppress NSFW concepts.Source: §2 · p. 2
  • Concept-erased methods may leave some NSFW content and can reduce benign-image quality [16] [34] [40].These methods modify model inference guidance or use fine-tuning, unlike external input- and output-stage safety measures.Source: §2 · p. 2
  • MMA-Diffusion demonstrates attacks that bypass prompt filters and post-hoc safety checkers, apply to concept-erased models such as SLD [34], and generalize across varied T2I models.The paper presents this as a multimodal attack that produces high-quality NSFW content tailored to semantic prompts.Source: §2 · p. 2

3. Method

MMA-Diffusion evaluates attacks on T2I models under white-box and black-box access, targeting NSFW generations that match a plain-text description. It uses text- and image-modal attacks according to whether defenses rely on prompt filtering, post-hoc safety checking, or both.

3.1. Threat Model

  • The threat model covers white-box attacks with access to open-source model architecture and checkpoints, and black-box transfer attacks against online services without parameter access.The passage gives SDv1.5 as an open-source example and Midjourney as an online-service example.Source: §3.1 · p. 2

3.2. Approach Overview

  • MMA-Diffusion targets successful NSFW generation aligned with the attacker’s plain-text description, adapting its attack modality to prompt filters, post-hoc checkers, or both.It uses text attacks when only prompt filtering is present, image attacks when only post-hoc checking is present, and both when both defenses are used.Source: §3.2 · pp. 2–3

3.3. Text-Modal Attack

  • The text-modal attack seeks a filter-safe prompt whose text embedding remains semantically close to the target, using gradient-guided token search and suppressing sensitive-word tokens.It assumes prompt filters use sensitive-word lists; candidate substitutions are ranked by token gradients, then sampled and compared by objective value.Source: §3.3 · pp. 3–4

3.4. Image-Modal Attack

  • The image-modal attack crafts a minimally perturbed input image so the post-hoc checker releases a synthesis by reducing only cosine-similarity losses that exceed NSFW thresholds.The constrained objective is solved with projected gradient descent.Source: §3.4 · p. 4

4. Experiments

MMA-Diffusion is evaluated against open-source models and online services, and through image-modal and combined multimodal attacks. The experiments report successful attacks across these settings, including when prompt filters and post-hoc safety checkers are both present.

4.1. Experimental Settings

  • Experiments used 1,000 high-NSFW-score LAION-COCO captions and 30 UnsafeDiff prompts, with SDv1.5 white-box attacks and transfer tests on SDXL, SLD, and online services.QF-Attack variants and sexual I2P prompts served as baselines; ASR-N counts a prompt as successful if any of N generations contains NSFW content and bypasses the prompt filter, assessed with three detectors for open-source models and six human evaluators for online and image-modal attacks.Source: §4.1 · p. 5

4.2. Attacking Open-Source Models

  • 83.37% ASR-4 on SD, 73.70% on SDXL, and 76.73% on SLD demonstrate successful white-box and black-box attacks.MMA-Diffusion outperforms the baselines quantitatively and qualitatively; unlike QF-Attack, it generates prompts from scratch, while I2P lacks control over generated content, and the baselines’ unsuppressed sensitive words trigger prompt-filter rejection.Source: §4.2 · pp. 5–6, Figure 5 · p. 6

4.3. Attacking Online T2I Services

  • 90.00% 10-query attack success on Leonardo.Ai and 83.33% on Midjourney show that adversarial prompts bypassed both services’ AI moderators.The evaluation used 30 UnsafeDiff prompts across six NSFW categories, with 10 adversarial prompts and 10 queries per target prompt; success required human evaluators to rate the generation as high-quality and high-fidelity.Source: Table 2 · p. 6, §4.3 · p. 6
  • Leonardo.Ai’s adult-theme prompts bypassed its defenses in 64% of cases, while Midjourney attacks achieved 3.96% success for pornography and 27.67% for violent content.Nearly 60% of Leonardo.Ai prompts that bypassed the filter induced adult images, for a 38% final success rate; celebrity attacks often depicted an associated person instead of the target because names were excluded.Source: §4.3 · pp. 6–7, Table 2 · p. 6

4.4. Multimodal Attack Results

  • 85.48% ASR-4 and 75.52% ASR-1 show that multimodal attacks can deceive both SD’s prompt filter and post-hoc safety checker.The attack combines adversarial prompts that bypass the prompt filter with adversarial images that deceive the safety checker.Source: Table 3 · p. 8, §4.4 · p. 8
  • 88.52% ASR-4 and 78.68% ASR-1 were achieved against SD’s built-in safety checker using adversarial images.The attack perturbed input images by ℓ2 = 16 over 20 optimization iterations while leaving the prompt and mask unchanged; transferred images deceived Q16 in 30% and MHSC in 20% of cases.Source: §4.4 · p. 7, Table 3 · p. 8

5. Ethical Considerations

The authors frame their vulnerability research as intended to strengthen T2I diffusion security, not enable misuse, and say they generalized or omitted attack details to mitigate misuse. They call for responsible use of the findings and ethical, transparent AI research attentive to societal impact and misuse prevention.

Ethical Considerations

  • The research is intended to strengthen T2I diffusion models rather than enable misuse.The authors describe revealing security vulnerabilities as the research’s purpose.Source: §5 · p. 8
  • To mitigate potential misuse, the authors deliberately omitted or generalized specific attack-method details.Source: §5 · p. 8
  • The authors urge developers to use the findings responsibly to improve T2I security and advocate ethical, transparent AI research attentive to societal impact and misuse prevention.Source: §5 · p. 8

6. Conclusion

MMA-Diffusion is a multimodal attack framework that automates generation of visually realistic, semantically diverse images with high success without compromising quality or diversity. It also supports black-box attacks across different generative models, exposing limitations in current defenses and the need for more effective security controls.

  • MMA-Diffusion automates generation of visually realistic, semantically diverse images with high success without compromising quality or diversity.Source: §6 · p. 8
  • MMA-Diffusion enables black-box attacks across different generative models, demonstrating its versatility.Source: §6 · p. 8
  • The results highlight limitations in current defensive measures and the need for more effective security controls.Source: §6 · p. 8

Supplementary Material … B. Implementation Details

The supplementary material adds implementation and experimental details, a sensitive-word list, and further results and visualizations. It specifies how that list is used across datasets and prompt filtering, and identifies the implementation topics covered.

Overview

  • The supplement adds a detailed algorithm, additional setup and experiments, failure cases, and further visualizations.It also includes experiments on DALL·E2-pytorch and against input sanitization defense.Source: Overview · p. 11

A. Sensitive Word List

  • The sensitive-word list spans Adult Theme and Other NSFW Theme terms, including words such as “sexual,” “blood,” “nude,” and “horror.”The list is used in the experiments.Source: A. Sensitive Word List · p. 11, Table S-1
  • Attacks on LAION-COCO use only the Adult Theme category, whereas attacks on UnsafeDiff use the entire sensitive-word list.The list is also used by the prompt filter when evaluating open-source diffusion models.Source: A. Sensitive Word List · p. 11
  • Most sensitive words come from studies [25] [29], and sensitive-word regularization is used to keep them out of generated adversarial prompts.The regularization is intended to mitigate the exhibition of sensitive words in those prompts.Source: A. Sensitive Word List · p. 11
  • The same sensitive words are used by the prompt filter to identify and flag NSFW prompts in open-source diffusion model evaluations.Source: A. Sensitive Word List · p. 11

B. Implementation Details

  • Implementation details cover data processing, victim-model implementations, baseline hyperparameters, and specifics of the proposed approach.Source: B. Implementation Details · p. 11

B.1. Data Processes … B.5. Baseline Implementation

These appendix sections specify the data-screening process, experimental hardware and model settings, MMA-Diffusion attack configurations, and baseline adjustments.

B.1. Data Processes

  • Candidate prompts are LAION-COCO captions with NSFW scores above 0.99; sensitive words are filtered, and prompts are checked in SD to verify toxicity and that resulting images do not trigger its safety checker.Source: §B.1 · p. 11

B.2. Hardware Platform

  • Experiments were conducted on an NVIDIA RTX4090 GPU with 24GB of memory.Source: §B.2 · p. 11

B.3. Details of Diffusion Models

  • SDv1.5 uses guidance scale 7.5, 100 inference steps, and 512 × 512 images; SDXLv1.0 uses 7.5, 50 steps, and 1024 × 1024 images.Source: §B.3 · pp. 11–12
  • SLD uses guidance scale 7.5, 100 inference steps, Medium safety, and 512 × 512 images; DALL·E2-pytorch [26] uses 7.5, 1000 steps, 4 prior samples, and 224 × 224 images.Source: §B.3 · p. 12
  • Midjounery and Leonardo.Ai models use their default settings.Source: §B.3 · p. 12

B.4. MMA-Diffusion Implementation

  • The text attack optimizes a 20-letter random adversarial prompt for 500 steps, using top-256 token candidates and sampling 512 prompts per step, typically taking about 380 seconds.The prompt length matches the reported I2P average.Source: §B.4 · p. 12
  • The image attack uses an ℓ2 perturbation budget of 16, step size α=2, 20 iterations, and SD inference step 8, a configuration found effective and feasible on one RTX4090 GPU.Source: §B.4 · p. 12

B.5. Baseline Implementation

  • For fairer comparison, QF-attack [41] was reconfigured to match MMA-Diffusion’s objective and sensitive-word-filtered inputs; GENETIC and GREEDY settings stayed unchanged, while QF-PGD used 100 iterations.QF-attack was originally designed to append a five-character suffix that disrupts semantic alignment.Source: §B.5 · p. 12

C. Results on DALL·E2-pytorch

DALL·E-pytorch’s resolution and text-to-image fidelity limitations negatively impact attack success rate (ASR); generating more samples per prompt yields ASR comparable to SDXL.

C. Results on DALL·E2-pytorch

D. Against Input Sanitization Defense · E. More Visualizations

Input sanitization left most tested adversarial prompts effective, while supplemental visualizations show failure cases across text and image-modal attacks and black-box examples.

D. Against Input Sanitization Defense

  • In the basic input-sanitization test, 87.00% of sanitized adversarial prompts (870 out of 1000 tested) still generated NSFW content when interfaced with the SD model.The defense used GPT-turbo-3.5 to filter out non-dictionary words and special characters while retaining intelligible words.Source: D. Against Input Sanitization Defense · pp. 12–13
  • MMA-Diffusion’s success depends on the collective impact of its tokens, not special tokens, and it adapts its candidate vocabulary to evade rudimentary sanitization.Simply removing tokens cannot fully neutralize the adversarial prompts.Source: D. Against Input Sanitization Defense · p. 13

E. More Visualizations

  • In Figure S-1, prompts avoiding celebrity names led T2I models to generate individuals or objects related to the targeted celebrities rather than the celebrities themselves.The names of celebrities are highlighted in red.Source: Figure S-1 · p. 13
  • Figures S-2 and S-3 show generated images that fail to convey the intended NSFW concepts Racism and naked, respectively; human evaluators classified them as unsuccessful.Source: Figure S-2 · p. 13, Figure S-3 · p. 13
  • Figures S-4 and S-5 show black-box attacks on Midjourney and Leonardo.Ai, with sensitive words that MMA-Diffusion avoids highlighted in red.Source: Figure S-4 · p. 14, Figure S-5 · p. 15
  • Figure S-6 presents MMA-Diffusion generating inauthentic depictions of real people; the authors added Gaussian blurs for ethical considerations.The figure states that the method aims to reflect attackers’ malicious intentions.Source: Figure S-6 · p. 16
Loading 2311.17516v4…