Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

SGGAN - Official Tensorflow Implementation

Sparsely Grouped Multi-task Generative Adversarial Networks for Facial Attribute Manipulation
Jichao Zhang, Yezhi Shu, Songhua Xu, Gongze Cao, Fan Zhong, Meng Liu, Xueying Qin
In ACMMM 2018 Oral.


Abstract: Recently, Image-to-Image Translation (IIT) has made great progress in enabling image style transfer and manipulation of semantic context in an image. However, existing approaches require exhaustive labelling of training data, which is labor demanding, difficult to scale up, and hard to adapt to a new domain. To overcome such a key limitation, we propose sparsely grouped generative adversarial networks(SG-GAN), a novel approach that can perform image translation in the sparsely grouped datasets, which most training data are mixed and just a few are labelled. SG-GAN with one-input multiple output architecture can be used for the translations among multiple groups using only a single trained model. As a case study for experimentally validating the advantages of our model, we apply the algorithm to tackle a series of tasks of attribute manipulation for facial images. Experiment results show that SG-GAN can achieve competitive results compared with previous state-of-the-art methods on adequately labelled datasets while attaining the superior quality of image translation results on sparsely grouped datasets where most data is mixed and only small parts are labelled..


  title={Sparsely grouped multi-task generative adversarial networks for facial attribute manipulation},
  author={Zhang, Jichao and Shu, Yezhi and Xu, Songhua and Cao, Gongze and Zhong, Fan and Liu, Meng and Qin, Xueying},
  booktitle={Proceedings of the 26th ACM international conference on Multimedia},


pip install -r requirments.txt


  • Clone this repo:
git clone
cd Sparsely-Grouped-GAN
  • Download the CelebA dataset

You can download the CelebA dataset and unzip CelebA into a directory.

Just like


The training data folder should look like : 


You can edit label_dir and data_dir in Baseoptions.txt and use the path for your CelebA dataset.

  • Train the model using command line with python
python --exper_name='log20_5_1' --gpu_id='0' --loss_type='wgan_gp' --n_critic=5 --lam_c=10
  • Test the model
python --exper_name='log20_5_1' --gpu_id='0' 

Or Using scripts for training

bash scripts/

Using scripts for testing and pretained model can be downloaded Pretrained Model

bash scripts/

Experiment Result

Reference code


Code for paper "Sparsely Grouped Multi-task Generative Adversarial Networks for Facial Attribute Manipulation"





No releases published


No packages published
You can’t perform that action at this time.