# 4 layers of Convolutional Neural Network

- September 01, 2020
- By Saurav prasad
- 0 Comments

The convolutional neural network, from its inception, has been playing a pivotal role in solving real-life problems. For example, in the 1990s, the neural network research group at AT&T developed a convolutional network for reading cheques. Today they are widely used for face recognition, document analysis, and understanding climate change, etc.

Just like humans have eyes that give them the ability to differentiate objects in the real world. Similarly, a convolutional neural network is a type of neural network which allows computers to see things. So, In this blog, we are going to talk about this deep learning technique that revolutionized Artificial Intelligence.

So, why do we call them convolutional neural networks and not the artificial neural network since

CNN also uses the dense or fully-connected layer. Because before a dense layer, it uses several other layers. Those layers sever two purposes:

**Extracting as many features as possible.****Reduce the dimensions of the image data.**

One such layer is the **convolutional layer **that we will be talking about in the latter part of this blog. Because of this layer, we call it a convolutional neural network.

*So what is the convolution?*

In mathematics, convolution is an operation on two functions that result in a third function expressing how one is influenced by the other. Some applications of this idea are signal processing, reliability, etc.

Mathematically

Fig. 1 Mathematical Form. |

If you want to know more about the convolutions here, is the link to the video by 3 Blue 1 Brown. For our purposes, we are going to use the idea only, that is, with two signals we are producing a new signal which is influenced by both the signals.

**CNN Structure:**

So, let's took into the architecture of CNN first. Below is a pictorial representation of the CNN structure. Here, the output of one layer works as input for the next layer.

Fig. 2 CNN Structure |

- Convolutional Layer
- Detector Layer
- Pooling Layer
- Fully Connected Layer

**1) Convolutional Layer :**

**Filter/Kernel**- A filter is nothing but a square matrix. It strides over the image and looks for those regions which are similar to that filter.Fig. 3 Convolution in Motion. |

**cross-correlation**because we are trying to find where the filter has a high or low correlation with the image.

Fig. 4 Mathematical Formulae. |

Fig. 4 Feature Maps. |

**So how it looks like on the actual image?**

Fig.5 Image Representation. |

**2) Detector Layer** :

Some authors consider it as an add-on step to the convolution operation. While many authors, and in our case, it is a separate stage. The detector stage is simply a non-linear function. Images contain many non-linear features like edge, changing pixels, etc. So to preserve this non-linearity of the image, we pass the output of the convolution operation to a non-linear function. **ReLu (Rectified Linear Unit)** is the most commonly used non-linear function.

**3) Pooling layer :**

**Types of pooling:**

**a) Max pooling:**

**b) Average Pooling:**

Fig. 7 Average Pooling. |

**Note -**

*We cannot say that average pooling is better than max pooling or vice-versa. This thing varies from problem to problem. In some cases, Max pooling outperforms the Average pooling. In some cases, Average pooling performs better. Also, there are many other pooling operations like sum pooling, L2 norm, etc.*

**4) Fully connected layer**:

.

**Note**-

*it's not mandatory to use only one convolutional layer. We can build a more complex network by having multiple convolutional layers. Even the given website uses multiple convolution layers.*

*"Thanks for reading, if you find it helpful please share with your friends"*

## 0 Comments

Please do not comment any spam link in the comment box