Convolutional Neural Network

Machine Learning Model suitable for grid like data structures.

Consists of an alternation between Convolutional Layers and Pooling Layers, concluding with a dense layer.

Convolutional Layer

A convolutional layer consists of a set of filters that aim to detect whether a feature is present in the input data or not. In the case of the input data being an image, a feature might represent certain edges, textures, shapes or colours. Applying a filter on an image means calculating the dot product between the filter matrix and an area of the image data matrix. This step is repeated until each filter has been incrementally applied to all parts of the image. The results of the dot product are stored in an output data matrix called a feature map. This operation is called a convolution.

Pooling Layer

The pooling layer performs a step known as dimensionality reduction or downsampling. Its purpose is to reduce the number of parameters while retaining as much information as possible. Similar to the convolutional layer, a filter is used to sweep across the image. Two common types of pooling include either taking the highest value of an image area (max pooling) or the average value in that area (average pooling). Even though information is lost in this process, this step reduces the complexity of the model and helps prevent it from overfitting.

Dense Layer

In the final stage the classification of the examples based on the extracted features is performed. Before the final layer, the multidimensional output from the previous layers is typically transformed into a one-dimensional vector, in a process referred to as flattening. Following this, the vector is fed into a dense layer, also known as a fully connected layer. In this layer, each neuron is connected to every neuron in the previous layer. After performing a linear transformation on the input data, an optional activation function is applied, which allows the model to learn nonlinear patterns.