# Using Convolutional Neural Networks for Blocking Prediction in Elastic Optical Networks
## 4 CNN Structure  
In the convolution process, certain features of the input data are extracted [24; 25]. Such a process makes CNNs highly efficient for applications such as image processing or any form of similar pattern recognition since a specific feature (shape, texture, or pattern) may occur anywhere in the image or the array of the input data. CNN models consist of multiple layers that can be tuned according to the application. CNNs are typically composed of three types of layers: convolution, pooling, and fully connected. The role of the convolution and pooling layers is feature extraction, while the role of the fully connected layer is to perform the classification task [24; 25]. The convolution layers are the main component of a CNN model. The input data to a CNN model can be represented in the form of a one-dimensional (1D) or two-dimensional (2D) array of numbers. In the convolution layer, a small grid of parameters called a kernel (filter) is convolved through the input data. The features which have to be extracted and used in the neural network are determined by the kernel matrix. Consequently, the entries of the kernel matrix have an important role in the model and can affect the performance of the system. Therefore, in a CNN model, the kernel matrix is also considered a trainable part of the model, and entries of the kernel matrix are determined and optimized in the training process, along with weights and thresholds in the neural network. The output of a convolution layer is a matrix called a \"feature map\". Typically, the size of a feature map matrix can be very large. Therefore, a downsampling process can be very helpful in reducing the complexity of the subsequent layers and thus the computational process of the whole model. Max-Pooling is a commonly used downsampling technique in CNNs. In this technique, the feature map is divided into several smaller areas called patches. If a certain feature is detected in one of these areas, the value of at least one of the elements in that area increases. Consequently, by just monitoring the maximum value in each patch, it can be determined whether or not a certain feature is present in that patch. In this work, we use the max-pooling technique with a patch size of 2 in the CNN 1D model and a patch size of 2 \(\times\) 2 in the CNN 2D model. Each pair of convolution and pooling layers is called a feature map layer. A CNN model might consist of multiple feature map convolution layers, which then hierarchically can detect and extract more complex features. Figure 7: Example of not-leading-to-blocking spectral status matrices. In CNNs, the classification process is performed by the fully connected (FC) layers, also known as dense layers. After feature extraction and the downsampling of input data by convolution and the pooling layers, the results are mapped onto the final outputs of the network by fully connected layers. These fully connected layers consist of several neurons and each neuron is connected to all of the vectors in the previous layer. Each of these connections transfers the output value of the earlier layers to the neurons in the next layers by a learnable weight value. In this work, we use two FC layers in both our 1D and 2D CNN models, the first of which consists of 30 neurons and the second one of 15 neurons. Neural Network models (similar to CNNs) can encounter problems with overfitting. To resolve this issue, certain regularization techniques, such as dropout, can be applied in fully connected layers. In the dropout techniques, we randomly disable a fraction of neurons in each layer at each training step by artificially setting the output values of the neuron at zero. The dropout rate denotes the fraction of neurons that are disabled. The activation function of a neuron in a neural network is responsible for computing the output of a neuron based on its input values and the associated weights assigned to each input.