Skip to main content
QUICK REVIEW

[Paper Review] S2WAT: Image Style Transfer via Hierarchical Vision Transformer using Strips Window Attention

Chiyu Zhang, Xu, Xiaogang|arXiv (Cornell University)|Oct 22, 2022
Generative Adversarial Networks and Image SynthesisComputer Science6 citations
TL;DR

S2WAT proposes a hierarchical Vision Transformer for image style transfer that uses strips window attention (SpW Attention) to balance local and global feature modeling, integrating multiple window shapes via a dynamic 'Attn Merge' mechanism. The method achieves state-of-the-art performance with reduced content leakage and superior stylization quality on benchmark datasets.

ABSTRACT

Transformer's recent integration into style transfer leverages its proficiency in establishing long-range dependencies, albeit at the expense of attenuated local modeling. This paper introduces Strips Window Attention Transformer (S2WAT), a novel hierarchical vision transformer designed for style transfer. S2WAT employs attention computation in diverse window shapes to capture both short- and long-range dependencies. The merged dependencies utilize the "Attn Merge" strategy, which adaptively determines spatial weights based on their relevance to the target. Extensive experiments on representative datasets show the proposed method's effectiveness compared to state-of-the-art (SOTA) transformer-based and other approaches. The code and pre-trained models are available at https://github.com/AlienZhang1996/S2WAT.

Motivation & Objective

  • To address the locality problem in transformer-based style transfer, where window-based attention causes grid-like artifacts and weak local modeling.
  • To improve the balance between short-range (local) and long-range (global) feature modeling in style transfer networks.
  • To reduce content leakage during iterative stylization, especially under repeated application of the same style.
  • To develop a dynamic fusion mechanism that adaptively weights attention outputs from diverse window shapes based on relevance to the target.

Proposed method

  • Introduces Strips Window Attention (SpW Attention), which computes self-attention over three window types: horizontal strips, vertical strips, and square windows to capture both long-range and short-range dependencies.
  • Employs a novel 'Attn Merge' strategy that computes spatial correlation scores between input features and attention outputs to dynamically assign merging weights.
  • Uses a hierarchical transformer architecture with patch embedding and multi-scale feature extraction, enabling efficient modeling across multiple receptive fields.
  • Applies the SpW Attention mechanism in encoder blocks to preserve content details while transferring artistic style effectively.
  • Leverages multi-head self-attention with relative position bias to maintain spatial structure during feature transformation.
  • Trains the model end-to-end using perceptual and style loss, with optimization stabilized by the adaptive Attn Merge mechanism.

Experimental results

Research questions

  • RQ1Can a hierarchical Vision Transformer with multi-shaped window attention improve both local and global feature modeling in image style transfer?
  • RQ2Does the proposed 'Attn Merge' mechanism outperform static fusion strategies like concatenation or summation in attention output integration?
  • RQ3How does S2WAT compare to SOTA methods in mitigating content leakage during iterative stylization?
  • RQ4To what extent does the use of strip-shaped windows reduce grid-like artifacts compared to standard square windows?
  • RQ5Can the model generalize well across diverse content and style combinations in user studies?

Key findings

  • S2WAT achieved a 25.4% vote share in a large-scale user study, outperforming StyTr2 (23.6%), ArtFlow (13.3%), MCC (19.4%), and SANet (18.3%) in perceived stylization quality.
  • The 'Attn Merge' mechanism significantly outperformed sum and concatenation fusion strategies, with sum-based outputs being heavily corrupted and concatenation losing critical style information.
  • S2WAT demonstrated minimal content detail loss over 20 iterative stylization steps, outperforming CNN-based and SDM-based models that suffered from blurriness and degradation.
  • Visual ablation showed that using only horizontal or vertical strip windows produced directional artifacts, while combining them via Attn Merge yielded artifact-free, high-quality results.
  • The model effectively mitigated content leakage, with stylized outputs preserving fine-grained content details even under repeated stylization.
  • Extensive experiments on public datasets confirmed S2WAT's state-of-the-art performance in both quantitative metrics and qualitative evaluation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.