Skip to main content
QUICK REVIEW

[Paper Review] TransGAN: Two Pure Transformers Can Make One Strong GAN, and That Can Scale Up

Yifan Jiang, Shiyu Chang|arXiv (Cornell University)|Feb 14, 2021
Generative Adversarial Networks and Image SynthesisComputer Science92 references263 citations
TL;DR

TransGAN builds a GAN with no convolutions using pure Transformers, featuring a memory-friendly generator, multi-scale discriminator, and grid self-attention, achieving competitive results and scalable high-resolution generation.

ABSTRACT

The recent explosive interest on transformers has suggested their potential to become powerful "universal" models for computer vision tasks, such as classification, detection, and segmentation. While those attempts mainly study the discriminative models, we explore transformers on some more notoriously difficult vision tasks, e.g., generative adversarial networks (GANs). Our goal is to conduct the first pilot study in building a GAN completely free of convolutions, using only pure transformer-based architectures. Our vanilla GAN architecture, dubbed TransGAN, consists of a memory-friendly transformer-based generator that progressively increases feature resolution, and correspondingly a multi-scale discriminator to capture simultaneously semantic contexts and low-level textures. On top of them, we introduce the new module of grid self-attention for alleviating the memory bottleneck further, in order to scale up TransGAN to high-resolution generation. We also develop a unique training recipe including a series of techniques that can mitigate the training instability issues of TransGAN, such as data augmentation, modified normalization, and relative position encoding. Our best architecture achieves highly competitive performance compared to current state-of-the-art GANs using convolutional backbones. Specifically, TransGAN sets new state-of-the-art inception score of 10.43 and FID of 18.28 on STL-10, outperforming StyleGAN-V2. When it comes to higher-resolution (e.g. 256 x 256) generation tasks, such as on CelebA-HQ and LSUN-Church, TransGAN continues to produce diverse visual examples with high fidelity and impressive texture details. In addition, we dive deep into the transformer-based generation models to understand how their behaviors differ from convolutional ones, by visualizing training dynamics. The code is available at https://github.com/VITA-Group/TransGAN.

Motivation & Objective

  • Motivate the exploration of convolution-free GANs using pure transformer architectures for image generation.
  • Design a memory-efficient generator and a multi-scale discriminator suitable for transformer-based GANs.
  • Develop techniques (grid self-attention, data augmentation, modified normalization, relative position encoding) to stabilize training and improve fidelity.
  • Evaluate TransGAN on small and large datasets to assess performance and scalability against CNN-based GANs.

Proposed method

  • Use a memory-friendly, multi-stage Transformer-based generator that progressively increases feature map resolution.
  • Implement a multi-scale discriminator that processes patches of different sizes to capture global context and local texture.
  • Introduce Grid Self-Attention to reduce memory burden at high resolutions while retaining global coherence.
  • Apply a training recipe including strong data augmentation, modified normalization (token-wise scaling), and relative position encoding to stabilize training.
  • Scale to high-resolution generation (e.g., 256×256) with high-quality visual results and ablation studies.

Experimental results

Research questions

  • RQ1Can a GAN be effectively built without any convolutional layers using pure transformer components?
  • RQ2What architectural and training strategies enable stable, high-fidelity image generation with Transformer-based GANs?
  • RQ3How do memory-efficient attention mechanisms (like grid self-attention) affect quality and scalability at high resolutions?
  • RQ4How do data augmentation and relative position encoding impactTransGAN training stability and performance?

Key findings

  • TransGAN achieves competitive quantitive results compared to state-of-the-art CNN-based GANs on CIFAR-10, STL-10, and CelebA with strong augmentation.
  • On CIFAR-10, TransGAN attains an Inception Score of 9.02 and an FID of 9.26.
  • On STL-10, it reaches an Inception Score of 10.43 and an FID of 18.28.
  • On CelebA (128×128), it achieves an FID of 5.28, approaching the best reported results.
  • TransGAN scales to higher resolution generation (e.g., 256×256) with 256×256 CelebA-HQ and LSUN Church demonstrations showing diverse, high-fidelity outputs.
  • Ablation studies show grid self-attention and the proposed training recipe (data augmentation, modified normalization, relative position encoding) substantially improve performance.

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.