FlowGuard: Towards Lightweight In-Generation Safety Detection for Diffusion Models via Linear Latent Decoding
On the map: Diffusion models → Robustness, privacy and adversarial aspects
Abstract (arXiv)
Diffusion-based image generation models have advanced rapidly but pose a safety risk due to their potential to generate Not-Safe-For-Work (NSFW) content. Existing NSFW detection methods mainly operate either before or after image generation. Pre-generation methods rely on text prompts and struggle with the gap between prompt safety and image safety. Post-generation methods apply classifiers to final outputs, but they are poorly suited to intermediate noisy images. To address this, we introduce FlowGuard, a cross-model in-generation detection framework that inspects intermediate denoising steps. This is particularly challenging in latent diffusion, where early-stage noise obscures visual signals. FlowGuard employs a novel linear approximation for latent decoding and leverages a curriculum learning approach to stabilize training. By detecting unsafe content early, FlowGuard reduces unnecessary diffusion steps to cut computational costs. Our cross-model benchmark spanning nine diffusion-based backbones shows the effectiveness of FlowGuard for in-generation NSFW detection in both in-distribution and out-of-distribution settings, outperforming existing methods by over 30% in F1 score while delivering transformative efficiency gains, including slashing peak GPU memory demand by over 97% and projection time from 8.1 seconds to 0.2 seconds compared to standard VAE decoding.
Key facts. Cited by 2 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 19 of its 34 references that are in the map. First posted on arXiv 9 Apr 2026.
Builds on
19 of 34 references.
Closest ancestors · 6
Same direction, newest first
- 2025Wukong Framework for Not Safe For Work Detection in Text-to-Image systems1 Aug
- 2025Detect-and-Guide: Self-regulation of Diffusion Models for Safe Text-to-Image Generation via Guideline Token Optimization19 Mar
- 2024SAFREE: Training-Free and Adaptive Guard for Safe Text-to-Image And Video Generation16 Oct
- 2023Prompting4Debugging: Red-Teaming Text-to-Image Diffusion Models by Finding Problematic Prompts12 Sep
- 2023SneakyPrompt: Jailbreaking Text-to-image Generative Models20 May
- 2022Safe Latent Diffusion: Mitigating Inappropriate Degeneration in Diffusion Models9 Nov
Other references · 13
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,744
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2020Denoising Diffusion Probabilistic Modelscited by 21,076
- 2020Score-Based Generative Modeling through Stochastic Differential Equationscited by 9,122
- 2022Photorealistic Text-to-Image Diffusion Models with Deep Language Understandingcited by 6,355
- 2022Generative Adversarial Networkscited by 5,627
- 2016SGDR: Stochastic Gradient Descent with Warm Restartscited by 5,045
- 2023SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesiscited by 4,356
- 2024Scaling Rectified Flow Transformers for High-Resolution Image Synthesiscited by 4,181
- 2025FLUX.1 Kontext: Flow Matching for In-Context Image Generation and Editing in Latent Spacecited by 1,006
- 2019An Introduction to Variational Autoencoderscited by 1,000
- 2024LlavaGuard: An Open VLM-based Framework for Safeguarding Vision Datasets and Modelscited by 52
1 more
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2025Seeing It Before It Happens: In-Generation NSFW Detection for Diffusion-Based Text-to-Image Models
- 2026Disciplined Diffusion: Text-to-Image Diffusion Model against NSFW Generation
- 2026Test-Time Scaling for Safe Text-Guided Image Generation via Intermediate Clean Estimates
- 2023Diffusion Noise Feature: Accurate and Fast Generated Image Detection
- 2026Safe Image Generation via Reinforcement Learning
- 2025Towards SFW sampling for diffusion models via external conditioning
- 2024DiffGuard: Text-Based Safety Checker for Diffusion Models
- 2025SC-Pro: Training-Free Framework for Defending Unsafe Image Synthesis Attack