安全文本到图像生成:简单净化提示词嵌入
Safe Text-to-Image Generation: Simply Sanitize the Prompt Embedding
AI总结:
针对文本到图像生成模型的不安全生成风险及现有方法鲁棒性不足的问题,提出嵌入净化器(ES),通过净化提示词嵌入中的不当概念并采用即插即用设计,在五个基准上优于现有基线,兼顾安全性与图像质量。
摘要:
近年来,文本到图像(T2I)生成模型在生成与文本描述一致的高质量图像方面取得了显著进展。然而,这些模型也面临不安全生成的风险,可能产生违反使用政策的有害内容,例如露骨材料。现有安全生成方法通常通过从视觉表示中删除不需要的概念来抑制不当内容,却忽视了净化文本表示。尽管这些方法在一定程度上有助于降低误用风险,但在应对对抗性攻击时,其鲁棒性仍不足。鉴于输入文本与输出图像之间的语义一致性是T2I模型的核心要求,我们认为文本表示可能是不安全生成的主要来源。为此,我们提出嵌入净化器(ES),通过净化提示词嵌入中的不当概念来增强T2I模型的安全性。据我们所知,ES是首个可解释的安全生成框架,它为提示词中的每个标记分配一个分数以指示其潜在危害性。此外,ES采用即插即用的模块化设计,可与各种T2I模型及其他安全措施无缝集成。在五个提示词基准上的评估表明,ES优于十一种现有安全基线,在保持高质量图像生成的同时实现了最先进的鲁棒性。
英文摘要:
In recent years, text-to-image (T2I) generation models have made significant progress in generating high-quality images that align with text descriptions. However, these models also face the risk of unsafe generation, potentially producing harmful content that violates usage policies, such as explicit material. Existing safe generation methods typically focus on suppressing inappropriate content by erasing undesired concepts from visual representations, while neglecting to sanitize the textual representation. Although these methods help mitigate the risk of misuse to some extent, their robustness remains insufficient when dealing with adversarial attacks. Given that semantic consistency between input text and output image is a core requirement of T2I models, we identify that textual representations are likely the primary source of unsafe generation. To this end, we propose Embedding Sanitizer (ES), which enhances the safety of T2I models by sanitizing inappropriate concepts in prompt embeddings. To our knowledge, ES is the first interpretable safe generation framework that assigns a score to each token in the prompt to indicate its potential harmfulness. In addition, ES adopts a plug-and-play modular design, offering compatibility for seamless integration with various T2I models and other safeguards. Evaluations on five prompt benchmarks show that ES outperforms eleven existing safeguard baselines, achieving state-of-the-art robustness while maintaining high-quality image generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。