ViTGAN: Training GANs with Vision Transformers
Kwonjoon Lee1,3 Huiwen Chang2 Lu Jiang2 Han Zhang2 Zhuowen Tu1 Ce Liu4 1UC San Diego 2Google Research 3Honda Research Institute 4Microsoft Azure AI
Abstract
Recently, Vision Transformers (ViTs) have shown competitive performance on image recognition while requiring less vision-specific inductive biases. In this paper, we investigate if such performance can be extended to image generation. To this end, we integrate the ViT architecture into generative adversarial networks (GANs). For ViT discriminators, we observe that existing regularization methods for GANs interact poorly with self-attention, causing serious instability during training. To resolve this issue, we introduce several novel regularization techniques for training GANs with ViTs. For ViT generators, we examine architectural choices for latent and pixel mapping layers to facilitate convergence. Empirically, our approach, named ViTGAN, achieves comparable performance to the leading CNN-based GAN models on three datasets: CIFAR-10, CelebA, and LSUN bedroom. Our code is available online111https://github.com/mlpc-ucsd/ViTGAN.
中文速览
视觉Transformer(Vision Transformer,ViT)在图像分类上已取得优秀成绩,但能否把它用到图像生成(GAN对抗训练)中,一直是个未解难题。研究者发现,把ViT直接塞进GAN框架后,训练极不稳定——现有的梯度惩罚、谱归一化等正则化方法对卷积网络有效,却会与自注意力机制产生严重冲突。为此,他们提出了一套专为ViT设计的稳定化方案:在判别器侧引入L2注意力、改进的谱归一化、重叠图像块划分以及卷积投影;在生成器侧重新设计隐变量映射层和像素输出层,确保收敛。最终得到的ViTGAN在CIFAR-10、CelebA和LSUN卧室三个标准数据集上达到了与主流CNN-GAN(StyleGAN2)相当的图像生成质量,证明了纯Transformer架构在图像生成任务上的可行性,也为后续用ViT替代CNN做生成模型奠定了基础。
原文 arXiv:2107.04589;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2107.04589v2