SlideShare a Scribd company logo
Convolutional Neural
Network
By Mohamed Gamal
© Mohamed Gamal 2024
Agenda
▪ What is CNN?
▪ Architecture and Components of CNN
▪ Advantages of CNN
▪ Disadvantages of CNN
1
▪ Convolutional Neural Networks (CNNs) come under the subdomain of
Machine Learning which is Deep Learning.
▪ CNN is a supervised type of Deep learning.
▪ Algorithms under Deep Learning process information the same way
the human brain does, but obviously on a very small scale, since our
brain is too complex (our brain has around 86 billion neurons).
What is CNN?
2
Image by Roger Brown
Image from a paper by Rahul
Kumar Sevakula
3
Source: Software Testing Help
4
Source: Top Apps
Components of CNN
General Architecture of Convolutional Neural Networks (CNN)
Flattening
feature extraction Classification
Convolution + Activation & Pooling
Output
Hidden Layer
5
Source: ByteByteGo
Convolution
+
Activation
Convolution
+
Activation
Pooling Pooling
Feature Extraction Classification
Activation
Function
(e.g., Softmax)
Feature Maps
Probabilistic
Distribution
Fully Connected
Layer
+
Dropout Layer
Components of CNN (Cont.)
Hidden Layer
(1D Feature Vector)
6
Image Source
7
Source: V7Labs
Feature Extraction
▪ Convolutional layer
▪ Pooling layer
▪ Activation functions
▪ Flatten Layer
▪ Fully Connected Layer
▪ Dropout Layer
▪ Output Layer
Components of CNN in detail
Convolutional Layer
• Convolutional layer: the primary purpose of convolution is to extract features
from the input image.
Average Filter
9
Images Source
Convolutional Layer (Cont.)
3D Image Convolution
10
Source
Source
Laplacian Filter
(Sharpening)
Gaussian Filter
(Smoothing)
Average/Mean Filter
(Smoothing)
Convolutional Layer (Cont.)
Original Image Average Filter
11
3D
View
2D
View
Images Source
Pooling Layer
• Pooling Layer: a down-sampling operation that reduces the dimensionality
of the feature map, but retains important information.
▪ Max Pooling, Min Pooling, Average Pooling, Sum Pooling … etc.
15
Activation Functions
• Activation functions: introduce non-linearity to the network, allowing it
to learn complex patterns in the data.
▪ ReLU (e.g., Image/Object Classification— Non-linear)
▪ Sigmoid (e.g., Binary Classification — Non-linear)
▪ Linear (e.g., Linear Regression)
▪ Tanh (e.g., Multiclass Classification — Non-linear)
▪ Softmax (e.g., Multiclass Classification — Non-linear)
▪ ⋮
12
Activation Functions (Cont.)
13
• Table 4.1 can help you choose a last-layer activation function for a few
common problem types.
ReLU
max(0, 𝑥)
Linear
𝑓(𝑥) = 𝑥
Sigmoid
𝜎 𝑥 =
1
1 + 𝑒−𝑥
Tanh
tanh(𝑥)
Softmax
Softmax 𝑍𝑖 =
𝑒𝑧𝑖
σ𝑗=1
𝐾
𝑒𝑧𝑗
, for 𝑖 = 1, … , 𝐾
0
0.5
14
Flatten Layer
• Flatten Layer: used to convert the multidimensional output of the previous
layer into a 1D array.
1D
16
Fully Connected (FC) Layer
• Fully Connected Layer: takes 1D input from the previous layer (i.e., Flatten
Layer) and computes the class scores and outputs the 1D array of size equal
to the number of classes.
Activation
Function
(e.g., Softmax)
Softmax Activation:
Used to produce probability distribution
over classes.
𝐾 = 5
𝑧1, 𝑖 = 1
𝑧2, 𝑖 = 2
𝑧3, 𝑖 = 3
𝑧4, 𝑖 = 4
𝑧5, 𝑖 = 5
Output
෍ = 1
17
෍
𝑗=1
𝐾=5
𝑒𝑧𝑗 = 181.7341362
𝑒1.3
181.7341362
= 0.02
Dropout Layer
• Dropout Layer:
— The term "dropout" refers to dropping out some nodes.
— A regularization technique used to help prevent overfitting, focusing on
generalization of the model.
— The nodes are dropped by a dropout probability 𝑝.
▪ For instance, if the hidden layers have 1000 neurons (nodes) and a dropout
is applied with drop probability 𝑝 = 0.5, then 500 neurons would be
randomly dropped.
— Dropout can be used, for example, after convolutional and pooling layers
in feature extraction process, however, it is typically added after or with
the fully connected layer.
17
Dropout Layer (Cont.)
17
Source
Advantages of CNNs
▪ No human supervision.
▪ High accuracy at image recognition and computer vision.
▪ Minimize computation.
▪ Exploit the spatial and hierarchical structure of the images.
18
Disadvantages of CNNs
▪ Classification of images/objects with different Positions and
orientations.
▪ A lot of training data is needed.
▪ Training process takes a long time (slow).
▪ Prone to overfitting
19
CNN Visualizer
TensorFlow CNN Playground
20
ThankYou!

More Related Content

Similar to Understanding Convolutional Neural Networks (CNN) (20)

PPTX
Convolutional Neural Network (CNN) - image recognition
YUNG-KUEI CHEN
 
PPTX
Cnn
rimshailyas1
 
PPTX
11_Saloni Malhotra_SummerTraining_PPT.pptx
SaloniMalhotra23
 
PPTX
Introduction To Tensorflow
Rayyan Khalid
 
PDF
Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018
Universitat Politècnica de Catalunya
 
PPTX
Introduction to deep learning
Junaid Bhat
 
PDF
Separating Hype from Reality in Deep Learning with Sameer Farooqui
Databricks
 
PDF
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
nguyenhoangy207
 
DOCX
Deep Neural Network DNN.docx
jaffarbikat
 
PPTX
Introduction to convolutional networks .pptx
ArunNegi37
 
PPTX
CNN_Presentation to learn the basics of CNN Model.pptx
bani30122004
 
PPTX
Neural Networks with Google TensorFlow
Darshan Patel
 
PDF
Deep Learning in theano
Massimo Quadrana
 
PPTX
build a Convolutional Neural Network (CNN) using TensorFlow in Python
Kv Sagar
 
PDF
Introducing Deep learning with Matlab
Massimo Talia
 
PDF
Deep Feed Forward Neural Networks and Regularization
Yan Xu
 
PDF
Power ai tensorflowworkloadtutorial-20171117
Ganesan Narayanasamy
 
PDF
Deep learning introduction basic information
AnoopCadlord1
 
PDF
Introduction to deeplearning engineering
foodf4187
 
Convolutional Neural Network (CNN) - image recognition
YUNG-KUEI CHEN
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
SaloniMalhotra23
 
Introduction To Tensorflow
Rayyan Khalid
 
Multilayer Perceptron - Elisa Sayrol - UPC Barcelona 2018
Universitat Politècnica de Catalunya
 
Introduction to deep learning
Junaid Bhat
 
Separating Hype from Reality in Deep Learning with Sameer Farooqui
Databricks
 
dfdshofdifhdifhdfhgfoighfgofgfgfgfgdfdfdfdf
nguyenhoangy207
 
Deep Neural Network DNN.docx
jaffarbikat
 
Introduction to convolutional networks .pptx
ArunNegi37
 
CNN_Presentation to learn the basics of CNN Model.pptx
bani30122004
 
Neural Networks with Google TensorFlow
Darshan Patel
 
Deep Learning in theano
Massimo Quadrana
 
build a Convolutional Neural Network (CNN) using TensorFlow in Python
Kv Sagar
 
Introducing Deep learning with Matlab
Massimo Talia
 
Deep Feed Forward Neural Networks and Regularization
Yan Xu
 
Power ai tensorflowworkloadtutorial-20171117
Ganesan Narayanasamy
 
Deep learning introduction basic information
AnoopCadlord1
 
Introduction to deeplearning engineering
foodf4187
 

More from Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt (20)

PDF
How to install CS50 Library (Step-by-step guide)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Understanding Singular Value Decomposition (SVD)
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Understanding K-Nearest Neighbor (KNN) Algorithm
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Luhn's algorithm to validate Egyptian ID numbers
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 3
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 4
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Complier Design - Operations on Languages, RE, Finite Automata
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 1
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 3
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Object Oriented Programming (OOP) using C++ - Lecture 4
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Ad

Recently uploaded (20)

PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Neurodivergent Friendly Schools - Slides from training session
Pooky Knightsmith
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Ad

Understanding Convolutional Neural Networks (CNN)

  • 1. Convolutional Neural Network By Mohamed Gamal © Mohamed Gamal 2024
  • 2. Agenda ▪ What is CNN? ▪ Architecture and Components of CNN ▪ Advantages of CNN ▪ Disadvantages of CNN 1
  • 3. ▪ Convolutional Neural Networks (CNNs) come under the subdomain of Machine Learning which is Deep Learning. ▪ CNN is a supervised type of Deep learning. ▪ Algorithms under Deep Learning process information the same way the human brain does, but obviously on a very small scale, since our brain is too complex (our brain has around 86 billion neurons). What is CNN? 2 Image by Roger Brown Image from a paper by Rahul Kumar Sevakula
  • 6. Components of CNN General Architecture of Convolutional Neural Networks (CNN) Flattening feature extraction Classification Convolution + Activation & Pooling Output Hidden Layer 5 Source: ByteByteGo
  • 7. Convolution + Activation Convolution + Activation Pooling Pooling Feature Extraction Classification Activation Function (e.g., Softmax) Feature Maps Probabilistic Distribution Fully Connected Layer + Dropout Layer Components of CNN (Cont.) Hidden Layer (1D Feature Vector) 6 Image Source
  • 9. Feature Extraction ▪ Convolutional layer ▪ Pooling layer ▪ Activation functions ▪ Flatten Layer ▪ Fully Connected Layer ▪ Dropout Layer ▪ Output Layer Components of CNN in detail
  • 10. Convolutional Layer • Convolutional layer: the primary purpose of convolution is to extract features from the input image. Average Filter 9 Images Source
  • 11. Convolutional Layer (Cont.) 3D Image Convolution 10 Source Source
  • 12. Laplacian Filter (Sharpening) Gaussian Filter (Smoothing) Average/Mean Filter (Smoothing) Convolutional Layer (Cont.) Original Image Average Filter 11 3D View 2D View Images Source
  • 13. Pooling Layer • Pooling Layer: a down-sampling operation that reduces the dimensionality of the feature map, but retains important information. ▪ Max Pooling, Min Pooling, Average Pooling, Sum Pooling … etc. 15
  • 14. Activation Functions • Activation functions: introduce non-linearity to the network, allowing it to learn complex patterns in the data. ▪ ReLU (e.g., Image/Object Classification— Non-linear) ▪ Sigmoid (e.g., Binary Classification — Non-linear) ▪ Linear (e.g., Linear Regression) ▪ Tanh (e.g., Multiclass Classification — Non-linear) ▪ Softmax (e.g., Multiclass Classification — Non-linear) ▪ ⋮ 12
  • 15. Activation Functions (Cont.) 13 • Table 4.1 can help you choose a last-layer activation function for a few common problem types.
  • 16. ReLU max(0, 𝑥) Linear 𝑓(𝑥) = 𝑥 Sigmoid 𝜎 𝑥 = 1 1 + 𝑒−𝑥 Tanh tanh(𝑥) Softmax Softmax 𝑍𝑖 = 𝑒𝑧𝑖 σ𝑗=1 𝐾 𝑒𝑧𝑗 , for 𝑖 = 1, … , 𝐾 0 0.5 14
  • 17. Flatten Layer • Flatten Layer: used to convert the multidimensional output of the previous layer into a 1D array. 1D 16
  • 18. Fully Connected (FC) Layer • Fully Connected Layer: takes 1D input from the previous layer (i.e., Flatten Layer) and computes the class scores and outputs the 1D array of size equal to the number of classes. Activation Function (e.g., Softmax) Softmax Activation: Used to produce probability distribution over classes. 𝐾 = 5 𝑧1, 𝑖 = 1 𝑧2, 𝑖 = 2 𝑧3, 𝑖 = 3 𝑧4, 𝑖 = 4 𝑧5, 𝑖 = 5 Output ෍ = 1 17 ෍ 𝑗=1 𝐾=5 𝑒𝑧𝑗 = 181.7341362 𝑒1.3 181.7341362 = 0.02
  • 19. Dropout Layer • Dropout Layer: — The term "dropout" refers to dropping out some nodes. — A regularization technique used to help prevent overfitting, focusing on generalization of the model. — The nodes are dropped by a dropout probability 𝑝. ▪ For instance, if the hidden layers have 1000 neurons (nodes) and a dropout is applied with drop probability 𝑝 = 0.5, then 500 neurons would be randomly dropped. — Dropout can be used, for example, after convolutional and pooling layers in feature extraction process, however, it is typically added after or with the fully connected layer. 17
  • 21. Advantages of CNNs ▪ No human supervision. ▪ High accuracy at image recognition and computer vision. ▪ Minimize computation. ▪ Exploit the spatial and hierarchical structure of the images. 18
  • 22. Disadvantages of CNNs ▪ Classification of images/objects with different Positions and orientations. ▪ A lot of training data is needed. ▪ Training process takes a long time (slow). ▪ Prone to overfitting 19