6 Star 41 Fork 11

OpenMMLab / mmgeneration

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 10.42 KB
一键复制 编辑 原始数据 按行查看 历史
LeoXing1996 提交于 2022-09-13 15:44 . [CI] Fix Master CI (#431)

SNGAN

Spectral Normalization for Generative Adversarial Networks

Abstract

One of the challenges in the study of generative adversarial networks is the instability of its training. In this paper, we propose a novel weight normalization technique called spectral normalization to stabilize the training of the discriminator. Our new normalization technique is computationally light and easy to incorporate into existing implementations. We tested the efficacy of spectral normalization on CIFAR10, STL-10, and ILSVRC2012 dataset, and we experimentally confirmed that spectrally normalized GANs (SN-GANs) is capable of generating images of better or equal quality relative to the previous training stabilization techniques.

Results and models

Results from our SNGAN-PROJ trained in CIFAR10 and ImageNet
  
Models Dataset Inplace ReLU disc_step Total Iters* Iter IS FID Config Download Log
SNGAN_Proj-32x32-woInplaceReLU Best IS CIFAR10 w/o 5 500000 400000 9.6919 9.8203 config ckpt Log
SNGAN_Proj-32x32-woInplaceReLU Best FID CIFAR10 w/o 5 500000 490000 9.5659 8.1158 config ckpt Log
SNGAN_Proj-32x32-wInplaceReLU Best IS CIFAR10 w 5 500000 490000 9.5564 8.3462 config ckpt Log
SNGAN_Proj-32x32-wInplaceReLU Best FID CIFAR10 w 5 500000 490000 9.5564 8.3462 config ckpt Log
SNGAN_Proj-128x128-woInplaceReLU Best IS ImageNet w/o 5 1000000 952000 30.0651 33.4682 config ckpt Log
SNGAN_Proj-128x128-woInplaceReLU Best FID ImageNet w/o 5 1000000 989000 29.5779 32.6193 config ckpt Log
SNGAN_Proj-128x128-wInplaceReLU Best IS ImageNet w 5 1000000 944000 28.1799 34.3383 config ckpt Log
SNGAN_Proj-128x128-wInplaceReLU Best FID ImageNet w 5 1000000 988000 27.7948 33.4821 config ckpt Log

'*' Iteration counting rule in our implementation is different from others. If you want to align with other codebases, you can use the following conversion formula:

total_iters (biggan/pytorch studio gan) = our_total_iters / disc_step

We also provide converted pre-train models from Pytorch-StudioGAN. To be noted that, in Pytorch Studio GAN, inplace ReLU is used in generator and discriminator.

Models Dataset Inplace ReLU disc_step Total Iters IS (Our Pipeline) FID (Our Pipeline) IS (StudioGAN) FID (StudioGAN) Config Download Original Download link
SAGAN_Proj-32x32 StudioGAN CIFAR10 w 5 100000 9.372 10.2011 8.677 13.248 config model model
SAGAN_Proj-128x128 StudioGAN ImageNet w 2 1000000 30.218 29.8199 32.247 26.792 config model model
  • Our Pipeline denote results evaluated with our pipeline.
  • StudioGAN denote results released by Pytorch-StudioGAN.

For IS metric, our implementation is different from PyTorch-Studio GAN in the following aspects:

  1. We use Tero's Inception for feature extraction.
  2. We use bicubic interpolation with PIL backend to resize image before feed them to Inception.

For FID evaluation, we follow the pipeline of BigGAN, where the whole training set is adopted to extract inception statistics, and Pytorch Studio GAN uses 50000 randomly selected samples. Besides, we also use Tero's Inception for feature extraction.

You can download the preprocessed inception state by the following url: CIFAR10 and ImageNet1k.

You can use following commands to extract those inception states by yourself.

# For CIFAR10
python tools/utils/inception_stat.py --data-cfg configs/_base_/datasets/cifar10_inception_stat.py --pklname cifar10.pkl --no-shuffle --inception-style stylegan --num-samples -1 --subset train

# For ImageNet1k
python tools/utils/inception_stat.py --data-cfg configs/_base_/datasets/imagenet_128x128_inception_stat.py --pklname imagenet.pkl --no-shuffle --inception-style stylegan --num-samples -1 --subset train

Citation

@inproceedings{miyato2018spectral,
  title={Spectral Normalization for Generative Adversarial Networks},
  author={Miyato, Takeru and Kataoka, Toshiki and Koyama, Masanori and Yoshida, Yuichi},
  booktitle={International Conference on Learning Representations},
  year={2018},
  url={https://openreview.net/forum?id=B1QRgziT-},
}
1
https://gitee.com/open-mmlab/mmgeneration.git
git@gitee.com:open-mmlab/mmgeneration.git
open-mmlab
mmgeneration
mmgeneration
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891