Skip to content

JohnMcCarroll/GAN_Gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GAN Gallery

This project was created for an intro course I took my first semester in RIT's Software Engineering program. It's an exploration of Deep Learning aimed at training a Generative Adversarial Network (GAN) capable of generating original art. This project was created over the course of one semester by a two-person team: John McCarroll and Troy Potter.

GANs are an interesting application of Deep Learning technologies aimed at training a Convolutional Neural Network (CNN) to generate original images from smaller, noisy input matrices, rather than generating small encoding matrices from larger input images. The training loop involves three major components: a ground truth dataset, a generator network, and a discriminator network. First, the generator network creates some output images. Then, those original output images are mixed together with some ground truth images. The resulting training dataset is a labelled superset of newly generated images and ground truth images. In our case, the 'ground truth' images are paintings pulled from wikiArt. The Discriminator network is then trained on this superset, tasked with discerning if a given image is ground truth or originally generated by the Generator network. The Generator network is trained only on the set of images it created; it is rewarded for tricking the Discriminator network into mislabelling its images as "ground truth." This adversarial training loop creates an AI arms race that hopefully results in a robust Generator network, capable of turning noise into art.

Setup

Clone the repo to your local machine:

$ git clone https://github.com/JohnMcCarroll/GAN_Gallery.git

Set up a virtual environment:

$ python -m venv .

Activate your new virtual environment. This command is platform dependent, but for Linux it reads:

$ source bin/activate 

Install dependencies:

$ pip install -r requirements.txt

Curate Data

NOTE: The scripts for this step are currently disorganized, brittle, and take a long time to run. In the interest of time, a collection of uniformly sized paintings can be found in the /data directory.

Collect gallery of paintings from wikiArt:

$ python src/wikiArt.py

Resize images to uniform dimensions:

$ python src/imageDimen.py

Training

Package data for training:

$ python src/InputFormatting.py

Run Training loop:

$ python src/TrainingLoop.py

Improvements

GANs are notoriously unstable to train, and the results of this project are no exception. While we were able to get some interesting output images, they would barely pass as abstract art. We believe there are two major issues with the training loop so far: output image size and training stability. Currently, the data used are 400x400 images. We later discovered that most GAN projects used output sizes of 32x32 to 128x128 to reduce complexity. We also train both the Discriminator the Generator simultaneously during our training loop. This adds to the instability of training loop, as the Generator network must learn to map an ever-changing probability distribution. To address this issue, training should alternate between updating the weights of one network and then the other in periodized blocks.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages