Skip to main content
QUICK REVIEW

[论文解读] StyTr$^2$: Image Style Transfer with Transformers

Yingying Deng, Fan Tang|arXiv (Cornell University)|May 30, 2021
Generative Adversarial Networks and Image Synthesis被引用 34
一句话总结

StyTr^2 引入了一种基于 Transformer 的风格迁移框架,具备两个领域特定编码器(内容和风格)以及一个内容感知的位置编码(CAPE),在内容保留和风格保真方面优于基于 CNN 和光流的方法。

ABSTRACT

The goal of image style transfer is to render an image with artistic features guided by a style reference while maintaining the original content. Owing to the locality in convolutional neural networks (CNNs), extracting and maintaining the global information of input images is difficult. Therefore, traditional neural style transfer methods face biased content representation. To address this critical issue, we take long-range dependencies of input images into account for image style transfer by proposing a transformer-based approach called StyTr$^2$. In contrast with visual transformers for other vision tasks, StyTr$^2$ contains two different transformer encoders to generate domain-specific sequences for content and style, respectively. Following the encoders, a multi-layer transformer decoder is adopted to stylize the content sequence according to the style sequence. We also analyze the deficiency of existing positional encoding methods and propose the content-aware positional encoding (CAPE), which is scale-invariant and more suitable for image style transfer tasks. Qualitative and quantitative experiments demonstrate the effectiveness of the proposed StyTr$^2$ compared with state-of-the-art CNN-based and flow-based approaches. Code and models are available at https://github.com/diyiiyiii/StyTR-2.

研究动机与目标

  • 通过捕捉长程依赖来解决基于 CNN 的风格迁移中的内容偏倚表示。
  • 提出一种双 Transformer 编码器架构以分别建模内容域和风格域。
  • 引入 CAPE(内容感知位置编码)以实现对图像的尺度不变、语义驱动的编码。
  • 通过 Transformer 解码器和 CNN 上采样解码器实现逐步风格化,以获得高分辨率输出。
  • 展示在定性和定量方面都优于最新方法的性能。

提出的方法

  • 将内容图像和风格图像分割为小块,并将它们投影到序列化的嵌入中。
  • 使用两个 Transformer 编码器提取域特定的内容和风格表示。
  • 应用多层 Transformer 解码器将内容序列按照风格序列进行转换。
  • 引入 CAPE,提供以内容为条件的尺度不变、语义感知的位置编码。
  • 使用基于 CNN 的上采样解码器以生成高分辨率的风格化输出。
  • 结合感知内容/风格损失和身份损失来优化,以保留内容和风格。

实验结果

研究问题

  • RQ1双 Transformer(内容和风格编码器)能否比基于 CNN 的编码器更好地建模内容与风格之间的关系?
  • RQ2内容感知位置编码(CAPE)是否在可变图像分辨率下提高尺度不变性和风格化质量?
  • RQ3与最先进的方法相比,StyTr^2 在保持内容结构的同时应用多样的风格参考方面表现如何?
  • RQ4所提出的损失函数(内容、风格、身份)对内容保留和风格保真度的影响是什么?

主要发现

  • StyTr^2 在内容损失方面低于竞争方法(IEST 为第二名),在风格损失方面具有竞争力,表明内容保留和风格一致性较强。
  • 定性结果显示 StyTr^2 能很好地保留内容结构,并呈现理想的风格模式,减少了在 CNN 与基于光流的方法中常见的伪影。
  • 一项包含 100 名参与者、4,000 票的用户研究表明,StyTr^2 在总体质量、内容保留和风格一致性方面优异于若干基线方法。
  • 通过基于 Transformer 的架构缓解了内容泄露,在多轮风格化中保持了清晰的内容细节。
  • 与正弦位置编码相比,CAPE 在图像尺度变化和重复模式方面表现出更强的鲁棒性。
  • 该研究展示了 StyTr^2 在内容保真度与风格对齐方面优于多种基于 CNN 和 Transformer 的基线方法的平衡。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。