Docsity

Convolution neural network, Study notes of Machine Learning

Toggle sidebar
bg1
DEEP LEARNING
CNN
A Convolution Neural Network (CNN) is a feed-
forward neural network (FNN). So far CNNs have
established extraordinary performance in image search
services, voice recognition and natural language
processing (NLP).
In addition, CNN can detect any particular feature
anywhere on the image, but a DNN can detect it only in
that particular location.
Since images have generally repetitive features, CNNs
can generalise much better than DNNs for image
processing tasks such as classification.
A CNNs architecture has prior knowledge of how pixels
are organised.
Thus, in short, CNN is a class of neural networks that
specialises in processing data that has a grid-like
topology, such as an image.
Each neuron works in it’s own receptive field and is
connected to other neurons in a way that they cover
entire visual field.
A CNN design begins with feature extraction and
finishes with classification.
Layers used :
1. The first hidden layer performs convolution. Each
feature map in the hidden layer consists of neurons and
each neuron is assigned a receptive field.
2. The second hidden layer performs averaging and
subsampling. Each layer consists of feature maps and
the neurons of each feature map has a receptive field. It
pf3
pf4
pf5

Partial preview of the text

Download Convolution neural network and more Study notes Machine Learning in PDF only on Docsity!

DEEP LEARNING

CNN

 A Convolution Neural Network (CNN) is a feed- forward neural network (FNN). So far CNNs have established extraordinary performance in image search services, voice recognition and natural language processing (NLP). In addition, CNN can detect any particular feature anywhere on the image, but a DNN can detect it only in that particular location.  Since images have generally repetitive features, CNNs can generalise much better than DNNs for image processing tasks such as classification.  A CNNs architecture has prior knowledge of how pixels are organised.  Thus, in short, CNN is a class of neural networks that specialises in processing data that has a grid-like topology, such as an image.  Each neuron works in it’s own receptive field and is connected to other neurons in a way that they cover entire visual field.  A CNN design begins with feature extraction and finishes with classification.  Layers used :

  1. The first hidden layer performs convolution. Each feature map in the hidden layer consists of neurons and each neuron is assigned a receptive field.
  2. The second hidden layer performs averaging and subsampling. Each layer consists of feature maps and the neurons of each feature map has a receptive field. It

has a trainable bias, trainable coefficient and sigmoid function. They control the operating point of the neuron.

  1. The next hidden layer performs a second convolution. Again each feature map in this hidden layer consists of neurons. And each neuron has connections with the previous hidden layer.
  2. The next hidden layer performs averaging and subsampling.
  3. The output layer performs final stage of convolution. Each neuron is assigned a receptive field and is assigned the possible characters. The layers in the network alternate between convolution and subsampling, and we get a “bipyramidal” effect. Thus at each layer i.e. either subsampling or convolutional layer, the number of feature maps is increased while the space- resolution is reduced. The weight sharing reduces the number of free parameters in the network compared to the synaptic connections in multilayer perceptron. Also by the use of weight sharing, implementation of convolutional network in parallel form is possible. Pooling layer  Pooling layers are used to reduce the dimensions of the feature maps. It reduces the number of parameters to learn and the amount of computation performed in the network.  The pooling layer summarises the features present in a region of the feature map generated by a convolutional layer.  A pooling layers is another building block of a CNN, when processing multichannel input-data, the pooling layer pools each input channel separately.  Pooling layer reduce the dimensions of the data by

Average pooling is different from Max Pooling. Average pooling retains ‘less important’ information about the elements of a block, or pool.  But Max pooling chooses the maximum value and discards less important values (as shown in the Fig. 5.9.3). But ‘less important’ is also sometimes useful in a variety of situations. 4 3 1 5 1 3 4 8 Av [4, 3, 1, 3] =

4 5 4 3 6 5 9 4 4 3 1 5 1 3 4 8 

Fig. 5.9. Padding  In Convolutional Neural Networks (CNN), padding is a term that refers to the a number of pixels added to an image when it is being processed by the kernel of a CNN.  For example, if padding in CNN is kept zero, then every pixel value that is added will be of value zero.  Padding is simply a process of adding layers of zeros to

our input images so as to avoid the problems mentioned above.  CNNs are used extensively for tackling problems occurring in image processing and predictive modelling or classification tasks. The main application of CNN is to analyse image data.  Now, every image in any dataset is a matrix of it’s pixel values. When working with simple CNN for an image, we get output reduced in size and that is loss of data. And that hinders to obtain a proper result according to our requirements.  When we do not want the shape or our outputs to reduce in size, the addition of more layers in the data can help to obtain a proper result and that addition can be done by padding.  Padding basically extends the area of an image in which convolutional neural network processes. The kernel/filter which moves across the image scans each pixels and converts the image into a smaller image.  Padding is added to the outer frame of the image to allow for more space for the filter to cover in the image. This creates a more accurate analysis of images. Types of Padding: (1) Same padding (2) Valid Padding (3) Causal padding (1) Same padding : In this type of padding, the padding layers have zero values in the outer frame of the images or data so the filter we are using can cover the edge of the matrix and it carries the required inference.

mean not sliding at all.  Applying convolution means sliding a kernel over an input signal outputting a weighted sum where the weights are the values inside the kernel.  If we use a convolution with a (2  2) stride, the step is 2 in both x and y direction, followed by non-strided convolution, stride 1, step 1.  We observe that the output of a convolution with stride 2 halves the width and height of the input, whereas the output of a convolution with stride 1 has width = input ... width – 2 and height = height – 2, since the kernel is 3  3.  Stride Output Dimension For padding P, filter size (f  f) and input image size (n  n), and stride ‘s’ our output image dimension will be *