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

反思无分类器扩散引导中的空间不一致性

Rethinking the Spatial Inconsistency in Classifier-Free Diffusion Guidance

Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);SenseTime Research(商汤科技研究院);The University of Hong Kong(香港大学);The Chinese University of Hong Kong(香港中文大学)

Dazhong Shen, Guanglu Song, Zeyue Xue, Fu-Yun Wang, Yu Liu

AI总结:

针对全局 CFG scale 造成的语义引导空间不一致问题,提出 S-CFG,通过无需训练的注意力语义分区和自适应区域缩放提升图像质量。

摘要:

Classifier-Free Guidance(CFG,无分类器引导)已被广泛应用于文本到图像扩散模型,其中引入 CFG scale 来控制文本引导对整个图像空间的强度。然而,我们认为全局 CFG scale 会导致不同语义强度上的空间不一致性,以及次优的图像质量。为解决该问题,我们提出了一种新方法 Semantic-aware Classifier-Free Guidance(S-CFG,语义感知无分类器引导),用于在文本到图像扩散模型中为不同语义单元定制引导程度。具体而言,我们首先设计了一种无需训练的语义分割方法,在每个去噪步骤将潜在图像划分为相对独立的语义区域。特别地,去噪 U-net 主干中的交叉注意力图被重新归一化,以将每个 patch 分配给对应的 token,同时自注意力图被用于补全语义区域。随后,为平衡不同语义单元的放大,我们在不同语义区域之间自适应调整 CFG scales,将文本引导程度重新缩放到统一水平。最后,大量实验表明,在多种文本到图像扩散模型上,S-CFG 优于原始 CFG 策略,且不需要任何额外训练成本。我们的代码可在 https://github.com/SmilesDZgk/S-CFG 获取。

英文摘要:

Classifier-Free Guidance (CFG) has been widely used in text-to-image diffusion models, where the CFG scale is introduced to control the strength of text guidance on the whole image space. However, we argue that a global CFG scale results in spatial inconsistency on varying semantic strengths and suboptimal image quality. To address this problem, we present a novel approach, Semantic-aware Classifier-Free Guidance (S-CFG), to customize the guidance degrees for different semantic units in text-to-image diffusion models. Specifically, we first design a training-free semantic segmentation method to partition the latent image into relatively independent semantic regions at each denoising step. In particular, the cross-attention map in the denoising U-net backbone is renormalized for assigning each patch to the corresponding token, while the self-attention map is used to complete the semantic regions. Then, to balance the amplification of diverse semantic units, we adaptively adjust the CFG scales across different semantic regions to rescale the text guidance degrees into a uniform level. Finally, extensive experiments demonstrate the superiority of S-CFG over the original CFG strategy on various text-to-image diffusion models, without requiring any extra training cost. our codes are available at https://github.com/SmilesDZgk/S-CFG.

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

↑