## 3 Background
### Convolutional Neural Networks (CNNs)  
Fully convolutional networks have shown compelling quality and efficiency for image classification and segmentation. It has been shown that a fully convolutional network, which is trained end to end, pixel to pixel, given the category-wise semantic segmentation annotation, exceeds the state of the art without further creating hand-crafted features [40; 41].  
The layers of a convolutional neural network are arranged to represent spatial information within data in a grid structure. These spatial relationships are inherited from one layer to the next creating representative features based on a small local spatial region in the previous layer. This spatial transformation is achieved by three types of layers which are commonly present in a convolutional neural network: convolution, pooling, and activation function layers. Each layer in the convolutional network represents a three-dimensional grid structure of size \(h\times w\times d\), where height (\(h\)), width (\(w\)) and depth (\(d\)), \(h\) and \(w\) are spatial dimensions, and \(d\) refers to the number of channels or the number of feature maps in the hidden layers. In addition to hidden layers, a final set of fully connected layers is often used in an application specific way to generate the desired output [42].  
Let \(x^{l}=\left[x^{l}_{ijk}\right]\) be a three-dimensional tensor representing feature maps in the \(l\)th layer. The indices \(i,j,k\) indicate the positions along the height, width, and depth of the filter maps. The weights of the \(p\)th feature map in the \(l\)th layer are represented by the three-dimensional tensor as \(W^{(p,l)}=\left[w^{(p,l)}_{ijk}\right]\). The transformation from the \(l\)th to the \((l+1)\) st convolutional layer after activation function applied can be written as follows:  
\[y^{(l+1)}_{ijp}=f\!\!\left(\!b^{l}_{p}+\sum_{r=1}^{M}\sum_{s=1}^{M}\sum_{k=1}^{ d_{l}}w^{(p,l)}_{rsk}\;x^{l}_{i+r-1,\;j+s-1,\;k}\!\right) \tag{4}\]  
where \(f\) is the activation function, such as _tanh_ or ReLU, \(b^{l}_{p}\) is the bias for the \(p\)th feature map, \(w^{(p,l)}_{rsk}\) represents the parameters of the \(p\)th filter, and \(M\) is the size of the filter. The convolutional operation is a simple dot product over the entire volume of the filter, which is repeated over spatial dimensions \((i,j)\) and filters (indexed by p). \(d_{l+1}\) is the number of feature maps, or number of channels, in the \((l+1)\)\(st\) layer, where \(p\;\in\;\{1\ldots d_{l+1}\}\).  
The pooling operation works on small spatial regions and produces another layer with the same depth. The pooling layers decrease the spatial dimensions of each activation map and effectively reduce the number of parameters and computational complexity of the network. Max pooling and average pooling are the mostly used pooling techniques in CNNs. Max pooling operation with pooling size of \(R\times R\) returns the maximum of the values in the square region of pool size in each layer. Stride value defines how much the pooling window will move in each spatial dimension, which is another way that convolution can reduce the spatial footprint of the feature maps. Previous studies [43] show that max pooling is superior to average pooling for image classification and it also leads to faster convergence rate and improves generalization performance by preventing overfitting. Hence, the max pooling strategy is applied in convolutional neural network component of the proposed framework.