CONVOLUTIONAL NEURAL NETWORK (CNN)

TINU ROHITH D
Analytics Vidhya
Published in
3 min readMay 30, 2020

Hello fellow people, It is instructive for instance to trace the computer industry’s to decline in vision, idealism, creativity, romance and sheer fun as it becomes more important and prosperous.

Here, Lets look into computational neural network architecture and constructing a cnn model for detection of ship using satellite imagery.

What is CNN ?

1. They are extensively used in computer vision problems. They differ from Multi-Layer Perceptron in manner and relatively cheap computing.

2. They are mainly used to classify, detect or recognize objects from image or video data.

ARCHITECTURE OF CNN:

  1. Input Layer: Read the required input data, scale it to pixel dimension between 0–255 and specify the range of bandwidth either grayscale or RGB
  2. Convolution Layer:

Extract the features of the object present on the image by detecting specific patterns within the picture. The computer will scan a part of the image, usually with a matrix dimension known as Filter i.e.,3x3 matrix. The output of the convolution layer is called a Feature map.

Strides: The number of pixels shifts over the input matrix. When the stride is 1 then we move the filters to 1 pixel at a time. When the stride is 2 then we move the filters to 2 pixels at a time and so on.

3. Pooling Layer:

Pooling is done to reduce the dimensionality of the input image.

Eg: View the diagram. “pooling” will screen a 4x4 feature map and return the maximum value. The pooling takes the maximum value of a 2x2 array and then move this windows by two pixels.

4. Fully Connected Layer: Fully Connected layers in a neural networks are those layers where all the inputs from one layer are connected to every activation unit of the next layer.

5. Dense Layer or Output Layer: It takes the input and return the output using appropriate activation function.

NOTE: Every layer has activation function associated with it. Where this function is used to introduce non linearity to the data. Appropriate weights and bias are introduced to each input pixel or object . Various kinds of activation function are used based on the model requirement.

Lets train a CNN model for detecting ship using satellite imagery:

Link to download data:

Step 1: Read the data:

Step 2: Scaling and reshaping the image:

Step 3: Data split into train, validation and test test:

Step 4: Model construction and compiling:

Step 6: Fit the model for training:

Step 7: Lets view Training history of the model :

Step 8: Model Evaluation:

Accuracy = 95%
THE ACCURACY OF THE MODEL IS 95%

CONCLUSION:

We just came across the architecture of CNN and steps involved in constructing a basis convolutional neural network model. Hope this article bought a jist of CNN. Appreciate It!

--

--