# Going Deeper into OSNR Estimation with CNN
## 4 Discussion
### Comparison  
In this section, comparisons between our proposed architecture and the state-of-the-art OSNR monitoring schemes are shown in the following with regard to performance and complexity. We evaluate the performance with MAE and RMSE for accuracy and precision, respectively. The complexity of an algorithm can be divided into time complexity and space complexity. Time complexity, which is defined as the time of calculation on the algorithm, can be quantitatively analyzed with floating-point operations (FLOPs). Space complexity describes the memory occupation when the algorithm runs.  
In [47], He investigated the relationship between the accuracy of CNNs and the complexity. The paper calculated the total time complexity of all convolutional layers as (6).  
\[O(\sum_{l=1}^{d}n_{l-1}\cdot s_{l}^{2}\cdot n_{l}\cdot m_{l}^{2}), \tag{6}\]  
where \(l\) is the index of a conventional layer, while \(l-1\) represents the index of the previous one, and \(d\) is the number of conventional layers. \(n_{l}\) is the number of convolutional kernels of the \(l\)-th layer when \(n_{l-1}\) is regarded as the number of input channels of the \(l\)-th layer received from the output of the previous layer. Considering the kernel and feature map are both square, \(s_{l}\) represents the spatial size of the kernel, and \(m_{l}\) is the spatial size of the output feature map.  
When it comes to space complexity, the memory occupation always includes two parts: the memory for weights, and the memory for output of every layer. For CNN, the space complexity is proportional to (7).  
\[O(\sum_{l=1}^{d}(s_{l}^{2}\cdot n_{l-1}\cdot n_{l}+m_{l}^{2}\cdot n_{l})). \tag{7}\]  
For the FC layer, the time and space complexity is determined by the number of nodes in output \(n_{l}\) and that in input \(n_{l-1}\). Thus, the FLOPs can be computed as \(O(2n_{l-1}n_{l})\) and the occupied memory is proportional to \(O(n_{l-1}\cdot n_{l}+n_{l})\).  
Therefore, a comparison is invited among the proposed OptInception scheme, CNN monitoring scheme in [25], and the CDF estimation algorithm in [15], as Table 1 depicts. All schemes were tested on our test dataset. The CNN model in [25] was trained with the same training dataset of OptInception. The parameters in the CDF algorithm were assigned with the same typical values in [15]. The parameters were stored in the data type of 32-bit floating-point numbers, and the space complexity was presented in bytes.  
Figure 13: The learning curve of OptInception as a function of the number of epochs. The dashed lines show the learning curves after smoothing with an exponential weighted (EW) function. Mean absolute error is the metric of performance.  
Table 1 vividly shows that the conventional method based on CDF has much lower computing complexity and memory occupation than schemes based on neural networks. However, the cost of low complexity is the relatively low estimation performance and the difficulty in deployment on devices without equalization. It makes sense that the deeper model, OptInception, monitors OSNR more accurately and precisely with lower values in MAE and RMSE than the scheme in [25] only using the basic CNN module. Surprisingly, the complexity of OptInception is obviously less than the basic CNN scheme in both time and space. In fact, when the node number in the FC layer grows, the number of weights becomes considerable along with addition and multiplication operations. The number of weights in FC layers of [25] accounts for 99.46%, but only 5.54% for Inception. Thanks to the averaging pooling layer before the FC network, the widths of FC layers shrink markedly. Last but not least, more than two-fold the space complexity and one-third of the time complexity increment in OptInception-Pro brought almost no more than a 15% improvement in performance. This phenomenon suggests that the marginal utility is diminishing as the depth of the network increases.