0% found this document useful (0 votes)
3 views59 pages

Introduction to Deep Learning CNN

Chapter 5 introduces deep learning, highlighting its distinction from machine learning and its applications, particularly in scenarios with large amounts of unstructured data. It covers the architecture and functioning of deep feedforward networks and convolutional neural networks (CNNs), including their implementation using TensorFlow. The chapter also discusses when to use deep learning, emphasizing its effectiveness in tasks requiring high accuracy and automation.

Uploaded by

relaxeddavinci0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views59 pages

Introduction to Deep Learning CNN

Chapter 5 introduces deep learning, highlighting its distinction from machine learning and its applications, particularly in scenarios with large amounts of unstructured data. It covers the architecture and functioning of deep feedforward networks and convolutional neural networks (CNNs), including their implementation using TensorFlow. The chapter also discusses when to use deep learning, emphasizing its effectiveness in tasks requiring high accuracy and automation.

Uploaded by

relaxeddavinci0
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Ch-5

Introduction to Deep Learning & CNN

May 30, 2025 1


Ch-5 Introduction to Deep Learning & CNN

1. What is deep learning?


2. Difference between Machine Learning and Deep
Learning,
3. When to use Deep Learning?
4. Deep Feedforward Networks, Example: Learning XOR,
5. Convolution Neural Networks (CNN) – Convolutional
Layer: Filters, Stacking Multiple Feature Maps,
TensorFlow Implementation, Pooling Layer,
6. CNN Architectures

May 30, 2025 2


1. What is deep learning?

❑ Deep learning is a subfield of machine learning that uses artificial neural networks with
multiple layers (hence "deep") to analyze and learn from data.

❑ Deep Learning is transforming the way machines understand, learn, and interact with
complex data.

❑ Deep learning mimics neural networks of the human brain,

❑ It enables computers to autonomously uncover patterns and make informed decisions


from vast amounts of unstructured data.

❑ Deep Learning leverages artificial neural networks (ANNs) to process and learn from
complex data.
1. What is deep learning?

❑ How Deep Learning Works?


➢ Neural network consists of layers of
interconnected nodes, or neurons, that
collaborate to process input data.
➢ In a fully connected deep neural network,
data flows through multiple layers, where
each neuron performs nonlinear
transformations, allowing the model to learn
intricate representations of the data.
➢ In a deep neural network, the input layer
receives data, which passes through hidden
layers that transform the data using
nonlinear functions.
➢ The final output layer generates the model’s
prediction.
1. What is deep learning?

❑ How Deep Learning Works?


➢ Neural network consists of layers of
interconnected nodes, or neurons, that
collaborate to process input data.
➢ In a fully connected deep neural network,
data flows through multiple layers, where
each neuron performs nonlinear
transformations, allowing the model to learn
intricate representations of the data.
➢ In a deep neural network, the input layer
receives data, which passes through hidden
layers that transform the data using
nonlinear functions.
➢ The final output layer generates the model’s
prediction.
1. What is deep learning?

❑ Deep Learning in Machine Learning


Paradigms
➢ Supervised Learning: Neural networks
learn from labeled data to predict or
classify, using algorithms like CNNs and
RNNs for tasks such as image recognition
and language translation.
➢ Unsupervised Learning: Neural
networks identify patterns in unlabeled
data, using techniques like Autoencoders
and Generative Models for tasks like
clustering and anomaly detection.
➢ Reinforcement Learning: An agent
learns to make decisions by maximizing
rewards, with algorithms like DQN and
DDPG applied in areas like robotics and
game playing.
Ch-5 Introduction to Deep Learning & CNN

1. What is deep learning?


2. Difference between Machine Learning and Deep
Learning,
3. When to use Deep Learning?
4. Deep Feedforward Networks, Example: Learning XOR,
5. Convolution Neural Networks (CNN) – Convolutional
Layer: Filters, Stacking Multiple Feature Maps,
TensorFlow Implementation, Pooling Layer,
6. CNN Architectures

May 30, 2025 7


2. Difference between Machine Learning and Deep Learning

❑ Machine learning and Deep Learning both are subsets of artificial intelligence but there are many
similarities and differences between them.
Ch-5 Introduction to Deep Learning & CNN

1. What is deep learning?


2. Difference between Machine Learning and Deep
Learning,
3. When to use Deep Learning?
4. Deep Feedforward Networks, Example: Learning XOR,
5. Convolution Neural Networks (CNN) – Convolutional
Layer: Filters, Stacking Multiple Feature Maps,
TensorFlow Implementation, Pooling Layer,
6. CNN Architectures

May 30, 2025 9


3. When to use Deep Learning?

❑ Deep learning should be considered when you have large amounts of data, especially
unstructured or unlabeled data, and when complex, non-linear patterns need to be identified.

❑ It's particularly useful for tasks where feature engineering is difficult or time-consuming, and
where the goal is to achieve high accuracy and automation.

1. When Data is Abundant: Deep learning thrives on large datasets, often requiring millions of
data points to train effectively. Traditional machine learning algorithms can struggle with
such volumes, while deep learning models can learn complex patterns from vast amounts of
information.
2. When Data is Unstructured: Deep learning excels at processing raw data formats like
images, audio, and text, where features are not explicitly defined. Algorithms like
convolutional neural networks (CNNs) and recurrent neural networks (RNNs) are
specifically designed to extract features from these types of data.
3. When to use Deep Learning?

❑ ...
3. When Feature Engineering is Challenging: Deep learning can automate feature extraction,
reducing the need for manual engineering of features. This is particularly beneficial in
domains like computer vision and natural language processing, where identifying relevant
features can be complex.
4. When High Accuracy is Critical: Deep learning models can achieve high levels of accuracy
in various tasks, often surpassing traditional machine learning algorithms, especially when
dealing with complex problems. This is due to their ability to learn intricate non-linear
relationships in the data.
5. When Automation is Desired: Deep learning models can be trained to perform tasks with
minimal human intervention, making them ideal for applications like self-driving cars, object
detection, and image recognition.
3. When to use Deep Learning?

❑ Examples of When to Use Deep Learning:


❖ Image Recognition:
o Identifying objects and features in images, like facial recognition, medical image
analysis, and object detection in self-driving cars.
❖ Natural Language Processing:
o Understanding and processing text, such as in chatbots, language translation, and
sentiment analysis.
❖ Speech Recognition:
o Converting speech to text and vice versa.
❖ Predictive Modeling:
o Forecasting demand, predicting customer churn, and making market predictions.
❖ Reinforcement Learning:
o Training agents to make decisions in complex environments, like game playing,
robotics, and control systems.
Ch-5 Introduction to Deep Learning & CNN

1. What is deep learning?


2. Difference between Machine Learning and Deep Learning,
3. When to use Deep Learning?
4. Deep Feedforward Networks, Example: Learning XOR,
5. Convolution Neural Networks (CNN) – Convolutional
Layer: Filters, Stacking Multiple Feature Maps, TensorFlow
Implementation, Pooling Layer,
6. CNN Architectures

May 30, 2025 13


4. Deep Feedforward Networks, Example: Learning XOR

❑ Feed forward neural networks are artificial neural networks in which nodes do not form loops.

❑ This type of neural network is also known as a multi-layer neural network as all information is
only passed forward.

❑ During data flow, input nodes receive data, which travel through hidden layers, and exit output
nodes.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ XOR function is not linearly separable, meaning a single line cannot separate the (0,0) and
(1,1) points from the (0,1) and (1,0) points.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ A Deep Feedforward Network (DFN), also known as a Multi-Layer Perceptron (MLP), can
learn the XOR function by using a hidden layer and non-linear activation functions.

➢ This is because the XOR function is not linearly separable, meaning a single line cannot
separate the (0,0) and (1,1) points from the (0,1) and (1,0) points.

➢ A DFN can overcome this by introducing a hidden layer that transforms the input space into a
space where the XOR function is linearly separable.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ How Multi-Layer Neural Networks Solve XOR?
o A multi-layer neural network which is also known as a feedforward neural network or
multi-layer perceptron is able to solve the XOR problem.
o There are multiple layer of neurons such as input layer, hidden layer, and output layer.
o The working of each layer:
1. Input Layer: This layer takes the two inputs (A and B).
2. Hidden Layer: This layer applies non-linear activation functions to create new,
transformed features that help separate the classes.
3. Output Layer: This layer produces the final XOR result.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ How Multi-Layer Neural Networks Solve XOR? . . .
Step 1: Input to Hidden Layer Transformation
Consider an MLP with two neurons in the hidden layer, each applying a non-linear
activation function (like the sigmoid function). The output of the hidden neurons
can be represented as:
h1​=σ(w11A+w12B+b1​)
h2=σ(w21A+w22B+b2)
Where:
▪ σ(x)=1/1+e−x is the sigmoid activation function.
▪ wij are the weights from the input neurons to the hidden neurons.
▪ bi are the biases for the hidden neurons.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ How Multi-Layer Neural Networks Solve XOR? . . .
Step 2: Hidden Layer to Output Layer Transformation
The output neuron combines the outputs of the hidden neurons to produce the
final output:
Output=σ(w31h1​+w32h2​+b3​)
Where w3i are the weights from the hidden neurons to the output neuron,
and b3 is the bias for the output neuron.
Step 3: Learning Weights and Biases
During the training process, the network adjusts the weights wij and biases bi
using backpropagation and gradient descent to minimize the error between
the predicted output and the actual XOR output.
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ How Multi-Layer Neural Networks Solve XOR? . . .
Example Configuration: Let's consider a specific configuration of weights and biases that solves
the XOR problem:
For the hidden layer:
• w11​=1, w12​=1, b1​=0.5
• w21=1,w22=1,b2=−1.5
For the output layer:
• w31​=1,w32​=1, b3​=−1
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ Python code implementation using TensorFlow and Keras:
#....
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# Define the XOR input and output data


X = np.array([[0, 0], [0, 1], [1, 0], [1, 1]])
y = np.array([[0], [1], [1], [0]])

# Build the neural network model


model = Sequential()
model.add(Dense(2, input_dim=2, activation='relu')) # Hidden layer with 2 neurons
model.add(Dense(1, activation='sigmoid')) # Output layer with 1 neuron
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ Python code implementation using TensorFlow and Keras: . . .
#...
# Compile the model
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])

# Train the model


model.fit(X, y, epochs=10000, verbose=0)

# Evaluate the model


_, accuracy = model.evaluate(X, y)
print(f"Accuracy: {accuracy * 100:.2f}%")
4. Deep Feedforward Networks, Example: Learning XOR

❑ Example: Learning XOR


➢ Python code implementation using TensorFlow and Keras: . . .
#...
# Make predictions
predictions = model.predict(X)
predictions = np.round(predictions).astype(int)

print("Predictions:")
for i in range(len(X)):
print(f"Input: {X[i]} => Predicted Output: {predictions[i]}, Actual Output: {y[i]}")
Ch-5 Introduction to Deep Learning & CNN

1. What is deep learning?


2. Difference between Machine Learning and Deep Learning,
3. When to use Deep Learning?
4. Deep Feedforward Networks, Example: Learning XOR,
5. Convolution Neural Networks (CNN) – Convolutional
Layer: Filters, Stacking Multiple Feature Maps, TensorFlow
Implementation, Pooling Layer,
6. CNN Architectures

May 30, 2025 24


4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Convolution Neural Networks
➢ CNN is the one algorithm that started the revolution in the field of computer vision. Its
capability lies in its architectural design.

➢ Convolutional Neural Network, CNN or ConvNet is a type of deep learning algorithm where
a mathematical operation known as convolution is used instead of the traditional general
matrix multiplication, at least in one of the hidden layers.

➢ The difference here is that in convolution, a mathematical operation on two functions


produces a third function that explains how the shape of one modifies the other.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ As CNN is a deep learning algorithm, hence, is comprised of multiple layers of artificial
neurons.
➢ The artificial neuron calculates the weighted sum of the inputs and runs it by an activation
function that returns an output. The weights dictate the behavior of each neuron.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution:
o An image consists of pixels, serving as input for a CNN - Each hidden layer generates
activation maps, emphasizing vital features.

o Multiplying pixel values with neuron weights and summing them is known as convolution,
and the layer is referred to as a convolution layer - It’s important to note that this
multiplication is more peculiar.

o Neurons in the CNN consider pixel patches as input, multiplying pixel color values by
assigned weights.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution: . . .
o The neuron sums these products and passes the result through an activation function,
capturing essential image characteristics.

o A Convolutional Neural Network can comprise multiple such convolutional layers (along
with other layers of CNN discussed in the next section), each having an activation function
to detect features.

o The activation function in the convolution layers is typically responsible for inducing non-
linearity in the network so that complex learning can occur.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution: . . .
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution: . . .
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution: . . .
o While the first hidden layer detects basic features in an image, such as the vertical,
diagonal, and horizontal edges, the next few layers extract more complicated features.

o The output of the first hidden layer gets fed to the next layer, which extracts corners, a
combination of edges, and other complicated features.

o The third layer considers the output of the second layer as its input and, in turn, extracts
even more complicated features.

o As you progress deeper into the network, increasingly complex features are extracted, and
the final layers specialize in detecting higher-level features such as faces, objects, and so
on.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Convolution: . . .
o While the first hidden layer detects basic features in an image, such as the vertical,
diagonal, and horizontal edges, the next few layers extract more complicated features.

o The output of the first hidden layer gets fed to the next layer, which extracts corners, a
combination of edges, and other complicated features.

o The third layer considers the output of the second layer as its input and, in turn, extracts
even more complicated features.

o As you progress deeper into the network, increasingly complex features are extracted, and
the final layers specialize in detecting higher-level features such as faces, objects, and so
on.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Output:
o The output layer’s activation function decides how the output is provided. Typically, the
activation function is set to return values between 0 and 1, indicating the network’s
confidence in associating the input image with a class.

o For example, a convolution network classifies apples, oranges, and peaches, will return
probabilities for each class for an input image.

o These probabilities will indicate how likely the input image belongs to each class. So if we
get 40% for apples, 25% for oranges, and 35% for peaches, then as per the network, the
input image is probably of an apple.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Backpropagation:
o The key aspect of deep neural networks, including Convolutional Neural Networks (CNNs),
involves adjusting neuron weights to extract accurate features from images - This process,
known as training, begins with a large, well-labeled training dataset.

o The training begins by assigning random weights to each neuron - Each labeled image in
the training dataset is processed with these random values, producing a predicted label.

o The predicted label is then compared with the image’s actual label. If they don’t match,
which is likely initially, the neurons’ weights are slightly adjusted, and the network is re-
run to make a new prediction.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ How does CNN Work ?
➢ Validation:
o After completing the training, the network is evaluated on the test dataset, an untouched
labeled dataset not used for training. The trained network makes predictions on this test
dataset. If the network performs similarly to the testing phase, the model is considered to
generalize well. If, for some reason, it performs worse, the model is considered
‘overfitted’.

o Overfitting typically happens due to a lack of variety in images in the training data,
networking going through too many epochs during the training, or other reasons arising
from incorrect values of various parameters.

o As you can see, the working of CNN is similar to other neural networks, with the
difference being how it processes the input.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Of the many layers of CNN, the
first layer (after the input layer)
is the convolutional layer that
extracts the features from the
data.

o With each successive


convolution layer, more complex
features are identified and
extracted from the image.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Filter/Kernel:
• In convolution, the initial matrix is
a filter, also known as a kernel,
with a size of MxN.

• This filter comprises learnable


parameters (kernel weights) that
modify its functions.

• The second matrix is a confined


portion of the image.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Filter/Kernel: . . .
• The dot product between these
matrices occurs by sliding the filter
over the input image, with the dot
product calculated between the
filter and the restricted part of the
image, limited by the filter size
(MxN).

• To be precise, the filter for the non-


colored image is MxNx1, while for
the colored image, it is MxNx3.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Filter/Kernel: . . .
• Here, M and N are the height and
width of the image while 3 is the
depth of the image (the depth is 3
for a colored image as it comprises
stacked R (red), G (green), and B
(blue) colored images).

• The filter slides across the image, or


the entire input volume, step by
step, with each step referred to as a
stride.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Filter/Kernel: . . .
• This process produces an outcome
known as a feature map or a convolved
feature, highlighting key features such
as corners, edges, and other essential
information in an image.

• Preserving the spatial relationship


between pixels is crucial for the feature
map. The convolution layer then passes
its output to the next layer but does
not directly proceed to the subsequent
layer.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Convolution Layer :
o Filter/Kernel: . . .

• Instead, the output experiences a


non-linear activation function, like
ReLU, and transmits the resulting
output to the following layer.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Pooling Layer:
o Typically, a pooling layer follows a
convolution layer to reduce the
dimensions of the input data. As a
result, convolution and pooling layers
generally form pairs and work
together.

o The convolved feature map is large


and can increase the computational
cost and chance of overfitting;
reducing its size is important.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Pooling Layer: . . .
o Achieving this involves analyzing a
restricted neighborhood, also known as a
pooling region, in the input matrix and
extracting its dominant features.

o This extraction can happen in two ways –


average pooling or max pooling. In
average pooling, the average of all the
values in the pooling region is calculated,
while in max pooling, the maximum value
within the pooling region is considered.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Pooling Layer : . . .

o By performing such a process, the


resultant matrix comprises the main
features of the input matrix (i.e., the
input image) in fewer dimensions or,
in other words, summarizes the
features extracted by the convolution
layer.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:

➢ Fully Connected Layer:


o Until now, the network has only extracted
the relevant features and reduced its
dimensions; however, no classification
has occurred. Flattening the input image
into a single-column vector allows the
utilization of a conventional, fully
connected, dense, feed-forward neural
network for classification.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Fully Connected Layer:

o In a fully connected layer, nodes from one


layer connect to every other node in the
next layer.

o Multiple fully connected layers process


the flattened vector, akin to data in a
frame, distinguishing crucial features for
image classification. Positioned just
before the output layer, they conclude
the process, refining the model after
feature extraction for accurate
classification.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Output Layer:

o An output layer typically utilizes a


logistic function like sigmoid or softmax
to perform classification on the output
of the final fully connected layer. This
process assigns a probability score to
each class, enabling classification.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Dropout Layers:

o One issue with the fully connected layer


is its dense architecture can easily
cause the model to overfit the training
dataset. A dropout layer randomly
drops a few neurons from the network
to address this issue.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Dropout Layers:

o For example, a dropout value 0.15 can


make 15% of the neurons drop out from
the network, ensuring that the model
doesn’t overfit during training.

o As you may have noticed, the


architecture of the Convolutional
Neural Network is complex, with a lot of
room to play around. This is why
numerous variations to this architecture
give rise to various types of CNN.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ CNN Architecture
➢ Most crucial layers of a convolutional neural network:
➢ Dropout Layers:

o For example, a dropout value 0.15 can


make 15% of the neurons drop out from
the network, ensuring that the model
doesn’t overfit during training.

o As you may have noticed, the


architecture of the Convolutional
Neural Network is complex, with a lot of
room to play around. This is why
numerous variations to this architecture
give rise to various types of CNN.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Types of convolutional neural networks : most common types of neural networks that are still
commonly used.

➢ 1) LeNEt

o LeNet, the pioneering design of CNN,


was created to recognize handwritten
characters. It considers a series of
convolutional and pooling layers
followed by a fully connected layer and
a softmax classifier.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Types of convolutional neural networks : most common types of neural networks that are still
commonly used.

➢ VGGNet
o Visual Geometry Group – an engineering
science research group at the University
of Oxford designed and developed
VGGNet that uses small convolutional
filters of size 3×3 but has a deep
architecture with layers up to 19.
o This allows the network to learn
increasingly complex features. It uses
max pooling layers to reduce the feature
map’s spatial resolution and increase the
receptive field, making the network
recognize objects of varying orientations
and scales.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Types of convolutional neural networks : most common types of neural networks that are still
commonly used.

➢ AlexNet

o The winner of ILSVRC 2012, AlexNet uses five


convolutional layers with max pooling and
three fully connected layers with ReLU as the
activation function used throughout the
network. Apart from the usual small
convolutional filters of size 3×3, it also uses
filters of 5×5 and 11×11.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Types of convolutional neural networks : most common types of neural networks that are still
commonly used.

➢ GoogLeNet
o Developed by researchers at Google,
GoogleNet won the ILSVRC. It consists of
multiple parallel convolutional layers. Each
of these parallel layers has different filter
sizes, followed by a pooling layer and the
concatenation of outputs. This parallel
architecture allows for learning features at
multiple resolutions and scales.

o At intermediate layers, auxiliary classifiers


manage overfitting, enabling the network to
learn more discriminative features.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Types of convolutional neural networks : most common types of neural networks that are still
commonly used.

➢ GoogLeNet . . .

o Beyond this brief overview, explore


additional CNN types like ResNet,
MobileNet, R-CNN, Fast R-CNN, Faster R-
CNN, etc., to enrich your understanding. We
will explore this remarkable network’s
advantages, disadvantages, and applications.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Benefits and Limitations of CNN
Benefits Limitations
1.As it uses at least three layers, the results are 1.After all, it is a pattern recognition tool and therefore
accurate. suffers in comprehending meaning, context, etc. This
2.It eliminates manual feature extraction. has been an issue when moderating content on
3.Retraining CNN allows for the performance of new social media, where there is a high rate of false
recognition tasks, enabling the rebuilding of the positives.
network on preexisting networks. 2.It can break down if images are out of context or are
4.It can detect patterns in images, videos, and audio seen for the first time. A bicycle attached to the back
signals. of a car or a horse carriage can severely confuse the
5.It exhibits robustness to noise and is less prone to network. New angles and lighting conditions can also
overfitting when proper regularization is applied. make the network off balance.
3.It needs a lot of well-labeled training data that is
difficult to obtain.
4. Convolution Neural Networks (CNN) – Convolutional Layer: Filters,
Stacking Multiple Feature Maps, TensorFlow Implementation, Pooling
Layer
❑ Benefits and Limitations of CNN
Benefits Limitations
1.As it uses at least three layers, the results are 4. It is susceptible to adversarial attacks. While minor
accurate. perturbations go unnoticed by the human eye,
2.It eliminates manual feature extraction. they can have a massive effect on the neural
3.Retraining CNN allows for the performance of new network. This can be hazardous in the case of
recognition tasks, enabling the rebuilding of the applications like self-driving cars.
network on preexisting networks. 5. It’s computationally expensive and needs a lot of
4.It can detect patterns in images, videos, and audio computer memory.
signals. 6. As CNN is a deep learning algorithm, its
5.It exhibits robustness to noise and is less prone to interpretability is limited. It works as a black box,
overfitting when proper regularization is applied. and it’s extremely difficult to understand what it
learned in the hidden layers and how it came to a
decision.
References

◼ https://www.geeksforgeeks.org/introduction-deep-learning/
◼ https://www.geeksforgeeks.org/how-neural-networks-solve-the-xor-problem/
◼ https://www.analytixlabs.co.in/blog/convolutional-neural-
network/#How_does_CNN_work

May 30, 2025 59


Thank You
!

You might also like