Generative NN :
Style Transfer

TensorFlow & Deep Learning SG

Martin Andrews @ redcatlabs.com

13 April 2017

About Me

  • Machine Intelligence / Startups / Finance
    • Moved from NYC to Singapore in Sep-2013
  • 2014 = 'fun' :
    • Machine Learning, Deep Learning, NLP
    • Robots, drones
  • Since 2015 = 'serious' :: NLP + deep learning
    • & Papers...

Already Covered

  • Basic Neural Network ideas
  • Training : Feature creation
  • Layers : Different 'levels' of Features



http://redcatlabs.com/
2017-03-20_TFandDL_IntroToCNNs/

CNN Review

  • Pixels in an images are 'organised' :
    • Up/down left/right
    • Translational invariance
  • Idea : Use whole image as feature
    • Update parameters of 'Photoshop filters'
  • Mathematical term : 'convolution kernel'
    • CNN = Convolutional Neural Network

CNN Filter

CNN Diagram

Play with a Filter

Convolution Demo http://redcatlabs.com/
2017-03-20_TFandDL_IntroToCNNs/
CNN-demo.html

CNN Model Overview

CNN flow

Image Competition

  • ImageNet aka ILSVRC
  • over 15 million labeled high-resolution images...
  • ... in over 22,000 categories

ImageNet Karpathy

ImageNet-googlenet

  • Pre-trained networks are available :

Google ImageNet

GoogLeNet (2014)

Layers of Features

AlexNet

AlexNet (2012)

Let's Abuse a CNN

  • Last time : Speech Recognition
  • Now : Creating Art

Style-Transfer

  • Combine :
    • Regular photo (you provide)
    • An artist's style (another photo)
  • 'Understand' both using CNN features

Style-Transfer idea

  • Start out with a copy of your photo
  • Change it to mimic :
    • Fine features from the original
    • Style features from the artist
    • A good looking result

Style-Transfer details

  • Start with image==photo (or random noise)
  • Update image to minimise (gradient descent) :
    • Pixel-wise L2 vs photo features
    • Gram-matrix similarity vs style features
    • Self total-variational-loss
  • Change parameters according to taste

Demo time

Style Transfer intermediate layers

github.com/mdda/deep-learning-workshop/
notebooks/2-CNN/6-StyleTransfer/
4-Art-Style-Transfer-inception_tf.ipynb

Some Examples

(Apologies to the artists)

Style Transfer example

Starry Canal (~ van Gogh)

Style Transfer example

Mediterranean Canal (~ Picasso )

Style Transfer example

Cat Cézanne

Wrap-up

  • CNNs have rich features
  • Can be abused in interesting ways
  • Having a GPU is VERY helpful
GitHub - mdda

* Please add a star... *

TF & DL
MeetUp Group

TF Codecamp

  • ML Jeju Camp - mentorship from top Google developers
  • July 3rd through 28th, 2017 in Jeju, South Korea
  • Apply now (limited to 20 people, closes 20-April-2017)
    • Good understanding of TensorFlow and deep learning
    • Submit a project proposal
    • No nationality, gender, age, degree, education requirements
  • Release all code written on GitHub

8-week Deep Learning
Developer Course

  • July - Sept (catch-up during August)
  • Weekly 3-hour sessions will include :
    • Instruction
    • Projects : 3 structured & 2 self-directed
  • More information : http://RedCatLabs.com/course
  • Expect to work hard...

- QUESTIONS -


Martin.Andrews @
RedCatLabs.com


My blog : http://mdda.net/

GitHub : mdda