6 Star 41 Fork 11

OpenMMLab / mmgeneration

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

ADA

Training Generative Adversarial Networks with Limited Data

Abstract

Training generative adversarial networks (GAN) using too little data typically leads to discriminator overfitting, causing training to diverge. We propose an adaptive discriminator augmentation mechanism that significantly stabilizes training in limited data regimes. The approach does not require changes to loss functions or network architectures, and is applicable both when training from scratch and when fine-tuning an existing GAN on another dataset. We demonstrate, on several datasets, that good results are now possible using only a few thousand training images, often matching StyleGAN2 results with an order of magnitude fewer images. We expect this to open up new application domains for GANs. We also find that the widely used CIFAR-10 is, in fact, a limited data benchmark, and improve the record FID from 5.59 to 2.42.

Results and Models

Results (compressed) from StyleGAN3-ada trained by MMGeneration
Model Dataset Iter FID50k Config Log Download
stylegan3-t-ada metface 1024x1024 130000 15.09 config log model

Usage

Currently we only implement ada for StyleGANv2/v3. To use this training trick. You should use ADAStyleGAN2Discriminator as your discriminator.

An example:

model = dict(
    xxx,
    discriminator=dict(
        type='ADAStyleGAN2Discriminator',
        in_size=1024,
        data_aug=dict(type='ADAAug', aug_pipeline=aug_kwargs, ada_kimg=100)),
    xxx
)

Here, you can adjust ada_kimg to change the magnitude of augmentation(The smaller the value, the greater the magnitude).

aug_kwargs is usually set as follows:

aug_kwargs = {
    'xflip': 1,
    'rotate90': 1,
    'xint': 1,
    'scale': 1,
    'rotate': 1,
    'aniso': 1,
    'xfrac': 1,
    'brightness': 1,
    'contrast': 1,
    'lumaflip': 1,
    'hue': 1,
    'saturation': 1
}

Here, the number is Probability multiplier for each operation. For details, you can refer to augment.

Citation

@inproceedings{Karras2020ada,
  title     = {Training Generative Adversarial Networks with Limited Data},
  author    = {Tero Karras and Miika Aittala and Janne Hellsten and Samuli Laine and Jaakko Lehtinen and Timo Aila},
  booktitle = {Proc. NeurIPS},
  year      = {2020}
}
1
https://gitee.com/open-mmlab/mmgeneration.git
git@gitee.com:open-mmlab/mmgeneration.git
open-mmlab
mmgeneration
mmgeneration
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891