Coder Social home page Coder Social logo

generate_datasets's Introduction

Synthetic Data Gen Logo

Synthetic Data Generation

User friendly library to generate datasets using GANs and VAEs.

Paper supporting this library: Synthetic Data Generation To Better Perceive Classifier Predictions

Installation

Use git to install generate_datasets.

git clone https://github.com/Mr-Vicente/generate_datasets.git

Usage

GAN

from generate_datasets import data_access
from generate_datasets.WGAN_GP.wgan_gp_class_generic import WGAN_GP

EPOCHS = 500
OUTPUT_DIR = "imgs_gen"
params = {
    'lr': 0.0001,
    'beta1': 0,
    'batch_size': 64,
    'latent_dim': 128,
    'image_size': 152
}

class_names = ['Blond-yellow','Yellow','Orange','Orange-Brown','Blond',
                'Light-Brown','Brown','Black','Gray','White']


Number_Dataset_Classes = len(class_names)

gan = WGAN_GP(params)
gan.load_dataset(data_access.prepare_data('gan'),Number_Dataset_Classes)
gan.train_model(EPOCHS)
gan.generate_images(10,OUTPUT_DIR,class_names)

If no classifier is provided to GANs, the gan model will behave like a normal gan. The interest of one providing a classifier to our GAN model might be to better understand how it is operating, or even to generate images of a specific class.

VAE

from generate_datasets import data_access
from generate_datasets.VAE.generic_vannila_vae import VAE
from generate_datasets.Processing import process_cartoon

EPOCHS = 500
n_images = 10
OUTPUT_DIR = "imgs_gen"

params = {
    'lr': 0.0001,
    'beta1': 0,
    'batch_size': 64,
    'latent_dim': 128,
    'image_size': 152
}

class_names = ['Blond-yellow','Yellow','Orange','Orange-Brown','Blond',
                'Light-Brown','Brown','Black','Gray','White']

def load_cartoon_data():
    images, labels = process_cartoon.decode_data_cartoon()
    return images, labels

tf.keras.backend.clear_session()

model = VAE()
model.load_dataset(data_access.prepare_dataset('vae',load_cartoon_data(),image_size=(128,128)))
model.train_model(epochs)
model.generate_images(n_images,OUTPUT_DIR)

Library Info

This library has several generative models at your despose:

  • GAN (Generative Adversarial Network)
    • Status: Working
    • Paper: GAN
    • Official Implementation: None
  • VAE (Variational Autoencoder)
    • Status: Working
    • Paper: VAE
    • Official Implementation: None
  • WGAN (Wasserstein GAN)
    • Status: Working
    • Paper: WGAN
    • Official Implementation: None
  • WGAN-GP (Wasserstein GAN with Gradient Penalty)
  • PGGAN (Progressive Growing GAN)
  • IntroVAE (Introspective Variational Autoencoder)
    • Status: Not giving proper results
    • Paper: IntroVAE
    • Official Implementation: None

To learn more about these Generative models visit the referenced papers/implementations.

Generated Images (examples)

Epochs Datasets Original Images WGAN-GP VAE IntroVAE
~20 Fashion MNIST Fashion MNIST image sample Image generated by WGAN-GP Image generated by Vae -
~200 Cartoon Dataset Cartoon Dataset image sample Image generated by WGAN-GP Image generated by Vae -
~200 Train Dataset Train Dataset image sample Image generated by WGAN-GP - Image generated by IntroVae
~200 LSUN Bedroom Dataset LSUN Bedroom Dataset image sample Image generated by WGAN-GP - -

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Project status

On going!

Authors and acknowledgment

Frederico Vicente & Ludwig Krippahl

License

MIT

generate_datasets's People

Contributors

mr-vicente avatar

Watchers

 avatar  avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.