Skip to main content
QUICK REVIEW

[Paper Review] Improving Visual Quality of Image Synthesis by A Token-based Generator with Transformers

Yanhong Zeng, Huan Yang|arXiv (Cornell University)|Nov 5, 2021
Generative Adversarial Networks and Image SynthesisComputer Science49 references11 citations
TL;DR

This paper proposes TokenGAN, a transformer-based generator that formulates image synthesis as visual token generation using content and style tokens. By leveraging self- and cross-attention mechanisms in a Transformer to enable content-aware, fine-grained style control, TokenGAN achieves state-of-the-art FID scores and generates high-fidelity $1024\times1024$ images without convolutions.

ABSTRACT

We present a new perspective of achieving image synthesis by viewing this task as a visual token generation problem. Different from existing paradigms that directly synthesize a full image from a single input (e.g., a latent code), the new formulation enables a flexible local manipulation for different image regions, which makes it possible to learn content-aware and fine-grained style control for image synthesis. Specifically, it takes as input a sequence of latent tokens to predict the visual tokens for synthesizing an image. Under this perspective, we propose a token-based generator (i.e.,TokenGAN). Particularly, the TokenGAN inputs two semantically different visual tokens, i.e., the learned constant content tokens and the style tokens from the latent space. Given a sequence of style tokens, the TokenGAN is able to control the image synthesis by assigning the styles to the content tokens by attention mechanism with a Transformer. We conduct extensive experiments and show that the proposed TokenGAN has achieved state-of-the-art results on several widely-used image synthesis benchmarks, including FFHQ and LSUN CHURCH with different resolutions. In particular, the generator is able to synthesize high-fidelity images with 1024x1024 size, dispensing with convolutions entirely.

Motivation & Objective

  • To address the limitations of style-based generators in entangled style control and content-independent normalization.
  • To explore image synthesis as a visual token generation problem for improved local and fine-grained style manipulation.
  • To design a generator that enables content-aware, attention-driven style transfer via learned style and content tokens.
  • To achieve high-fidelity image synthesis at high resolutions (e.g., 1024×1024) without using convolutional layers.

Proposed method

  • The generator uses two types of learned latent tokens: content tokens (fixed per image) and style tokens (projected from latent space).
  • A visual Transformer models cross-attention between content tokens and style tokens to condition image generation per region.
  • Content tokens are spatially positioned and represent image patches, while style tokens encode style embeddings for each patch.
  • The model employs LayerNorm for style normalization, outperforming InstanceNorm and PixelNorm in ablation.
  • The generator is trained via adversarial loss with a discriminator, and the mapping network projects noise to style tokens.
  • The architecture is fully transformer-based, eliminating convolutional layers entirely.

Experimental results

Research questions

  • RQ1Can image synthesis be effectively reformulated as a visual token generation task to improve local style control?
  • RQ2How does content-aware style modeling via cross-attention in a Transformer improve image quality compared to global AdaIN-based style injection?
  • RQ3What is the optimal number of style and content tokens for high-resolution image synthesis?
  • RQ4How does the choice of normalization layer affect performance in the token-based generator?
  • RQ5Can the latent space support perceptually smooth interpolation across high-level attributes like hairstyle or facial expression?

Key findings

  • TokenGAN achieves a Fréchet Inception Distance (FID) of 6.81 on FFHQ-256, outperforming StyleGAN2 (FID 7.66) with 32 style tokens.
  • The model generates high-fidelity $1024\times1024$ images without any convolutional layers, demonstrating the feasibility of pure transformer-based image synthesis.
  • Linear interpolation in the style token space produces perceptually smooth transitions across attributes like glasses, age, and hair length.
  • Using 32 style tokens yields the best performance; increasing to 64 leads to training instability and performance drop.
  • LayerNorm outperforms InstanceNorm and PixelNorm in style normalization, achieving the lowest FID (6.81) in ablation studies.

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.