UniNDM: A Unified Noise-driven Detection and Mitigation Framework Against Sexual Content in Text-to-Image Generation

📅 2026-07-18
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the vulnerability of current text-to-image diffusion models to implicit sexual prompts that induce inappropriate content generation, a challenge inadequately mitigated by existing safety mechanisms due to their inability to recognize diverse latent malicious intents. The authors propose UniNDM, a novel framework that, for the first time, reveals the semantic separability of early-stage noise between benign and harmful generations. Leveraging this insight, UniNDM introduces a lightweight noise detector, integrates a large language model to dynamically generate context-aware negative prompts, and suppresses attention to sensitive tokens by optimizing the initial noise. Notably, the approach requires no retraining and seamlessly extends to DiT architectures, enabling unified cross-model protection. Experiments demonstrate that UniNDM significantly outperforms state-of-the-art methods such as SLD, UCE, and Safree on both U-Net and DiT backbones, achieving high-precision detection and effective content suppression under natural and adversarial conditions with minimal computational overhead.
📝 Abstract
Despite the impressive generative capabilities of text-to-image diffusion models, they remain vulnerable to implicit sexual prompts, where subtle cues disguised as benign terms or adversarial tokens unexpectedly generate the inappropriate content due to model biases or latent correlations in training data. Existing safety mechanisms face fundamental limitations: detection methods primarily identify explicit content and fail to capture implicit malicious intent, while mitigation approaches rely on static negative prompts inadequate for diverse implicit scenarios. To address these challenges, we propose UniNDM, a unified noise-driven framework that rethinks safety mechanisms through the lens of noise dynamics in diffusion processes. Our key insight is that early-stage predicted noise exhibits inherent separability between normal and sexually explicit content, which we theoretically demonstrates quadratically increasing semantic concentration with timestep. Leveraging this property, we develop a lightweight noise-based detector achieving superior accuracy with virtually no computational overhead. For mitigation, we introduce noise-enhanced adaptive negative guidance: dynamically generating context-specific negative prompts via large language models to handle diverse implicit content, while optimizing initial noise by suppressing attention concentration on explicit tokens to provide comprehensive protection. Besides the U-Net-based diffusion models, we further extend our framework to emerging Diffusion Transformer architectures through region-constrained semantic guidance tailored for their unified multimodal attention. Comprehensive experiments across U-Net models and DiT models on both natural and adversarial datasets demonstrate substantial improvements over state-of-the-art methods, including SLD, UCE, Safree, etc. Our code is publicly available at https://github.com/Aries-iai/UniNDM.
Problem

Research questions and friction points this paper is trying to address.

implicit sexual content
text-to-image generation
safety detection
adversarial prompts
diffusion models
Innovation

Methods, ideas, or system contributions that make the work stand out.

noise-driven detection
adaptive negative prompting
diffusion models safety
implicit sexual content mitigation
Diffusion Transformer
🔎 Similar Papers
No similar papers found.