Top Banner
Deep CNNs Stanford University 06-Dec-2018 1 Lecture: Deep Convolutional Neural Networks Shubhang Desai Stanford Vision and Learning Lab
32

Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Jul 07, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

1

Lecture:DeepConvolutionalNeuralNetworks

ShubhangDesaiStanfordVisionandLearningLab

Page 2: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

2

Today’sagenda

• Deepconvolutionalnetworks• HistoryofCNNs• CNNdev• Architecturesearch

Page 3: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

3

Previously…

InputImage Prediction𝑦" Classifier

𝑎𝑟𝑔𝑚𝑎𝑥 𝑐)*+,

ClassificationOutput

InputLabel

𝑦 𝐶𝐸 𝐿LossValueLossFunction

FeatureExtractor

Page 4: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

4

Previously…

InputImage Prediction𝑦" Classifier

𝑎𝑟𝑔𝑚𝑎𝑥 𝑐)*+,

ClassificationOutput

InputLabel

𝑦 𝐶𝐸 𝐿LossValueLossFunction

FeatureExtractor

Page 5: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

5

Previously…

InputImage Prediction𝑦" Classifier

𝑎𝑟𝑔𝑚𝑎𝑥 𝑐)*+,

ClassificationOutput

InputLabel

𝑦 𝐶𝐸 𝐿LossValueLossFunction

FeatureExtractor

Page 6: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

6

Previously…

InputImage Prediction𝑦" Classifier

𝑎𝑟𝑔𝑚𝑎𝑥 𝑐)*+,

ClassificationOutput

InputLabel

𝑦 𝐶𝐸 𝐿LossValueLossFunction

FeatureExtractor

3)Usinggradientdescent!

Page 7: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

7

Previously…

InputImage Prediction𝑦" Classifier

𝑎𝑟𝑔𝑚𝑎𝑥 𝑐)*+,

ClassificationOutput

InputLabel

𝑦 𝐶𝐸 𝐿LossValueLossFunction

FeatureExtractor

3)Usinggradientdescent!

Whyonlyoneconvolution?

Page 8: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

8

Convolutions

Convolutions=Insights

MoreConvolutions=MoreInsights?

Page 9: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

9

RecallHubelandWeisel…

Page 10: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

10

RecallHubelandWeisel…

Thethinghasedges…

Theedgescanbegroupedintotrianglesandovals…

Thetrianglesareears,theovalisabody…

It’samousetoy!

Page 11: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

11

RecallHubelandWeisel…

Thethinghasedges…

Theedgescanbegroupedintotrianglesandovals…

Thetrianglesareears,theovalisabody…

It’samousetoy!

Page 12: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

12

ConvolutionsAcrossChannels

28×28×3 Image 15×15×3 Filter 14×14×1 Output

Page 13: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

13

ConvolutionsAcrossChannels

28×28×3 Image 15×15×3×4 Filter 14×14×4 Output

Page 14: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

14

ConvolutionsAcrossChannels

28×28×3 Image 15×15×3×4 Filter 14×14×4 Output

moreoutputchannels=morefilters

=morefeatureswecanlearn!

Page 15: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

15

ConvolutionsAcrossChannels

15×15×3×4 ConvBlock

Page 16: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

16

StackingConvolutions

32×32×3Input

28×28×4Output

14×14×6Output

7×7×8Output

1×1×10Output

5×5×3×4ConvBlock

15×15×4×6ConvBlock

8×8×6×8ConvBlock

7×7×8×10ConvBlock

Page 17: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

17

StackingConvolutions

32×32×3Input

28×28×4Output

14×14×6Output

7×7×8Output

1×1×10Output

5×5×3×4ConvBlock

15×15×4×6ConvBlock

8×8×6×8ConvBlock

7×7×8×10ConvBlock

Page 18: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

18

ConvolutionalNeuralNetworks(ConvNets)

• Neuralnetworkswhichinvolvethestackingofmultipleconvolutionallayerstoproduceoutput

• Oftentimesendinfully-connectedlayersasthe“classifier”

Page 19: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

19

HistoryofConvNets

LeNet – 1998

Page 20: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

20

HistoryofConvNets

AlexNet – 2012

Page 21: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

21

HistoryofConvNets

NiN – 2013

Page 22: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

22

HistoryofConvNets

InceptionNetwork– 2015

Page 23: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

23

WhyDoTheyWorkSoWell?

Page 24: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

24

WhyDoTheyWorkSoWell?

Page 25: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

25

WhyDoTheyWorkSoWell?

Page 26: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

26

WhyDoTheyWorkSoWell?

Page 27: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

27

WhyDoTheyWorkSoWell?

Thisistheneuralnetwork’s“receptivefield”—it’sable

tosee!

Page 28: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

28

GreatApplicationsofConvNets

Fine-Grained Recognition Segmentation

ArtGeneration FacialRecognition

“StaffordshireBullTerrier”

“RanjayKrishna”

Page 29: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

29

WhatisCNNDev?

• Definetheobjective–Whatistheinput/output?–Whatistheloss/objectivefunction?

• Createthearchitecture– Howmanyconvlayers?–Whatsizearetheconvolutions?– Howmanyfully-connectedlayers?

• Definehyperparameters–Whatisthelearningrate?

• Trainandevaluate– Howdidwedo?– Howcanwedobetter?

Page 30: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

30

WhatisCNNDev?

• Definetheobjective–Whatistheinput/output?–Whatistheloss/objectivefunction?

• Createthearchitecture– Howmanyconvlayers?–Whatsizearetheconvolutions?– Howmanyfully-connectedlayers?

• Definehyperparameters–Whatisthelearningrate?

• Trainandevaluate– Howdidwedo?– Howcanwedobetter?

Canthisbeautomated?

Page 31: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

31

NeuralArchitectureSearch

Automaticallyfindsthebestarchitectureforagiventask

Beforewehadtofindbestfeaturizer forafixedclassifier—nowwefindthebestclassifierandfeaturizer intandem!

Page 32: Lecture: Deep Convolutional Neural Networksvision.stanford.edu/teaching/cs131_fall1819/files/20_deep_cnns.pdfConvolutional Neural Networks (ConvNets) • Neural networks which involve

Deep CNNs

Stanford University

06-Dec-2018

32

Insummary…

Wecanuseconvolutionsasabasistobuildpowerfulvisualsystems

Wecanleveragedeeplearningtoautomaticallylearnthebestwaystodopreviouslydifficulttasksincomputervision

Stilllotsofopenquestions!

Ifyou’reinterestedinmachinelearningand/ordeeplearning,take:• MachineLearning(CS229)• DeepLearning(CS230)• NLPwithDeepLearning(CS224n)• ConvolutionalNeuralNetworks(CS231n)