通过优化提示词和采样噪声,实现文本生成图像的安全防护。
Safeguarding Text-to-Image Generation via Inference-Time Prompt-Noise Optimization
- 在推理阶段优化提示词嵌入与噪声轨迹,无需训练模型。
- 显著抑制有害内容生成,且对对抗攻击具有鲁棒性。
- 保持良好图文一致性的前提下提升生成安全性,适合实际部署。
文本到图像(T2I)扩散模型能够基于文本提示生成高质量、多样化的图像。然而,尽管已有进展,这些模型仍易生成包含敏感或不当内容的图像,可能对用户造成伤害。现有安全防护方法容易被绕过,且易受对抗攻击影响。本文提出一种全新的、无需训练的方法——提示词-噪声优化(Prompt-Noise Optimization, PNO),通过联合优化连续提示嵌入与采样过程中的噪声轨迹,生成安全图像。大量实验表明,该框架在抑制有害图像生成方面达到当前最优性能,并对对抗攻击具有强鲁棒性,且无需调整模型参数。相比现有方法,PNO在生成时间相当的前提下,实现了安全生成与提示-图像对齐之间的最佳平衡。
原文摘要 · Abstract (English)
Text-to-Image (T2I) diffusion models are widely recognized for their ability to generate high-quality and diverse images based on text prompts. However, despite recent advances, these models are still prone to generating unsafe images containing sensitive or inappropriate content, which can be harmful to users. Current efforts to prevent inappropriate image generation for diffusion models are easy to bypass and vulnerable to adversarial attacks. How to ensure that T2I models align with specific safety goals remains a significant challenge. In this work, we propose a novel, training-free approach, called Prompt-Noise Optimization (PNO), to mitigate unsafe image generation. Our method introduces a novel optimization framework that leverages both the continuous prompt embedding and the injected noise trajectory in the sampling process to generate safe images. Extensive numerical results demonstrate that our framework achieves state-of-the-art performance in suppressing toxic image generations and demonstrates robustness to adversarial attacks, without needing to tune the model parameters. Furthermore, compared with existing methods, PNO uses comparable generation time while offering the best tradeoff between the conflicting goals of safe generation and prompt-image alignment.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。