SlideShare a Scribd company logo
1 of 49
Download to read offline
Convolutional
Neural Network
Hung-yi Lee
Can the network be simplified by
considering the properties of images?
Why CNN for Image
• Some patterns are much smaller than the whole
image
A neuron does not have to see the whole image
to discover the pattern.
“beak” detector
Connecting to small region with less parameters
Why CNN for Image
• The same patterns appear in different regions.
“upper-left
beak” detector
“middle beak”
detector
They can use the same
set of parameters.
Do almost the same thing
Why CNN for Image
• Subsampling the pixels will not change the object
subsampling
bird
bird
We can subsample the pixels to make image smaller
Less parameters for the network to process the image
The whole CNN
Fully Connected
Feedforward network
cat dog ……
Convolution
Max Pooling
Convolution
Max Pooling
Flatten
Can repeat
many times
The whole CNN
Convolution
Max Pooling
Convolution
Max Pooling
Flatten
Can repeat
many times
➢ Some patterns are much
smaller than the whole image
➢The same patterns appear in
different regions.
➢Subsampling the pixels will
not change the object
Property 1
Property 2
Property 3
The whole CNN
Fully Connected
Feedforward network
cat dog ……
Convolution
Max Pooling
Convolution
Max Pooling
Flatten
Can repeat
many times
CNN – Convolution
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
-1 1 -1
-1 1 -1
-1 1 -1
Filter 2
……
Those are the network
parameters to be learned.
Matrix
Matrix
Each filter detects a small
pattern (3 x 3).
Property 1
CNN – Convolution
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
3 -1
stride=1
CNN – Convolution
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
3 -3
If stride=2
We set stride=1 below
CNN – Convolution
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
3 -1 -3 -1
-3 1 0 -3
-3 -3 0 1
3 -2 -2 -1
stride=1
Property 2
CNN – Convolution
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
3 -1 -3 -1
-3 1 0 -3
-3 -3 0 1
3 -2 -2 -1
-1 1 -1
-1 1 -1
-1 1 -1
Filter 2
-1 -1 -1 -1
-1 -1 -2 1
-1 -1 -2 1
-1 0 -4 3
Do the same process for
every filter
stride=1
4 x 4 image
Feature
Map
CNN – Colorful image
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
-1 1 -1
-1 1 -1
-1 1 -1
Filter 2
1 -1 -1
-1 1 -1
-1 -1 1
1 -1 -1
-1 1 -1
-1 -1 1
-1 1 -1
-1 1 -1
-1 1 -1
-1 1 -1
-1 1 -1
-1 1 -1
Colorful image
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
image
convolution
-1 1 -1
-1 1 -1
-1 1 -1
1 -1 -1
-1 1 -1
-1 -1 1
1
x
2
x
……
36
x
……
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
Convolution v.s. Fully Connected
Fully-
connected
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
1:
2:
3:
…
7:
8:
9:
…
13:
14:
15:
… Only connect to 9
input, not fully
connected
4:
10:
16:
1
0
0
0
0
1
0
0
0
0
1
1
3
Less parameters!
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
1:
2:
3:
…
7:
8:
9:
…
13:
14:
15:
…
4:
10:
16:
1
0
0
0
0
1
0
0
0
0
1
1
3
-1
Shared weights
6 x 6 image
Less parameters!
Even less parameters!
The whole CNN
Fully Connected
Feedforward network
cat dog ……
Convolution
Max Pooling
Convolution
Max Pooling
Flatten
Can repeat
many times
CNN – Max Pooling
3 -1 -3 -1
-3 1 0 -3
-3 -3 0 1
3 -2 -2 -1
-1 1 -1
-1 1 -1
-1 1 -1
Filter 2
-1 -1 -1 -1
-1 -1 -2 1
-1 -1 -2 1
-1 0 -4 3
1 -1 -1
-1 1 -1
-1 -1 1
Filter 1
CNN – Max Pooling
1 0 0 0 0 1
0 1 0 0 1 0
0 0 1 1 0 0
1 0 0 0 1 0
0 1 0 0 1 0
0 0 1 0 1 0
6 x 6 image
3 0
1
3
-1 1
3
0
2 x 2 image
Each filter
is a channel
New image
but smaller
Conv
Max
Pooling
The whole CNN
Convolution
Max Pooling
Convolution
Max Pooling
Can repeat
many times
A new image
The number of the channel
is the number of filters
Smaller than the original
image
3 0
1
3
-1 1
3
0
The whole CNN
Fully Connected
Feedforward network
cat dog ……
Convolution
Max Pooling
Convolution
Max Pooling
Flatten
A new image
A new image
Flatten
3 0
1
3
-1 1
3
0 Flatten
3
0
1
3
-1
1
0
3
Fully Connected
Feedforward network
Only modified the network structure and
input format (vector -> 3-D tensor)
CNN in Keras
Convolution
Max Pooling
Convolution
Max Pooling
input
1 -1 -1
-1 1 -1
-1 -1 1
-1 1 -1
-1 1 -1
-1 1 -1
There are 25
3x3 filters.
……
Input_shape = ( 28 , 28 , 1)
1: black/white, 3: RGB
28 x 28 pixels
3 -1
-3 1
3
Only modified the network structure and
input format (vector -> 3-D tensor)
CNN in Keras
Convolution
Max Pooling
Convolution
Max Pooling
input
1 x 28 x 28
25 x 26 x 26
25 x 13 x 13
50 x 11 x 11
50 x 5 x 5
How many parameters
for each filter?
How many parameters
for each filter?
9
225
Only modified the network structure and
input format (vector -> 3-D tensor)
CNN in Keras
Convolution
Max Pooling
Convolution
Max Pooling
input
1 x 28 x 28
25 x 26 x 26
25 x 13 x 13
50 x 11 x 11
50 x 5 x 5
Flatten
1250
Fully Connected
Feedforward network
output
Live Demo
What does machine learn?
http://newsneakernews.wpengine.netdna-cdn.com/wp-
content/uploads/2016/11/rihanna-puma-creeper-velvet-release-date-02.jpg
球鞋
美洲獅
First Convolution Layer
• Typical-looking
filters on the
trained first layer
http://cs231n.github.io/understanding-cnn/
11 x 11
(AlexNet)
How about higher layers?
• Which images make a specific neuron activate
Ross Girshick, Jeff
Donahue, Trevor
Darrell, Jitendra Malik, “Rich
feature hierarchies for accurate
object detection and semantic
segmentation”, CVPR, 2014
Convolution
Max Pooling
Convolution
Max Pooling
input
25 3x3
filters
50 3x3
filters
What does CNN learn?
50 x 11 x 11
The output of the k-th filter is a
11 x 11 matrix.
Degree of the activation
of the k-th filter: 𝑎𝑘 = ෍
𝑖=1
11
෍
𝑗=1
11
𝑎𝑖𝑗
𝑘
3 -1 -1
-3 1 -3
3 -2 -1
……
……
……
……
……
……
𝑎𝑖𝑗
𝑘
11
11
x
𝑥∗ = 𝑎𝑟𝑔 max
𝑥
𝑎𝑘
(gradient ascent)
𝜕𝑎𝑘
𝜕𝑥𝑖𝑗
Convolution
Max Pooling
Convolution
Max Pooling
input
25 3x3
filters
50 3x3
filters
What does CNN learn?
50 x 11 x 11
The output of the k-th filter is a
11 x 11 matrix.
Degree of the activation
of the k-th filter: 𝑎𝑘 = ෍
𝑖=1
11
෍
𝑗=1
11
𝑎𝑖𝑗
𝑘
𝑥∗ = 𝑎𝑟𝑔 max
𝑥
𝑎𝑘
(gradient ascent)
For each filter
𝜕𝑎𝑘
𝜕𝑥𝑖𝑗
What does CNN learn?
Convolution
Max Pooling
input
Convolution
Max Pooling
flatten
𝑎𝑗
𝑥∗ = 𝑎𝑟𝑔 max
𝑥
𝑎𝑗
Each figure corresponds to a neuron
Find an image maximizing the output
of neuron:
Convolution
Max Pooling
input
Convolution
Max Pooling
flatten
𝑦𝑖
What does CNN learn?
𝑥∗
= 𝑎𝑟𝑔 max
𝑥
𝑦𝑖
Can we see digits?
0 1 2
3 4 5
6 7 8
Deep Neural Networks are Easily Fooled
https://www.youtube.com/watch?v=M2IebCN9Ht4
What does CNN learn?
0 1 2
3 4 5
6 7 8
0 1 2
3 4 5
6 7 8
𝑥∗
= 𝑎𝑟𝑔 max
𝑥
𝑦𝑖 𝑥∗
= 𝑎𝑟𝑔 max
𝑥
𝑦𝑖
− ෍
𝑖,𝑗
𝑥𝑖𝑗
Over all
pixel values
Karen Simonyan, Andrea Vedaldi, Andrew Zisserman, “Deep Inside Convolutional
Networks: Visualising Image Classification Models and Saliency Maps”, ICLR, 2014
Karen Simonyan, Andrea Vedaldi, Andrew Zisserman, “Deep Inside Convolutional
Networks: Visualising Image Classification Models and Saliency Maps”, ICLR, 2014
|
𝜕𝑦𝑘
𝜕𝑥𝑖𝑗
|
𝑦𝑘: the predicted
class of the model
Pixel 𝑥𝑖𝑗
Reference: Zeiler, M. D., & Fergus, R. (2014). Visualizing and understanding
convolutional networks. In Computer Vision–ECCV 2014 (pp. 818-833)
Deep Dream
• Given a photo, machine adds what it sees ……
http://deepdreamgenerator.com/
CNN
3.9
−1.5
2.3
⋮
Modify
image
CNN exaggerates what it sees
Deep Dream
• Given a photo, machine adds what it sees ……
http://deepdreamgenerator.com/
Deep Style
• Given a photo, make its style like famous paintings
https://dreamscopeapp.com/
Deep Style
• Given a photo, make its style like famous paintings
https://dreamscopeapp.com/
Deep Style
CNN CNN
content style
CNN
?
A Neural
Algorithm of
Artistic Style
https://arxiv.org/abs/150
8.06576
More Application: Playing Go
Network (19 x 19
positions)
Next move
19 x 19 vector
Black: 1
white: -1
none: 0
19 x 19 vector
Fully-connected feedforward
network can be used
But CNN performs much better.
19 x 19 matrix
(image)
More Application: Playing Go
CNN
CNN
record of
previous plays
Target:
“天元” = 1
else = 0
Target:
“五之 5” = 1
else = 0
Training: 黑: 5之五 白: 天元 黑: 五之5 …
Why CNN for playing Go?
• Some patterns are much smaller than the whole
image
• The same patterns appear in different regions.
Alpha Go uses 5 x 5 for first layer
Why CNN for playing Go?
• Subsampling the pixels will not change the object
Alpha Go does not use Max Pooling ……
Max Pooling How to explain this???
More Application: Speech
Time
Frequency
Spectrogram
CNN
Image
The filters move in the
frequency direction.
More Application: Text
Source of image:
http://citeseerx.ist.psu.edu/viewdoc/downloa
d?doi=10.1.1.703.6858&rep=rep1&type=pdf
?
Acknowledgment
• 感謝 Guobiao Mo 發現投影片上的打字錯誤

More Related Content

What's hot

Convolution Neural Network (CNN)
Convolution Neural Network (CNN)Convolution Neural Network (CNN)
Convolution Neural Network (CNN)Basit Rafiq
 
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Simplilearn
 
Introduction to Keras
Introduction to KerasIntroduction to Keras
Introduction to KerasJohn Ramey
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network Yan Xu
 
CONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORKCONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORKMd Rajib Bhuiyan
 
Convolutional neural networks
Convolutional neural networks Convolutional neural networks
Convolutional neural networks Roozbeh Sanaei
 
Image classification using cnn
Image classification using cnnImage classification using cnn
Image classification using cnnSumeraHangi
 
CNN and its applications by ketaki
CNN and its applications by ketakiCNN and its applications by ketaki
CNN and its applications by ketakiKetaki Patwari
 
Resnet.pptx
Resnet.pptxResnet.pptx
Resnet.pptxYanhuaSi
 
Introduction to Deep learning
Introduction to Deep learningIntroduction to Deep learning
Introduction to Deep learningleopauly
 
Understanding Convolutional Neural Networks
Understanding Convolutional Neural NetworksUnderstanding Convolutional Neural Networks
Understanding Convolutional Neural NetworksJeremy Nixon
 
GUI based handwritten digit recognition using CNN
GUI based handwritten digit recognition using CNNGUI based handwritten digit recognition using CNN
GUI based handwritten digit recognition using CNNAbhishek Tiwari
 
ResNet basics (Deep Residual Network for Image Recognition)
ResNet basics (Deep Residual Network for Image Recognition)ResNet basics (Deep Residual Network for Image Recognition)
ResNet basics (Deep Residual Network for Image Recognition)Sanjay Saha
 
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Simplilearn
 

What's hot (20)

그림 그리는 AI
그림 그리는 AI그림 그리는 AI
그림 그리는 AI
 
Convolution Neural Network (CNN)
Convolution Neural Network (CNN)Convolution Neural Network (CNN)
Convolution Neural Network (CNN)
 
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
Deep Learning Tutorial | Deep Learning Tutorial For Beginners | What Is Deep ...
 
Introduction to Keras
Introduction to KerasIntroduction to Keras
Introduction to Keras
 
Convolutional neural network
Convolutional neural network Convolutional neural network
Convolutional neural network
 
CONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORKCONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORK
 
Convolutional neural networks
Convolutional neural networks Convolutional neural networks
Convolutional neural networks
 
Image classification using cnn
Image classification using cnnImage classification using cnn
Image classification using cnn
 
Resnet
ResnetResnet
Resnet
 
CNN and its applications by ketaki
CNN and its applications by ketakiCNN and its applications by ketaki
CNN and its applications by ketaki
 
CNN Tutorial
CNN TutorialCNN Tutorial
CNN Tutorial
 
Resnet.pptx
Resnet.pptxResnet.pptx
Resnet.pptx
 
Introduction to Deep learning
Introduction to Deep learningIntroduction to Deep learning
Introduction to Deep learning
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
 
Max net
Max netMax net
Max net
 
Understanding Convolutional Neural Networks
Understanding Convolutional Neural NetworksUnderstanding Convolutional Neural Networks
Understanding Convolutional Neural Networks
 
GUI based handwritten digit recognition using CNN
GUI based handwritten digit recognition using CNNGUI based handwritten digit recognition using CNN
GUI based handwritten digit recognition using CNN
 
ResNet basics (Deep Residual Network for Image Recognition)
ResNet basics (Deep Residual Network for Image Recognition)ResNet basics (Deep Residual Network for Image Recognition)
ResNet basics (Deep Residual Network for Image Recognition)
 
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
Convolutional Neural Network - CNN | How CNN Works | Deep Learning Course | S...
 
Vgg
VggVgg
Vgg
 

Similar to CNN

Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptAminHa5
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptEngineeringTamilan
 
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.ppt
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.pptDeep-Learning-Convolutional Neural Networks and Sequence Modeling.ppt
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.pptPraveenVundrajavarap
 
Deep-Learning presnetation by someone from the internet
Deep-Learning presnetation by someone from the internetDeep-Learning presnetation by someone from the internet
Deep-Learning presnetation by someone from the internetclash12hero
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptrohithprabhas1
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptsruthiksanalkumar
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptkundurti
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptAshishKumarSingh176
 
Deep learning-2017-lecture5 cnn
Deep learning-2017-lecture5 cnnDeep learning-2017-lecture5 cnn
Deep learning-2017-lecture5 cnnAnandShinde47
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptSaadMemon23
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptarchn4
 
Deep-Learning
Deep-LearningDeep-Learning
Deep-LearningAmnaalia
 
Deep Learning Techniques like CNN and RNN
Deep Learning Techniques like CNN and RNNDeep Learning Techniques like CNN and RNN
Deep Learning Techniques like CNN and RNNSumaiyaSk
 
Deep learning-smaller neural network
Deep learning-smaller neural networkDeep learning-smaller neural network
Deep learning-smaller neural networksonykhan3
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptsghorai
 
convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfSubhamKumar3239
 
Practical Deep Learning Using Tensor Flow - Sandeep Kath
Practical Deep Learning Using Tensor Flow - Sandeep KathPractical Deep Learning Using Tensor Flow - Sandeep Kath
Practical Deep Learning Using Tensor Flow - Sandeep KathSandeep Kath
 
Deep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptxDeep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptxDr. Radhey Shyam
 
Machine learning algorithms like CNN and LSTM
Machine learning algorithms like CNN and LSTMMachine learning algorithms like CNN and LSTM
Machine learning algorithms like CNN and LSTMmonihareni
 

Similar to CNN (20)

CNN (v2).pptx
CNN (v2).pptxCNN (v2).pptx
CNN (v2).pptx
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.ppt
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.pptDeep-Learning-Convolutional Neural Networks and Sequence Modeling.ppt
Deep-Learning-Convolutional Neural Networks and Sequence Modeling.ppt
 
Deep-Learning presnetation by someone from the internet
Deep-Learning presnetation by someone from the internetDeep-Learning presnetation by someone from the internet
Deep-Learning presnetation by someone from the internet
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep learning-2017-lecture5 cnn
Deep learning-2017-lecture5 cnnDeep learning-2017-lecture5 cnn
Deep learning-2017-lecture5 cnn
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
Deep-Learning
Deep-LearningDeep-Learning
Deep-Learning
 
Deep Learning Techniques like CNN and RNN
Deep Learning Techniques like CNN and RNNDeep Learning Techniques like CNN and RNN
Deep Learning Techniques like CNN and RNN
 
Deep learning-smaller neural network
Deep learning-smaller neural networkDeep learning-smaller neural network
Deep learning-smaller neural network
 
Deep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.pptDeep-Learning-2017-Lecture5CNN.ppt
Deep-Learning-2017-Lecture5CNN.ppt
 
convolutional neural network and its applications.pdf
convolutional neural network and its applications.pdfconvolutional neural network and its applications.pdf
convolutional neural network and its applications.pdf
 
Practical Deep Learning Using Tensor Flow - Sandeep Kath
Practical Deep Learning Using Tensor Flow - Sandeep KathPractical Deep Learning Using Tensor Flow - Sandeep Kath
Practical Deep Learning Using Tensor Flow - Sandeep Kath
 
Deep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptxDeep-Learning-2017-Lecture5CNN.pptx
Deep-Learning-2017-Lecture5CNN.pptx
 
Machine learning algorithms like CNN and LSTM
Machine learning algorithms like CNN and LSTMMachine learning algorithms like CNN and LSTM
Machine learning algorithms like CNN and LSTM
 

More from georgejustymirobi1 (20)

JanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.pptJanData-mining-to-knowledge-discovery.ppt
JanData-mining-to-knowledge-discovery.ppt
 
Network IP Security.pdf
Network IP Security.pdfNetwork IP Security.pdf
Network IP Security.pdf
 
How To Write A Scientific Paper
How To Write A Scientific PaperHow To Write A Scientific Paper
How To Write A Scientific Paper
 
writing_the_research_paper.ppt
writing_the_research_paper.pptwriting_the_research_paper.ppt
writing_the_research_paper.ppt
 
Bluetooth.ppt
Bluetooth.pptBluetooth.ppt
Bluetooth.ppt
 
ABCD15042603583.pdf
ABCD15042603583.pdfABCD15042603583.pdf
ABCD15042603583.pdf
 
ch18 ABCD.pdf
ch18 ABCD.pdfch18 ABCD.pdf
ch18 ABCD.pdf
 
ch13 ABCD.ppt
ch13 ABCD.pptch13 ABCD.ppt
ch13 ABCD.ppt
 
BluetoothSecurity.ppt
BluetoothSecurity.pptBluetoothSecurity.ppt
BluetoothSecurity.ppt
 
1682302951397_PGP.pdf
1682302951397_PGP.pdf1682302951397_PGP.pdf
1682302951397_PGP.pdf
 
CNN Algorithm
CNN AlgorithmCNN Algorithm
CNN Algorithm
 
applicationlayer.pptx
applicationlayer.pptxapplicationlayer.pptx
applicationlayer.pptx
 
Fair Bluetooth.pdf
Fair Bluetooth.pdfFair Bluetooth.pdf
Fair Bluetooth.pdf
 
Bluetooth.pptx
Bluetooth.pptxBluetooth.pptx
Bluetooth.pptx
 
Research Score.pdf
Research Score.pdfResearch Score.pdf
Research Score.pdf
 
educational_technology_meena_arora.ppt
educational_technology_meena_arora.ppteducational_technology_meena_arora.ppt
educational_technology_meena_arora.ppt
 
Array.ppt
Array.pptArray.ppt
Array.ppt
 
PYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptxPYTHON-PROGRAMMING-UNIT-II (1).pptx
PYTHON-PROGRAMMING-UNIT-II (1).pptx
 
cprogrammingoperator.ppt
cprogrammingoperator.pptcprogrammingoperator.ppt
cprogrammingoperator.ppt
 
cprogrammingarrayaggregatetype.ppt
cprogrammingarrayaggregatetype.pptcprogrammingarrayaggregatetype.ppt
cprogrammingarrayaggregatetype.ppt
 

Recently uploaded

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 

Recently uploaded (20)

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 

CNN

  • 1. Convolutional Neural Network Hung-yi Lee Can the network be simplified by considering the properties of images?
  • 2. Why CNN for Image • Some patterns are much smaller than the whole image A neuron does not have to see the whole image to discover the pattern. “beak” detector Connecting to small region with less parameters
  • 3. Why CNN for Image • The same patterns appear in different regions. “upper-left beak” detector “middle beak” detector They can use the same set of parameters. Do almost the same thing
  • 4. Why CNN for Image • Subsampling the pixels will not change the object subsampling bird bird We can subsample the pixels to make image smaller Less parameters for the network to process the image
  • 5. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flatten Can repeat many times
  • 6. The whole CNN Convolution Max Pooling Convolution Max Pooling Flatten Can repeat many times ➢ Some patterns are much smaller than the whole image ➢The same patterns appear in different regions. ➢Subsampling the pixels will not change the object Property 1 Property 2 Property 3
  • 7. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flatten Can repeat many times
  • 8. CNN – Convolution 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 -1 1 -1 -1 1 -1 -1 1 -1 Filter 2 …… Those are the network parameters to be learned. Matrix Matrix Each filter detects a small pattern (3 x 3). Property 1
  • 9. CNN – Convolution 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 3 -1 stride=1
  • 10. CNN – Convolution 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 3 -3 If stride=2 We set stride=1 below
  • 11. CNN – Convolution 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 3 -1 -3 -1 -3 1 0 -3 -3 -3 0 1 3 -2 -2 -1 stride=1 Property 2
  • 12. CNN – Convolution 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 3 -1 -3 -1 -3 1 0 -3 -3 -3 0 1 3 -2 -2 -1 -1 1 -1 -1 1 -1 -1 1 -1 Filter 2 -1 -1 -1 -1 -1 -1 -2 1 -1 -1 -2 1 -1 0 -4 3 Do the same process for every filter stride=1 4 x 4 image Feature Map
  • 13. CNN – Colorful image 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 -1 1 -1 -1 1 -1 -1 1 -1 Filter 2 1 -1 -1 -1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 -1 1 -1 Colorful image
  • 14. 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 image convolution -1 1 -1 -1 1 -1 -1 1 -1 1 -1 -1 -1 1 -1 -1 -1 1 1 x 2 x …… 36 x …… 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 Convolution v.s. Fully Connected Fully- connected
  • 15. 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 1: 2: 3: … 7: 8: 9: … 13: 14: 15: … Only connect to 9 input, not fully connected 4: 10: 16: 1 0 0 0 0 1 0 0 0 0 1 1 3 Less parameters!
  • 16. 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1 1: 2: 3: … 7: 8: 9: … 13: 14: 15: … 4: 10: 16: 1 0 0 0 0 1 0 0 0 0 1 1 3 -1 Shared weights 6 x 6 image Less parameters! Even less parameters!
  • 17. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flatten Can repeat many times
  • 18. CNN – Max Pooling 3 -1 -3 -1 -3 1 0 -3 -3 -3 0 1 3 -2 -2 -1 -1 1 -1 -1 1 -1 -1 1 -1 Filter 2 -1 -1 -1 -1 -1 -1 -2 1 -1 -1 -2 1 -1 0 -4 3 1 -1 -1 -1 1 -1 -1 -1 1 Filter 1
  • 19. CNN – Max Pooling 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 1 0 6 x 6 image 3 0 1 3 -1 1 3 0 2 x 2 image Each filter is a channel New image but smaller Conv Max Pooling
  • 20. The whole CNN Convolution Max Pooling Convolution Max Pooling Can repeat many times A new image The number of the channel is the number of filters Smaller than the original image 3 0 1 3 -1 1 3 0
  • 21. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flatten A new image A new image
  • 22. Flatten 3 0 1 3 -1 1 3 0 Flatten 3 0 1 3 -1 1 0 3 Fully Connected Feedforward network
  • 23. Only modified the network structure and input format (vector -> 3-D tensor) CNN in Keras Convolution Max Pooling Convolution Max Pooling input 1 -1 -1 -1 1 -1 -1 -1 1 -1 1 -1 -1 1 -1 -1 1 -1 There are 25 3x3 filters. …… Input_shape = ( 28 , 28 , 1) 1: black/white, 3: RGB 28 x 28 pixels 3 -1 -3 1 3
  • 24. Only modified the network structure and input format (vector -> 3-D tensor) CNN in Keras Convolution Max Pooling Convolution Max Pooling input 1 x 28 x 28 25 x 26 x 26 25 x 13 x 13 50 x 11 x 11 50 x 5 x 5 How many parameters for each filter? How many parameters for each filter? 9 225
  • 25. Only modified the network structure and input format (vector -> 3-D tensor) CNN in Keras Convolution Max Pooling Convolution Max Pooling input 1 x 28 x 28 25 x 26 x 26 25 x 13 x 13 50 x 11 x 11 50 x 5 x 5 Flatten 1250 Fully Connected Feedforward network output
  • 27. What does machine learn? http://newsneakernews.wpengine.netdna-cdn.com/wp- content/uploads/2016/11/rihanna-puma-creeper-velvet-release-date-02.jpg 球鞋 美洲獅
  • 28. First Convolution Layer • Typical-looking filters on the trained first layer http://cs231n.github.io/understanding-cnn/ 11 x 11 (AlexNet)
  • 29. How about higher layers? • Which images make a specific neuron activate Ross Girshick, Jeff Donahue, Trevor Darrell, Jitendra Malik, “Rich feature hierarchies for accurate object detection and semantic segmentation”, CVPR, 2014
  • 30. Convolution Max Pooling Convolution Max Pooling input 25 3x3 filters 50 3x3 filters What does CNN learn? 50 x 11 x 11 The output of the k-th filter is a 11 x 11 matrix. Degree of the activation of the k-th filter: 𝑎𝑘 = ෍ 𝑖=1 11 ෍ 𝑗=1 11 𝑎𝑖𝑗 𝑘 3 -1 -1 -3 1 -3 3 -2 -1 …… …… …… …… …… …… 𝑎𝑖𝑗 𝑘 11 11 x 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑎𝑘 (gradient ascent) 𝜕𝑎𝑘 𝜕𝑥𝑖𝑗
  • 31. Convolution Max Pooling Convolution Max Pooling input 25 3x3 filters 50 3x3 filters What does CNN learn? 50 x 11 x 11 The output of the k-th filter is a 11 x 11 matrix. Degree of the activation of the k-th filter: 𝑎𝑘 = ෍ 𝑖=1 11 ෍ 𝑗=1 11 𝑎𝑖𝑗 𝑘 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑎𝑘 (gradient ascent) For each filter 𝜕𝑎𝑘 𝜕𝑥𝑖𝑗
  • 32. What does CNN learn? Convolution Max Pooling input Convolution Max Pooling flatten 𝑎𝑗 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑎𝑗 Each figure corresponds to a neuron Find an image maximizing the output of neuron:
  • 33. Convolution Max Pooling input Convolution Max Pooling flatten 𝑦𝑖 What does CNN learn? 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑦𝑖 Can we see digits? 0 1 2 3 4 5 6 7 8 Deep Neural Networks are Easily Fooled https://www.youtube.com/watch?v=M2IebCN9Ht4
  • 34. What does CNN learn? 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑦𝑖 𝑥∗ = 𝑎𝑟𝑔 max 𝑥 𝑦𝑖 − ෍ 𝑖,𝑗 𝑥𝑖𝑗 Over all pixel values
  • 35. Karen Simonyan, Andrea Vedaldi, Andrew Zisserman, “Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps”, ICLR, 2014
  • 36. Karen Simonyan, Andrea Vedaldi, Andrew Zisserman, “Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Maps”, ICLR, 2014 | 𝜕𝑦𝑘 𝜕𝑥𝑖𝑗 | 𝑦𝑘: the predicted class of the model Pixel 𝑥𝑖𝑗
  • 37. Reference: Zeiler, M. D., & Fergus, R. (2014). Visualizing and understanding convolutional networks. In Computer Vision–ECCV 2014 (pp. 818-833)
  • 38. Deep Dream • Given a photo, machine adds what it sees …… http://deepdreamgenerator.com/ CNN 3.9 −1.5 2.3 ⋮ Modify image CNN exaggerates what it sees
  • 39. Deep Dream • Given a photo, machine adds what it sees …… http://deepdreamgenerator.com/
  • 40. Deep Style • Given a photo, make its style like famous paintings https://dreamscopeapp.com/
  • 41. Deep Style • Given a photo, make its style like famous paintings https://dreamscopeapp.com/
  • 42. Deep Style CNN CNN content style CNN ? A Neural Algorithm of Artistic Style https://arxiv.org/abs/150 8.06576
  • 43. More Application: Playing Go Network (19 x 19 positions) Next move 19 x 19 vector Black: 1 white: -1 none: 0 19 x 19 vector Fully-connected feedforward network can be used But CNN performs much better. 19 x 19 matrix (image)
  • 44. More Application: Playing Go CNN CNN record of previous plays Target: “天元” = 1 else = 0 Target: “五之 5” = 1 else = 0 Training: 黑: 5之五 白: 天元 黑: 五之5 …
  • 45. Why CNN for playing Go? • Some patterns are much smaller than the whole image • The same patterns appear in different regions. Alpha Go uses 5 x 5 for first layer
  • 46. Why CNN for playing Go? • Subsampling the pixels will not change the object Alpha Go does not use Max Pooling …… Max Pooling How to explain this???
  • 47. More Application: Speech Time Frequency Spectrogram CNN Image The filters move in the frequency direction.
  • 48. More Application: Text Source of image: http://citeseerx.ist.psu.edu/viewdoc/downloa d?doi=10.1.1.703.6858&rep=rep1&type=pdf ?
  • 49. Acknowledgment • 感謝 Guobiao Mo 發現投影片上的打字錯誤