SlideShare a Scribd company logo
Convolutional Neural Network Complete
Guide
What is Convolutional Neural Network?
Convolutional Neural Network is an algorithm of Deep Learning. That is
used for Image Recognition and in Natural Language Processing.
Convolutional Neural Network (CNN) takes an image to identify its
features and predict it.
Suppose, when you see some image of Dog, your brain focuses on
certain features of the dog to identify. These features may be dog’s ears,
eyes, or it may be anything else. Based on these features your brain
gives you signal that this is a dog.
Similarly, Convolutional Neural Network processes the image and
identifies it based on certain features. Convolutional Neural Network is
gaining so much popularity over the artificial neural networks. Because it
is used mostly in every field like ​self-driven cars, Image recognition​.
Another application of a convolutional neural network is that on
Facebook​, it easily identifies the face of the person and tags them by
their names.
Yann Lecun​ is the father of the Convolutional Neural Network. He is the
student of ​Geoffrey Hilton​. Geoffrey Hilton is the father of Artificial
Neural Network.
©MLTUT Visit ​https://www.mltut.com/
So let’s see how CNN works-
So, this is the basic structure of the Convolutional Neural Network. This
input image may be anything, CNN takes this image to perform the
operation and then classify it.
©MLTUT Visit ​https://www.mltut.com/
Convolutional Neural Network can be used in ​Sentiment Analysis​. That
means it can detect that a person is ​happy or sad​ based on the feature
of the images.
This is an emoticon just for a reference, but CNN can identify the
emotions of human faces. CNN gives the ​probability​ for example it can
say 90% is the probability that the person is happy.
©MLTUT Visit ​https://www.mltut.com/
How Convolutional Neural Network
Recognizes the Features?
The black and white image is a 2- dimensional array. For Black and
White images, the pixel ranges from​ 0 to 255.​ The 0 pixel is a black pixel
and 255 is the exact white pixel. And between 0 to 255 there are
different variations of grey color. Based on that information, the
computer works. This is the starting point in CNN to work on an image.
A computer doesn’t work on colors, it works on 0 and 1-pixel values.
In the colored image, it is a 3-dimensional array. It has an RGB layer.
RGB means Red, Green, and Blue. Each pixel has different values
assigned to it. And again the computer works on that value to find out
the color of the image.
Let’s take a very simple example so that you can understand easily.
Suppose we have a smiling Face. So to convert it into a pixel form,
consider 0 as white, and 1 as black. The smiling image can be
represented in the pixel format, that looks something like that-
©MLTUT Visit ​https://www.mltut.com/
Now, let’s move to the steps of CNN.
Steps in Convolutional Neural Network-
In Convolutional Neural Network, there are basically following steps-
1. Convolution Operation.
2. ReLU Layer.
3. Pooling.
4. Flattening.
5. Full Connection.
©MLTUT Visit ​https://www.mltut.com/
Convolution Operation-
A Convolution is basically a combining integration of two functions. And
it shows how one function modifies the shape of others. But here I am
not gonna discuss the maths behind it. I will discuss the functionality of
the Convolution layer.
It’s very easy and interesting.
So let’s see what happens in the Convolution Layer.
In the convolution layer, we have a ​feature detector​ or you can say a
Filter.​ This feature detector is a matrix. This matrix may be 3×3 or 5×5.
Here, I am taking a 3×3 matrix. You see mostly a 3×3 matrix.
A ​feature detector​ is also known as ​Kernel​. A feature detector basically
performs a multiplication of input images and generates a ​Feature Map.
You can understand the functionality of convolution with the help of this
image.
©MLTUT Visit ​https://www.mltut.com/
So, here in the image, there is an input image matrix, feature detector,
and feature map. This feature detector that I used here is just for your
reference. It may be anything.
In the convolution layer, multiplication is done between the input image
and the feature detector/filter.
As the filter is a 3×3 matrix, so in the input image choose the top left 3×3
matrix to perform multiplication.
©MLTUT Visit ​https://www.mltut.com/
So, here we take the top-left 3×3 matrix from the input layer, and then
we match values from the feature detector, here nothing is matched,
that’s why I write 0 in a feature map. How many features are matched,
we write that number in the feature map.
©MLTUT Visit ​https://www.mltut.com/
Let’s see how we get 0 in feature map and how matching is done with help
of this image-
Here, in both the matrices, we didn’t get any 1 which is at the same
location in both matrices.
Are you still confused about how we get 0 as a result?
Don’t worry!
©MLTUT Visit ​https://www.mltut.com/
I will explain to you again.
Here, we are trying to find the matching place of 1. When we find 1
which is located at the same place in both matrices, we count it as 1.
Otherwise, we put 0 in a feature map.
I hope now you understand. Let’s see how to perform the same operation with
other matrices.
Here, we got 1 in the feature map, because we found one place where 1
is located at the same place in both matrices.
©MLTUT Visit ​https://www.mltut.com/
Similarly, it happens with all other matrices.
One more important thing to keep in mind is that here, we are using a
single step. That means the gap between the two pixels is one. It may be
two or more.
So after performing the same operation on all pixels, we get our feature
map that looks something like that.
©MLTUT Visit ​https://www.mltut.com/
Here, I have mentioned the pixel, where we got 4 because we got 4
matching places, where 1 is located.
I hope now you understand how multiplication is performed in the
Convolution Layer.
So, now what we have created in the Convolution layer?. It's a Feature
map. By creating a feature map, we reduced the size of our image.
Because our input image is of a 7×7 matrix, but after the convolution
layer, we converted it into a 5×5 matrix.
The main purpose of the convolution layer is to make the image smaller
in size so that we can perform operation faster.
But,
There is one more question, that are we losing the information? So the
answer is- yes, some information we are losing, but the main features of
the image, we have collected. In image all of the features are not
important, some are useless. They can only increase the image size. So
it’s better to remove such features.
The higher the number you get in the feature map, the more important
feature it is. Like in the example image, we got 4. So it shows some
important features of the image.
In CNN multiple feature maps are created for a single image with the
help of different filters. Here, I have shown only one feature map, but it
may be much more in CNN. Therefore, lots of features are collected
from different feature maps.
©MLTUT Visit ​https://www.mltut.com/
Different feature maps are collected, and then at the training time, the
neural network decides, which features are important. We apply different
feature detectors or filters to get different feature maps.
2. ReLU Layer-
This is the additional step in the convolution layer. Here, we apply a
rectifier function. I hope you are familiar with the rectifier function. If not,
then read it from ​here​.
©MLTUT Visit ​https://www.mltut.com/
We apply the rectifier function here because we want to increase the
nonlinearity in our CNN. The reason for increasing the nonlinearity in
CNN because images are highly nonlinear. But when we apply different
functions like convolution, the image may become linear. Therefore, we
want to break the linearity.
There is nothing much to discuss in that Layer. It is a subpart of the
Convolution layer.
Let’s move to the next layer.
3. Pooling-
Suppose CNN has to identify the apple. But all apple images are not the
same. Some have different shapes, some have different colors, so how
CNN can recognize every image of an apple. If CNN looks only at those
features from those it learned previously, it can’t predict the new shape
apple. Therefore we have to make sure that our neural network has a
property called special variance. That means it doesn’t care that features
are a little bit different, still, CNN can recognize that it is an apple. That is
all about Pooling.
Here, I am gonna use Max Pooling. But there are different kinds of
pooling- Min Pooling, Sum Pooling, and many more.
©MLTUT Visit ​https://www.mltut.com/
Now let’s see how to apply Max Pooling-
● We take a box of 2×2 pixels from the feature map. You can
choose a 3×3 pixel of the box. It’s not fixed.
● Start from the top left corner of the feature map.
● As, we are doing max pooling, so we take the max number
from that box and put it into the Pooled Feature Map.
● Then move to the next box with one step and perform the
same operation.
©MLTUT Visit ​https://www.mltut.com/
Now, let’s understand with the help of this image-
Here, we got 1 because the maximum number is 1 in the box of 2×2
pixels.
©MLTUT Visit ​https://www.mltut.com/
Let’s see the next step-
©MLTUT Visit ​https://www.mltut.com/
Step 3-
©MLTUT Visit ​https://www.mltut.com/
Step 4-
Here, we got 4, because the maximum number in that box is 4.
Similarly, you can perform the same operation with the whole feature
map. After performing on full feature map, you get your Pooled feature
map something like that-
©MLTUT Visit ​https://www.mltut.com/
By performing Pooling, we are reducing the size but also preserving the
important features of the image. We are preventing overfitting by
performing pooling. And that is the main advantage of pooling. Because
not all information is important.
So, that’s all about pooling. Now let’s move to the next step.
©MLTUT Visit ​https://www.mltut.com/
4. Flattening-
This is a very simple step. After Pooling, we got out the Pooled Feature
Map. So, in this step, we are going to convert a 3×3 matrix into a single
column.
The reason for doing flattening is because we will provide these values
as input values in the input layer.
Let’s see how it looks after performing flattening-
©MLTUT Visit ​https://www.mltut.com/
So, after flattening, we got pixels values in this form. And these will be
supplied to the input layer.
Now, let’s move to the final step-
5. Full Connection-
In that step, we add our fully convolutional network to the artificial neural
network. All the work which we have done so far, now it's time to pass
these pixel values to the neural network.
I have discussed the artificial neural network in a separate article. If you
are not aware of the artificial neural network and its structure, then first
read this article from here- ​Artificial Neural Network.
So, in an artificial neural network, we have an input layer, a hidden layer,
and output layer, something like that-
©MLTUT Visit ​https://www.mltut.com/
In CNN the hidden layers are called a fully connected layer.
So, now we pass our flattening values to the input layer, and fully
connected layers perform operations and predict the outcome based on
the features.
Let’s understand what operation is performed here-
1. First, we pass input values to the input layer.
2. A fully connected layer performs an operation, and predicts
the output.
©MLTUT Visit ​https://www.mltut.com/
3. Then it checks for the error rate in the output layer with the
help of cost function as we did in artificial neural networks.
4. After that, we backpropagate and adjust the weights, and
again predict the output.
5. Then again the predicted output is matched with actual
output and calculates the error rate.
6. Again backpropagate, update the weights.
7. This process is repeated until ​CNN​ predicts the accurate
result.
So this is all about ​Convolutional Neural Network.
I hope now you understand What is Convolutional Neural Network? and
its steps.
For more details visit- ​https://www.mltut.com/
©MLTUT Visit ​https://www.mltut.com/

More Related Content

What's hot

Image_processing
Image_processingImage_processing
Image_processing
Elijah Willie
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
Ahmed Badr
 
Datt 2501 week 10
Datt 2501 week 10Datt 2501 week 10
Datt 2501 week 10
Joe Hambleton
 
Datt 2501 week 11
Datt 2501 week 11Datt 2501 week 11
Datt 2501 week 11
Joe Hambleton
 
ic1
ic1ic1
Animation techniques for CG students
Animation techniques for CG studentsAnimation techniques for CG students
Animation techniques for CG students
Mahith
 
Gaming Process
Gaming ProcessGaming Process
Gaming Process
Sharad Mitra
 
Datt 2500 week 10
Datt 2500 week 10Datt 2500 week 10
Datt 2500 week 10
Joe Hambleton
 
Animations
AnimationsAnimations
Animations
Adri Jovin
 
Graphics
GraphicsGraphics
Graphics
ShailajaMca
 
Face Morphing Be Project
Face Morphing Be ProjectFace Morphing Be Project
Face Morphing Be Project
Akshay Suresh
 
3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough
Martin Reimer
 
Chap9 10
Chap9 10Chap9 10
Chap9 10
dkd_woohoo
 

What's hot (13)

Image_processing
Image_processingImage_processing
Image_processing
 
Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologies
 
Datt 2501 week 10
Datt 2501 week 10Datt 2501 week 10
Datt 2501 week 10
 
Datt 2501 week 11
Datt 2501 week 11Datt 2501 week 11
Datt 2501 week 11
 
ic1
ic1ic1
ic1
 
Animation techniques for CG students
Animation techniques for CG studentsAnimation techniques for CG students
Animation techniques for CG students
 
Gaming Process
Gaming ProcessGaming Process
Gaming Process
 
Datt 2500 week 10
Datt 2500 week 10Datt 2500 week 10
Datt 2500 week 10
 
Animations
AnimationsAnimations
Animations
 
Graphics
GraphicsGraphics
Graphics
 
Face Morphing Be Project
Face Morphing Be ProjectFace Morphing Be Project
Face Morphing Be Project
 
3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough
 
Chap9 10
Chap9 10Chap9 10
Chap9 10
 

Similar to Convolutional neural network complete guide

Convolutional_neural_network mechanism.pptx.pdf
Convolutional_neural_network mechanism.pptx.pdfConvolutional_neural_network mechanism.pptx.pdf
Convolutional_neural_network mechanism.pptx.pdf
SwathiSoman5
 
Data Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image ProcessingData Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image Processing
Derek Kane
 
Deep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxDeep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptx
JawadHaider36
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
graphitech
 
Traffic Automation System
Traffic Automation SystemTraffic Automation System
Traffic Automation System
Prabal Chauhan
 
Dssg talk CNN intro
Dssg talk CNN introDssg talk CNN intro
Dssg talk CNN intro
Vincent Tatan
 
Designing a neural network architecture for image recognition
Designing a neural network architecture for image recognitionDesigning a neural network architecture for image recognition
Designing a neural network architecture for image recognition
ShandukaniVhulondo
 
Real Time Sign Language Recognition Using Deep Learning
Real Time Sign Language Recognition Using Deep LearningReal Time Sign Language Recognition Using Deep Learning
Real Time Sign Language Recognition Using Deep Learning
IRJET Journal
 
[Revised] Intro to CNN
[Revised] Intro to CNN[Revised] Intro to CNN
[Revised] Intro to CNN
Vincent Tatan
 
Lets build a neural network
Lets build a neural networkLets build a neural network
Lets build a neural network
Commit Software Sh.p.k.
 
Transcript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesTranscript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and Techniques
ARDC
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
rohithprabhas1
 
PBL presentation p2.pptx
PBL presentation p2.pptxPBL presentation p2.pptx
PBL presentation p2.pptx
Tony383416
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorial
potaters
 
Deep Neural Network DNN.docx
Deep Neural Network DNN.docxDeep Neural Network DNN.docx
Deep Neural Network DNN.docx
jaffarbikat
 
16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx
ssuser90e017
 
Laureate Online Education Internet and Multimedia Technolog.docx
Laureate Online Education    Internet and Multimedia Technolog.docxLaureate Online Education    Internet and Multimedia Technolog.docx
Laureate Online Education Internet and Multimedia Technolog.docx
DIPESH30
 
Scale invariant feature transform
Scale invariant feature transformScale invariant feature transform
Scale invariant feature transform
Mohammad Asghar Barech
 
Graphics on the Go
Graphics on the GoGraphics on the Go
Graphics on the Go
Gil Irizarry
 
Idiots guide-to-photoshop
Idiots guide-to-photoshopIdiots guide-to-photoshop
Idiots guide-to-photoshop
Marcela Conroy
 

Similar to Convolutional neural network complete guide (20)

Convolutional_neural_network mechanism.pptx.pdf
Convolutional_neural_network mechanism.pptx.pdfConvolutional_neural_network mechanism.pptx.pdf
Convolutional_neural_network mechanism.pptx.pdf
 
Data Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image ProcessingData Science - Part XVII - Deep Learning & Image Processing
Data Science - Part XVII - Deep Learning & Image Processing
 
Deep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxDeep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptx
 
A graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolationA graphic library and an application for simple curve manipolation
A graphic library and an application for simple curve manipolation
 
Traffic Automation System
Traffic Automation SystemTraffic Automation System
Traffic Automation System
 
Dssg talk CNN intro
Dssg talk CNN introDssg talk CNN intro
Dssg talk CNN intro
 
Designing a neural network architecture for image recognition
Designing a neural network architecture for image recognitionDesigning a neural network architecture for image recognition
Designing a neural network architecture for image recognition
 
Real Time Sign Language Recognition Using Deep Learning
Real Time Sign Language Recognition Using Deep LearningReal Time Sign Language Recognition Using Deep Learning
Real Time Sign Language Recognition Using Deep Learning
 
[Revised] Intro to CNN
[Revised] Intro to CNN[Revised] Intro to CNN
[Revised] Intro to CNN
 
Lets build a neural network
Lets build a neural networkLets build a neural network
Lets build a neural network
 
Transcript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesTranscript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and Techniques
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
 
PBL presentation p2.pptx
PBL presentation p2.pptxPBL presentation p2.pptx
PBL presentation p2.pptx
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorial
 
Deep Neural Network DNN.docx
Deep Neural Network DNN.docxDeep Neural Network DNN.docx
Deep Neural Network DNN.docx
 
16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx16 OpenCV Functions to Start your Computer Vision journey.docx
16 OpenCV Functions to Start your Computer Vision journey.docx
 
Laureate Online Education Internet and Multimedia Technolog.docx
Laureate Online Education    Internet and Multimedia Technolog.docxLaureate Online Education    Internet and Multimedia Technolog.docx
Laureate Online Education Internet and Multimedia Technolog.docx
 
Scale invariant feature transform
Scale invariant feature transformScale invariant feature transform
Scale invariant feature transform
 
Graphics on the Go
Graphics on the GoGraphics on the Go
Graphics on the Go
 
Idiots guide-to-photoshop
Idiots guide-to-photoshopIdiots guide-to-photoshop
Idiots guide-to-photoshop
 

Recently uploaded

An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
ElakkiaU
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
IJECEIAES
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
ydzowc
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
gowrishankartb2005
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
KrishnaveniKrishnara1
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
GauravCar
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
Madan Karki
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
KrishnaveniKrishnara1
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 

Recently uploaded (20)

An Introduction to the Compiler Designss
An Introduction to the Compiler DesignssAn Introduction to the Compiler Designss
An Introduction to the Compiler Designss
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...An improved modulation technique suitable for a three level flying capacitor ...
An improved modulation technique suitable for a three level flying capacitor ...
 
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
原版制作(Humboldt毕业证书)柏林大学毕业证学位证一模一样
 
Material for memory and display system h
Material for memory and display system hMaterial for memory and display system h
Material for memory and display system h
 
22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt22CYT12-Unit-V-E Waste and its Management.ppt
22CYT12-Unit-V-E Waste and its Management.ppt
 
artificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptxartificial intelligence and data science contents.pptx
artificial intelligence and data science contents.pptx
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Seminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptxSeminar on Distillation study-mafia.pptx
Seminar on Distillation study-mafia.pptx
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.pptUnit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
Unit-III-ELECTROCHEMICAL STORAGE DEVICES.ppt
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 

Convolutional neural network complete guide

  • 1. Convolutional Neural Network Complete Guide What is Convolutional Neural Network? Convolutional Neural Network is an algorithm of Deep Learning. That is used for Image Recognition and in Natural Language Processing. Convolutional Neural Network (CNN) takes an image to identify its features and predict it. Suppose, when you see some image of Dog, your brain focuses on certain features of the dog to identify. These features may be dog’s ears, eyes, or it may be anything else. Based on these features your brain gives you signal that this is a dog. Similarly, Convolutional Neural Network processes the image and identifies it based on certain features. Convolutional Neural Network is gaining so much popularity over the artificial neural networks. Because it is used mostly in every field like ​self-driven cars, Image recognition​. Another application of a convolutional neural network is that on Facebook​, it easily identifies the face of the person and tags them by their names. Yann Lecun​ is the father of the Convolutional Neural Network. He is the student of ​Geoffrey Hilton​. Geoffrey Hilton is the father of Artificial Neural Network. ©MLTUT Visit ​https://www.mltut.com/
  • 2. So let’s see how CNN works- So, this is the basic structure of the Convolutional Neural Network. This input image may be anything, CNN takes this image to perform the operation and then classify it. ©MLTUT Visit ​https://www.mltut.com/
  • 3. Convolutional Neural Network can be used in ​Sentiment Analysis​. That means it can detect that a person is ​happy or sad​ based on the feature of the images. This is an emoticon just for a reference, but CNN can identify the emotions of human faces. CNN gives the ​probability​ for example it can say 90% is the probability that the person is happy. ©MLTUT Visit ​https://www.mltut.com/
  • 4. How Convolutional Neural Network Recognizes the Features? The black and white image is a 2- dimensional array. For Black and White images, the pixel ranges from​ 0 to 255.​ The 0 pixel is a black pixel and 255 is the exact white pixel. And between 0 to 255 there are different variations of grey color. Based on that information, the computer works. This is the starting point in CNN to work on an image. A computer doesn’t work on colors, it works on 0 and 1-pixel values. In the colored image, it is a 3-dimensional array. It has an RGB layer. RGB means Red, Green, and Blue. Each pixel has different values assigned to it. And again the computer works on that value to find out the color of the image. Let’s take a very simple example so that you can understand easily. Suppose we have a smiling Face. So to convert it into a pixel form, consider 0 as white, and 1 as black. The smiling image can be represented in the pixel format, that looks something like that- ©MLTUT Visit ​https://www.mltut.com/
  • 5. Now, let’s move to the steps of CNN. Steps in Convolutional Neural Network- In Convolutional Neural Network, there are basically following steps- 1. Convolution Operation. 2. ReLU Layer. 3. Pooling. 4. Flattening. 5. Full Connection. ©MLTUT Visit ​https://www.mltut.com/
  • 6. Convolution Operation- A Convolution is basically a combining integration of two functions. And it shows how one function modifies the shape of others. But here I am not gonna discuss the maths behind it. I will discuss the functionality of the Convolution layer. It’s very easy and interesting. So let’s see what happens in the Convolution Layer. In the convolution layer, we have a ​feature detector​ or you can say a Filter.​ This feature detector is a matrix. This matrix may be 3×3 or 5×5. Here, I am taking a 3×3 matrix. You see mostly a 3×3 matrix. A ​feature detector​ is also known as ​Kernel​. A feature detector basically performs a multiplication of input images and generates a ​Feature Map. You can understand the functionality of convolution with the help of this image. ©MLTUT Visit ​https://www.mltut.com/
  • 7. So, here in the image, there is an input image matrix, feature detector, and feature map. This feature detector that I used here is just for your reference. It may be anything. In the convolution layer, multiplication is done between the input image and the feature detector/filter. As the filter is a 3×3 matrix, so in the input image choose the top left 3×3 matrix to perform multiplication. ©MLTUT Visit ​https://www.mltut.com/
  • 8. So, here we take the top-left 3×3 matrix from the input layer, and then we match values from the feature detector, here nothing is matched, that’s why I write 0 in a feature map. How many features are matched, we write that number in the feature map. ©MLTUT Visit ​https://www.mltut.com/
  • 9. Let’s see how we get 0 in feature map and how matching is done with help of this image- Here, in both the matrices, we didn’t get any 1 which is at the same location in both matrices. Are you still confused about how we get 0 as a result? Don’t worry! ©MLTUT Visit ​https://www.mltut.com/
  • 10. I will explain to you again. Here, we are trying to find the matching place of 1. When we find 1 which is located at the same place in both matrices, we count it as 1. Otherwise, we put 0 in a feature map. I hope now you understand. Let’s see how to perform the same operation with other matrices. Here, we got 1 in the feature map, because we found one place where 1 is located at the same place in both matrices. ©MLTUT Visit ​https://www.mltut.com/
  • 11. Similarly, it happens with all other matrices. One more important thing to keep in mind is that here, we are using a single step. That means the gap between the two pixels is one. It may be two or more. So after performing the same operation on all pixels, we get our feature map that looks something like that. ©MLTUT Visit ​https://www.mltut.com/
  • 12. Here, I have mentioned the pixel, where we got 4 because we got 4 matching places, where 1 is located. I hope now you understand how multiplication is performed in the Convolution Layer. So, now what we have created in the Convolution layer?. It's a Feature map. By creating a feature map, we reduced the size of our image. Because our input image is of a 7×7 matrix, but after the convolution layer, we converted it into a 5×5 matrix. The main purpose of the convolution layer is to make the image smaller in size so that we can perform operation faster. But, There is one more question, that are we losing the information? So the answer is- yes, some information we are losing, but the main features of the image, we have collected. In image all of the features are not important, some are useless. They can only increase the image size. So it’s better to remove such features. The higher the number you get in the feature map, the more important feature it is. Like in the example image, we got 4. So it shows some important features of the image. In CNN multiple feature maps are created for a single image with the help of different filters. Here, I have shown only one feature map, but it may be much more in CNN. Therefore, lots of features are collected from different feature maps. ©MLTUT Visit ​https://www.mltut.com/
  • 13. Different feature maps are collected, and then at the training time, the neural network decides, which features are important. We apply different feature detectors or filters to get different feature maps. 2. ReLU Layer- This is the additional step in the convolution layer. Here, we apply a rectifier function. I hope you are familiar with the rectifier function. If not, then read it from ​here​. ©MLTUT Visit ​https://www.mltut.com/
  • 14. We apply the rectifier function here because we want to increase the nonlinearity in our CNN. The reason for increasing the nonlinearity in CNN because images are highly nonlinear. But when we apply different functions like convolution, the image may become linear. Therefore, we want to break the linearity. There is nothing much to discuss in that Layer. It is a subpart of the Convolution layer. Let’s move to the next layer. 3. Pooling- Suppose CNN has to identify the apple. But all apple images are not the same. Some have different shapes, some have different colors, so how CNN can recognize every image of an apple. If CNN looks only at those features from those it learned previously, it can’t predict the new shape apple. Therefore we have to make sure that our neural network has a property called special variance. That means it doesn’t care that features are a little bit different, still, CNN can recognize that it is an apple. That is all about Pooling. Here, I am gonna use Max Pooling. But there are different kinds of pooling- Min Pooling, Sum Pooling, and many more. ©MLTUT Visit ​https://www.mltut.com/
  • 15. Now let’s see how to apply Max Pooling- ● We take a box of 2×2 pixels from the feature map. You can choose a 3×3 pixel of the box. It’s not fixed. ● Start from the top left corner of the feature map. ● As, we are doing max pooling, so we take the max number from that box and put it into the Pooled Feature Map. ● Then move to the next box with one step and perform the same operation. ©MLTUT Visit ​https://www.mltut.com/
  • 16. Now, let’s understand with the help of this image- Here, we got 1 because the maximum number is 1 in the box of 2×2 pixels. ©MLTUT Visit ​https://www.mltut.com/
  • 17. Let’s see the next step- ©MLTUT Visit ​https://www.mltut.com/
  • 18. Step 3- ©MLTUT Visit ​https://www.mltut.com/
  • 19. Step 4- Here, we got 4, because the maximum number in that box is 4. Similarly, you can perform the same operation with the whole feature map. After performing on full feature map, you get your Pooled feature map something like that- ©MLTUT Visit ​https://www.mltut.com/
  • 20. By performing Pooling, we are reducing the size but also preserving the important features of the image. We are preventing overfitting by performing pooling. And that is the main advantage of pooling. Because not all information is important. So, that’s all about pooling. Now let’s move to the next step. ©MLTUT Visit ​https://www.mltut.com/
  • 21. 4. Flattening- This is a very simple step. After Pooling, we got out the Pooled Feature Map. So, in this step, we are going to convert a 3×3 matrix into a single column. The reason for doing flattening is because we will provide these values as input values in the input layer. Let’s see how it looks after performing flattening- ©MLTUT Visit ​https://www.mltut.com/
  • 22. So, after flattening, we got pixels values in this form. And these will be supplied to the input layer. Now, let’s move to the final step- 5. Full Connection- In that step, we add our fully convolutional network to the artificial neural network. All the work which we have done so far, now it's time to pass these pixel values to the neural network. I have discussed the artificial neural network in a separate article. If you are not aware of the artificial neural network and its structure, then first read this article from here- ​Artificial Neural Network. So, in an artificial neural network, we have an input layer, a hidden layer, and output layer, something like that- ©MLTUT Visit ​https://www.mltut.com/
  • 23. In CNN the hidden layers are called a fully connected layer. So, now we pass our flattening values to the input layer, and fully connected layers perform operations and predict the outcome based on the features. Let’s understand what operation is performed here- 1. First, we pass input values to the input layer. 2. A fully connected layer performs an operation, and predicts the output. ©MLTUT Visit ​https://www.mltut.com/
  • 24. 3. Then it checks for the error rate in the output layer with the help of cost function as we did in artificial neural networks. 4. After that, we backpropagate and adjust the weights, and again predict the output. 5. Then again the predicted output is matched with actual output and calculates the error rate. 6. Again backpropagate, update the weights. 7. This process is repeated until ​CNN​ predicts the accurate result. So this is all about ​Convolutional Neural Network. I hope now you understand What is Convolutional Neural Network? and its steps. For more details visit- ​https://www.mltut.com/ ©MLTUT Visit ​https://www.mltut.com/