Skip to main content
QUICK REVIEW

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

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

StyTr^2 提出了一种基于 Transformer 的图像风格迁移方法,采用独立的内容和风格编码器,并结合内容感知的位置编码,以减少偏差和内容泄露。通过建模长距离依赖关系并改进位置编码,其在一致性与无偏性方面优于基于 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. Due to the locality and spatial invariance in CNNs, it is difficult to extract and maintain the global information of input images. Therefore, traditional neural style transfer methods are usually biased and content leak can be observed by running several times of the style transfer process with the same reference style image. To address this critical issue, we take long-range dependencies of input images into account for unbiased style transfer by proposing a transformer-based approach, namely StyTr^2. In contrast with visual transformers for other vision tasks, our 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. In addition, we 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 task. Qualitative and quantitative experiments demonstrate the effectiveness of the proposed StyTr^2 compared to state-of-the-art CNN-based and flow-based approaches.

研究动机与目标

  • 解决 CNN 因其局部归纳偏置而引起的神经风格迁移中的偏差与内容泄露问题。
  • 在图像中建模长距离空间依赖关系,以实现更精确的风格迁移。
  • 设计一种尺度不变且适用于风格迁移的位置编码方法。
  • 在相同风格参考下,提升多次推理中生成图像的一致性与质量。
  • 在定性和定量评估中,超越现有的基于 CNN 和基于流的风格迁移方法。

提出的方法

  • StyTr^2 采用两个独立的 Transformer 编码器,从输入图像中生成内容和风格的特定领域序列。
  • 一个多层 Transformer 解码器基于风格序列对内容序列进行风格迁移,实现内容与风格表征之间的交叉注意力机制。
  • 引入内容感知位置编码(CAPE),以替代标准位置编码,实现尺度不变性并更好地契合风格迁移需求。
  • CAPE 能够基于内容特征自适应地编码空间位置,提升模型保留结构细节的能力。
  • 通过内容重建损失与风格重建损失的组合,端到端训练该架构,以平衡保真度与风格化效果。
  • 该方法利用自注意力机制捕捉长距离依赖关系,克服了 CNN 中局部感受野的局限性。

实验结果

研究问题

  • RQ1与基于 CNN 的方法相比,基于 Transformer 的架构是否能有效减少图像风格迁移中的偏差与内容泄露?
  • RQ2建模长距离依赖关系如何影响生成图像的一致性与质量?
  • RQ3内容感知位置编码(CAPE)是否能提升风格迁移任务中的性能与稳定性?
  • RQ4双编码器 Transformer 框架是否能超越现有的基于流和基于 CNN 的风格迁移方法?
  • RQ5所提出方法在多次推理中,能在多大程度上保持内容完整性并实现风格迁移?

主要发现

  • 与基于 CNN 的基线方法相比,StyTr^2 显著减少了内容泄露,在使用相同风格参考的多次推理中实现了更一致的风格化效果。
  • 所提出的內容感知位置编码(CAPE)通过实现尺度不变的表征学习,提升了性能,优于标准正弦位置编码与可学习位置编码。
  • 定性结果表明,与现有方法相比,StyTr^2 更好地保留了细粒度的内容细节,尤其在具有长距离结构的复杂场景中表现更优。
  • 定量评估显示,与最先进的基于 CNN 和基于流的方法相比,StyTr^2 在 FID 和 LPIPS 指标上表现更优。
  • 该模型在多样化的风格参考下,仍能保持高质量的风格化效果,同时最小化伪影并保留语义内容。
  • 消融实验验证了双编码器设计与 CAPE 对模型鲁棒性与性能的显著贡献。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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