SlideShare a Scribd company logo
1 of 54
Download to read offline
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 1
Lecture 5: Understanding Convnets and Knowledge Transfer
Deep Learning @ UvA
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 2
o What are the Convolutional Neural Networks?
o Why are they important in Computer Vision?
o Differences from standard Neural Networks
o How to train a Convolutional Neural Network?
Previous Lecture
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 3
o What do convolutions look like?
o Build on the visual intuition behind Convnets
o Deep Learning Feature maps
o Transfer Learning
Lecture Overview
UVA DEEP LEARNING COURSE
EFSTRATIOS GAVVES
UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 4
Understanding
convnets
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 5
o Traditionally, medium sized filters (smaller than 11 × 11)
o Modern architectures prefer small filter sizes (e.g. 3 × 3)
o We lose frequency resolution
o Fewer parameters to train
o Deeper networks of cascade filters
◦ Still, the same output dimensionalities
How large filters?
∗
𝑣𝑠.
𝑑 + 1 2 𝑑 + 1 2
2𝑑 + 1 2
𝐿𝑎𝑦𝑒𝑟 𝑙 ∗ (𝐿𝑎𝑦𝑒𝑟 𝑙 + 1)
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 6
o Traditionally, medium sized filters (smaller than 11 × 11)
o Modern architectures prefer small filter sizes (e.g. 3 × 3)
o We lose frequency resolution
o Fewer parameters to train
o Deeper networks of cascade filters
◦ Still, the same output dimensionalities
How large filters?
∗
𝑣𝑠.
𝑑 + 1 2 𝑑 + 1 2
2𝑑 + 1 2
𝐿𝑎𝑦𝑒𝑟 𝑙 ∗ (𝐿𝑎𝑦𝑒𝑟 𝑙 + 1)
For stride 1 the first feature
map has dimensionality
𝐻−2𝑑−1
1
+ 1 = 𝐻 − 2𝑑
For stride 1 the first feature map has dimensionality
𝐻 − 𝑑, the second image
𝐻−𝑑−𝑑−1
1
+ 1 = 𝐻 − 2𝑑
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 7
o Filters learn how
different variances
affect appearance
o Different layers and
different hierarchies
focus on different
transformations
o For different objects
filters reproduce
different behaviors
Filter invariance and equivariance
Aubry et al., Understanding deep features with computer-generated imagery , 2015]
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 8
Filter invariance and equivariance
Right-left chairs look different
Right-left cars look similar
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 9
The effect of the architecture
Depth is important
Early signs of
overfitting
Overfitting
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 10
o ℎ𝐼 𝑥, 𝑦 = 𝐼 𝑥, 𝑦 ∗ ℎ
= σ𝑖=−𝑎
𝑎 σ𝑗=−𝑏
𝑏
𝐼 𝑥 − 𝑖, 𝑦 − 𝑗 ⋅ ℎ(𝑖, 𝑗)
o For every image pixel we compute a convolved
image pixel
o After each convolution we end up with a "new
image
Convolution activations are “images”
ℎ(𝐼)
𝐼
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 11
o What do the image activations in different layers look like?
o What types of images create the strongest activations?
o What are the activations for the class “ostrich”?
o Do the activations occur in meaningful positions?
Several interesting questions
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 12
o The convolution activations are also called feature maps
o A deep network has several hierarchical layers
◦ hence several feature maps
Feature maps
Image borrowed by
A. Karpathy
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 13
o Naturally, given an image some feature maps will be “stronger”
◦ Contribute higher amount to the final classification score
o Why? What pixel structure excited these particular feature maps?
◦ Generally, what part of the picture excites a certain feature map?
Feature map strength
Image borrowed by
A. Karpathy
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 14
o Naturally, given an image some feature maps will be “stronger”
◦ Contribute higher amount to the final classification score
o Why? What pixel structure excited these particular feature maps?
◦ Generally, what part of the picture excites a certain feature map?
Feature map strength
Image borrowed by
A. Karpathy
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 15
Starting from a convnet [Zeiler2014]
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 16
o Same as convent, but in reverse
◦ Instead of mapping pixels to activations,
mapping activations to pixels
o Attach a deconvnet layer on every
convnet layer
o Unpooling via switches that remember
where max pooling was activated
o Deconv filtering equals to
“reverse conv filtering”
Visualization with a Deconvnet [Zeiler2014]
𝐹 =
1 5
6 3
𝐹𝑇 =
3 6
5 1
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 17
What excites feature maps?
o “Given a random feature map what are the top 9 activations?”
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 18
What excites feature maps?
Similar activations from lower level visual patterns
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 19
What excites feature maps? [Zeiler2014]
Similar activations
from semantically
similar pictures
Visual patterns
become more and
more intricate
and specific (greater
invariance)
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 20
Feature evolution over training
o For a particular neuron (that generates a feature map)
o Pick the strongest activation during training
o For epochs 1, 2, 5, 10, 20, 30, 40, 64
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 21
But does a Convnet really learn the object?
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 22
o What is the image with the highest “dogness score”
arg max
𝐼
𝑆𝑐 𝐼; 𝜃 − 𝜆 Ι 2
◦ The parameters 𝜃 are fixed during the training
◦ Optimization is done with respect to the image Ι
◦ Initialized with the “average training image”
What is a “Convnet dog”, however? [Simonyan2014]
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 23
Maximum-scoring class images
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 24
Maximum-scoring class images
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 25
Maximum-scoring class images
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 26
o Given the “monkey” class, what are the
most “monkey-ish” parts in my image?
o Approximate 𝑆𝑐 around an initial point 𝐼0
with the first order Taylor expansion
𝑆𝑐 𝐼 ȁ𝐼0
≈ 𝑤𝑇𝐼 + 𝑏, where 𝑤 =
𝜕𝑆𝑐
𝜕𝐼
ȁ𝐼0
from
backpropagation
◦ Solution is locally optimal
Class-specific image saliency
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 27
Examples
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 28
Examples
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 29
Object localization using class saliency
GrabCut
UVA DEEP LEARNING COURSE
EFSTRATIOS GAVVES
UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 30
Fooling a Convnet
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 31
o What if we follow a similar procedure but with a different goal
o Generate “visually random” images
◦ Images that make a lot of sense to a Convnet but no sense at all to us
o Or, assume we make very small changes to a picture (invisible to the
naked eye)
◦ Is a convnet always invariant to these changes?
◦ Or could it be fooled?
Fooling images
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 32
o We assume our classifiers enjoy local generalization
o Assume an image containing a cat lies at coordinates 𝑥
o Assume also a small change 𝑟 around 𝑥, such that 𝑥 + 𝑟 < 𝜀
◦ 𝜀 is a very small constant
o Is the smoothness assumption reasonable?
o Or can we “break” it by some adversarial examples
◦ E.g. if we correctly classify 𝑥 as “Argan goat”, with the
right 𝑟 make the convnet see a “BMW i6”
◦ The 𝑥 + 𝑟 would be adversarial examples
Smoothness assumption
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 33
o If 𝑓: ℛ𝑚
→ 1 … , 𝑘 our goal can be mathematically described as
min 𝑟 2
𝑠. 𝑡. 𝑓 𝑥 + 𝑟 = 𝑙, 𝑥 + 𝑟 ∈ 0, 1 𝑚
o The goal is to optimize the distortion 𝑟 so that the predicted label 𝑙 is
different than the original label
Generating adversarial examples
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 34
Adversarial images
Image Image
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 35
Adversarial images
Image+Noise Image+Noise
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 36
Adversarial images
Image+Noise=Image’ Image+Noise=Image’
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 37
Adversarial images
Image’=Predicted as Ostrich, Struthiocamelus
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 38
More adversarial images
UVA DEEP LEARNING COURSE
EFSTRATIOS GAVVES
UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 39
Knowledge transfer
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 40
o A CNN can have millions of parameters
o What about the dataset size?
o Could we still train a CNN without overfitting problems?
CNNs and dataset size
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 41
o Assume two datasets, 𝑇 and 𝑆
o Dataset 𝑆 is
◦ fully annotated, plenty of images
◦ We can build a model ℎ𝑆
o Dataset 𝑇 is
◦ Not as much annotated, or much fewer images
◦ The annotations of 𝑇 do not need to overlap with 𝑆
o We can use the model ℎ𝑆 to learn a better ℎ𝑇
o This is called transfer learning
Transfer learning
Imagenet: 1million
My dataset: 1,000
𝒉𝑨
𝒉𝑩
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 42
o Even if our dataset 𝑇 is not large, we can train a CNN for it
o Pre-train a network on the dataset 𝑆
o Then, there are two solutions
◦ Fine-tuning
◦ CNN as feature extractor
Convnets are good in transfer learning
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 43
o Assume the parameters of 𝑆 are already a good start near our final local
optimum
o Use them as the initial parameters for our new CNN for the target dataset
𝜃Τ, 𝑙
(𝑡=0)
= 𝜃S, 𝑙 for some layers 𝑙 = 1, 2, …
o This is a good solution when the dataset 𝑇 is relatively big
◦ E.g. for Imagenet 𝑆 with approximately 1 million images
◦ For a dataset 𝑇 with more than a few thousand images should be ok
o What layers to initialize and how?
Solution I: Fine-tune ℎ𝑇 using ℎ𝑆 as initialization
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 44
o Classifier layer to loss
◦ The loss layer essentially is the “classifier”
◦ Same labels  keep the weights from ℎ𝑆
◦ Different labels  delete the layer and start over
◦ When too few data, fine-tune only this layer
o Fully connected layers
◦ Very important for fine-tuning
◦ Sometimes you need to completely delete the last
before the classification layer if datasets are very
different
◦ Capture more semantic, “specific” information
◦ Always try first when fine-tuning
◦ If you have more data, fine-tune also these layers
Initializing ℎ𝑇 with ℎ𝑆
Convolutional Layer 1
Convolutional Layer 2
Convolutional Layer 3
Convolutional Layer 4
Convolutional Layer 5
Fully connected layer fc6
Fully connected layer fc7
Classifier layer fc8
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 45
o Upper convolutional layers (conv4, conv5)
◦ Mid-level spatial features (face, wheel detectors …)
◦ Can be different from dataset to dataset
◦ Capture more generic information
◦ Fine-tuning pays off
◦ Fine-tune if dataset is big enough
o Lower convolutional layers (conv1, conv2)
◦ They capture low level information
◦ This information does not change usually
◦ Probably, no need to fine-tune but no harm trying
Initializing ℎ𝑇 with ℎ𝑆
Convolutional Layer 1
Convolutional Layer 2
Convolutional Layer 3
Convolutional Layer 4
Convolutional Layer 5
Fully connected layer fc6
Fully connected layer fc7
Classifier layer fc8
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 46
o For layers initialized from ℎ𝑆 use a mild learning rate
◦ Remember: your network is already close to a near optimum
◦ If too aggressive, learning might diverge
◦ A learning rate of 0.001 is a good starting choice (assuming
0.01 was the original learning rate)
o For completely new layers (e.g. loss) use aggressive
learning rate
◦ If too small, the training will converge very slowly
◦ Remember: the rest of the network is near a solution, this
layer is very far from one
◦ A learning rate of 0.01 is a good starting choice
o If datasets are very similar, fine-tune only fully
connected layers
o If datasets are different and you have enough data,
fine-tune all layers
How to fine-tune?
Convolutional Layer 1
Convolutional Layer 2
Convolutional Layer 3
Convolutional Layer 4
Convolutional Layer 5
Fully connected layer fc6
Fully connected layer fc7
Classifier layer fc8
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 47
o Essentially similar to a case of solution I
◦ but train only the loss layer
o Essentially use the network as a pretrained feature extractor
o This is a good solution if the dataset 𝑇 is small
◦ Any fine-tuning of layer might cause overfitting
o Or when we don’t have the resources to train a deep net
o Or when we don’t care for the best possible accuracy
Solution II: Use ℎ𝑠 as a feature extractor for ℎ𝑇
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 48
Deep features from different layers
Convolutional
Layer
1
Convolutional
Layer
2
Convolutional
Layer
3
Convolutional
Layer
4
Convolutional
Layer
5
Fully
connected
layer
fc6
Fully
connected
layer
fc6
Fully
connected
layer
fc7
fc7 feature space
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 49
Deep features from different layers
Convolutional
Layer
1
Convolutional
Layer
2
Convolutional
Layer
3
Convolutional
Layer
4
Convolutional
Layer
5
Fully
connected
layer
fc6
Fully
connected
layer
fc6
Fully
connected
layer
fc6
fc6 feature space
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 50
Deep features from different layers
Convolutional
Layer
1
Convolutional
Layer
2
Convolutional
Layer
3
Convolutional
Layer
4
Convolutional
Layer
5
Fully
connected
layer
fc6
Fully
connected
layer
fc6
Convolutional
Layer
5 Conv5 feature space
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 51
Which layer?
Visualizing and Understanding Convolutional Networks, Zeiler and Fergus, ECCV 2014
Higher layer features are capture
more semantic information. Good
for higher level classification
Lower layer features capture more
basic information (texture, etc). Good
for image-to-image comparisons,
image retrieval
UVA DEEP LEARNING COURSE
EFSTRATIOS GAVVES
UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 52
Summary
o What do convolutions look like?
o Build on the visual intuition behind Convnets
o Deep Learning Feature maps
o Transfer Learning
UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 53
o http://www.deeplearningbook.org/
◦ Part II: Chapter 11
[Aubry2015] Aubry, Russell. Understanding deep features with computer-generated imagery, ICCV, 2015
[Nguyen2015] Nguyen, Yosinksi, Clune. Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Images,
CVPR, 2015
[Simonyan2014] Simonyan, Vedaldi, Zisserman . Deep Inside Convolutional Networks: Visualising Image Classification Models and
Saliency Maps, CVPR 2014
[Zeiler2014] Zeiler, Fergus, Visualizing and Understanding Convolutional Networks, ECCV, 2014
Reading material & references
UVA DEEP LEARNING COURSE
EFSTRATIOS GAVVES
UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 54
Next lecture
o Convolutional Neural Networks for Object
Detection and Segmentation
o Convolutional Neural Networks and Structured
Prediction

More Related Content

Similar to lecture5.pdf

Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...
Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...
Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...Wee Hyong Tok
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harrisWael Badawy
 
A tutorial on deep learning at icml 2013
A tutorial on deep learning at icml 2013A tutorial on deep learning at icml 2013
A tutorial on deep learning at icml 2013Philip Zheng
 
[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded ImaginationDeep Learning JP
 
23 Machine Learning Feature Generation
23 Machine Learning Feature Generation23 Machine Learning Feature Generation
23 Machine Learning Feature GenerationAndres Mendez-Vazquez
 
What convnets look at when they look at nudity
What convnets look at when they look at nudityWhat convnets look at when they look at nudity
What convnets look at when they look at nudityRyan Compton
 
Using Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataUsing Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataAnalyticsWeek
 
Automatic Attendance System using CNN
Automatic Attendance System using CNNAutomatic Attendance System using CNN
Automatic Attendance System using CNNPinaki Ranjan Sarkar
 
Multimodal Residual Networks for Visual QA
Multimodal Residual Networks for Visual QAMultimodal Residual Networks for Visual QA
Multimodal Residual Networks for Visual QAJin-Hwa Kim
 
Introduction to Fundamentals of RNNs
Introduction to Fundamentals of RNNsIntroduction to Fundamentals of RNNs
Introduction to Fundamentals of RNNsElvis Saravia
 
MLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningMLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningCharles Deledalle
 
Lec11: Active Contour and Level Set for Medical Image Segmentation
Lec11: Active Contour and Level Set for Medical Image SegmentationLec11: Active Contour and Level Set for Medical Image Segmentation
Lec11: Active Contour and Level Set for Medical Image SegmentationUlaş Bağcı
 
Composing graphical models with neural networks for structured representatio...
Composing graphical models with  neural networks for structured representatio...Composing graphical models with  neural networks for structured representatio...
Composing graphical models with neural networks for structured representatio...Jeongmin Cha
 

Similar to lecture5.pdf (15)

Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...
Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...
Bootstrap Custom Image Classification using Transfer Learning by Danielle Dea...
 
Recognition
RecognitionRecognition
Recognition
 
Computer Vision harris
Computer Vision harrisComputer Vision harris
Computer Vision harris
 
A tutorial on deep learning at icml 2013
A tutorial on deep learning at icml 2013A tutorial on deep learning at icml 2013
A tutorial on deep learning at icml 2013
 
[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination[DL輪読会]Generative Models of Visually Grounded Imagination
[DL輪読会]Generative Models of Visually Grounded Imagination
 
23 Machine Learning Feature Generation
23 Machine Learning Feature Generation23 Machine Learning Feature Generation
23 Machine Learning Feature Generation
 
What convnets look at when they look at nudity
What convnets look at when they look at nudityWhat convnets look at when they look at nudity
What convnets look at when they look at nudity
 
Using Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataUsing Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigData
 
alexVAE_New.pdf
alexVAE_New.pdfalexVAE_New.pdf
alexVAE_New.pdf
 
Automatic Attendance System using CNN
Automatic Attendance System using CNNAutomatic Attendance System using CNN
Automatic Attendance System using CNN
 
Multimodal Residual Networks for Visual QA
Multimodal Residual Networks for Visual QAMultimodal Residual Networks for Visual QA
Multimodal Residual Networks for Visual QA
 
Introduction to Fundamentals of RNNs
Introduction to Fundamentals of RNNsIntroduction to Fundamentals of RNNs
Introduction to Fundamentals of RNNs
 
MLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningMLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learning
 
Lec11: Active Contour and Level Set for Medical Image Segmentation
Lec11: Active Contour and Level Set for Medical Image SegmentationLec11: Active Contour and Level Set for Medical Image Segmentation
Lec11: Active Contour and Level Set for Medical Image Segmentation
 
Composing graphical models with neural networks for structured representatio...
Composing graphical models with  neural networks for structured representatio...Composing graphical models with  neural networks for structured representatio...
Composing graphical models with neural networks for structured representatio...
 

More from Tigabu Yaya

ML_basics_lecture1_linear_regression.pdf
ML_basics_lecture1_linear_regression.pdfML_basics_lecture1_linear_regression.pdf
ML_basics_lecture1_linear_regression.pdfTigabu Yaya
 
03. Data Exploration in Data Science.pdf
03. Data Exploration in Data Science.pdf03. Data Exploration in Data Science.pdf
03. Data Exploration in Data Science.pdfTigabu Yaya
 
MOD_Architectural_Design_Chap6_Summary.pdf
MOD_Architectural_Design_Chap6_Summary.pdfMOD_Architectural_Design_Chap6_Summary.pdf
MOD_Architectural_Design_Chap6_Summary.pdfTigabu Yaya
 
MOD_Design_Implementation_Ch7_summary.pdf
MOD_Design_Implementation_Ch7_summary.pdfMOD_Design_Implementation_Ch7_summary.pdf
MOD_Design_Implementation_Ch7_summary.pdfTigabu Yaya
 
GER_Project_Management_Ch22_summary.pdf
GER_Project_Management_Ch22_summary.pdfGER_Project_Management_Ch22_summary.pdf
GER_Project_Management_Ch22_summary.pdfTigabu Yaya
 
lecture_GPUArchCUDA02-CUDAMem.pdf
lecture_GPUArchCUDA02-CUDAMem.pdflecture_GPUArchCUDA02-CUDAMem.pdf
lecture_GPUArchCUDA02-CUDAMem.pdfTigabu Yaya
 
lecture_GPUArchCUDA04-OpenMPHOMP.pdf
lecture_GPUArchCUDA04-OpenMPHOMP.pdflecture_GPUArchCUDA04-OpenMPHOMP.pdf
lecture_GPUArchCUDA04-OpenMPHOMP.pdfTigabu Yaya
 
6_RealTimeScheduling.pdf
6_RealTimeScheduling.pdf6_RealTimeScheduling.pdf
6_RealTimeScheduling.pdfTigabu Yaya
 
200402_RoseRealTime.ppt
200402_RoseRealTime.ppt200402_RoseRealTime.ppt
200402_RoseRealTime.pptTigabu Yaya
 
matrixfactorization.ppt
matrixfactorization.pptmatrixfactorization.ppt
matrixfactorization.pptTigabu Yaya
 
The Jacobi and Gauss-Seidel Iterative Methods.pdf
The Jacobi and Gauss-Seidel Iterative Methods.pdfThe Jacobi and Gauss-Seidel Iterative Methods.pdf
The Jacobi and Gauss-Seidel Iterative Methods.pdfTigabu Yaya
 
C_and_C++_notes.pdf
C_and_C++_notes.pdfC_and_C++_notes.pdf
C_and_C++_notes.pdfTigabu Yaya
 
nabil-201-chap-03.ppt
nabil-201-chap-03.pptnabil-201-chap-03.ppt
nabil-201-chap-03.pptTigabu Yaya
 
Mat 223_Ch3-Determinants.ppt
Mat 223_Ch3-Determinants.pptMat 223_Ch3-Determinants.ppt
Mat 223_Ch3-Determinants.pptTigabu Yaya
 
Chapter 2 variety of modelling
Chapter 2 variety of modellingChapter 2 variety of modelling
Chapter 2 variety of modellingTigabu Yaya
 

More from Tigabu Yaya (20)

ML_basics_lecture1_linear_regression.pdf
ML_basics_lecture1_linear_regression.pdfML_basics_lecture1_linear_regression.pdf
ML_basics_lecture1_linear_regression.pdf
 
03. Data Exploration in Data Science.pdf
03. Data Exploration in Data Science.pdf03. Data Exploration in Data Science.pdf
03. Data Exploration in Data Science.pdf
 
MOD_Architectural_Design_Chap6_Summary.pdf
MOD_Architectural_Design_Chap6_Summary.pdfMOD_Architectural_Design_Chap6_Summary.pdf
MOD_Architectural_Design_Chap6_Summary.pdf
 
MOD_Design_Implementation_Ch7_summary.pdf
MOD_Design_Implementation_Ch7_summary.pdfMOD_Design_Implementation_Ch7_summary.pdf
MOD_Design_Implementation_Ch7_summary.pdf
 
GER_Project_Management_Ch22_summary.pdf
GER_Project_Management_Ch22_summary.pdfGER_Project_Management_Ch22_summary.pdf
GER_Project_Management_Ch22_summary.pdf
 
lecture_GPUArchCUDA02-CUDAMem.pdf
lecture_GPUArchCUDA02-CUDAMem.pdflecture_GPUArchCUDA02-CUDAMem.pdf
lecture_GPUArchCUDA02-CUDAMem.pdf
 
lecture_GPUArchCUDA04-OpenMPHOMP.pdf
lecture_GPUArchCUDA04-OpenMPHOMP.pdflecture_GPUArchCUDA04-OpenMPHOMP.pdf
lecture_GPUArchCUDA04-OpenMPHOMP.pdf
 
6_RealTimeScheduling.pdf
6_RealTimeScheduling.pdf6_RealTimeScheduling.pdf
6_RealTimeScheduling.pdf
 
Regression.pptx
Regression.pptxRegression.pptx
Regression.pptx
 
lecture2.pdf
lecture2.pdflecture2.pdf
lecture2.pdf
 
Chap 4.ppt
Chap 4.pptChap 4.ppt
Chap 4.ppt
 
200402_RoseRealTime.ppt
200402_RoseRealTime.ppt200402_RoseRealTime.ppt
200402_RoseRealTime.ppt
 
matrixfactorization.ppt
matrixfactorization.pptmatrixfactorization.ppt
matrixfactorization.ppt
 
nnfl.0620.pptx
nnfl.0620.pptxnnfl.0620.pptx
nnfl.0620.pptx
 
L20.ppt
L20.pptL20.ppt
L20.ppt
 
The Jacobi and Gauss-Seidel Iterative Methods.pdf
The Jacobi and Gauss-Seidel Iterative Methods.pdfThe Jacobi and Gauss-Seidel Iterative Methods.pdf
The Jacobi and Gauss-Seidel Iterative Methods.pdf
 
C_and_C++_notes.pdf
C_and_C++_notes.pdfC_and_C++_notes.pdf
C_and_C++_notes.pdf
 
nabil-201-chap-03.ppt
nabil-201-chap-03.pptnabil-201-chap-03.ppt
nabil-201-chap-03.ppt
 
Mat 223_Ch3-Determinants.ppt
Mat 223_Ch3-Determinants.pptMat 223_Ch3-Determinants.ppt
Mat 223_Ch3-Determinants.ppt
 
Chapter 2 variety of modelling
Chapter 2 variety of modellingChapter 2 variety of modelling
Chapter 2 variety of modelling
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 

lecture5.pdf

  • 1. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 1 Lecture 5: Understanding Convnets and Knowledge Transfer Deep Learning @ UvA
  • 2. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 2 o What are the Convolutional Neural Networks? o Why are they important in Computer Vision? o Differences from standard Neural Networks o How to train a Convolutional Neural Network? Previous Lecture
  • 3. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 3 o What do convolutions look like? o Build on the visual intuition behind Convnets o Deep Learning Feature maps o Transfer Learning Lecture Overview
  • 4. UVA DEEP LEARNING COURSE EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 4 Understanding convnets
  • 5. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 5 o Traditionally, medium sized filters (smaller than 11 × 11) o Modern architectures prefer small filter sizes (e.g. 3 × 3) o We lose frequency resolution o Fewer parameters to train o Deeper networks of cascade filters ◦ Still, the same output dimensionalities How large filters? ∗ 𝑣𝑠. 𝑑 + 1 2 𝑑 + 1 2 2𝑑 + 1 2 𝐿𝑎𝑦𝑒𝑟 𝑙 ∗ (𝐿𝑎𝑦𝑒𝑟 𝑙 + 1)
  • 6. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 6 o Traditionally, medium sized filters (smaller than 11 × 11) o Modern architectures prefer small filter sizes (e.g. 3 × 3) o We lose frequency resolution o Fewer parameters to train o Deeper networks of cascade filters ◦ Still, the same output dimensionalities How large filters? ∗ 𝑣𝑠. 𝑑 + 1 2 𝑑 + 1 2 2𝑑 + 1 2 𝐿𝑎𝑦𝑒𝑟 𝑙 ∗ (𝐿𝑎𝑦𝑒𝑟 𝑙 + 1) For stride 1 the first feature map has dimensionality 𝐻−2𝑑−1 1 + 1 = 𝐻 − 2𝑑 For stride 1 the first feature map has dimensionality 𝐻 − 𝑑, the second image 𝐻−𝑑−𝑑−1 1 + 1 = 𝐻 − 2𝑑
  • 7. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 7 o Filters learn how different variances affect appearance o Different layers and different hierarchies focus on different transformations o For different objects filters reproduce different behaviors Filter invariance and equivariance Aubry et al., Understanding deep features with computer-generated imagery , 2015]
  • 8. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 8 Filter invariance and equivariance Right-left chairs look different Right-left cars look similar
  • 9. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 9 The effect of the architecture Depth is important Early signs of overfitting Overfitting
  • 10. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 10 o ℎ𝐼 𝑥, 𝑦 = 𝐼 𝑥, 𝑦 ∗ ℎ = σ𝑖=−𝑎 𝑎 σ𝑗=−𝑏 𝑏 𝐼 𝑥 − 𝑖, 𝑦 − 𝑗 ⋅ ℎ(𝑖, 𝑗) o For every image pixel we compute a convolved image pixel o After each convolution we end up with a "new image Convolution activations are “images” ℎ(𝐼) 𝐼
  • 11. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 11 o What do the image activations in different layers look like? o What types of images create the strongest activations? o What are the activations for the class “ostrich”? o Do the activations occur in meaningful positions? Several interesting questions
  • 12. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 12 o The convolution activations are also called feature maps o A deep network has several hierarchical layers ◦ hence several feature maps Feature maps Image borrowed by A. Karpathy
  • 13. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 13 o Naturally, given an image some feature maps will be “stronger” ◦ Contribute higher amount to the final classification score o Why? What pixel structure excited these particular feature maps? ◦ Generally, what part of the picture excites a certain feature map? Feature map strength Image borrowed by A. Karpathy
  • 14. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 14 o Naturally, given an image some feature maps will be “stronger” ◦ Contribute higher amount to the final classification score o Why? What pixel structure excited these particular feature maps? ◦ Generally, what part of the picture excites a certain feature map? Feature map strength Image borrowed by A. Karpathy
  • 15. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 15 Starting from a convnet [Zeiler2014]
  • 16. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 16 o Same as convent, but in reverse ◦ Instead of mapping pixels to activations, mapping activations to pixels o Attach a deconvnet layer on every convnet layer o Unpooling via switches that remember where max pooling was activated o Deconv filtering equals to “reverse conv filtering” Visualization with a Deconvnet [Zeiler2014] 𝐹 = 1 5 6 3 𝐹𝑇 = 3 6 5 1
  • 17. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 17 What excites feature maps? o “Given a random feature map what are the top 9 activations?”
  • 18. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 18 What excites feature maps? Similar activations from lower level visual patterns
  • 19. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 19 What excites feature maps? [Zeiler2014] Similar activations from semantically similar pictures Visual patterns become more and more intricate and specific (greater invariance)
  • 20. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 20 Feature evolution over training o For a particular neuron (that generates a feature map) o Pick the strongest activation during training o For epochs 1, 2, 5, 10, 20, 30, 40, 64
  • 21. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 21 But does a Convnet really learn the object?
  • 22. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 22 o What is the image with the highest “dogness score” arg max 𝐼 𝑆𝑐 𝐼; 𝜃 − 𝜆 Ι 2 ◦ The parameters 𝜃 are fixed during the training ◦ Optimization is done with respect to the image Ι ◦ Initialized with the “average training image” What is a “Convnet dog”, however? [Simonyan2014]
  • 23. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 23 Maximum-scoring class images
  • 24. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 24 Maximum-scoring class images
  • 25. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 25 Maximum-scoring class images
  • 26. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 26 o Given the “monkey” class, what are the most “monkey-ish” parts in my image? o Approximate 𝑆𝑐 around an initial point 𝐼0 with the first order Taylor expansion 𝑆𝑐 𝐼 ȁ𝐼0 ≈ 𝑤𝑇𝐼 + 𝑏, where 𝑤 = 𝜕𝑆𝑐 𝜕𝐼 ȁ𝐼0 from backpropagation ◦ Solution is locally optimal Class-specific image saliency
  • 27. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 27 Examples
  • 28. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 28 Examples
  • 29. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 29 Object localization using class saliency GrabCut
  • 30. UVA DEEP LEARNING COURSE EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 30 Fooling a Convnet
  • 31. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 31 o What if we follow a similar procedure but with a different goal o Generate “visually random” images ◦ Images that make a lot of sense to a Convnet but no sense at all to us o Or, assume we make very small changes to a picture (invisible to the naked eye) ◦ Is a convnet always invariant to these changes? ◦ Or could it be fooled? Fooling images
  • 32. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 32 o We assume our classifiers enjoy local generalization o Assume an image containing a cat lies at coordinates 𝑥 o Assume also a small change 𝑟 around 𝑥, such that 𝑥 + 𝑟 < 𝜀 ◦ 𝜀 is a very small constant o Is the smoothness assumption reasonable? o Or can we “break” it by some adversarial examples ◦ E.g. if we correctly classify 𝑥 as “Argan goat”, with the right 𝑟 make the convnet see a “BMW i6” ◦ The 𝑥 + 𝑟 would be adversarial examples Smoothness assumption
  • 33. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 33 o If 𝑓: ℛ𝑚 → 1 … , 𝑘 our goal can be mathematically described as min 𝑟 2 𝑠. 𝑡. 𝑓 𝑥 + 𝑟 = 𝑙, 𝑥 + 𝑟 ∈ 0, 1 𝑚 o The goal is to optimize the distortion 𝑟 so that the predicted label 𝑙 is different than the original label Generating adversarial examples
  • 34. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 34 Adversarial images Image Image
  • 35. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 35 Adversarial images Image+Noise Image+Noise
  • 36. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 36 Adversarial images Image+Noise=Image’ Image+Noise=Image’
  • 37. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 37 Adversarial images Image’=Predicted as Ostrich, Struthiocamelus
  • 38. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 38 More adversarial images
  • 39. UVA DEEP LEARNING COURSE EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 39 Knowledge transfer
  • 40. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 40 o A CNN can have millions of parameters o What about the dataset size? o Could we still train a CNN without overfitting problems? CNNs and dataset size
  • 41. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 41 o Assume two datasets, 𝑇 and 𝑆 o Dataset 𝑆 is ◦ fully annotated, plenty of images ◦ We can build a model ℎ𝑆 o Dataset 𝑇 is ◦ Not as much annotated, or much fewer images ◦ The annotations of 𝑇 do not need to overlap with 𝑆 o We can use the model ℎ𝑆 to learn a better ℎ𝑇 o This is called transfer learning Transfer learning Imagenet: 1million My dataset: 1,000 𝒉𝑨 𝒉𝑩
  • 42. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 42 o Even if our dataset 𝑇 is not large, we can train a CNN for it o Pre-train a network on the dataset 𝑆 o Then, there are two solutions ◦ Fine-tuning ◦ CNN as feature extractor Convnets are good in transfer learning
  • 43. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 43 o Assume the parameters of 𝑆 are already a good start near our final local optimum o Use them as the initial parameters for our new CNN for the target dataset 𝜃Τ, 𝑙 (𝑡=0) = 𝜃S, 𝑙 for some layers 𝑙 = 1, 2, … o This is a good solution when the dataset 𝑇 is relatively big ◦ E.g. for Imagenet 𝑆 with approximately 1 million images ◦ For a dataset 𝑇 with more than a few thousand images should be ok o What layers to initialize and how? Solution I: Fine-tune ℎ𝑇 using ℎ𝑆 as initialization
  • 44. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 44 o Classifier layer to loss ◦ The loss layer essentially is the “classifier” ◦ Same labels  keep the weights from ℎ𝑆 ◦ Different labels  delete the layer and start over ◦ When too few data, fine-tune only this layer o Fully connected layers ◦ Very important for fine-tuning ◦ Sometimes you need to completely delete the last before the classification layer if datasets are very different ◦ Capture more semantic, “specific” information ◦ Always try first when fine-tuning ◦ If you have more data, fine-tune also these layers Initializing ℎ𝑇 with ℎ𝑆 Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc7 Classifier layer fc8
  • 45. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 45 o Upper convolutional layers (conv4, conv5) ◦ Mid-level spatial features (face, wheel detectors …) ◦ Can be different from dataset to dataset ◦ Capture more generic information ◦ Fine-tuning pays off ◦ Fine-tune if dataset is big enough o Lower convolutional layers (conv1, conv2) ◦ They capture low level information ◦ This information does not change usually ◦ Probably, no need to fine-tune but no harm trying Initializing ℎ𝑇 with ℎ𝑆 Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc7 Classifier layer fc8
  • 46. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 46 o For layers initialized from ℎ𝑆 use a mild learning rate ◦ Remember: your network is already close to a near optimum ◦ If too aggressive, learning might diverge ◦ A learning rate of 0.001 is a good starting choice (assuming 0.01 was the original learning rate) o For completely new layers (e.g. loss) use aggressive learning rate ◦ If too small, the training will converge very slowly ◦ Remember: the rest of the network is near a solution, this layer is very far from one ◦ A learning rate of 0.01 is a good starting choice o If datasets are very similar, fine-tune only fully connected layers o If datasets are different and you have enough data, fine-tune all layers How to fine-tune? Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc7 Classifier layer fc8
  • 47. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 47 o Essentially similar to a case of solution I ◦ but train only the loss layer o Essentially use the network as a pretrained feature extractor o This is a good solution if the dataset 𝑇 is small ◦ Any fine-tuning of layer might cause overfitting o Or when we don’t have the resources to train a deep net o Or when we don’t care for the best possible accuracy Solution II: Use ℎ𝑠 as a feature extractor for ℎ𝑇
  • 48. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 48 Deep features from different layers Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc6 Fully connected layer fc7 fc7 feature space
  • 49. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 49 Deep features from different layers Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc6 Fully connected layer fc6 fc6 feature space
  • 50. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 50 Deep features from different layers Convolutional Layer 1 Convolutional Layer 2 Convolutional Layer 3 Convolutional Layer 4 Convolutional Layer 5 Fully connected layer fc6 Fully connected layer fc6 Convolutional Layer 5 Conv5 feature space
  • 51. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 51 Which layer? Visualizing and Understanding Convolutional Networks, Zeiler and Fergus, ECCV 2014 Higher layer features are capture more semantic information. Good for higher level classification Lower layer features capture more basic information (texture, etc). Good for image-to-image comparisons, image retrieval
  • 52. UVA DEEP LEARNING COURSE EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 52 Summary o What do convolutions look like? o Build on the visual intuition behind Convnets o Deep Learning Feature maps o Transfer Learning
  • 53. UVA DEEP LEARNING COURSE – EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 53 o http://www.deeplearningbook.org/ ◦ Part II: Chapter 11 [Aubry2015] Aubry, Russell. Understanding deep features with computer-generated imagery, ICCV, 2015 [Nguyen2015] Nguyen, Yosinksi, Clune. Deep Neural Networks are Easily Fooled: High Confidence Predictions for Unrecognizable Images, CVPR, 2015 [Simonyan2014] Simonyan, Vedaldi, Zisserman . Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps, CVPR 2014 [Zeiler2014] Zeiler, Fergus, Visualizing and Understanding Convolutional Networks, ECCV, 2014 Reading material & references
  • 54. UVA DEEP LEARNING COURSE EFSTRATIOS GAVVES UNDERSTANDING CONVNETS AND KNOWLEDGE TRANSFER - 54 Next lecture o Convolutional Neural Networks for Object Detection and Segmentation o Convolutional Neural Networks and Structured Prediction