arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2503.07389cs.CVcs.AI
收藏

TRCE:面向文本到图像扩散模型中可靠恶意概念擦除的研究

TRCE: Towards Reliable Malicious Concept Erasure in Text-to-Image Diffusion Models

The School of Electrical and Information Engineering, Tianjin University(天津大学电气与信息工程学院)

Ruidong Chen, Honglin Guo, Lanjun Wang, Chenyu Zhang, Weizhi Nie, An-An Liu

AI总结:

针对现有文本到图像扩散模型概念擦除方法难以彻底清除隐含恶意概念且易损伤正常生成能力的问题,提出两阶段TRCE方法,通过优化交叉注意力层和对比学习引导去噪方向,实现可靠擦除的同时更好保留模型原有生成能力。

摘要:

文本到图像扩散模型的最新进展实现了照片级真实感图像生成,但也存在生成恶意内容(如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.

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

↑