What is CNN in machine learning?

CNN “Convolutional Neural Network” is more commonly listed under deep learning algorithms which is a subset of machine learning and AI.

Convolution means, convolving/applying a kernel/filter of nxn dimension on a selected pixel and its surroundings, then moving the same kernel to the next pixel and its surrounding and so on, to asses each pixel.

Mainly, CNN is used with images to extract features. Although features, shapes and patterns can be detected directly using multilayer sequential neural networks, CNN is more accurate.

CNN applies filters to each pixel of the image to examine the feature type which this pixel belongs to, whether it is a line, half circle, curve,etc.

Pixels which gives a high score after it is convolved with a straight line filter, most probably belongs to a straight line.

A kernel of size 3×3 that gives a maximum value for detecting a diagonal. Image source :Deep learning Udacity Nanodegree .

Filter/kernel size determines the size around the pixel to consider during feature examination.

Detecting a square is done by detecting its edges first, “straight lines” then form a complete understanding of the shape .

Horizontal edge with another vertical one, form a half square, half square with another half, signals a complete square. This process is done over multiple CNN layers, each layer has its own function till the assembly.

The same happens with circles as shown

A circle is detected with steps, the upper left curve with a upper right ..etc. results in a complete circle understanding as shown in the above figure. See more in this youtube channel

This is also used for detecting the handwritten letters. Each set of layers can detect a feature in the image combining different features results in different shapes of numbers.

In this figure, both numbers, 8 and 9 has an upper loop, while 9 has a lower straight line, 8 has a lower loop. A layer(s) in this network is dedicated for loop detection another one for vertical line detection. Analysing the features within the input will lead to classify the number inside the image.

The beauty is that, the values of these filters are determined by training the network not by your selection :).

Leave a comment

Design a site like this with WordPress.com
Get started