Convoution Neural Networks (CNN)

A convolutional neural network is a deep learning model that is specifically used for image and video processing. They are used for the matrix dataset in which the learnable filters are passed over the image or matrix to extract the useful features. It preserved the spatial structure of images that is lost in NN as it accepts the vector as input. 

Image representation in CNN

Images are the primary input data for CNN. They are represented as multidimensional arrays with each element of the array representing the pixel value at that location.

Grayscale Images: Grayscale images are represented as 2D arrays where each element corresponds to the intensity of a pixel. The pixel intensity values range from 0 to 255, where 0 represents black and 255 represents white.

Color Images (RGB): Color images are represented as 3D arrays with three channels: Red, Green, and Blue (RGB).

Each channel corresponds to the intensity of a particular color in the image.

The values in each channel range from 0 to 255, representing the intensity of the respective color.

Layers in CNN

Convolution layers:

Convolutions are the main building blocks of this network. Different learnable filters are applied in these layers to extract the features from data and generate a feature map. The filter slides over the image and the dot product is taken between the elements of the filter and a patch of image at a time.

Activation layer (ReLu):

After the convolution nonlinearity is induced by applying the activation function, Relu is a commonly used activation function that converts the negative values to 0. The dimensions of the feature map remain the same only the non-linearity is induced.

Pooling layer:

The pooling layer downsamples the activation map. These layers also have a filter size representing the location we pool over. The feature map generated is of high dimensions and to reduce the dimensions, the feature matrix is passed through the pooling layer. 

Flattened layer:

The matrix generated is converted to a one-dimensional vector to feed it to fully connected layers.

You might also like

Leave a Reply

Your email address will not be published. Required fields are marked *