Understanding of Convolutional Neural Network (CNN) - Deep Learning
Understanding of Convolutional Neural Network (CNN) - Deep Learning
Understanding of Convolutional
Neural Network (CNN) —
Deep Learning
Prabhu Follow
Mar 4, 2018 · 5 min read
Technically, deep learning CNN models to train and test, each input
image will pass it through a series of convolution layers with filters
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 1/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
Convolution Layer
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 2/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 3/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
Strides
Stride is the number of pixels shifts over the input matrix. When the
stride is 1 then we move the filters to 1 pixel at a time. When the stride
is 2 then we move the filters to 2 pixels at a time and so on. The below
figure shows convolution would work with a stride of 2.
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 4/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
Padding
Sometimes filter does not fit perfectly fit the input image. We have two
options:
• Drop the part of the image where the filter did not fit. This is
called valid padding which keeps only valid part of the image.
ReLU stands for Rectified Linear Unit for a non-linear operation. The
output is ƒ(x) = max(0,x).
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 5/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
There are other non linear functions such as tanh or sigmoid can also
be used instead of ReLU. Most of the data scientists uses ReLU since
performance wise ReLU is better than other two.
Pooling Layer
• Max Pooling
• Average Pooling
• Sum Pooling
Max pooling take the largest element from the rectified feature map.
Taking the largest element could also take the average pooling. Sum of
all elements in the feature map call as sum pooling.
The layer we call as FC layer, we flattened our matrix into vector and
feed it into a fully connected layer like neural network.
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 6/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
Summary
• Flatten the output and feed into a fully connected layer (FC Layer)
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 7/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
In the next post, I would like to talk about some popular CNN
architectures such as AlexNet, VGGNet, GoogLeNet and ResNet.
References :
• https://www.mathworks.com/discovery/convolutional-neural-
network.html
• https://adeshpande3.github.io/adeshpande3.github.io/A-
Beginner's-Guide-To-Understanding-Convolutional-Neural-
Networks/
• https://ujjwalkarn.me/2016/08/11/intuitive-explanation-
convnets/
• https://blog.datawow.io/interns-explain-cnn-8a669d053f8b.
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 8/9
4/11/2019 Understanding of Convolutional Neural Network (CNN) — Deep Learning
https://medium.com/@RaghavPrabhu/understanding-of-convolutional-neural-network-cnn-deep-learning-99760835f148 9/9