Attention-based arbitrary style transfer studies have shown promising performance in synthesizing vivid local style details. They typically use the all-to-all attention mechanism -- each position of content features is fully matched to all positions of style features. However, all-to-all attention tends to generate distorted style patterns and has quadratic complexity, limiting the effectiveness and efficiency of arbitrary style transfer. In this paper, we propose a novel all-to-key attention mechanism -- each position of content features is matched to stable key positions of style features -- that is more in line with the characteristics of style transfer. Specifically, it integrates two newly proposed attention forms: distributed and progressive attention. Distributed attention assigns attention to key style representations that depict the style distribution of local regions; Progressive attention pays attention from coarse-grained regions to fine-grained key positions. The resultant module, dubbed StyA2K, shows extraordinary performance in preserving the semantic structure and rendering consistent style patterns. Qualitative and quantitative comparisons with state-of-the-art methods demonstrate the superior performance of our approach.
翻译:基于注意力的任意风格迁移研究在合成生动的局部风格细节方面展现出良好性能。这类方法通常采用全对全注意力机制——内容特征的每个位置与风格特征的所有位置进行完全匹配。然而,全对全注意力容易生成扭曲的风格模式且具有二次复杂度,限制了任意风格迁移的效果与效率。本文提出一种新颖的全对键注意力机制——内容特征的每个位置与风格特征的稳定键位置进行匹配——更符合风格迁移的特性。具体而言,该机制融合了两种新提出的注意力形式:分布式注意力与渐进式注意力。分布式注意力将注意力分配到描绘局部区域风格分布的关键风格表征上;渐进式注意力则从粗粒度区域逐步聚焦到细粒度键位置。由此产生的模块称为StyA2K,在保持语义结构并生成一致风格模式方面展现出卓越性能。与当前最先进方法的定性和定量比较均证明了我们方法的优越性。