arXiv:2411.15236cs.CVcs.LG2024-11CVPR被引 14

通过优化文本注意力关系,提升图文生成中的语义对齐精度

Text Embedding is Not All You Need: Attention Control for Text-to-Image Semantic Alignment with Text Self-Attention Maps

论文配图:Text Embedding is Not All You Need: Attention Control for Text-to-Image Semantic Alignment with Text Self-Attention Maps
图 1 · 摘自论文原文
  • 利用文本自注意力图中的语法关系指导跨注意力机制
  • 在不依赖外部信息下,显著减少属性绑定错误和缺失物体问题
  • 适用于需要精确语义对齐的文本到图像生成任务

在文本到图像扩散模型中,每个文本词元的交叉注意力图指示其关注的图像区域。对比句法相关词元的注意力图,可判断生成图像是否准确反映文本提示。例如,在提示"a black car and a white clock"中,'black'与'car'的注意力图应重叠以描绘黑色汽车,而'car'与'clock'则不应重叠。现有模型中,词元间文本嵌入相似性导致注意力集中在相同区域,且文本嵌入未能忠实捕捉文本注意力图中的句法关系,致使跨注意力模块忽略这些关系,引发生成缺陷。为此,我们提出一种方法:在测试时通过优化,将文本注意力图中的句法关系直接传递至跨注意力模块。该方法利用文本注意力图中蕴含但未被利用的信息,增强多样提示下的图像-文本语义对齐,无需外部引导。

原文摘要 · Abstract (English)

In text-to-image diffusion models, the cross-attention map of each text token indicates the specific image regions attended. Comparing these maps of syntactically related tokens provides insights into how well the generated image reflects the text prompt. For example, in the prompt, "a black car and a white clock", the cross-attention maps for "black" and "car" should focus on overlapping regions to depict a black car, while "car" and "clock" should not. Incorrect overlapping in the maps generally produces generation flaws such as missing objects and incorrect attribute binding. Our study makes the key observations investigating this issue in the existing text-to-image models:(1) the similarity in text embeddings between different tokens -- used as conditioning inputs -- can cause their cross-attention maps to focus on the same image regions; and (2) text embeddings often fail to faithfully capture syntactic relations already within text attention maps. As a result, such syntactic relationships can be overlooked in cross-attention module, leading to inaccurate image generation. To address this, we propose a method that directly transfers syntactic relations from the text attention maps to the cross-attention module via a test-time optimization. Our approach leverages this inherent yet unexploited information within text attention maps to enhance image-text semantic alignment across diverse prompts, without relying on external guidance.

文本生成注意力机制图文对齐

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。