Giter Site home page Giter Site logo

vivianbuan / geneticdraw Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 181.32 MB

The GeneticDraw is a model designed for automatically drawing images given a label using genetic algorithm and CNN classifier. It is result of EECS289 Spring2018 final project.

Python 100.00%

geneticdraw's Introduction

Evolutionary Painting: Use genetic algorithm and convolutional neural network to create artworks。

The GeneticDraw is a model designed for automatically drawing images given a label using genetic algorithm and CNN classifier. This is the result of gruaduation student final project of Berkeley EECS 189/289A course.

If you're interested, checkout our final report for details of experiment results and discussion.

Instroduction

In this project we investigate the ability of genetic algorithm to draw original painting. We design a selection, crossover, and mutation model using 50 shapes of ellipses and polygons to draw MNIST-like digits given a specific target label. A MNIST classifier with three convolutional layers and one fully connected layer was used to evaluate the generated images by computing the Kullback–Leibler divergence from the predicted probabilities to the one hot vector of the desired label. The final results we generate are human decipherable, as well as incorporating nice art effects.

The genetic algorithm part of our model is modified from vishaldotkhanna/polygonGA.
The MNIST classifier is modified from golbin/TensorFlow-MNIST

Model

Result

The results of using our model to draw MNIST-like digits given target label 0-9. The results are not perfect but are human decipherable.

Notice that we are not trying to reconstruct perfect imageslike those are done with generative adversarial network (GAN) whose idea is also derived from biology, but toexpand the idea of evolutionary painting associated with theknowledge in machine learning.



Usage

Run main.py in polygonGA-modified/ to start drawing. To specify the target digit to draw, change img_label on line 165.

TensorFlow-MNIST-modified/models/has-unknown/drop-out/ folder contains pretrained MNIST classifier with images of one label been dropt out and an unknown label related to randomly generated images introduced. If you're Pycharm user, remember to add the model to library.

To train your own model, run train.py in TensorFlow-MNIST-modified/. You can choose whether or not to include drop out and unknown by setting the flags accordingly.

Our model can be extended to different image classifier. We experimented with VGG16 but didn't result in readable images. For more details of our experiments and decision choice, refer to our final report.

Authors

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.