通过非线性注意力门实现精准消去图像生成中的特定概念
Concept Pinpoint Eraser for Text-to-image Diffusion Models via Residual Attention Gate
- 引入非线性残差注意力门,动态选择性删除目标概念
- 在保留多样其余概念的同时,有效消除名人、风格等敏感内容
- 支持对抗训练,提升对恶意提示的鲁棒性,适合安全可控生成
文本到图像扩散模型虽取得显著进展,但存在生成不当或受版权保护概念的风险。概念消去旨在删除模型中的目标概念,同时最小化对其他概念的干扰。现有方法通常微调交叉注意力层,但此类线性更新难以保持多样剩余概念。本文提出概念精准擦除框架CPE,通过引入非线性残差注意力门(ResAG),结合注意力锚定损失,实现对目标概念的选择性切断,并防止遗忘。此外,采用迭代对抗训练,联合优化可学习文本嵌入与ResAG,以增强对攻击性提示的鲁棒性。在名人、艺术风格及成人内容的消去任务中,CPE显著优于现有方法,在保持多样化输出的同时实现强健的概念删除。代码已开源。
原文摘要 · Abstract (English)
Remarkable progress in text-to-image diffusion models has brought a major concern about potentially generating images on inappropriate or trademarked concepts. Concept erasing has been investigated with the goals of deleting target concepts in diffusion models while preserving other concepts with minimal distortion. To achieve these goals, recent concept erasing methods usually fine-tune the cross-attention layers of diffusion models. In this work, we first show that merely updating the cross-attention layers in diffusion models, which is mathematically equivalent to adding \emph{linear} modules to weights, may not be able to preserve diverse remaining concepts. Then, we propose a novel framework, dubbed Concept Pinpoint Eraser (CPE), by adding \emph{nonlinear} Residual Attention Gates (ResAGs) that selectively erase (or cut) target concepts while safeguarding remaining concepts from broad distributions by employing an attention anchoring loss to prevent the forgetting. Moreover, we adversarially train CPE with ResAG and learnable text embeddings in an iterative manner to maximize erasing performance and enhance robustness against adversarial attacks. Extensive experiments on the erasure of celebrities, artistic styles, and explicit contents demonstrated that the proposed CPE outperforms prior arts by keeping diverse remaining concepts while deleting the target concepts with robustness against attack prompts. Code is available at https://github.com/Hyun1A/CPE
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。