How CNN works for image analysis by ON April 06 2019

Convolutional neural network (CNN):- A CNN is composed of a series of layers, where each layer defines a specific computation. The Neural Network provides functionality to easily design a CNN layer-by-layer.

There are main four layers in the convolutional neural network.
A. Convolutional Layer
B. Rectified Linear unit Layer
C. Max Pooling Layer
D. Fully Connected Layer

Let take a example to understand how computer understand the image.

Basically a computer understand an image using numbers at each pixel .

In our example, we have taken an image of ‘X’ that consider the value of each pixel that a black pixel will have value 1 and a white pixel will have -1 value.

A. Convolutional Layer: In Convolutional move the features/filter to every possible position of the image and there are four steps to be performed in this layer.

1.Line up the feature and the image : First we need to decide the sliding window size for extracting the features from image.

Example : here sliding window is 3X3 .

We can see the below image there are some features extracted from another image X which are equal to a feature of original image X.

2. Multiply each image pixel by the corresponding feature pixel :-

3. Add them up: Whatever intermediate matrix get from the previous step we will add the result of each cell and pass to the next step.

4. Divide by the total number of pixel in the features: Here the added value is divided by the total number of cell in the matrix and the result will be stored in a next intermediate matrix that is called the output of Convolutional layer.

B. Rectified Linear unit Layer (ReLU) : – ReLU transform function only activates a cell if the input is above a certain quantity , while the input is below 0 the output is 0 , but when input rises above a certain threshold ,it has a linear relationship with dependent variable .

In this layer removed every negative values from filtered image and replace it with 0.

Function :- f(x) = max(0,x)

0 : X < 0
1 : X > 0

C. Max Pooling Layer: In this layer shrink the matrix stack into a smaller size.

For getting some result we need to perform some steps:

• Pick a window size (usually 2×2 or 3×3 )
• Picked a stride size (usually 2)
• Move the window across the filtered matrix (Output of ReLU layer)
• From each window take the maximum values

After this layer perform all above the layer again an again till the resultan matrix in not minimized.

D. Fully Connected Layer :- This is the final layer where the actual classification happens .

Here take our filtered and shrinked matrix and put in into single list .

After all the process prediction is happen like

Match the maximum predicted value from among the list.

Finally, an image is identified as “X” because its prediction value is higher than the other.

Thank you : >) ALL POST
Knowledge contribution is better than any contribution.

BY April 06 2019

#### 5 thoughts on “How CNN works for image analysis”

Mayurkumar Bharatbhai Malaviya
April 10, 2019 at 12:03 pm

your blog is easy to understand for fresher

http://www.formatnyc.com
September 11, 2019 at 4:55 am

extremely slow for me. Is anyone else having this problem
or is it a problem on my end? I’ll check back later and see if the problem still exists.

decor
November 7, 2019 at 8:13 pm

Right away I am going away to do my breakfast, afterward
having my breakfast coming again to read further
news.

crystaldreamsworld
January 19, 2020 at 10:22 am

I found this board and I find It really helpful & it helped me out much.