Skip to content

shinshoji01/Latent_Conditional_GAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latent Conditional GAN

This repository is to introduce PyTorch implementation of our paper: "LCGAN: Conditional GAN with Multiple Discrete Classes"


Introduction

This paper introduces Latent Conditional GAN. This is Conditional GAN whose label is generated by the latent code of Variational Auto-Encoder(VAE). Thanks to this kind of label representation, compared to the one-hot vector, the model has advantages as follows:

  • Reduction of the label dimension
  • Inclusion of the class relevance
  • Representing the continuous label by discrete classes
  • not depending on the structure of GANs and VAEs

I conducted the experimentation with CelebA dataset, which has plenty of annotations. As a result, this model could generate data that changes continuously in regard to the given class vector with a lower dimension.


Notebook Structure

The whole picture of my model is shown below.

Screen Shot 2020-07-29 at 12 18 32

This procedure is divided into 3 notebooks and they are colored separately. I'm gonna show the results and concise explanations, please visit the notebooks for the detail and the implementation.

VAE

The reconstructed images are shown below, where the upper images represent the input image and the others are reconstructed by the model. The reconstructed image seems to be distinguishable among the classes.

image

Dimension Reduction

As I said, a relational label is the label which is processed by the latent code of VAE. In this experiment, dimension of the latent code was 128 and it's reduced to 3 by the means of dimension reduction. Please visit the notebook to follow the detail. A gif and static image of the relational label is shown below.

relational_label_gif_for_git Screen Shot 2020-07-29 at 12 23 24

LCGAN

This is the final experiment for LCGAN. I employed the relational label as a label instead of the one-hot vector. The motivation of using this label is representation of continuous label. So that I've changed the label gradually and observed the output as shown below.

transition_LCGAN image


Installation of some apps

Git LFS (large file storage)

Since this repository contains the parameters of VAE and LCGAN. I used Git LFS to store a large file. The codes below are the recipe for macOS. For the others, please visit this.

brew update
brew install git-lfs
  • then, navigate to this repository.
git lfs install
git lfs fetch --all
git lfs pull

Docker Environment

This repository contains docker environment to allow anyone to try my model. To make the execution simple, I created my environment with docker-compose. Please follow the procedure below to build my environment.

  1. Go to Docker/
  2. docker-compose up -d
  3. docker-compose exec lcgan nohup jupyter lab --ip=0.0.0.0 --no-browser --allow-root --NotebookApp.token='' --port 8085
  4. Go to http://localhost:8085/lab

Citation

If our work is useful for your research, please consider to cite:

@article{Sho INOUE2020,
  title={LCGAN: Conditional GAN with Multiple Discrete Classes},
  author={Sho INOUE and Tad GONSALVES},
  journal={人工知能学会全国大会論文集},
  volume={JSAI2020},
  number={ },
  pages={2K4ES202-2K4ES202},
  year={2020},
  doi={10.11517/pjsai.JSAI2020.0_2K4ES202}
}

Coming soon

Some are not explained which include:

  • the structures of VAE and LCGAN.
  • explanations of some functions.

Contact

Feel free to contact me if you have any question(s-inoue-tgz@eagle.sophia.ac.jp).


Notice

ここに掲載した著作物の利用に関する注意 本著作物の著作権は人工知能学会に帰属しま す。本著作物は著作権者である人工知能学会の許可のもとに掲載するものです。ご利用に当 たっては「著作権法」に従うことをお願いいたします。

Notice for the use of this material. The copyright of this material is retained by the Japanese Society for Artificial Intelligence (JSAI). This material is published here with the agreement of JSAI. Please be complied with Copyright Law of Japan if any users wish to reproduce, make derivative work, distribute or make available to the public any part or whole thereof. All Rights Reserved, Copyright (C) The Japanese Society for Artificial Intelligence.

About

This repository is to introduce our research, LCGAN.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published