MIKE ARMISTEAD
2 min readJul 13, 2020

Convolutional Neural Networks

Convolutional Neural Networks or CNN are a great model for image classification. One reason that they have become so popular is because CNN are able to recognize a pattern in one region and apply it to another region. But how does it work. First thing to help understand how they work is to figure out how the model looks at images.

Images are made up of pixels that have a Red, Green, and Blue (RGB) value. What this value does is it tells how much of each color ( Red, Green and Blue) to be put into the image. When building a CNN model the first thing that needs to be done is turning the images into arrays. The image turns into an array that is the Width x Height x 3. The three layers are the values of the R,G and B.

Now that the model can understand the image in numbers it can begin learning. The first step in the process is the Convolutional layer. The Convolutional layer will be able to determine edges of shapes. A CNN model takes a filter of a 5x5 or 3x3 (you choose the size of the filter) to look over every possible 5x5 or 3x3 region of the original image. From there it creates an output of a matrix that is the same size as the filter. This process that was just described is what happens with a HxW matrix, but what about when we have an image with RGB? The flat filter then becomes a cube to scan all three layers instead of one layer at a time.

The next step is the Pooling layer. What this does is looks at the convolutional layer and it can either take the average of each layer or it can take the max of each layer. The point of this is to downsample the convolutional layer because the pooling layer will take a summary of all the convolutional layers in a much lager section creating more viable times in model training

The CNN model may have a couple of convolutional and pooling layers. At the end of the model it will need a dense layer in order to allow the network to create a final decision function.

MIKE ARMISTEAD
MIKE ARMISTEAD

Written by MIKE ARMISTEAD

Tech recruiter turned Data Scientist

No responses yet