TRCE: Towards Reliable Malicious Concept Erasure in Text-to-Image Diffusion Models
该论文提出了TRCE,一种基于两阶段策略的可靠恶意概念擦除方法,以在文本到图像扩散模型中有效消除恶意概念,同时最小化对模型生成能力的影响。
更新于 2025-03-11。作者:Ruidong Chen、Honglin Guo、Lanjun Wang、Chenyu Zhang、Weizhi Nie、An-An Liu。
中文摘要
最近,文本到图像的扩散模型在图像生成方面取得了重大进展,但同时也存在着产生恶意内容,如NSFW图像的风险。为了降低风险,研究人员正在研究概念擦除方法,以便让模型能够忘记特定的概念。然而,当前的研究在删除嵌入在提示(例如隐喻表达式或对抗性提示)中的恶意概念的同时,仍保留模型的正常生成能力方面遇到了困难。为了应对这一挑战,我们的研究提出了TRCE,采用两阶段概念擦除策略,在可靠的擦除和知识保留之间实现有效的权衡。首先,TRCE通过删除文本提示中隐含的恶意语义来开始。通过识别一个关键映射目标(即[EoT]嵌入),我们优化了交叉注意力层,将恶意提示映射到上下文相似但概念安全的提示。这一步骤防止模型在降噪过程中过度受到恶意语义的影响。随后,考虑到扩散模型采样轨迹的确定性特性,TRCE通过对比学习进一步引导早期降噪预测向安全方向前进,远离不安全方向,从而进一步避免生成恶意内容。最后,我们在多个恶意概念擦除基准上对TRCE进行了全面评估,结果表明其在删除恶意概念的同时,更好地保留了模型的原始生成能力。代码可在以下链接获取:http://github.com/ddgoodgood/TRCE。注意:本文包含由模型生成的可能含有冒犯性内容的内容。
英文摘要
Recent advances in text-to-image diffusion models enable photorealistic image generation, but they also risk producing malicious content, such as NSFW images. To mitigate risk, concept erasure methods are studied to facilitate the model to unlearn specific concepts. However, current studies struggle to fully erase malicious concepts implicitly embedded in prompts (e.g., metaphorical expressions or adversarial prompts) while preserving the model's normal generation capability. To address this challenge, our study proposes TRCE, using a two-stage concept erasure strategy to achieve an effective trade-off between reliable erasure and knowledge preservation. Firstly, TRCE starts by erasing the malicious semantics implicitly embedded in textual prompts. By identifying a critical mapping objective(i.e., the [EoT] embedding), we optimize the cross-attention layers to map malicious prompts to contextually similar prompts but with safe concepts. This step prevents the model from being overly influenced by malicious semantics during the denoising process. Following this, considering the deterministic properties of the sampling trajectory of the diffusion model, TRCE further steers the early denoising prediction toward the safe direction and away from the unsafe one through contrastive learning, thus further avoiding the generation of malicious content. Finally, we conduct comprehensive evaluations of TRCE on multiple malicious concept erasure benchmarks, and the results demonstrate its effectiveness in erasing malicious concepts while better preserving the model's original generation ability. The code is available at: http://github.com/ddgoodgood/TRCE. CAUTION: This paper includes model-generated content that may contain offensive material.
解读
一句话总结
该论文提出了TRCE,一种基于两阶段策略的可靠恶意概念擦除方法,以在文本到图像扩散模型中有效消除恶意概念,同时最小化对模型生成能力的影响。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:文本到图像扩散模型能够生成高度逼真的图像,但同时也可能产生包含不适当内容的恶意图像。
- 现有方案不足:当前的概念擦除方法难以完全消除隐含在提示中的恶意概念,同时在保留模型正常生成能力方面也存在挑战。
- 研究目标:提出一种两阶段的概念擦除策略,在确保可靠擦除的同时,最大限度地减少对模型知识保留的影响。
问题2:论文的核心创新点是什么?
- 技术创新:提出了一种两阶段的概念擦除策略,包括文本语义擦除和去噪轨迹引导。
- 方法改进:利用[EoT]嵌入优化交叉注意力层,将恶意提示映射到具有安全概念的上下文相似提示。
- 优势:与现有方法相比,TRCE在擦除效果和知识保留之间实现了更好的平衡。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在多个恶意概念擦除基准测试上对TRCE进行了评估。
- 性能提升:TRCE在消除恶意概念的同时,更好地保留了模型的原始生成能力。
- 对比结果:与基线方法相比,TRCE在攻击成功率和FID分数上均有所提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:可用于防止文本到图像扩散模型生成不适当的内容,如NSFW图像。
- 实施建议:结合文本语义擦除和去噪轨迹引导两阶段策略,以实现更好的效果。
- 局限与展望:目前方法在处理复杂提示和对抗性提示时的鲁棒性仍需提高。未来研究可探索更先进的擦除策略和更鲁棒的模型。
来源
机器可读索引:llms.txt