arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.05173cs.CRcs.AIcs.CV
收藏

SafeGuider:文本到图像模型的稳健且实用的内容安全控制

SafeGuider: Robust and Practical Content Safety Control for Text-to-Image Models

University of Science and Technology of China(中国科学技术大学);Nanyang Technological University(南洋理工大学)

Peigui Qi, Kunsheng Tang, Wenbo Zhou, Weiming Zhang, Nenghai Yu, Tianwei Zhang, Qing Guo, Jie Zhang

AI总结:

SafeGuider提出两步框架,利用[EOS]标记的语义聚合特性,结合嵌入级识别与特征擦除波束搜索,实现文本到图像模型的高质量生成与稳健安全防御,攻击成功率低至5.48%。

摘要:

文本到图像模型在根据自然语言描述生成高质量图像方面展现出了卓越的能力。然而,这些模型极易受到对抗性提示的攻击,这些提示可以绕过安全措施并生成有害内容。尽管存在各种防御策略,但在实际应用中实现对抗攻击的稳健性同时保持实用性仍然是一个重大挑战。为了解决这个问题,我们首先对Stable Diffusion (SD)模型中的文本编码器进行了实证研究,SD模型是一种广泛使用且具有代表性的文本到图像模型。我们的研究发现,[EOS]标记充当语义聚合器,在其嵌入空间中,良性提示和对抗性提示之间表现出不同的分布模式。基于这一见解,我们引入了SafeGuider,一个两步框架,旨在实现稳健的安全控制而不损害生成质量。SafeGuider结合了嵌入级识别模型和具有安全意识的特征擦除波束搜索算法。这种集成使框架能够为良性提示保持高质量的图像生成,同时确保对域内和域外攻击的稳健防御。SafeGuider在最小化攻击成功率方面表现出卓越的有效性,在各种攻击场景下,最大成功率仅为5.48%。此外,对于不安全的提示,SafeGuider不是拒绝生成或生成黑色图像,而是生成安全且有意义的图像,增强了其实用性。此外,SafeGuider不限于SD模型,还可以有效应用于其他文本到图像模型,如Flux模型,展示了其在不同架构上的通用性和适应性。我们希望SafeGuider能为安全文本到图像系统的实际部署提供一些启示。

英文摘要:

Text-to-image models have shown remarkable capabilities in generating high-quality images from natural language descriptions. However, these models are highly vulnerable to adversarial prompts, which can bypass safety measures and produce harmful content. Despite various defensive strategies, achieving robustness against attacks while maintaining practical utility in real-world applications remains a significant challenge. To address this issue, we first conduct an empirical study of the text encoder in the Stable Diffusion (SD) model, which is a widely used and representative text-to-image model. Our findings reveal that the [EOS] token acts as a semantic aggregator, exhibiting distinct distributional patterns between benign and adversarial prompts in its embedding space. Building on this insight, we introduce SafeGuider, a two-step framework designed for robust safety control without compromising generation quality. SafeGuider combines an embedding-level recognition model with a safety-aware feature erasure beam search algorithm. This integration enables the framework to maintain high-quality image generation for benign prompts while ensuring robust defense against both in-domain and out-of-domain attacks. SafeGuider demonstrates exceptional effectiveness in minimizing attack success rates, achieving a maximum rate of only 5.48\% across various attack scenarios. Moreover, instead of refusing to generate or producing black images for unsafe prompts, SafeGuider generates safe and meaningful images, enhancing its practical utility. In addition, SafeGuider is not limited to the SD model and can be effectively applied to other text-to-image models, such as the Flux model, demonstrating its versatility and adaptability across different architectures. We hope that SafeGuider can shed some light on the practical deployment of secure text-to-image systems.

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

↑