Coder Social home page Coder Social logo

chediak / creative-adversarial-networks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from voodoohop/creative-adversarial-networks

1.0 0.0 0.0 25.08 MB

(WIP) Implementation of Creative Adversarial Networks https://arxiv.org/pdf/1706.07068.pdf

License: MIT License

Python 88.87% Shell 5.89% Jupyter Notebook 5.24%

creative-adversarial-networks's Introduction

Creative Adversarial Networks

collage

256x256 samples directly from CAN (no cherry picking) with fixed classification network trained on WikiArt

An implementation of CAN: Creative Adversarial Networks, Generating "Art" by Learning About Styles and Deviating from Style Norms with a variation that improves sample variance and quality significantly.

Repo based on DCGAN-tensorflow.

Getting the Dataset

We used the wikiart dataset available here. Using the dataset is subject to wikiart's terms of use

mkdir data
cd data
wget http://www.cs-chan.com/source/ICIP2017/wikiart.zip
unzip wikiart.zip

Getting pretrained models

We uploaded all of our models to this google drive folder

Training a CAN model from scratch (architecture used in the paper)

bash experiments/train_can_paper.sh # must run from the root directory of the project

Evaluating an existing CAN model

# make sure that load_dir acts correctly
bash experiments/eval_can_paper.sh

External Style Classification network

We ran an experiment where we trained an inception resnet to classify style (60% accuracy) and then used this for the style classification loss, removing the need to learn the layers in the discriminator. We hold the style classification network constant, so the style distribution doesn't change as the generator improves. We found that this improved the quality and diversity of our samples.

Training CAN with External Style Network

# make sure that `style_net_checkpoint` is set correctly, or you will error out
bash experiment/train_can_external_style.sh

Training the (ImageNet pre-trained) Inception Resnet

Everything you need should be included in the script. The gist is that it converts the wikiart images into tf records trains the last layer of the model on these images, then fine-tunes the entire model for 100 epochs, at the end of which you should get roughlyy 60% validation accuracy. Since we're looking to generate artwork, this gives us a level of accuracy that is sufficient to try and generate new artwork.

cd slim/
vim finetune_inception_resnet_v2_on_wikiart.sh # edit INPUT_DATASET_DIR to match the location of where you downloaded wikiart
bash finetune_inception_resnet_v2_on_wikiart.sh

Evaluating CAN with External Style Network

# make sure that `style_net_checkpoint` and `load_dir` point to the downloaded models. 
bash eval_can_external_style.sh

Experiments

We have run a variety of experiments, all of which are available in the experiments/ directory.

Authors

Phillip Kravtsov

Phillip Kuznetsov

Citation

If you use this implementation in your own work please cite the following

@misc{2017cans,
  author = {Phillip Kravtsov and Phillip Kuznetsov},
  title = {Creative Adversarial Networks},
  year = {2017},
  howpublished = {\url{https://github.com/mlberkeley/Creative-Adversarial-Networks}},
  note = {commit xxxxxxx}
}

creative-adversarial-networks's People

Contributors

bastianthiede avatar philkuz avatar phillip-kravtsov avatar

Stargazers

 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.