+ All Categories
Home > Data & Analytics > Intro To Convolutional Neural Networks

Intro To Convolutional Neural Networks

Date post: 24-Jan-2018
Category:
Upload: mark-scully
View: 268 times
Download: 1 times
Share this document with a friend
78
Intro To Convolu,onal Neural Networks Mark Scully datapraxis.com
Transcript
Page 1: Intro To Convolutional Neural Networks

Intro  To  Convolu,onal  Neural  Networks  

Mark  Scully  datapraxis.com  

Page 2: Intro To Convolutional Neural Networks

Why  CNNs?  

Page 3: Intro To Convolutional Neural Networks

h@ps://papers.nips.cc/paper/4824-­‐imagenet-­‐classifica,on-­‐with-­‐deep-­‐convolu,onal-­‐neural-­‐networks  

Image  Classifica,on  

Page 4: Intro To Convolutional Neural Networks

Object  Recogni,on  

h@ps://research.googleblog.com/2014/09/building-­‐deeper-­‐understanding-­‐of-­‐images.html  

Page 5: Intro To Convolutional Neural Networks

h@p://cs.stanford.edu/people/karpathy/deepimagesent/  

Page 6: Intro To Convolutional Neural Networks

Automa,c  Cap,oning  

h@ps://research.googleblog.com/2014/11/a-­‐picture-­‐is-­‐worth-­‐thousand-­‐coherent.html  

Page 7: Intro To Convolutional Neural Networks

Facial  Recogni,on    

Y.  Taigman,  M.  Yang,  M.  Ranzato,  L.  Wolf,  DeepFace:  Closing  the  Gap  to  Human-­‐Level  Performance  in  Face  Verifica,on,  CVPR  2014  

Page 8: Intro To Convolutional Neural Networks

Terminator  Vision  

Page 9: Intro To Convolutional Neural Networks

Colorize  Black  &  White  Images  

h@p://richzhang.github.io/coloriza,on/  

Page 10: Intro To Convolutional Neural Networks

Style  Transfer  

h@p://genekogan.com/works/style-­‐transfer/  

Mona  Lisa  restyled  by  Picasso,  van  Gough,  and  Monet  

Page 11: Intro To Convolutional Neural Networks

Generate  An  Image  From  A  Sketch  

h@ps://affinelayer.com/pixsrv/  

Page 12: Intro To Convolutional Neural Networks

ImageNet  Challenge  

Alexnet  Li  Fei-­‐Fei:  ImageNet  Large  Scale  Visual  Recogni,on  Challenge,  2014  

Page 13: Intro To Convolutional Neural Networks

ImageNet  Challenge  ILSVRC+

ImageNet Classification error throughout years and groups

Li  Fei-­‐Fei:  ImageNet  Large  Scale  Visual  Recogni,on  Challenge,  2014  

Page 14: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

Input  Conv  

Relu  Pool  

Conv  

Relu  

Pool  

Conv  

Relu  

Conv  

Relu  

Conv  Relu  

Pool  

FC  

Dropout  

FC  

Dropout  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  

1097-­‐1105,  2012  

FC  1000  

Page 15: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Page 16: Intro To Convolutional Neural Networks

ImageNet  Challenge  

Alexnet  Li  Fei-­‐Fei:  ImageNet  Large  Scale  Visual  Recogni,on  Challenge,  2014  

Page 17: Intro To Convolutional Neural Networks

Tradi,onal  Approach  To  Image  Classifica,on  

Input  Image  Hand  

Extracted  Features  

Classifier   Object  Label  

Page 18: Intro To Convolutional Neural Networks

Issues  

•  Who  makes  the  features?  – Need  an  expert  for  each  problem  domain  

•  Which  features?  – Are  they  the  same  for  every  problem  type?  

•  How  robust  are  these  features  to  real  images?  – Transla,on,  Rota,on,  contrast  changes,  etc.  

Page 19: Intro To Convolutional Neural Networks

Are  these  pictures  of  the  same  thing?  

Page 20: Intro To Convolutional Neural Networks

Features  Are  Hierarchical    

•  A  squirrel  is  a  combina,on  of  fur,  arms,  legs,  &  a  tail  in  specific  propor,ons.  

•  A  tail  is  made  of  texture,  color,  and  spa,al  rela,onships  

•  A  texture  is  made  of  oriented  edges,  gradients,  and  colors  

Page 21: Intro To Convolutional Neural Networks

Image  Features  

•  A  feature  is  something  in  the  image  or  derived  from  it  that’s  relevant  to  the  task  

•  Edges  •  Lines  at  different  angles,  curves,  etc.  •  Colors,  or  pa@erns  of  colors  •  SIFT,  SURF,  HOG,  GIST,  ORB,  etc  

Page 22: Intro To Convolutional Neural Networks

Edges  

Page 23: Intro To Convolutional Neural Networks

Ideally  We’d  Learn  Features  

Input  Image  

Output  Label  

Page 24: Intro To Convolutional Neural Networks

Ideally  We’d  Learn  Features  

Input  Image  

Output  Label  

CNNs  

Page 25: Intro To Convolutional Neural Networks

What  is  a  Neural  Network?  

•  Perceptron  is  biologically  inspired  •  A  mental  model  for  interpre,ng  the  math  

h@p://cs231n.stanford.edu/index.html    

Page 26: Intro To Convolutional Neural Networks

Perceptron  

1  

x1  

x2  

x3  

xm  

Σ   Output  

Ac,va,on  Func,on  Sum  

w0  

w1  

w2  

w3  

wm  

Weights  Inputs  

Page 27: Intro To Convolutional Neural Networks

Perceptron  

1  

x1  

x2  

x3  

xm  

Σ   Output  

Ac,va,on  Func,on  Sum  

w0  

w1  

w2  

w3  

wm  

Weights  Inputs  

wixii=0

m

∑ = w0x0 +w1x1 +w2x2 +...+wmxm

Page 28: Intro To Convolutional Neural Networks

Ac,va,on  Func,ons  

Page 29: Intro To Convolutional Neural Networks

Training:  Upda,ng  Weights  

1  

x1  

x2  

x3  

x4  

Σ   Output  

Ac,va,on  Func,on  Sum  

w0  

w1  

w2  

w3  

w4  

Weights  Inputs  

Error  =  Output  -­‐  Target  

Page 30: Intro To Convolutional Neural Networks

Perceptron  Decision  Boundary  

Page 31: Intro To Convolutional Neural Networks

Deep  (Mul,-­‐Layer)  Neural  Network  

Page 32: Intro To Convolutional Neural Networks

Backpropaga,on  

•  Error  propagates  backward  and  it  all  works  via  (normally  stochas,c)  gradient  descent.  

•  (wave  hands)  

Page 33: Intro To Convolutional Neural Networks
Page 34: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Page 35: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 36: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 37: Intro To Convolutional Neural Networks

Input:  Pixels  Are  Just  Numbers  

h@ps://medium.com/@ageitgey/machine-­‐learning-­‐is-­‐fun-­‐part-­‐3-­‐deep-­‐learning-­‐and-­‐convolu,onal-­‐neural-­‐networks-­‐f40359318721  

Page 38: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 39: Intro To Convolutional Neural Networks

Goals  

•  Need  to  detect  the  same  feature  anywhere  in  an  image  

•  Reuse  the  same  weights  over  and  over  •  What  we  really  want  is  one  neuron  that  detects  a  feature  that  we  slide  over  the  image  

Page 40: Intro To Convolutional Neural Networks

Neuron  =  Filter  

•  Act  as  detectors  for  some  specific  image  feature  

•  Take  images  as  inputs  and  produce  image  like  feature  maps  as  outputs  

Page 41: Intro To Convolutional Neural Networks

Convolu,on  

•  Like  sliding  a  matrix  over  the  input  and  performing  dot  products  

•  It’s  all  just  matrix  mul,plica,on  

Page 42: Intro To Convolutional Neural Networks

Convolu,on  

Page 43: Intro To Convolutional Neural Networks

Convolu,on  

Page 44: Intro To Convolutional Neural Networks

Filters  (or  Kernels)  

Sharpen  

Page 45: Intro To Convolutional Neural Networks

Filters  (or  Kernels)  

Box  Blur  

Page 46: Intro To Convolutional Neural Networks

Filters  (or  Kernels)  

Edge  Detec,on  

Feature  Map  

Page 47: Intro To Convolutional Neural Networks

Alexnet  Architecture  

Convolu,ons  

Page 48: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 49: Intro To Convolutional Neural Networks

Nonlinearity  

Page 50: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 51: Intro To Convolutional Neural Networks

Max  Pooling  Example  

Page 52: Intro To Convolutional Neural Networks

Alexnet  Architecture  

3x3  stride  2  Max  Pooling  

Page 53: Intro To Convolutional Neural Networks

Pooling  

•  Allows  us  to  look  at  more  of  the  image  •  Max,  sum,  and  L2  pooling  •  A  type  of  downsampling  

Page 54: Intro To Convolutional Neural Networks

CNN  Layer  Architecture  

Input  

Convolu,on  

Nonlinearity  

Pooling  (op,onal)  

Dropout  (op,onal)  

Page 55: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

Input  Conv  

Relu  Pool  

Conv  

Relu  

Pool  

Conv  

Relu  

Conv  

Relu  

Conv  Relu  

Pool  

FC  

Dropout  

FC  

Dropout  

FC  1000  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  

1097-­‐1105,  2012  

Dropout  

Page 56: Intro To Convolutional Neural Networks

Dropout  

h@p://cs231n.github.io/neural-­‐networks-­‐2/  

•  Randomly  disable  some  neurons  on  the  forward  pass  

•  Prevents  overfiong    

Page 57: Intro To Convolutional Neural Networks

Let’s  Predict  Something!  

•  We  have  all  these  features,  how  do  we  learn  to  label  something  based  on  them?  

Page 58: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

Input  Conv  

Relu  Pool  

Conv  

Relu  

Pool  

Conv  

Relu  

Conv  

Relu  

Conv  Relu  

Pool  

FC  

Dropout  

FC  

Dropout  

FC  1000  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  

1097-­‐1105,  2012  

Fully  Connected  

Page 59: Intro To Convolutional Neural Networks

Fully  Connected  Layers  

•  Each  neuron  is  connected  to  all  inputs  •  Standard  mul,layer  neural  net  •  Learns  non-­‐linear  combina,ons  of  the  feature  maps  to  make  predic,ons  

Page 60: Intro To Convolutional Neural Networks

Alexnet  Architecture  

Page 61: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

Input  Conv  

Relu  Pool  

Conv  

Relu  

Pool  

Conv  

Relu  

Conv  

Relu  

Conv  Relu  

Pool  

FC  

Dropout  

FC  

Dropout  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  

1097-­‐1105,  2012  

FC  1000  

Page 62: Intro To Convolutional Neural Networks

Which  Class  Is  It  Again?  

•  FC-­‐1000  gives  us  1000  numbers,  one  per  class,  how  do  we  compare  them?  

Page 63: Intro To Convolutional Neural Networks

Soqmax  

•  Mul,-­‐class  version  of  logis,c  func,on  •  Outputs  normalized  class  “probabili,es”  •  Takes  m  inputs  and  produces  m  outputs  between  zero  and  one,  that  sum  to  one  

•  Cross-­‐entropy  loss  •  Differen,able  

Page 64: Intro To Convolutional Neural Networks

h@ps://papers.nips.cc/paper/4824-­‐imagenet-­‐classifica,on-­‐with-­‐deep-­‐convolu,onal-­‐neural-­‐networks  

Image  Classifica,on  

Page 65: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Layer  1  

Page 66: Intro To Convolutional Neural Networks

Learned  Filters  –  Layer1  

Page 67: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Layer  2  

Page 68: Intro To Convolutional Neural Networks

Learned  Filters  –  Layer2  

Visualizing  and  Understanding  Convolu,onal  Networks  -­‐  Zeiler  &  Fergus,  ECCV  2014    

Page 69: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Layer  3  

Page 70: Intro To Convolutional Neural Networks

Learned  Filters  -­‐  Layer3  

Visualizing  and  Understanding  Convolu,onal  Networks  -­‐  Zeiler  &  Fergus,  ECCV  2014      

Page 71: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Layer  4   Layer  5  

Page 72: Intro To Convolutional Neural Networks

Learned  Features  –  Layers  4  &  5  

Page 73: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  1097-­‐1105,  

2012    

Page 74: Intro To Convolutional Neural Networks

Alexnet  Architecture  -­‐  2012  

Input  Conv  

Relu  Pool  

Conv  

Relu  

Pool  

Conv  

Relu  

Conv  

Relu  

Conv  Relu  

Pool  

FC  

Dropout  

FC  

Dropout  

ImageNet  Classifica,on  with  Deep  Convolu,onal  Neural  Networks  Alex  Krizhevsky,  Ilya  Sutskever  and  Geoffrey  E.  Hinton  Advances  in  Neural  Informa,on  Processing  Systems  25  eds.F.  Pereira,  C.J.C.  Burges,  L.  Bo@ou  and  K.Q.  Weinberger  pp.  

1097-­‐1105,  2012  

FC  1000  

Page 75: Intro To Convolutional Neural Networks

VGG16  

h@ps://blog.heuritech.com/2016/02/29/a-­‐brief-­‐report-­‐of-­‐the-­‐heuritech-­‐deep-­‐learning-­‐meetup-­‐5/  

Page 76: Intro To Convolutional Neural Networks

Google’s  Incep,on  Module  

Page 77: Intro To Convolutional Neural Networks

To  Learn  More  

•  h@p://colah.github.io/posts/2014-­‐07-­‐Understanding-­‐Convolu,ons/  

•  h@ps://adeshpande3.github.io/adeshpande3.github.io/The-­‐9-­‐Deep-­‐Learning-­‐Papers-­‐You-­‐Need-­‐To-­‐Know-­‐About.html  

•  h@p://cs231n.github.io/  •  h@p://course.fast.ai/  

Page 78: Intro To Convolutional Neural Networks

Ques,ons?  


Recommended