/sdgan

Implementation of "Semantically Decomposing the Latent Spaces of Generative Adversarial Networks"

Primary LanguagePythonMIT LicenseMIT

SD-GAN Tensorflow

Implementation of Semantically Decomposing the Latent Spaces of Generative Adversarial Networks (arXiv, demo).

Semantically decomposed GANs (SD-GANs) learn a decomposed latent space separating identity from the other contingent aspects of observations. In our paper, we demonstrate that SD-GANs can disentangle factors of variation corresponding to identity from photographs of celebrity faces and shoes. SD-GANs are especially applicable for datasets with many labels but few observations of each. Example results from an SD-GAN model; each row shares an identity and each column shares contingent factors:

Currently, only the SD-DCGAN model is implemented here; SD-BEGAN forthcoming.

Instructions

Download one or both of the compressed datasets to sdgan/data:

Run training:

  1. Navigate to: sdgan/data
  2. Extract a dataset: tar xvfz msceleb12k.tar.gz
  3. Navigate to: sdgan
  4. Run training: ./train.sh
  5. Navigate to: sdgan/train
  6. (Optional) Run grid visualization: ./prev.sh
  7. Run tensorboard: tensorboard --logdir=.

Requirements

  • tensorflow (>= 1.0)
  • numpy

Adding new datasets

To add new datasets, follow the naming convention in the prepackaged ones above. Dataset folder must have subdirectory called train. train must contain 64x64 png files formatted as <ID_NAME>_<OBS_NUMBER>_<?>.png. In our datasets, <?> is the original aspect ratio for the source image of the 64x64 thumbnail, though the attribute is unused in our code.

Attribution

If you use this dataset in your research, cite via the following BibTeX:

@article{donahue2017sdgan,
  title={Semantically Decomposing the Latent Spaces of Generative Adversarial Networks},
  author={Donahue, Chris and Balsubramani, Akshay and McAuley, Julian and Lipton, Zachary C},
  journal={arXiv:1705.07904},
  year={2017}
}

Reference code/datasets

Author

Chris Donahue (website, gscholar, twitter)