[Paper Review] Vector-quantized Image Modeling with Improved VQGAN
The paper introduces ViT-VQGAN for improved vector-quantized image modeling (VIM), achieving state-of-the-art FID/IS on ImageNet and strong unsupervised representations via a two-stage ViT-VQGAN encoder/decoder and a decoder-only Transformer for autoregressive token modeling.
Pretraining language models with next-token prediction on massive text corpora has delivered phenomenal zero-shot, few-shot, transfer learning and multi-tasking capabilities on both generative and discriminative language tasks. Motivated by this success, we explore a Vector-quantized Image Modeling (VIM) approach that involves pretraining a Transformer to predict rasterized image tokens autoregressively. The discrete image tokens are encoded from a learned Vision-Transformer-based VQGAN (ViT-VQGAN). We first propose multiple improvements over vanilla VQGAN from architecture to codebook learning, yielding better efficiency and reconstruction fidelity. The improved ViT-VQGAN further improves vector-quantized image modeling tasks, including unconditional, class-conditioned image generation and unsupervised representation learning. When trained on ImageNet at \(256 imes256\) resolution, we achieve Inception Score (IS) of 175.1 and Fr'echet Inception Distance (FID) of 4.17, a dramatic improvement over the vanilla VQGAN, which obtains 70.6 and 17.04 for IS and FID, respectively. Based on ViT-VQGAN and unsupervised pretraining, we further evaluate the pretrained Transformer by averaging intermediate features, similar to Image GPT (iGPT). This ImageNet-pretrained VIM-L significantly beats iGPT-L on linear-probe accuracy from 60.3% to 73.2% for a similar model size. VIM-L also outperforms iGPT-XL which is trained with extra web image data and larger model size.
Motivation & Objective
- Motivate and extend vector-quantized image modeling by replacing CNNs with Vision Transformers in the quantizer to improve efficiency and fidelity.
- Develop a ViT-VQGAN quantizer with better codebook usage and reconstruction quality for downstream autoregressive modeling.
- Show that a Transformer trained on discrete image tokens can perform unconditional/class-conditioned generation and unsupervised representation learning.
- Demonstrate strong image synthesis metrics (FID/IS) and competitive linear-probe performance against prior generative and discriminative pretraining methods.
Proposed method
- Replace CNN encoders/decoders with Vision Transformers in the VQGAN framework (ViT-VQGAN) for end-to-end image quantization.
- Improve codebook usage and reconstruction via factors such as low-dimensional factorized code indices, L2 normalization, and training objectives (logit-laplace, L2, perceptual, GAN losses).
- Train a decoder-only Transformer (VIM) to autoregressively model 1024 image tokens produced by ViT-VQGAN.
- For unsupervised learning, evaluate linear probe by training a softmax head on averaged intermediate Transformer features from a middle block.
- For class-conditioned generation, prepend a class-id token before image tokens during sampling to condition images.
Experimental results
Research questions
- RQ1Can ViT-based quantization (ViT-VQGAN) improve reconstruction quality and codebook usage over CNN-based VQGAN?
- RQ2Does the VIM framework with a Transformer over discrete image tokens achieve strong unconditional and class-conditioned image synthesis?
- RQ3Do the learned representations from VIM yield competitive linear-probe accuracy on ImageNet compared to other generative and discriminative pretraining methods?
- RQ4How do architectural choices (encoder/decoder sizes, codebook design, normalization) impact FID/IS and downstream linear evaluation?
- RQ5What is the impact of removing perceptual loss during unsupervised training versus including it for generation tasks?
Key findings
- ViT-VQGAN achieves better reconstruction quality and faster throughput than CNN-VQGAN across configurations.
- Unconditional ImageNet generation with ViT-VQGAN + VIM-Large yields IS 175.1 and FID 4.17, versus vanilla VQGAN’s IS 70.6 and FID 17.04.
- On ImageNet, linear-probe accuracy for VIM-Large reaches 73.2%, beating iGPT-L (60.3%) and iGPT-XL, indicating strong unsupervised representations.
- Table results show ViT-VQGAN with 8192 codebook size and 1024 tokens delivers superior FID (1.28) on ImageNet, and comparable gains on CelebA-HQ and FFHQ.
- Class-conditioned sampling with ViT-VQGAN achieves an IS of 175.1 and FID of 4.17 (L=Large stage 2), and applying classifier-based rejection sampling further improves FID to 3.04 and IS to 227.4.
- Unsupervised representations (VIM-Large) attain 73.2% linear-probe accuracy on ImageNet, outperforming iGPT-L and close to discriminative methods like BYOL/DINO in linear evaluation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.