CNN For Deep Learning - Convolutional Neural Networks
CNN For Deep Learning - Convolutional Neural Networks
×
[Journey To Success] This Roadmap is followed by 10000+ Data Science Professionals...
Download Now
Home
Manav Mandal — Published On May 1, 2021 and Last Modified On June 30th, 2023
Advanced Computer Vision Deep Learning Image Analysis
Introduction
In the past few decades, Deep Learning has proved to be a very powerful tool because of its ability to handle large amounts of
data. The interest to use hidden layers has surpassed traditional techniques, especially in pattern recognition. One of the most
popular deep neural networks is Convolutional Neural Networks (also known as CNN or ConvNet) in deep learning, especially
when it comes to Computer Vision applications.
Since the 1950s, the early days of AI, researchers have struggled to make a system that can understand visual data. In the
following years, this field came to be known as Computer Vision. In 2012, computer vision took a quantum leap when a group of
researchers from the University of Toronto developed an AI model that surpassed the best image recognition algorithms, and
that too by a large margin.
The AI system, which became known as AlexNet (named after its main creator, Alex Krizhevsky), won the 2012 ImageNet
computer vision contest with an amazing 85 percent accuracy. The runner-up scored a modest 74 percent on the test.
At the heart of AlexNet was Convolutional Neural Networks a special type of neural network that roughly imitates human
vision. Over the years CNNs have become a very important part of many Computer Vision applications and hence a part of any
computer vision course online. So let’s take a look at the workings of CNNs or CNN algorithm in deep learning.
Table of Contents
Background of CNNs
What Is a CNN?
How does it work?
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 1/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
What Is a Pooling
Introduction Layer?
to Convolutional Neural Networks (CNN)
Limitations of CNNs
Frequently Asked Questions
Background of CNNs
CNN’s were first developed and used around the 1980s. The most that a CNN could do at that time was recognize handwritten
digits. It was mostly used in the postal sectors to read zip codes, pin codes, etc. The important thing to remember about any
deep learning model is that it requires a large amount of data to train and also requires a lot of computing resources. This was a
major drawback for CNNs at that period and hence CNNs were only limited to the postal sectors and it failed to enter the world
of machine learning.
In 2012 Alex Krizhevsky realized that it was time to bring back the branch of deep learning that uses multi-layered neural
networks. The availability of large sets of data, to be more specific ImageNet datasets with millions of labeled images and an
abundance of computing resources enabled researchers to revive CNNs.
What Is a CNN?
In deep learning, a convolutional neural network (CNN/ConvNet) is a class of deep neural networks, most commonly applied to
analyze visual imagery. Now when we think of a neural network we think about matrix multiplications but that is not the case
with ConvNet. It uses a special technique called Convolution. Now in mathematics convolution is a mathematical operation on
two functions that produces a third function that expresses how the shape of one is modified by the other.
But we don’t really need to go behind the mathematics part to understand what a CNN is or how it works.
Bottom line is that the role of the ConvNet is to reduce the images into a form that is easier to process, without losing features
that are critical for getting a good prediction.
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 2/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
For simplicity, let’s stick with grayscale images as we try to understand how CNNs work.
The above image shows what a convolution is. We take a filter/kernel(3×3 matrix) and apply it to the input image to get the
convolved feature. This convolved feature is passed on to the next layer.
In the case of RGB color, channel take a look at this animation to understand its working
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 3/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
Convolutional neural networks are composed of multiple layers of artificial neurons. Artificial neurons, a rough imitation of
their biological counterparts, are mathematical functions that calculate the weighted sum of multiple inputs and outputs an
activation value. When you input an image in a ConvNet, each layer generates several activation functions that are passed on to
the next layer.
The first layer usually extracts basic features such as horizontal or diagonal edges. This output is passed on to the next layer
which detects more complex features such as corners or combinational edges. As we move deeper into the network it can
identify even more complex features such as objects, faces, etc.
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 4/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
Based on the activation map of the final convolution layer, the classification layer outputs a set of confidence scores (values
between 0 and 1) that specify how likely the image is to belong to a “class.” For instance, if you have a ConvNet that detects cats,
dogs, and horses, the output of the final layer is the possibility that the input image contains any of those animals.
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 5/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
So what we do in Max Pooling is we find the maximum value of a pixel from a portion of the image covered by the kernel. Max
Pooling also performs as a Noise Suppressant. It discards the noisy activations altogether and also performs de-noising along
with dimensionality reduction.
On the other hand, Average Pooling returns the average of all the values from the portion of the image covered by the Kernel.
Average Pooling simply performs dimensionality reduction as a noise suppressing mechanism. Hence, we can say that Max
Pooling performs a lot better than Average Pooling.
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 6/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
Limitations of CNNs
Despite the power and resource complexity of CNNs, they provide in-depth results. At the root of it all, it is just recognizing
patterns and details that are so minute and inconspicuous that it goes unnoticed to the human eye. But when it comes to
understanding the contents of an image it fails.
Let’s take a look at this example. When we pass the below image to a CNN it detects a person in their mid-30s and a child
probably around 10 years. But when we look at the same image we start thinking of multiple different scenarios. Maybe it’s a
father and son day out, a picnic or maybe they are camping. Maybe it is a school ground and the child scored a goal and his dad is
happy so he lifts him.
These limitations are more than evident when it comes to practical applications. For example, CNN’s were widely used to
moderate content on social media. But despite the vast resources of images and videos that they were trained on it still isn’t
able to completely block and remove inappropriate content. As it turns out it flagged a 30,000-year statue with nudity on
Facebook.
Several studies have shown that CNNs trained on ImageNet and other popular datasets fail to detect objects when they see
them under different lighting conditions and from new angles.
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 7/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
The media shown in this article are not owned by Analytics Vidhya and is used at the Author’s discretion.
blogathon CNN
view more
Download
Analytics Vidhya App for the Latest blog/Article
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 8/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
Akunna says:
September 26, 2022 at 6:55 pm
This article is amazing. It's helped greatly in aiding my understanding of CNNs. Thank you so much.
Reply
S* says:
October 11, 2022 at 1:39 am
It is very helpful in understanding CNN calculations. Concepts are cleared with pictures. Thanks
Reply
Rahaman A says:
November 03, 2022 at 5:24 pm
Leave a Reply
Your email address will not be published. Required fields are marked *
Comment
Name* Email*
Website
Submit
Top Resources
10 Best AI Image Generator Tools to Use in 2023 Top 10 AI Skills to Have for Landing a Job..
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 9/10
9/9/23, 2:26 AM CNN for Deep Learning | Convolutional Neural Networks
Top 10 SQL Projects for Data Analysis Understand Random Forest Algorithms With Examples
(Updated 2023)
Companies Visit us
Post Jobs
Trainings
Hiring Hackathons
Advertising
© Copyright 2013-2023 Analytics Vidhya. Privacy Policy Terms of Use Refund Policy
https://www.analyticsvidhya.com/blog/2021/05/convolutional-neural-networks-cnn/ 10/10