arXiv:2604.07879cs.CVcs.AI2026-04

提出轻量级生成中安全检测方法,提前识别扩散模型输出的不适宜内容。

FlowGuard: Towards Lightweight In-Generation Safety Detection for Diffusion Models via Linear Latent Decoding

  • 通过线性潜空间解码,在生成过程中检测中间图像的安全性。
  • 相比现有方法,F1分数提升超30%,峰值显存降低97%以上。
  • 适合需要实时安全过滤的生成式AI系统开发者使用。

基于扩散模型的图像生成技术快速发展,但存在生成不适宜工作内容(NSFW)的安全风险。现有检测方法多在生成前或生成后进行:生成前依赖文本提示,但提示安全与图像安全间存在差距;生成后对最终输出分类,却不适用于中间噪声图像。为此,我们提出FlowGuard,一种跨模型的生成中检测框架,可检查去噪过程中的中间步骤。该方法在潜空间扩散模型中尤为挑战,因早期噪声掩盖了视觉信号。FlowGuard采用新颖的线性潜空间解码近似,并结合课程学习稳定训练过程。通过早期检测不安全内容,可减少不必要的扩散步骤,从而降低计算开销。在涵盖九种扩散模型主干的跨模型基准测试中,FlowGuard在分布内与分布外设置下均表现优异,相比现有方法F1分数提升超30%,并实现显著效率提升:峰值GPU内存需求降低超过97%,投影时间从8.1秒降至0.2秒。

原文摘要 · Abstract (English)

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.

扩散模型安全检测轻量化生成中

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。