## 3 Background Theory  
### Convolutional Neural Network (CNN)  
A convolutional neural network (CNN) is a type of neural network that is more specialized for the training of visual or image type data sets. Like an ordinary neural network, the CNN has an input layer, numerous hidden layers, and an output layer. The major differences of CNNs from the rest of the neural networks reside in the technique to have optimized the minimal number of weights to reduce the training time, while these weights are connected in the local spatial domain, and secondly, it smartly selects the features for training on its own from the input images [11], which are the abstract representation of input data at various stages and structuration. Figure 2 shows the difference between a typical neural network and a CNN neural network framework. There are several layers of CNN among which some are commonly used layers. The convolutional layer is the main and foremost layer of the CNN architecture. The integral part of this layer is the small patches known as filters or kernels. These filters have a certain length and height, but the depth for a color image is threefold due to three channels; red, green, and blue. The parameters such as the number and size of filters rely on the forward-fed layer parameters such as width, height, and depth of the structure taken as  
Figure 1: Flow chart of the proposed technique. Figure 2: (**Left**) A typical neural network showing the interconnection of weights among all layers. (**Right**) Convolutional neural network (CNN) architecture with different layers with locally interconnected 3-dimensional weights [12]. input to the particular layer and intuitive selection [13]. Smaller filter size helps in retaining the critical information [14; 15]. On the input layer or the previous layer of the convolutional layer, each filter convolves through the width and height of the previous input structure, and then computes a dot product between filter numeric entries and current common regional values on the input, resulting in the formation of an activation map in two-dimensional spatial domains. The activation maps generated are equal to the number of filters used. Figure 3 shows the activation maps that are stacked in depth to produce the resulting output of the layer. The activation unit can be represented by the equation below. \[x_{u}^{k+1}=\sum_{i}w_{k,u}^{k+1}x_{u}^{k}+b_{k} \tag{1}\]  
where \(x_{u}^{k}\) are the activations, \(w_{k,u}^{k+1}\) is the weight of the entity of activations, \(b\) is the bias of the layer, \(k\) is the layer, and \(u\) is the individual entity. The resulting output of the single convolutional layer depends upon hyper-parameters such as stride, zero padding, and depth. Stride represents the number of pixels the filter jumps after every convolution step on the input. The smaller the stride, the greater the dimension of the output. Zero padding is used to pad the boundary of the input with zeros in order to preserve the output area the same as the input area, whereas depth is controlled by the number of filters being convolved with the input volume. For the square-shaped input layer and filter, the area of the output could be found using the following equation:  
\[L_{o}=\frac{L_{i}-F+2Z}{S}+1 \tag{2}\]  
where \(L_{i}\) and \(L_{o}\) are the input and output lengths for the square \(L_{i}^{2}\) and \(L_{o}^{2}\) areas, respectively, \(F\) is the filter length for the \(F^{2}\) area, \(Z\) is the zero padding, and \(S\) is the stride. The number of neurons of the corresponding layer connected to the input layer could be found using the following equation:  
\[N_{n}=L_{o}^{2}\times N_{F} \tag{3}\]  
where \(N_{n}\) and \(N_{F}\) are the number of neurons and filters, respectively.