Intro to CNNs

TensorFlow & Deep Learning SG

Martin Andrews @ redcatlabs.com

20 March 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...

Quick Review

  • Basic Neuron : Simple computation
  • Layers of Neurons : Feature creation



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

Single "Neuron"

One Neuron

Change weights to change output function

Multi-Layer

Layers of neurons combine and
can form more complex functions

Multi-Layer

TensorFlow Playground

TensorFlow Layout http://playground.tensorflow.org/

Things to Understand

  • Hands-on :
    • Goal : learning to predict regions
    • Input features
    • What a single neuron can learn
    • The blame game
    • How deep networks 'create' features

What is a CNN?

  • 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 Flow

CNN flow

Image Competition

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

ImageNet Karpathy

Winning Networks ...

AlexNet

AlexNet (2012)

Getting Bigger ...

Google ImageNet

GoogLeNet (2014)

3-ImageNet-googlenet

  • Demo of a pre-trained network

github.com / mdda / deep-learning-workshop
/notebooks/3-ImageNet-googlenet.ipynb

... Even More Complex

Google Inception v3

Google Inception-v3 (2015)

... and Deeper

Revolution of Depth

Microsoft ResNet (2015)

Beyond images?

  • Since CNNs are good at images ...
  • ... make everything into images

Let's Abuse a CNN

  • For example : Speech Recognition
  • Make this into an Image Recognition task

Speech Data 'stamps'

speech/SpeechRecognition_Dat

github.com/mdda/deep-learning-workshop/
notebooks/speech/SpeechRecognition_Data.ipynb

CNN Speech Recognition

stamps.shape: (31, 64, 32)
labels.shape: (31,)
batch_input_fn sizing :  (31, 64, 32, 1)

INFO:tensorflow:Starting evaluation at 2017-03-18-04:31:04
INFO:tensorflow:Evaluation [1/1]
INFO:tensorflow:Finished evaluation at 2017-03-18-04:31:05
{'accuracy': 1.0, 'loss': 0.0068151536, 'global_step': 3830}

... /speech/SpeechRecognition_Learn.ipynb

Wrap-up

  • CNNs can be applied to lots of things
  • Exploit known problem structure
  • Having a GPU is VERY helpful
GitHub - mdda

* Please add a star... *

Deep Learning
MeetUp Group

Deep Learning : 1-day Intro

  • Level : Beginner+
  • Date : ~May TBD
  • Basic plan :
    • 10am-4pm+ on a weekend
    • Play with real models
    • Ask questions 1-on-1
    • Get inspired
  • Cost: S$12 (lunch included)

10-week Deep Learning
Developer Course

  • Plan : Start ~June
  • Weekly 3-hour sessions will include :
    • Instruction
    • 4 structured projects
    • 2 self-directed projects
  • Cost: S$TBD
  • Expect to work hard...

- QUESTIONS -


Martin.Andrews @
RedCatLabs.com


My blog : http://mdda.net/

GitHub : mdda