mlsanityData to 14 Oct 2026

ShieldDiff: Suppressing Sexual Content Generation from Diffusion Models through Reinforcement Learning

arXiv 2410.05309 ↗First posted 4 Oct 2024cs.CVcited by 7

On the map: Diffusion models → Robustness, privacy and adversarial aspects

Abstract (arXiv)

With the advance of generative AI, the text-to-image (T2I) model has the ability to generate various contents. However, the generated contents cannot be fully controlled. There is a potential risk that T2I model can generate unsafe images with uncomfortable contents. In our work, we focus on eliminating the NSFW (not safe for work) content generation from T2I model while maintaining the high quality of generated images by fine-tuning the pre-trained diffusion model via reinforcement learning by optimizing the well-designed content-safe reward function. The proposed method leverages a customized reward function consisting of the CLIP (Contrastive Language-Image Pre-training) and nudity rewards to prune the nudity contents that adhere to the pret-rained model and keep the corresponding semantic meaning on the safe side. In this way, the T2I model is robust to unsafe adversarial prompts since unsafe visual representations are mitigated from latent space. Extensive experiments conducted on different datasets demonstrate the effectiveness of the proposed method in alleviating unsafe content generation while preserving the high-fidelity of benign images as well as images generated by unsafe prompts. We compare with five existing state-of-the-art (SOTA) methods and achieve competitive performance on sexual content removal and image quality retention. In terms of robustness, our method outperforms counterparts under the SOTA black-box attacking model. Furthermore, our constructed method can be a benchmark for anti-NSFW generation with semantically-relevant safe alignment.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Placed in Robustness, privacy and adversarial aspects, one of 14 directions in Diffusion models. Builds on 26 of its 44 references that are in the map. First posted on arXiv 4 Oct 2024.

Builds on

26 of 44 references.

Closest ancestors · 6

Same direction, newest first

  1. 2024SafeGen: Mitigating Sexually Explicit Content Generation in Text-to-Image Models10 Apr
  2. 2023SalUn: Empowering Machine Unlearning via Gradient-based Weight Saliency in Both Image Classification and Generation19 Oct
  3. 2023SneakyPrompt: Jailbreaking Text-to-image Generative Models20 May
  4. 2023Erasing Concepts from Diffusion Models13 Mar
  5. 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Models9 Nov
  6. 2022Red-Teaming the Stable Diffusion Safety Filter3 Oct

Other references · 20

  1. 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
  2. 2021High-Resolution Image Synthesis with Latent Diffusion Modelscited by 18,863
  3. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  4. 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,255
  5. 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,585
  6. 2023Adding Conditional Control to Text-to-Image Diffusion Modelscited by 5,503
  7. 2017Neural Discrete Representation Learningcited by 4,712
  8. 2022LAION-5B: An open large-scale dataset for training next generation image-text modelscited by 4,152
  9. 2021GLIDE: Towards Photorealistic Image Generation and Editing with Text-Guided Diffusion Modelscited by 3,614
  10. 2022Imagen Video: High Definition Video Generation with Diffusion Modelscited by 1,778
  11. 2020DiffWave: A Versatile Diffusion Model for Audio Synthesiscited by 1,354
  12. 2023Training Diffusion Models with Reinforcement Learningcited by 982
8 more
  1. 2021Vector-quantized Image Modeling with Improved VQGANcited by 658
  2. 2022DiffusionDB: A Large-scale Prompt Gallery Dataset for Text-to-Image Generative Modelscited by 379
  3. 2021Towards Understanding and Mitigating Social Biases in Language Modelscited by 296
  4. 2019Monte Carlo Gradient Estimation in Machine Learningcited by 283
  5. 2023Selective Amnesia: A Continual Learning Approach to Forgetting in Deep Generative Modelscited by 177
  6. 2022Pile of Law: Learning Responsible Data Filtering from the Law and a 256GB Open-Source Legal Datasetcited by 113
  7. 2023DiffCLIP: Leveraging Stable Diffusion for Language Grounded 3D Classificationcited by 23
  8. 2022Evaluating a Synthetic Image Dataset Generated with Stable Diffusioncited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 4; 2026: 2.

7 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Safe Image Generation via Reinforcement Learning
  2. 2026DTVI: Dual-Stage Textual and Visual Intervention for Safe Text-to-Image Generation
  3. 2026SafeDiffusion-R1: Online Reward Steering for Safe Diffusion Post-Training
  4. 2025NDM: A Noise-driven Detection and Mitigation Framework against Implicit Sexual Intentions in Text-to-Image Generation
  5. 2024Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimization
  6. 2026Test-Time Scaling for Safe Text-Guided Image Generation via Intermediate Clean Estimates
  7. 2025GenBreak: Red Teaming Text-to-Image Generators Using Large Language Models
  8. 2025Prompt-Based Safety Guidance Is Ineffective for Unlearned Text-to-Image Diffusion Models