Coder Social home page Coder Social logo

curioustauseef / deep-learning-with-cats Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexiajm/deep-learning-with-cats

0.0 1.0 0.0 8.4 MB

Deep learning with cats (^._.^)

License: GNU General Public License v3.0

Python 92.46% Shell 7.54%

deep-learning-with-cats's Introduction

Deep-learning-with-cats

This repository is a "toy" project so I can gain experience building deep neural networks. My first goal is learning to generate pictures of cats with Generative Adversarial Networks (^._.^).

Updates

  • 17/07/2017 : Added CycleGAN for style transfer, so far doesn't work well with the CAT dataset and it's so slow (20-24h to fully train it) that optimizing it is very difficult. I'm leaving it here for those interested but I probably will try fast neural style instead.
  • 15/07/2017 : Many people were concerned about whether the generated images are really novel or rather just copies of the training dataset so I made a python function that output the 5 most similar training (real) images to the given generated (fake) images. See: https://github.com/AlexiaJM/Generative-model-most-similar-images.

Objectives (so far)

  • Generate images of cats using various types of Generative Adversarial Networks (GAN)
    • use DCGAN (Done)
    • use WGAN (Done)
    • use WGAN-GP (Done)
    • use LSGAN (Done)
    • use BEGAN
  • Transform real cats into art pieces
    • use CycleGAN (Code done)
    • use Fast neural style
  • Various/Others
    • Preprocess cat images so we get aligned cat faces for much better GAN convergence (Done)
    • Separate cats by size to be better able to generate cats of certain sizes (Done)
    • Fix DCGAN models so that they can adapt to different input image sizes (Done)
    • Keeping log for TensorBoard (Done)
    • Automatic folder setup (Done)
    • Add multi-gpu and non-CUDA option (Done)
    • Option to load previous models (Done)
    • Add log to output (Done)
    • L2 Regularization (Done)
    • Try making higher resolutions pictures
      • 128 x 128 (Done)
      • 256 x 256 (Need more higher res data to do this)
    • Try Self-Normalizing Neural Networks (SELU) as per https://arxiv.org/abs/1706.02515 (Done)
    • Add option to generate more cat pictures (Done)
    • Add option to see the 5 nearest real cats images and thus be able to tell if the generated cats are really unique (Done)
    • Dropouts in G
    • Try adding Frechet Inception Distance (FID) as per https://arxiv.org/pdf/1706.08500.pdf
    • Try soft and noisy labels as per https://github.com/soumith/ganhacks
    • Try adding decaying noise to input as per https://github.com/soumith/ganhacks

Needed

To run

$ # Download dataset and preprocess cat pictures 
$ # Create two folders, one for cats bigger than 64x64 and one for cats bigger than 128x128
$ sh setting_up_script.sh
$ # Move to your favorite place
$ mv cats_bigger_than_64x64 "your_input_folder_64x64"
$ mv cats_bigger_than_128x128 "your_input_folder_128x128"
$ # Generate 64x64 cats using DCGAN
$ python Meow_DCGAN.py --input_folder "your_input_folder_64x64" --output_folder "your_output_folder"
$ # Generate 128x128 cats using DCGAN
$ python Meow_DCGAN.py --input_folder="your_input_folder_128x128" --image_size 128 --G_h_size 64 --D_h_size 64 --SELU True
$ # Generate 64x64 cats using WGAN
$ python Meow_WGAN.py --input_folder "your_input_folder_64x64" --output_folder "your_output_folder"
$ # Generate 64x64 cats using WGAN-GP
$ python Meow_WGAN-GP.py --input_folder "your_input_folder_64x64" --output_folder "your_output_folder" --SELU True
$ # Generate 64x64 cats using LSGAN (Least Squares GAN)
$ python Meow_LSGAN.py --input_folder "your_input_folder_64x64" --output_folder "your_output_folder"

To see TensorBoard plots of the losses

$ tensorboard --logdir "your_input_folder"

Results

Discussion of the results at https://ajolicoeur.wordpress.com/cats.

DCGAN 64x64

DCGAN 128x128 with SELU

WGAN 64x64

WGAN-GP 64x64 with SELU

deep-learning-with-cats's People

Contributors

alexiajm avatar

Watchers

 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.