SlideShare a Scribd company logo
1 of 79
Convolution Neural Network
Perception in Artificial Intelligence
Recall Neural Networks
 Neural Networks receive an input (a single
vector)
 Transform it through a series of hidden layers
 Each hidden layer is made up of a set of
neurons, where each neuron is fully
connected to all neurons in the previous layer
 Neurons in a single layer operate completely
independently and do not share any
connections
 Last fully-connected layer is called the “output
layer” and in classification settings it
represents the class scores
Recall Neural Networks
Suppose you have to design a Neural
Networks for classifying images into
categories: cat, dog, monkey, human.
Also the network consists of a single input
layer, hidden layer and output layer.
Moreover, the size of an image is 50*50,
number of units at hidden layer are 100.
What will be the size of weight matrix for
hidden layer and output layer?
Recall Neural Networks
In CIFAR-10, images are only of size
32x32x3 (32 wide, 32 high, 3 color
channels)
How much weights do we need for a single
fully-connected neuron in a first hidden
layer?
Recall Neural Networks
In CIFAR-10, images are only of size
32x32x3 (32 wide, 32 high, 3 color channels)
How much weights do we need for a single
fully-connected neuron in a first hidden layer:
32*32*3 = 3072 weights.
Smaller Network: Convolutional
Neural Network
 Do we really need all the edges?
 Can some of these be shared?
Smaller Network: Convolutional
Neural Network
Idea: Patterns are often much smaller
than the whole image, there is no point
of input whole image into the network
“beak” detector
Can represent a small region with fewer parameters
Same pattern appears in different places:
They can be compressed!
What about training a lot of such “small” detectors
and each detector must “move around”.
“upper-left
beak” detector
“middle beak”
detector
They can be compressed
to the same parameters.
Neural Networks -> Convolution Neural
Networks (CNN)
Instead of connecting a neuron to all of the
neurons of the previous layer, connect
each neuron to a some neurons in the
previous layer.
Neural Networks -> Convolution Neural
Networks (CNN)
Instead of connecting a neuron to all of the
neurons of the previous layer, connect
each neuron to a some neurons in the
previous layer.
Neural Networks -> Convolution Neural
Networks (CNN)
Instead of connecting a neuron to all of the
neurons of the previous layer, connect
each neuron to a some neurons in the
previous layer.
Convolution
Input
layer
Neural Networks -> Convolution Neural
Networks (CNN)
Instead of connecting a neuron to all of the
neurons of the previous layer, connect
each neuron to a some neurons in the
previous layer.
Convolution
Input
layer
Full connected
Neural Networks -> Convolution Neural
Networks (CNN)
Instead of connecting a neuron to all of the
neurons of the previous layer, connect
each neuron to a some neurons in the
previous layer.
Convolution
Input
layer
Full connected
Single
Dimensional
Convolution
1D Convolution
w1 w2
x1 x2 x3
X =
W =
Z = z1
1D Convolution
w1 w2
x1 x2 x3
X =
W =
Z = z1 z2
1D Convolution
w1 w2
x1 x2 x3
X =
W =
Z = z1 z2
L
Correlation/
similarity
1D Convolution
w1 w2
x1 x2 x3
X =
W =
Z = z1 z2
L
Correlation/
similarity
Ẃ = w2 w1
Flip
Convolution
A convolutional layer
A filter
A CNN is a neural network with some convolutional layers
(and some other layers). A convolutional layer has a number
of filters that does convolutional operation.
Beak detector
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
…
…
These are the network
parameters to be learned.
Each filter detects a
small pattern (3 x 3).
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
Dot
product
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
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
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
Repeat this for each filter
stride=1
Two 4 x 4 images
Forming 2 x 4 x 4 matrix
Feature
Map
Color image: RGB 3 channels
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
Color 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
…
8
9
…
13
14
15
… Only connect to
9 inputs, not
fully connected
4:
10:
16
1
0
0
0
0
1
0
0
0
0
1
1
3
fewer parameters!
7
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:
…
1
3:
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
Fewer parameters
Even fewer parameters
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size
filter→ 5*5 output
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
with stride of 2
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
with stride of 2
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size
filter→ 3*3 output
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
with stride of 3
What will be output
size?
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
with stride of 3
What will be output
size?
Doesn’t fit, you
cannot do it.
A Closer Look at Spatial Dimensions
7*7 input (spatially)
Assume 3*3 size filter
with stride of 3
Output size:
(N-F)/stride+1
e.g. N = 7, F = 3
Stride 1 → (7-3)/1+1 = 5
Stride 3 → (7-3)/3 +1 =
2.33
N
N
F
F
Zero Padding
0
0
0
0 0 0
0
7*7 input (spatially)
Assume 3*3 size filter
with stride of 1 → 7*7
output
Zero padding with (F-1)/2
will preserve size spatiall
e.g.
F=3 → zero pad with 1
F=5 → zero pad with 2
F=7 → zero pad with 3
The whole CNN
Fully Connected
Feedforward network
cat dog ……
Convolution
Max Pooling
Convolution
Max Pooling
Flattened
Can
repeat
many
times
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
Why Pooling
 Subsampling pixels will not change the object
Subsampling
bird
bird
We can subsample the pixels to make image
smaller fewer parameters to characterize the image
A CNN compresses a fully connected
network in two ways:
Reducing number of connections
Shared weights on the edges
Max pooling further reduces the complexity
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 channels
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
Flattened
A new image
A new image
Flattening
3 0
1
3
-1 1
3
0 Flattened
3
0
1
3
-1
1
0
3
Fully Connected
Feedforward network
From Matrices to Tensors: Working With
3D Images
From Matrices to Tensors: Working With
3D Images
From Matrices to Tensors: Working With
3D Images
From Matrices to Tensors: Working With
3D Images
From Matrices to Tensors: Working With
3D Images
From Matrices to Tensors: Working With
3D Images
Convolutional Layer Settings
Pooling
Pooling Layer Settings
Question
Input volume: 32*32*3
10 5*5 filter with stride 1 pad 2
Output size ?
Number of parameters?
LeNet-5
AlexNet-2012
AlexNet-2012
AlexNet-2012
AlexNet-2012
AlexNet-2012
AlexNet-2012
ZFNet-2013
VGGNet-2014
ResNet-2015
ResNet-2015
ResNet-2015
ResNet-2015
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 array)
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=
25x9
Only modified the network structure and
input format (vector -> 3-D array)
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
Flattened
1250
Fully connected
feedforward network
Output
AlphaGo
Neural
Network
(19 x 19
positions)
Next move
19 x 19 matrix
Black: 1
white: -1
none: 0
Fully-connected feedforward
network can be used
But CNN performs much better
AlphaGo’s policy network
Note: AlphaGo does not use Max Pooling.
The following is quotation from their Nature article:
CNN in speech recognition
Time
Frequency
Spectrogram
CNN
Image
The filters move in the
frequency direction.
CNN in text classification
Source of image:
http://citeseerx.ist.psu.edu/viewdoc/downlo
ad?doi=10.1.1.703.6858&rep=rep1&type=p
df
?
http://www.joshuakim.io/understanding-
how-convolutional-neural-network-cnn-
perform-text-classification-with-word-
embeddings/
https://www.analyticsvidhya.com/blog/202
0/02/mathematics-behind-convolutional-
neural-network/

More Related Content

Similar to Adv.TopicsAICNN.ppt

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
 
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.pptkundurti
 
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
 
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
 
Deep learning in E-Commerce Applications and Challenges (CNN)
Deep learning in E-Commerce Applications and Challenges (CNN) Deep learning in E-Commerce Applications and Challenges (CNN)
Deep learning in E-Commerce Applications and Challenges (CNN) Houda Bakir
 
convolutional neural networks for machine learning
convolutional neural networks for machine learningconvolutional neural networks for machine learning
convolutional neural networks for machine learningomogire08
 
Deep learning study 2
Deep learning study 2Deep learning study 2
Deep learning study 2San Kim
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplifiedLovelyn Rose
 
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
 

Similar to Adv.TopicsAICNN.ppt (20)

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
 
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
 
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
 
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
 
CNN (v2).pptx
CNN (v2).pptxCNN (v2).pptx
CNN (v2).pptx
 
Deep learning in E-Commerce Applications and Challenges (CNN)
Deep learning in E-Commerce Applications and Challenges (CNN) Deep learning in E-Commerce Applications and Challenges (CNN)
Deep learning in E-Commerce Applications and Challenges (CNN)
 
convolutional neural networks for machine learning
convolutional neural networks for machine learningconvolutional neural networks for machine learning
convolutional neural networks for machine learning
 
cnn.pdf
cnn.pdfcnn.pdf
cnn.pdf
 
CNN
CNNCNN
CNN
 
Deep learning study 2
Deep learning study 2Deep learning study 2
Deep learning study 2
 
Deep learning simplified
Deep learning simplifiedDeep learning simplified
Deep learning simplified
 
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 ...
 
Cnn method
Cnn methodCnn method
Cnn method
 

Recently uploaded

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

Adv.TopicsAICNN.ppt

  • 1. Convolution Neural Network Perception in Artificial Intelligence
  • 2. Recall Neural Networks  Neural Networks receive an input (a single vector)  Transform it through a series of hidden layers  Each hidden layer is made up of a set of neurons, where each neuron is fully connected to all neurons in the previous layer  Neurons in a single layer operate completely independently and do not share any connections  Last fully-connected layer is called the “output layer” and in classification settings it represents the class scores
  • 3. Recall Neural Networks Suppose you have to design a Neural Networks for classifying images into categories: cat, dog, monkey, human. Also the network consists of a single input layer, hidden layer and output layer. Moreover, the size of an image is 50*50, number of units at hidden layer are 100. What will be the size of weight matrix for hidden layer and output layer?
  • 4. Recall Neural Networks In CIFAR-10, images are only of size 32x32x3 (32 wide, 32 high, 3 color channels) How much weights do we need for a single fully-connected neuron in a first hidden layer?
  • 5. Recall Neural Networks In CIFAR-10, images are only of size 32x32x3 (32 wide, 32 high, 3 color channels) How much weights do we need for a single fully-connected neuron in a first hidden layer: 32*32*3 = 3072 weights.
  • 6. Smaller Network: Convolutional Neural Network  Do we really need all the edges?  Can some of these be shared?
  • 7. Smaller Network: Convolutional Neural Network Idea: Patterns are often much smaller than the whole image, there is no point of input whole image into the network “beak” detector Can represent a small region with fewer parameters
  • 8. Same pattern appears in different places: They can be compressed! What about training a lot of such “small” detectors and each detector must “move around”. “upper-left beak” detector “middle beak” detector They can be compressed to the same parameters.
  • 9. Neural Networks -> Convolution Neural Networks (CNN) Instead of connecting a neuron to all of the neurons of the previous layer, connect each neuron to a some neurons in the previous layer.
  • 10. Neural Networks -> Convolution Neural Networks (CNN) Instead of connecting a neuron to all of the neurons of the previous layer, connect each neuron to a some neurons in the previous layer.
  • 11. Neural Networks -> Convolution Neural Networks (CNN) Instead of connecting a neuron to all of the neurons of the previous layer, connect each neuron to a some neurons in the previous layer. Convolution Input layer
  • 12. Neural Networks -> Convolution Neural Networks (CNN) Instead of connecting a neuron to all of the neurons of the previous layer, connect each neuron to a some neurons in the previous layer. Convolution Input layer Full connected
  • 13. Neural Networks -> Convolution Neural Networks (CNN) Instead of connecting a neuron to all of the neurons of the previous layer, connect each neuron to a some neurons in the previous layer. Convolution Input layer Full connected Single Dimensional Convolution
  • 14. 1D Convolution w1 w2 x1 x2 x3 X = W = Z = z1
  • 15. 1D Convolution w1 w2 x1 x2 x3 X = W = Z = z1 z2
  • 16. 1D Convolution w1 w2 x1 x2 x3 X = W = Z = z1 z2 L Correlation/ similarity
  • 17. 1D Convolution w1 w2 x1 x2 x3 X = W = Z = z1 z2 L Correlation/ similarity Ẃ = w2 w1 Flip Convolution
  • 18. A convolutional layer A filter A CNN is a neural network with some convolutional layers (and some other layers). A convolutional layer has a number of filters that does convolutional operation. Beak detector
  • 19. 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 … … These are the network parameters to be learned. Each filter detects a small pattern (3 x 3).
  • 20. 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 Dot product
  • 21. 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
  • 22. 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
  • 23. 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 Repeat this for each filter stride=1 Two 4 x 4 images Forming 2 x 4 x 4 matrix Feature Map
  • 24. Color image: RGB 3 channels 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 Color image
  • 25. 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
  • 26. 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 … 8 9 … 13 14 15 … Only connect to 9 inputs, not fully connected 4: 10: 16 1 0 0 0 0 1 0 0 0 0 1 1 3 fewer parameters! 7
  • 27. 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: … 1 3: 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 Fewer parameters Even fewer parameters
  • 28. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter
  • 29. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter
  • 30. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter
  • 31. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter
  • 32. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter→ 5*5 output
  • 33. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter with stride of 2
  • 34. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter with stride of 2
  • 35. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter→ 3*3 output
  • 36. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter with stride of 3 What will be output size?
  • 37. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter with stride of 3 What will be output size? Doesn’t fit, you cannot do it.
  • 38. A Closer Look at Spatial Dimensions 7*7 input (spatially) Assume 3*3 size filter with stride of 3 Output size: (N-F)/stride+1 e.g. N = 7, F = 3 Stride 1 → (7-3)/1+1 = 5 Stride 3 → (7-3)/3 +1 = 2.33 N N F F
  • 39. Zero Padding 0 0 0 0 0 0 0 7*7 input (spatially) Assume 3*3 size filter with stride of 1 → 7*7 output Zero padding with (F-1)/2 will preserve size spatiall e.g. F=3 → zero pad with 1 F=5 → zero pad with 2 F=7 → zero pad with 3
  • 40. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flattened Can repeat many times
  • 41. 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
  • 42. Why Pooling  Subsampling pixels will not change the object Subsampling bird bird We can subsample the pixels to make image smaller fewer parameters to characterize the image
  • 43. A CNN compresses a fully connected network in two ways: Reducing number of connections Shared weights on the edges Max pooling further reduces the complexity
  • 44. 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
  • 45. The whole CNN Convolution Max Pooling Convolution Max Pooling Can repeat many times A new image The number of channels is the number of filters Smaller than the original image 3 0 1 3 -1 1 3 0
  • 46. The whole CNN Fully Connected Feedforward network cat dog …… Convolution Max Pooling Convolution Max Pooling Flattened A new image A new image
  • 47. Flattening 3 0 1 3 -1 1 3 0 Flattened 3 0 1 3 -1 1 0 3 Fully Connected Feedforward network
  • 48. From Matrices to Tensors: Working With 3D Images
  • 49. From Matrices to Tensors: Working With 3D Images
  • 50. From Matrices to Tensors: Working With 3D Images
  • 51. From Matrices to Tensors: Working With 3D Images
  • 52. From Matrices to Tensors: Working With 3D Images
  • 53. From Matrices to Tensors: Working With 3D Images
  • 54.
  • 58. Question Input volume: 32*32*3 10 5*5 filter with stride 1 pad 2 Output size ? Number of parameters?
  • 72. 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
  • 73. Only modified the network structure and input format (vector -> 3-D array) 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= 25x9
  • 74. Only modified the network structure and input format (vector -> 3-D array) 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 Flattened 1250 Fully connected feedforward network Output
  • 75. AlphaGo Neural Network (19 x 19 positions) Next move 19 x 19 matrix Black: 1 white: -1 none: 0 Fully-connected feedforward network can be used But CNN performs much better
  • 76. AlphaGo’s policy network Note: AlphaGo does not use Max Pooling. The following is quotation from their Nature article:
  • 77. CNN in speech recognition Time Frequency Spectrogram CNN Image The filters move in the frequency direction.
  • 78. CNN in text classification Source of image: http://citeseerx.ist.psu.edu/viewdoc/downlo ad?doi=10.1.1.703.6858&rep=rep1&type=p df ?

Editor's Notes

  1. You have filters and you are searching in an image the shapes of the filters. Learning is about finding filters that are good for detecting objects. Generally, finding properties of data occurring more often than noise.
  2. You have filters and you are searching in an image the shapes of the filters. Learning is about finding filters that are good for detecting objects. Generally, finding properties of data occurring more often than noise.
  3. You have filters and you are searching in an image the shapes of the filters. Learning is about finding filters that are good for detecting objects. Generally, finding properties of data occurring more often than noise.
  4. You have filters and you are searching in an image the shapes of the filters. Learning is about finding filters that are good for detecting objects. Generally, finding properties of data occurring more often than noise. W bar is W with flipped parameters. Stride is number of steps a filter moves over the image, typically is one. Zero padding is also another common practice to acquire feature map equivalent to image.