[论文解读] Dynamic Prompt Learning: Addressing Cross-Attention Leakage for Text-Based Image Editing
DPL 在每个时间戳学习动态名词标记,以降低跨注意力泄漏,从而在扩散模型的图像编辑中实现对目标对象的精确编辑,同时保留背景和干扰区域。
Large-scale text-to-image generative models have been a ground-breaking development in generative AI, with diffusion models showing their astounding ability to synthesize convincing images following an input text prompt. The goal of image editing research is to give users control over the generated images by modifying the text prompt. Current image editing techniques are susceptible to unintended modifications of regions outside the targeted area, such as on the background or on distractor objects which have some semantic or visual relationship with the targeted object. According to our experimental findings, inaccurate cross-attention maps are at the root of this problem. Based on this observation, we propose Dynamic Prompt Learning (DPL) to force cross-attention maps to focus on correct noun words in the text prompt. By updating the dynamic tokens for nouns in the textual input with the proposed leakage repairment losses, we achieve fine-grained image editing over particular objects while preventing undesired changes to other image regions. Our method DPL, based on the publicly available Stable Diffusion, is extensively evaluated on a wide range of images, and consistently obtains superior results both quantitatively (CLIP score, Structure-Dist) and qualitatively (on user-evaluation). We show improved prompt editing results for Word-Swap, Prompt Refinement, and Attention Re-weighting, especially for complex multi-object scenes.
研究动机与目标
- 提出文本引导的图像编辑中因跨注意力泄漏导致的非预期变更问题。
- 提出 Dynamic Prompt Learning (DPL),对每个时间戳优化名词词嵌入以局部化编辑。
- 开发以泄漏为焦点的损失函数(背景泄漏、非目标对象注意力分离、注意力平衡)以 refined 跨注意力图。
- 利用 Null-Text Inversion 和 DDIM 反演来实现对真实图像的精确编辑。
- 展示在使用 Stable Diffusion 的多目标真实图像提示上改进的编辑质量。
提出的方法
- 将提示中的名词词转化为动态、时间戳特定的标记。
- 引入三种损失以约束跨注意力:背景泄漏损失、非目标对象注意力损失、以及注意力平衡损失。
- 通过渐进阈值的基于梯度的优化,在每个时间戳更新标记嵌入,确保注意力映射聚焦到目标对象。
- 使用 Null-Text Inversion 在保持重建保真度的同时近似扩散轨迹。
- 将 DPL 与 P2P 风格的编辑结合,以在多对象场景中评估词替换及其他提示编辑任务。
- 可选地从自注意力聚类中推导背景掩码,以进一步抑制泄漏。
实验结果
研究问题
- RQ1动态、逐时间戳的令牌优化是否能改善多对象编辑的跨注意力局部化?
- RQ2以泄漏为焦点的损失(背景、干扰对象、注意力平衡)是否比基线提供更优的编辑质量?
- RQ3将 DPL 与现有编辑框架如 P2P 结合后,在真实多对象图像上的表现如何?
主要发现
- 与 Null-Text inversion 基线相比,DPL 在跨注意力图和编辑质量方面具有优势,特别是在复杂的多对象场景中。
- 定量指标显示,在多对象编辑中,DPL+P2P 相较于 NTI+P2P 拥有更高的 CLIP 分数和更低的 Structure-Dist。
- 消融研究表明,结合三者损失(背景泄漏、非目标对象注意力、注意力平衡)可实现最佳定位和编辑效果。
- DPL 通过减少对背景和干扰对象的非预期变化,提升 Word-Swap 和 Prompt Refinement 场景。
- 用户研究支持定量收益,DPL+P2P 在多对象编辑中优于 NTI+P2P。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。