SlideShare a Scribd company logo
1 of 24
Download to read offline
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

Game development terminologies
Game development terminologiesGame development terminologies
Game development terminologiesAhmed Badr
 
Animation techniques for CG students
Animation techniques for CG studentsAnimation techniques for CG students
Animation techniques for CG studentsMahith
 
Face Morphing Be Project
Face Morphing Be ProjectFace Morphing Be Project
Face Morphing Be ProjectAkshay Suresh
 
3D Modeling and Texturing Walkthrough
3D Modeling and Texturing Walkthrough3D Modeling and Texturing Walkthrough
3D Modeling and Texturing WalkthroughMartin Reimer
 

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 Complete Guide to Convolutional Neural Networks

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 ProcessingDerek Kane
 
Deep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxDeep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxJawadHaider36
 
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 manipolationgraphitech
 
Traffic Automation System
Traffic Automation SystemTraffic Automation System
Traffic Automation SystemPrabal Chauhan
 
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 recognitionShandukaniVhulondo
 
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 LearningIRJET Journal
 
[Revised] Intro to CNN
[Revised] Intro to CNN[Revised] Intro to CNN
[Revised] Intro to CNNVincent Tatan
 
Transcript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesTranscript - Data Visualisation - Tools and Techniques
Transcript - Data Visualisation - Tools and TechniquesARDC
 
PBL presentation p2.pptx
PBL presentation p2.pptxPBL presentation p2.pptx
PBL presentation p2.pptxTony383416
 
BMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialBMVA summer school MATLAB programming tutorial
BMVA summer school MATLAB programming tutorialpotaters
 
Deep Neural Network DNN.docx
Deep Neural Network DNN.docxDeep Neural Network DNN.docx
Deep Neural Network DNN.docxjaffarbikat
 
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.docxssuser90e017
 
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.docxDIPESH30
 
Graphics on the Go
Graphics on the GoGraphics on the Go
Graphics on the GoGil Irizarry
 
Idiots guide-to-photoshop
Idiots guide-to-photoshopIdiots guide-to-photoshop
Idiots guide-to-photoshopMarcela Conroy
 

Similar to Complete Guide to Convolutional Neural Networks (20)

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
 
Computer Vision.pptx
Computer Vision.pptxComputer Vision.pptx
Computer Vision.pptx
 

Recently uploaded

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

Complete Guide to Convolutional Neural Networks

  • 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/