arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.00591cs.CVcs.AIcs.CR
收藏

Wukong框架用于文本到图像系统中的不安全内容检测

Wukong Framework for Not Safe For Work Detection in Text-to-Image systems

Nanyang Technological University(南洋理工大学)

Mingrui Liu, Sixiao Zhang, Cheng Long

AI总结:

Wukong通过利用扩散过程早期的去噪步骤和U-Net的预训练交叉注意力参数,实现高效的不安全内容检测,优于传统文本和图像过滤方法。

摘要:

文本到图像(T2I)生成是一种流行的人工智能生成内容(AIGC)技术,能够实现多样化的图像合成。然而,某些输出可能包含不安全内容(如暴力),这会违反社区指南。检测不安全内容的效率和准确性,即外部防护,至关重要。现有的外部防护措施分为两种类型:文本过滤器,通过分析用户提示来检测,但忽略了T2I模型特定的变化,容易受到对抗性攻击;以及图像过滤器,通过分析最终生成的图像来检测,但计算成本高且引入延迟。扩散模型是现代T2I系统如Stable Diffusion的基础,通过迭代去噪使用U-Net架构,包含ResNet和Transformer块。我们观察到:(1)早期去噪步骤定义了图像的语义布局,(2)U-Net中的交叉注意力层对于对齐文本和图像区域至关重要。基于这些见解,我们提出了Wukong,一个基于Transformer的不安全内容检测框架,利用早期去噪步骤的中间输出,并重用U-Net预训练的交叉注意力参数。Wukong在扩散过程中运行,使其能够在不等待完整图像生成的情况下进行早期检测。我们还引入了一个包含提示、种子和图像特定不安全标签的新数据集,并在该数据集和两个公开基准上评估Wukong。结果表明,Wukong在文本过滤器上显著优于文本过滤器,并在图像过滤器的准确性上具有可比性,同时效率远高于图像过滤器。

英文摘要:

Text-to-Image (T2I) generation is a popular AI-generated content (AIGC) technology enabling diverse and creative image synthesis. However, some outputs may contain Not Safe For Work (NSFW) content (e.g., violence), violating community guidelines. Detecting NSFW content efficiently and accurately, known as external safeguarding, is essential. Existing external safeguards fall into two types: text filters, which analyze user prompts but overlook T2I model-specific variations and are prone to adversarial attacks; and image filters, which analyze final generated images but are computationally costly and introduce latency. Diffusion models, the foundation of modern T2I systems like Stable Diffusion, generate images through iterative denoising using a U-Net architecture with ResNet and Transformer blocks. We observe that: (1) early denoising steps define the semantic layout of the image, and (2) cross-attention layers in U-Net are crucial for aligning text and image regions. Based on these insights, we propose Wukong, a transformer-based NSFW detection framework that leverages intermediate outputs from early denoising steps and reuses U-Net's pre-trained cross-attention parameters. Wukong operates within the diffusion process, enabling early detection without waiting for full image generation. We also introduce a new dataset containing prompts, seeds, and image-specific NSFW labels, and evaluate Wukong on this and two public benchmarks. Results show that Wukong significantly outperforms text-based safeguards and achieves comparable accuracy of image filters, while offering much greater efficiency.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑