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.
Model | Dataset | Iter | FID50k | Config | Log | Download |
---|---|---|---|---|---|---|
stylegan3-t-ada | metface 1024x1024 | 130000 | 15.09 | config | log | model |
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.
@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}
}