Skip to main content
QUICK REVIEW

[Paper Review] STransGAN: An Empirical Study on Transformer in GANs

Rui Xu, Xiangyu Xu|arXiv (Cornell University)|Oct 25, 2021
Generative Adversarial Networks and Image SynthesisComputer Science8 citations
TL;DR

This paper proposes STrans-G and STrans-D, CNN-free Transformer-based generator and discriminator for GANs, respectively, by leveraging local attention and restructured residual connections. The approach achieves competitive image synthesis performance on both unconditional and conditional generation tasks, significantly reducing the accuracy gap between Transformer-based and CNN-based discriminators.

ABSTRACT

Transformer becomes prevalent in computer vision, especially for high-level vision tasks. However, deploying Transformer in the generative adversarial network (GAN) framework is still an open yet challenging problem. In this paper, we conduct a comprehensive empirical study to investigate the intrinsic properties of Transformer in GAN for high-fidelity image synthesis. Our analysis highlights the importance of feature locality in image generation. We first investigate the effective ways to implement local attention. We then examine the influence of residual connections in self-attention layers and propose a novel way to reduce their negative impacts on learning discriminators and conditional generators. Our study leads to a new design of Transformers in GAN, a convolutional neural network (CNN)-free generator termed as STrans-G, which achieves competitive results in both unconditional and conditional image generations. The Transformer-based discriminator, STrans-D, also significantly reduces its gap against the CNN-based discriminators.

Motivation & Objective

  • To investigate the intrinsic properties of Transformers in GANs for high-fidelity image synthesis.
  • To address the challenge of deploying Transformers in GANs, particularly in maintaining discriminative power and generative quality.
  • To reduce the performance gap between Transformer-based and CNN-based discriminators in GANs.
  • To design a CNN-free generator and discriminator that outperform or match existing CNN-based counterparts in image generation tasks.

Proposed method

  • Implement local self-attention mechanisms to preserve feature locality, crucial for image generation.
  • Redesign residual connections in self-attention layers to mitigate their negative impact on discriminator and conditional generator learning.
  • Propose STrans-G, a CNN-free generator based on the modified Transformer architecture, for unconditional and conditional image generation.
  • Design STrans-D, a Transformer-based discriminator that matches or exceeds CNN-based counterparts in performance.
  • Conduct extensive ablation studies to evaluate the contribution of local attention and residual connection modifications.
  • Train and evaluate the proposed models on standard benchmarks for both unconditional and conditional image synthesis.

Experimental results

Research questions

  • RQ1How does local attention affect image generation quality in Transformer-based GANs?
  • RQ2What is the impact of residual connections on the training dynamics of discriminators and conditional generators in Transformer-based GANs?
  • RQ3Can a CNN-free generator and discriminator achieve competitive performance compared to CNN-based counterparts in high-fidelity image synthesis?
  • RQ4How do architectural modifications to attention and residual connections improve the stability and performance of Transformers in GANs?

Key findings

  • Local attention mechanisms significantly improve feature representation and image quality in Transformer-based GANs.
  • Redesigned residual connections reduce interference with discriminator and generator learning, leading to more stable training.
  • STrans-G achieves competitive performance in both unconditional and conditional image generation without using convolutional layers.
  • STrans-D reduces the performance gap against CNN-based discriminators, demonstrating strong discriminative capability in a pure Transformer design.
  • The ablation study confirms that both local attention and modified residual connections are essential for high-fidelity image synthesis.
  • The proposed STransGAN framework achieves state-of-the-art results among CNN-free Transformer-based GANs on standard benchmarks.

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.