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.


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

0
下载
关闭预览

相关内容

面向 AI 生成图像的安全与鲁棒水印:全面综述
专知会员服务
14+阅读 · 2025年10月6日
文本生成与编辑图像:综述
专知会员服务
11+阅读 · 2025年5月8日
IMAGINE-E:最先进文本到图像模型的图像生成智能评估
专知会员服务
13+阅读 · 2025年2月3日
文本到图像合成:十年回顾
专知会员服务
31+阅读 · 2024年11月26日
【CVPR2024】用于文本到图像生成的判别性探测和调整
专知会员服务
15+阅读 · 2024年3月11日
视频生成的前沿论文,看我们推荐的7篇就够了
人工智能前沿讲习班
34+阅读 · 2018年12月30日
推荐|上交大推出Texygen:文本生成模型的基准测试平台
微信OCR(1)——公众号图文识别中的文本检测
微信AI
17+阅读 · 2017年11月22日
基于图片内容的深度学习图片检索(一)
七月在线实验室
20+阅读 · 2017年10月1日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员