Deep Learning
Classification
CNN
M. Abrar Ahmad
DEEP LEARNING
Multiple definitions, however, these definitions have in common:
 Multiple layers of processing units
 Supervised or unsupervised learning of feature representations in
each layer, with the layers forming a hierarchy from low-level to
high-level features
2
DEEP LEARNING
 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
3
DEEP LEARNING
4
Deep
Learning
Artificial Neural
Network
(ANN)
Convolutional Neural
Network
(CNN)
Recurrent Neural
Network
(RNN)
5
What are the CNNs???
 Convolutional Neural Network (CNN) is a multi-layer neural
network
 Neural Networks with a Convolutional operation in at least one of
the layers
 CNN performs much better than traditional approaches for various
image classification and segmentation problems
 CNN is used to reduce the images into a form that is easier to
process, without losing features that are critical for getting a good
prediction
6
Applications of CNN
 Face Recognition
 Image Classification
 Object Detection
 Segmentation
 Self-driving cars that leverage CNN based vision systems.
 And many More
Drawbacks of CNN
 A Convolutional neural network is significantly slower due to
different operations such as maxpooling.
 If the CNN has several layers, then the training process takes a lot of
time if the computer doesn’t consist of a good GPU
 A ConvNet requires a large Dataset to process and train the neural
network
7
Layers in CNN
8
Convolutional Layer
9
 Convolutional layer acts as a feature extractor that extracts features of the
inputs such as edges, corners , endpoints
 This 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
Convolutional
 The convolved feature is passed on to the next layer
10
The Convolutional operation
11
12
Output Feature Map Size
 Feature Map Size = 1+ (W – F + 2P)/S
 Input Size (W): 5 x 5
 Filter Size (F): 3 X 3
 Stride (S): 1
 Padding (P): 0
 So,
 1 + (5 – 3 + 0)/1 = 3
Normalization
13
 Once we get the output, we shall apply Rectified Linear Unit (relu)
activation function on each field of output
 After applying the ReLU a stack of images become a stack of
images with no negative values
 Max(y,0)
14
Pooling Layer
 The Pooling layer is responsible for reducing the spatial size of
the Convolved Feature
 This is to decrease the computational power required to process
the data by reducing the dimensions
 There are two types of pooling
 max pooling
 average pooling
Max Pooling
15
 The most common approach used in pooling is max pooling
 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
 Pooling Filter Size = 3 X 3
 Stride = 1
Avg Pooling
16
 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
 We can say that Max Pooling performs a lot better than Average
Pooling
 Pooling Filter Size = 3 X 3
 Stride = 1
Pooling
17
 Pooling Filter Size = 2 x 2
 Stride = 2
18
Flattening Layer
 Once the pooled featured map is obtained, the next step is to
flatten it
 We flatten the output of the convolutional layers to create a
single long feature vector
 Flattening involves transforming the entire pooled feature map
matrix into a single column which is then fed to the neural
network for processing
Flattening
 we are literally going to
flatten our pooled feature
map into a column like in the
image below
 it is connected to the final
classification model, which is
called a fully-connected layer
19
Deep stacking
 Layers can be repeated many time
20
21
Fully Connected Layer
 A traditional Multi-Layer Perceptron
 The term “Fully Connected” implies that every neuron in the previous layer
is connected to every neuron on the next layer
 The purpose of the Fully Connected layer is to use the high-level features for
classifying the input image into various classes based on the training
dataset
 Fully connect layer act as classifier
Fully Connected
 A summation of product of inputs and weights at each output node
determines the final prediction
22
CNN
 Putting all layers of CNN together
23

CNN.pptx

  • 1.
  • 2.
    DEEP LEARNING Multiple definitions,however, these definitions have in common:  Multiple layers of processing units  Supervised or unsupervised learning of feature representations in each layer, with the layers forming a hierarchy from low-level to high-level features 2
  • 3.
    DEEP LEARNING  DeepLearning 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 3
  • 4.
    DEEP LEARNING 4 Deep Learning Artificial Neural Network (ANN) ConvolutionalNeural Network (CNN) Recurrent Neural Network (RNN)
  • 5.
    5 What are theCNNs???  Convolutional Neural Network (CNN) is a multi-layer neural network  Neural Networks with a Convolutional operation in at least one of the layers  CNN performs much better than traditional approaches for various image classification and segmentation problems  CNN is used to reduce the images into a form that is easier to process, without losing features that are critical for getting a good prediction
  • 6.
    6 Applications of CNN Face Recognition  Image Classification  Object Detection  Segmentation  Self-driving cars that leverage CNN based vision systems.  And many More
  • 7.
    Drawbacks of CNN A Convolutional neural network is significantly slower due to different operations such as maxpooling.  If the CNN has several layers, then the training process takes a lot of time if the computer doesn’t consist of a good GPU  A ConvNet requires a large Dataset to process and train the neural network 7
  • 8.
  • 9.
    Convolutional Layer 9  Convolutionallayer acts as a feature extractor that extracts features of the inputs such as edges, corners , endpoints  This 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
  • 10.
    Convolutional  The convolvedfeature is passed on to the next layer 10
  • 11.
  • 12.
    12 Output Feature MapSize  Feature Map Size = 1+ (W – F + 2P)/S  Input Size (W): 5 x 5  Filter Size (F): 3 X 3  Stride (S): 1  Padding (P): 0  So,  1 + (5 – 3 + 0)/1 = 3
  • 13.
    Normalization 13  Once weget the output, we shall apply Rectified Linear Unit (relu) activation function on each field of output  After applying the ReLU a stack of images become a stack of images with no negative values  Max(y,0)
  • 14.
    14 Pooling Layer  ThePooling layer is responsible for reducing the spatial size of the Convolved Feature  This is to decrease the computational power required to process the data by reducing the dimensions  There are two types of pooling  max pooling  average pooling
  • 15.
    Max Pooling 15  Themost common approach used in pooling is max pooling  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  Pooling Filter Size = 3 X 3  Stride = 1
  • 16.
    Avg Pooling 16  AveragePooling 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  We can say that Max Pooling performs a lot better than Average Pooling  Pooling Filter Size = 3 X 3  Stride = 1
  • 17.
    Pooling 17  Pooling FilterSize = 2 x 2  Stride = 2
  • 18.
    18 Flattening Layer  Oncethe pooled featured map is obtained, the next step is to flatten it  We flatten the output of the convolutional layers to create a single long feature vector  Flattening involves transforming the entire pooled feature map matrix into a single column which is then fed to the neural network for processing
  • 19.
    Flattening  we areliterally going to flatten our pooled feature map into a column like in the image below  it is connected to the final classification model, which is called a fully-connected layer 19
  • 20.
    Deep stacking  Layerscan be repeated many time 20
  • 21.
    21 Fully Connected Layer A traditional Multi-Layer Perceptron  The term “Fully Connected” implies that every neuron in the previous layer is connected to every neuron on the next layer  The purpose of the Fully Connected layer is to use the high-level features for classifying the input image into various classes based on the training dataset  Fully connect layer act as classifier
  • 22.
    Fully Connected  Asummation of product of inputs and weights at each output node determines the final prediction 22
  • 23.
    CNN  Putting alllayers of CNN together 23