Skip to content
Related Articles
Open in App
Not now

Related Articles

Convolutional Block for Image Recognition

Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 16 Sep, 2021
Improve Article
Save Article

The basic neural network design i.e. an input layer, few dense layers, and an output layer does not work well for the image recognition system because objects can appear in lots of different places in an image. So the solution is to add one or more convolutional layers.

Basic Neural Network

The convolutional layer aids in the detection of patterns in our image, regardless of where they occur. These layers are quite precise when it comes to locating patterns. For relatively simple images, one or two convolutional layers and a thick layer may be enough, but for complicated images, we’ll need a few extra modifications and methods to make our model more efficient. 

CNN (Convolutional Neural Network)

We don’t normally need to know where in an image a pattern was detected down to the individual pixel because the convolutional layers look for patterns in our image and record whether or not they find such patterns in each section of our image. It is sufficient to have a rough idea of where it was discovered. We can use a technique called max pooling to tackle this problem. 

Convolutional Neural Network with Max pooling layer

The data is reduced and just the important bits are passed on by the Max-pooling layer. It aids in reducing the amount of data to be sent to the next layer. For example, if the convolutional filter produces a grid, the max-pooling layer will identify the grid’s greatest integer. Finally, it will construct a new array that will only save the integers it has chosen. We’re still recording roughly where each pattern was located in our image but with 1/4 of the data. We’ll wind up with a virtually identical result, but it’ll be a lot less work. 

Another problem with neural networks is that it tries to memorize the input data instead of learning the procedure and working. There’s a simple method to avoid this: we can force the neural network to learn as much as it can solely by memorizing the training data. The aim is to sandwich the dropout layer between other layers, which will randomly discard some of the input that passes through it by severing some of the neural network’s connections. The neural network is compelled to put up more effort to learn. Because it cannot rely on a single signal flowing through the neural network at all times, it must learn many methods to represent the same thoughts.

Dropout is a confusing concept in which we discard data to obtain a more accurate end result, but it works extremely well in practice. 

Dropout layer

These 3 layers together form the Convolutional block. We can add more than one convolutional block accordingly for complex scenarios.

Convolutional Block

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!