We use cookies to improve your experience with our site.

基于卷积神经网络和Transformer的视觉风格迁移的比较研究

A Comparative Study of CNN- and Transformer-Based Visual Style Transfer

  • 摘要: 1、研究背景(context):近期,基于多头自注意力机制的Transformer结构在计算机视觉领域,特别是图像分类、检测等感知任务,取得了显著的进展。不同于卷积神经网络强调层次化局部感受野叠加,视觉Transformer模型更多的关注图像中的大范围全局关联信息。相关研究指出,与Transformer模型展现出的形状偏好性质相比,卷积神经网络更偏向于纹理建模。目前大部分卷积神经网络与视觉Transformer工作多基于图像分类、检测等感知任务,但很少有研究关注二者在生成类任务(如风格迁移)上差异的表型比较及原因。
    2、目的(Objective):本文针对图像风格化任务,对比分析卷积神经网络与Transformer结构在生成任务上对于形状、纹理两方面的偏好,并探究造成两类结构主要差异的原因是来自于模型的结构还是参数。
    3、方法(Method):本文把Transformer结构引入到典型的视觉风格迁移算法(代表基于优化VST的NST、代表基于感知VST的AdaIN和代表基于重建VST的WCT)中,提出基于Transformer结构的任意图像风格化方法,并通过控制Transformer编码器和风格迁移算法的训练配置(相同结构,不同训练目标;相同训练目标,不同结构),对基于卷积神经网络和Transformer的视觉风格迁移方法进行了对比分析。
    4、结果(Result & Findings):在本文的对比分析中,我们发现,使用预训练 ViT的视觉风格迁移方法生成的风格化结果无法从风格图像中呈现出风格模式。而使用基于卷积神经网络的感知损失训练模型时,我们获得了纹理偏好更强的 Transformer编码器,基于该Transformer编码器的视觉风格迁移方法能够成功地生成风格化图像,并且取得了与原始基于卷积神经网络的视觉风格迁移方法相当的质量。我们还讨论了Transformer结构中一些基本模块的影响,例如位置编码和上采样方式。
    5、结论(Conclusions):结果表明,由于比较强的形状偏好,预训练的 ViT对于主流视觉风格迁移方法无效。我们证明了可以通过适当感知监督的训练来减少形状偏差。我们还得出结论:模型使用可学习的位置嵌入和不使用任何位置嵌入能够得到类似的结果,但使用正弦位置编码却不能,因为正弦位置编码将学到了的风格因子与位置信息所绑定的关系。此外,我们还证明了使用 CNN 作为上采样方法是避免棋盘伪影和重复模式的合适选择。

     

    Abstract: Vision Transformer has shown impressive performance on the image classification tasks. Observing that most existing visual style transfer (VST) algorithms are based on the texture-biased convolution neural network (CNN), here raises the question of whether the shape-biased Vision Transformer can perform style transfer as CNN. In this work, we focus on comparing and analyzing the shape bias between CNN- and transformer-based models from the view of VST tasks. For comprehensive comparisons, we propose three kinds of transformer-based visual style transfer (Tr-VST) methods (Tr-NST for optimization-based VST, Tr-WCT for reconstruction-based VST and Tr-AdaIN for perceptual-based VST). By engaging three mainstream VST methods in the transformer pipeline, we show that transformer-based models pre-trained on ImageNet are not proper for style transfer methods. Due to the strong shape bias of the transformer-based models, these Tr-VST methods cannot render style patterns. We further analyze the shape bias by considering the influence of the learned parameters and the structure design. Results prove that with proper style supervision, the transformer can learn similar texture-biased features as CNN does. With the reduced shape bias in the transformer encoder, Tr-VST methods can generate higher-quality results compared with state-of-the-art VST methods.

     

/

返回文章
返回