← Open Source
mit-han-lab

data-efficient-gans

[NeurIPS 2020] Differentiable Augmentation for Data-Efficient GAN Training.

Model DevelopmentDataset engineeringArchitecturePython
Open on GitHub
Momentum
+-1stars in 24 hours-0.1%
1.31k
Stars
173
Forks
+0
This week
4
Contributors
Created 2020-06-15 · Updated 2026-10-16 · #18895 today
Top developers
zsyzzsoftjunyanzjustinpinkney

mit-han-lab/data-efficient-gans is ranked 18,895 with 1,309 stars.

Same-category comparison

mit-han-lab/data-efficient-gans is ranked 18,895 among these 8 peers; Alibaba-NLP/ZeroSearch is ranked 18,894.

Same-category comparison
NameRankMetrics
reiniscimurs/DRL-robot-navigation18,880
Language:
Python
Stars:
1,377
Forks:
195
Description:
Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gradient (TD3) neural network, a robot learns to navigate to a random goal point in a simulated environment while avoiding obstacles.
gazebosim/gazebo-classic18,890
Language:
C++
Stars:
1,349
Forks:
516
Description:
Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim.
Renovamen/Speech-Emotion-Recognition18,892
Language:
Python
Stars:
1,314
Forks:
230
Alibaba-NLP/ZeroSearch18,894
Language:
Python
Stars:
1,311
Forks:
119
Description:
ZeroSearch: Incentivize the Search Capability of LLMs without Searching.
libgdx/gdx-ai18,896
Language:
Java
Stars:
1,305
Forks:
251
Description:
Artificial Intelligence framework for games based on libGDX or not. Features: Steering Behaviors, Formation Motion, Pathfinding, Behavior Trees and Finite State Machines.
huanngzh/MV-Adapter18,902
Language:
Python
Stars:
1,295
Forks:
96
Description:
[ICCV 2025] Official impl. of "MV-Adapter: Multi-view Consistent Image Generation Made Easy".
NVIDIA-Merlin/Transformers4Rec18,905
Language:
Python
Stars:
1,284
Forks:
165
Description:
Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.
davidmrau/mixture-of-experts18,908
Language:
Python
Stars:
1,255
Forks:
112
Description:
PyTorch Re-Implementation of "The Sparsely-Gated Mixture-of-Experts Layer" by Noam Shazeer et al. https://arxiv.org/abs/1701.06538.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryDataset engineering, Architecture
KeywordsImage production
Stars1,309
Forks173
Contributors4
Created date2020-06-15
Updated date2026-10-16
Stars in 1 day-1
Stars in 7 days0
Rank18,895
Previous rank10,732
Rank change-8,163
7-day stars rank12,746
Previous 7-day stars rank10,010
7-day stars rank change-2,736
Total stars rank9,046
Previous total stars rank9,026
Total stars rank change-20
CountryUSA
README summary

Data-Efficient GANs with DiffAugment project | paper | datasets | video | slides *Generated using only 100 images of Obama, grumpy cats, pandas, the Bridge of Sighs, the Medici Fountain, the Temple of Heaven, without pre-training. ]** PyTorch training with DiffAugment-stylegan2-pytorch is now available! ]** Time to generate 100-shot interpolation videos with generate_gif. ]** Our DiffAugment-biggan-imagenet repo (for TPU training) is released! ]** Our DiffAugment-biggan-cifar PyTorch repo is released! This repository contains our implementation of Differentiable Augmentation (DiffAugment

) in both PyTorch and TensorFlow. It can be used to significantly improve the data efficiency for GAN training. We have provided DiffAugment-stylegan2 (TensorFlow) and DiffAugment-stylegan2-pytorch, DiffAugment-biggan-cifar (PyTorch) for GPU training, and DiffAugment-biggan-imagenet (TensorFlow) for TPU training. *Low-shot generation without pre-training. With DiffAugment, our model can generate high-fidelity images using only 100 Obama portraits, grumpy cats, or pandas from our collected 100-shot datasets, 160 cats or 389 dogs from the

AnimalFace dataset at 256×256 resolution. * *Unconditional generation results on CIFAR-10. StyleGAN2’s performance drastically degrades given less training data. With DiffAugment, we are able to roughly match its FID and outperform its Inception Score (IS) using only **20%** training data. * Differentiable Augmentation for Data-Efficient GAN Training Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han MIT, Tsinghua University, Adobe Research, CMU arXiv Overview *Overview of DiffAugment for updating D (left) and G (right). DiffAugment

applies the augmentation T to both the real sample x and the generated output G(z). When we update G, gradients need to be back-propagated through T (iii), which requires T to be differentiable w. * To generate an interpolation video using our pre-trained models: or to train a new model: You may also try out , , , , , , or the folder containing your own training images. Please refer to the DiffAugment-stylegan2 README for the dependencies and details. ]** PyTorch training is

now available: DiffAugment for StyleGAN2 To run *StyleGAN2 + DiffAugment* for unconditional generation on the 100-shot datasets, CIFAR, FFHQ, or LSUN, please refer to the DiffAugment-stylegan2 README or DiffAugment-stylegan2-pytorch for the PyTorch version. DiffAugment for BigGAN Please refer to the DiffAugment-biggan-cifar README to run *BigGAN + DiffAugment* for conditional generation on CIFAR (using GPUs), and the DiffAugment-biggan-imagenet README to run on ImageNet (using TPUs). Using DiffAugment for Your Own Training To help you use

DiffAugment in your own codebase, we provide portable DiffAugment operations of both TensorFlow and PyTorch versions in DiffAugment_tf. Generally, DiffAugment can be easily adopted in any model by substituting every *D(x)* with *D(T(x))*, where *x* can be real images or fake images, *D* is the discriminator, and *T* is the DiffAugment operation. For example, We have implemented Color, Translation, and Cutout DiffAugment as visualized below: Citation If you find this code helpful, please cite our paper

: Acknowledgements We thank NSF Career Award #1943349, MIT-IBM Watson AI Lab, Google, Adobe, and Sony for supporting this research.

Frequently asked questions

How many stars and forks are recorded?

mit-han-lab/data-efficient-gans has 1,309 stars and 173 forks.

What is the repository rank?

mit-han-lab/data-efficient-gans is ranked 18,895.

What language and category are recorded?

mit-han-lab/data-efficient-gans has 1,309 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

mit-han-lab/data-efficient-gans is compared with Alibaba-NLP/ZeroSearch, ranked 18,894 with 1,311 stars.

README

Data-Efficient GANs with DiffAugment

project | paper | datasets | video | slides

Generated using only 100 images of Obama, grumpy cats, pandas, the Bridge of Sighs, the Medici Fountain, the Temple of Heaven, without pre-training.

[NEW!] PyTorch training with DiffAugment-stylegan2-pytorch is now available!

[NEW!] Our Colab tutorial is released!

[NEW!] FFHQ training is supported! See the DiffAugment-stylegan2 README.

[NEW!] Time to generate 100-shot interpolation videos with generate_gif.py!

[NEW!] Our DiffAugment-biggan-imagenet repo (for TPU training) is released!

[NEW!] Our DiffAugment-biggan-cifar PyTorch repo is released!

This repository contains our implementation of Differentiable Augmentation (DiffAugment) in both PyTorch and TensorFlow. It can be used to significantly improve the data efficiency for GAN training. We have provided DiffAugment-stylegan2 (TensorFlow) and DiffAugment-stylegan2-pytorch, DiffAugment-biggan-cifar (PyTorch) for GPU training, and DiffAugment-biggan-imagenet (TensorFlow) for TPU training.

Low-shot generation without pre-training. With DiffAugment, our model can generate high-fidelity images using only 100 Obama portraits, grumpy cats, or pandas from our collected 100-shot datasets, 160 cats or 389 dogs from the AnimalFace dataset at 256×256 resolution.

Unconditional generation results on CIFAR-10. StyleGAN2’s performance drastically degrades given less training data. With DiffAugment, we are able to roughly match its FID and outperform its Inception Score (IS) using only 20% training data.

Differentiable Augmentation for Data-Efficient GAN Training

Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han

MIT, Tsinghua University, Adobe Research, CMU

arXiv

Overview

Overview of DiffAugment for updating D (left) and G (right). DiffAugment applies the augmentation T to both the real sample x and the generated output G(z). When we update G, gradients need to be back-propagated through T (iii), which requires T to be differentiable w.r.t. the input.

Training and Generation with 100 Images

To generate an interpolation video using our pre-trained models:

cd DiffAugment-stylegan2
python generate_gif.py -r mit-han-lab:DiffAugment-stylegan2-100-shot-obama.pkl -o obama.gif

or to train a new model:

python run_low_shot.py --dataset=100-shot-obama --num-gpus=4

You may also try out 100-shot-grumpy_cat, 100-shot-panda, 100-shot-bridge_of_sighs, 100-shot-medici_fountain, 100-shot-temple_of_heaven, 100-shot-wuzhen, or the folder containing your own training images. Please refer to the DiffAugment-stylegan2 README for the dependencies and details.

[NEW!] PyTorch training is now available:

cd DiffAugment-stylegan2-pytorch
python train.py --outdir=training-runs --data=https://data-efficient-gans.mit.edu/datasets/100-shot-obama.zip --gpus=1

DiffAugment for StyleGAN2

To run StyleGAN2 + DiffAugment for unconditional generation on the 100-shot datasets, CIFAR, FFHQ, or LSUN, please refer to the DiffAugment-stylegan2 README or DiffAugment-stylegan2-pytorch for the PyTorch version.

DiffAugment for BigGAN

Please refer to the DiffAugment-biggan-cifar README to run BigGAN + DiffAugment for conditional generation on CIFAR (using GPUs), and the DiffAugment-biggan-imagenet README to run on ImageNet (using TPUs).

Using DiffAugment for Your Own Training

To help you use DiffAugment in your own codebase, we provide portable DiffAugment operations of both TensorFlow and PyTorch versions in DiffAugment_tf.py and DiffAugment_pytorch.py. Generally, DiffAugment can be easily adopted in any model by substituting every D(x) with D(T(x)), where x can be real images or fake images, D is the discriminator, and T is the DiffAugment operation. For example,

from DiffAugment_pytorch import DiffAugment
# from DiffAugment_tf import DiffAugment
policy = 'color,translation,cutout' # If your dataset is as small as ours (e.g.,
# hundreds of images), we recommend using the strongest Color + Translation + Cutout.
# For large datasets, try using a subset of transformations in ['color', 'translation', 'cutout'].
# Welcome to discover more DiffAugment transformations!

...
# Training loop: update D
reals = sample_real_images() # a batch of real images
z = sample_latent_vectors()
fakes = Generator(z) # a batch of fake images
real_scores = Discriminator(DiffAugment(reals, policy=policy))
fake_scores = Discriminator(DiffAugment(fakes, policy=policy))
# Calculating D's loss based on real_scores and fake_scores...
...

...
# Training loop: update G
z = sample_latent_vectors()
fakes = Generator(z) # a batch of fake images
fake_scores = Discriminator(DiffAugment(fakes, policy=policy))
# Calculating G's loss based on fake_scores...
...

We have implemented Color, Translation, and Cutout DiffAugment as visualized below:

Citation

If you find this code helpful, please cite our paper:

@inproceedings{zhao2020diffaugment,
  title={Differentiable Augmentation for Data-Efficient GAN Training},
  author={Zhao, Shengyu and Liu, Zhijian and Lin, Ji and Zhu, Jun-Yan and Han, Song},
  booktitle={Conference on Neural Information Processing Systems (NeurIPS)},
  year={2020}
}

Acknowledgements

We thank NSF Career Award #1943349, MIT-IBM Watson AI Lab, Google, Adobe, and Sony for supporting this research. Research supported with Cloud TPUs from Google's TensorFlow Research Cloud (TFRC). We thank William S. Peebles and Yijun Li for helpful comments.

Nearby in the ranking
Similar items