Department of
CSE
DEEP LEARNING
20CS3269AA
Topic:
CONVOLUTIONAL
NEURAL NETWORKS
Session - 11
AIM OF THE
SESSION
The student able to Understand Convolutional Neural Networks
INSTRUCTIONAL
OBJECTIVES
This
This Session
Session isis designed
designed to:
to:
1. Build Convolutional
1. Build Convolutional Neural
Neural Networks
Networks
2.
2. Make
Make use of Convolutional
use of Convolutional Neural
Neural Networks
Networks
LEARNING OUTCOMES
At
At the
the end
end of
of this
this session,
session, you
you should
should be
be able
able to:
to:
1. Build Convolutional
1. Build Convolutional Neural
Neural Networks
Networks
2.
2. Make
Make use of Convolutional
use of Convolutional Neural
Neural Networks
Networks
SESSION Introduction
The topics covered in the session are
1. What is need for CNN
2. Differences between CNN and ANN
3. CNN architecture
4. Convolution operation
5. Pooling techniques
02/23/2026 Deep learning 3
What is CNN?
• Convolutional Neural Networks (CNN) is a feed forward
neural network that is generally used for Image
recognition and object classification.
• CNNs are inspired from the visual cortex of the brain and
have been widely applied in image and speech
recognition.
• Cnn represent a huge breakthrough in image recognition
02/23/2026 Deep learning 4
Why CNN
• Until quite recently, computers were not good at tasks like recognizing puppy
in a picture or recognizing spoken words, which humans excel at.
The CNN is essential when it comes to image classification problems since it has such a
high degree of accuracy.
Prior to training an Artificial Neural Network, a 2D image is converted into a 1-
dimensional vector.
Furthermore, as the image size increases, the number of training parameters increases
exponentially, leading to storage loss.
02/23/2026 Deep learning 5
ANNs do not capture the sequence information that sequence data requires.
CNN vs ANN
1.
• In an ANN, each neuron in 1. In a CNN, each neuron in the
the network is connected hidden layer is connected to a small
to every other neuron in region of the input neurons.
the adjacent hidden 2. No of features /pixels are reduced
layers. thru convolution and pooling
operations
2 For small images it might work, but for
large images the no of pixels are so many
leading to millions of connections
between neurons, leading to intractable
solutions
02/23/2026 Deep learning 6
Applications of
CNN
Automatic video
classification
systems Voice
Self- recognition
drivin
g
cars
Natural
Imag language
e
searc processin
CNN
h g
Applications
CNN architecture
• CNN architecture has the following configuration:
• Convolutional Layer
• Pooling Layer
• Fully connected Layer
• Most normal configuration is convolutional layer, followed by ReLU
layer, followed by a pooling layer. The sets then keep repeating.
• The final layer is the fully connected layer, which precedes the
final image classification
02/23/2026 Deep learning 8
Cnn architecture
02/23/2026 Deep learning 9
CNN Architecture: Types of Layers
• Convolutional layer
• a “filter” passes over the image, scanning a
few pixels at a time and creating a feature
map that predicts the class to which each
feature belongs.
• Pooling layer (downsampling)
• reduces the amount of information in each
feature obtained in the convolutional layer
while maintaining the most important
information .
• there are usually several rounds of convolution
02/23/2026 Deep learning 10
CNN Architecture: Types of Layers
• Fully connected input layer (flatten)
• It takes the output of the previous layers,
“flattens” them and turns them into a single
vector that can be an input for the next stage.
• The first fully connected layer takes the inputs
from the feature analysis and applies weights
to predict the correct label.
• Fully connected output layer gives the final
probabilities for each label.
02/23/2026 Deep learning 11
CONVOLUTION PROCESS
• Assume the filter/kernel is weight
matrix wk. For example lets
assume a 3 x 3 wighted matrix.
• The kernel is a filter to extract
some particular features from the
original images.
• It could be for extracting curves ,
identifying a specific colour, or
recognizing a particular voice.
02/23/2026 Deep learning 12
Click here for title
Convolution operation
Kernel/Filter, K =
1 0 1 Ex. For the first feature element
0 1 0 (1*1+ 0*1 +1*1) +(0*0+1*1+0*1)+(1*0+0*0+1*1)=4
1 0 1
02/23/2026 Deep learning 13
Process of Convolution
(Contd.) EXAMPLE
• As the filter/kernel is slided across the input layer, the convolved layer
is obtained by adding the values obtained by element wise
multiplication of the weight matrix. 515
81 2 209 44 71 58 0 1 1
24 56 108 98 12 112 1 0 0
91 0 189 65 79 232 1 0 1
12 0 0 5 1 71
2 32 23 58 8 209
49 98 81 112 54 9
Input Filter/Kernel Outpu
layer t
(Weighted
matrix)
• For example, when the weighted matrix starts from the
top left corner of the input layer, the output value is
calculated as:
(81x0+2x1+209x1)+(24x1+56x0+108X0)+(91x
Process of Convolution
(Contd.) EXAMPLE
• The filter then moves by 1 pixel to the next cell and the process is repeated.
The output layer obtained after the filter slides over the entire image would
be a 4X4 [Link] is called an activation map/ feature map.
81 2 209 44 71 58 0 1 1 515 374
24 56 108 98 12 112 1 0 0
91 0 189 65 79 232 1 0 1
12 0 0 5 1 71
2 32 23 58 8 209
49 98 81 112 54 9
Input Filter/Kernel Output
layer (Weighted (Activation/Feature
matrix) Map)
• Dimension of output=n-f+1
• The distance between two consecutive receptive fields is called the stride.
• In this example stride is 1 since the receptive field was moved by 1 pixel at a
time.
padding
02/23/2026 Deep learning 16
Calculating output dimension of
Convolution layer
17
ReLU Layer
ReLU stands for Rectified Linear Unit and is a non-
linear operation. ReLU is an element wise
operation (applied per pixel) and replaces all
negative pixel values in the feature map by zero.
Output = Max(zero, Input)
18
sobel filters -edge detection
02/23/2026 Deep learning 19
Vertical edge detection with fileter
02/23/2026 Deep learning 20
Pooling Layer (Sub-sampling or Down-
sampling)
Pooling layer reduce the size of feature maps by using
some functions to summarize sub-regions, such as
taking the average or the maximum value
21
Fully connected layer
• After completion of series of convolutional, nonlinear
and pooling layers, it is necessary to attach a fully
connected layer.
• This layer takes the output information from
convolutional networks.
• Attaching a fully connected layer to the end of the
network results in an N dimensional vector, where N is
the amount of classes from which the model selects the
desired class.
example
SELF-ASSESSMENT QUESTIONS
1. A CNN is faster to train than a DNN because of the following reason.
[Link] Connected Layers.
b. Reusability of weights.
c. Both A and B
ANS: C
2.T/F: CNN's are able to generalize much better that DNN's for image processing
tasks such as classification using fewer training examples.
Ans : True
TERMINAL QUESTIONS
Q1) Derive the convolutional image for the given above 6 × 6 gray image applied to 3
× 3 kernel with Padding P=0 and Stride S=1
Q2) How pooling is used as feature reduction? What are the various types of Pooling
methods.
Q3) Illustrate the two major steps of CNN: Feature Learning and
Classification
02/23/2026 Deep learning 25
REFERENCES FOR FURTHER LEARNING OF
THE SESSION
Books:
1 Ian Goodfellow and Yoshua Bengio and Aaron Courville (2016) Deep Learning Book
02/23/2026 Deep learning 26