Convolutional Neural Networks

Share this post

  • CNN are one of the most popular models used today. This neural network computational model uses a variation of multilayer perceptrons and contains one or more convolutional layers that can be either entirely connected or pooled.
  • These convolutional layers create feature maps that record a region of image which is ultimately broken into rectangles and sent out for nonlinear processing.
Convolution neural network
  •  Let us suppose this in the input matrix of 5×5 and a filter of matrix 3X3, for those who don’t know what a filter is a set of weights in a matrix applied on an image or a matrix to obtain the required features, please search on convolution if this is your first time!

 Note: We always take the sum or average of all the values while doing a convolution

 Steps Involve in CNN

 

 

  1. Edge Detection (Convolution)

  • In the previous article, we saw that the early layers of a neural network detect edges from an image.Deeper layers might be able to detect the cause of the objects and even more deeper layers might detect the cause of complete objects (like a person’s face).

In this section, we will focus on how the edges can be detected from an image. Suppose we are given the below image: As you can see, there are many vertical and horizontal edges in the image. The first thing to do is to detect these edges:

  •  So, we take the first 3 X 3 matrix from the 7 X 7 image and multiply it with the filter. Now, the first element of the (n-k+1 x n-k+1) i.e (7-3+1 X 7-3+1) 5 X 5 output will be the sum of the element-wise product of these values, i.e. 00+00+10+10+01+00+00+10+1*0 =0. To calculate the second element of the 5 X 5 output, we will shift our filter one step towards the right and again get the sum of the element-wise product:

 2. Pooling

  • A pooling layer is another building block of a CNN. Its function is to progressively reduce the spatial size of the representation to reduce the amount of parameters and computation in the network. Pooling layer operates on each feature map independently. The most common approach used in pooling is max pooling.
Types of Pooling Layers :-
1. Max Pooling

Max pooling is a pooling operation that selects the maximum element from the region of the feature map covered by the filter. Thus, the output after max-pooling layer would be a feature map containing the most prominent features of the previous feature map.

2. Average Pooling

Average pooling computes the average of the elements present in the region of feature map covered by the filter. Thus, while max pooling gives the most prominent feature in a particular patch of the feature map, average pooling gives the average of features present in a patch.

Now Apply Pooling in our above Feature Map

Problem with Simple Convolution Layers
  • While applying convolutions we will not obtain the output dimensions the same as input we will lose data over borders so we append a border of zeros and recalculate the convolution covering all the input values.

1. Padding
 2. Striding

1. Padding
  • See In without padding our input is 6×6 but output image goes down into 4×4 . so by using padding we got the same result.Padding is simply a process of adding layers of zeros to our input images so as to avoid the problems mentioned above.
  • So padding prevents shrinking as, if p = number of layers of zeros added to the border of the image, then our (n x n) image becomes (n + 2p) x (n + 2p) image after padding. So, applying convolution-operation
    (with (f x f) filter) outputs (n + 2p – f + 1) x (n + 2p – f + 1) images. For example, adding one layer of padding to an (8 x 8) image and using a (3 x 3) filter we would get an (8 x 8) output after performing  convolution operation.
2. Strides
  • It uses to reduce the size of matrix. if we sfited by 1 then we called stride=1 and if we sfited by 2 means stride = 2 so on.
Padding,Stride Put in One Equation
Step3 : Flattening
  • Flattening is converting the data into a 1-dimensional array for inputting it to the next layer. We flatten the output of the convolutional layers to create a single long feature vector. And it is connected to the final classification model, which is called a fully-connected layer.
Step 4
Complete CNN in one View
here in last step we use full connection network
CNN model
 

Share this post

10 thoughts on “Convolutional Neural Networks”

  1. Howdy! This post could not be written any better! Reading through this post reminds me of my good old room mate!
    He always kept chatting about this. I will forward this article to him.
    Pretty sure he will have a good read. Thank you for sharing!

  2. whoah this weblog is great i like reading your posts. Stay up the good work!
    You know, many persons are hunting round for this info, you could help them greatly.

  3. I’m really enjoying the theme/design of your website.
    Do you ever run into any internet browser compatibility problems?
    A handful of my blog audience have complained about my
    site not operating correctly in Explorer but looks great in Firefox.
    Do you have any solutions to help fix this problem?

  4. I am not positive the place you’re getting your info, however great topic.
    I needs to spend some time finding out much more or understanding more.
    Thank you for wonderful info I was looking for this information for my mission.

  5. Appreciating the time and effort you put into your site and in depth information you offer.
    It’s good to come across a blog every once in a while that isn’t the same out of
    date rehashed material. Excellent read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  6. I truly love your blog.. Pleasant colors &
    theme. Did you build this website yourself?

    Please reply back as I’m trying to create my own personal blog and would love to learn where you
    got this from or what the theme is named. Cheers!

  7. One thing I have actually noticed is the fact there are plenty of myths regarding the finance institutions intentions when talking about home foreclosure. One fable in particular is the fact that the bank would like your house. The financial institution wants your money, not your property. They want the funds they gave you with interest. Preventing the bank will only draw any foreclosed final result. Thanks for your write-up.

Leave a Comment

Your email address will not be published. Required fields are marked *