# Deep Learning for Computational Mode Decomposition in Optical Fibers
## 3 Results
### Performance of the SMC Data Design  
First, the dataset is randomly split into a training dataset, a validation dataset, and a test dataset, with a ratio of 8:1:1. During the training process, the minibatch size is set to 128. The learning rate is set to 0.001 initially and reduced by a factor of 2 every 20 epochs. The loss function is defined as the mean-square-error (MSE) between the prediction \(p\) and the label \(l\) vector:  
\[MSE=\sum_{i=1}^{2N-1}\frac{(l_{i}-p_{i})^{2}}{2N-1}. \tag{9}\]  
_Adam_[32] is chosen as the optimization algorithm of the training progress. After 73,800 iterations, the DNN eventually converged. Afterwards, the trained DNN is tested with 5902 images. The relative errors (the maximum of the amplitude of the weights is 1) of the mode weight prediction are determined as follows:  
\[\Delta\rho_{p}=|\rho_{p}-\rho_{o}|\text{, and }\Delta\phi_{p}=\frac{|\phi_{p}- \phi_{o}|}{2\pi}, \tag{10}\]  
where \(p\) indicates a predicted value and \(o\) indicates an original value. The predicted weights are further used to generate a predicted intensity distribution, which is then correlated with the respective original distribution (Equation (6)).  
For a quantitative evaluation of the performance of the presented SMC training data design, we have trained the same network under the same conditions with purely random mode combinations. In Table 1, the results of both training methods are shown.  
It was found that the mean relative deviation when mode weights are predicted using the SMC data design is 1.8% for phase and 0.98% for amplitude, whereas the mean relative error of using random mode combinations for training the DNN is 7.32% and 6.48%, respectively, for phase and amplitude. Based on the predicted weights, the intensity distributions of the mode fields are again computed and correlated with the original intensity distributions (Equation (6)). Using the SMC dataset, a mean correlation coefficient of 99.61% could be achieved, whereas the mean correlation coefficient obtained by using random mode combinations has a value of 95.74%. The respective correlation coefficients are shown in Figure 3. Using the SMC training data design, the obtained correlation results scatter around the mean correlation coefficient with \(\sigma=0.57\%\) (Equation (7)). Using random mode combinations for the training data, the standard deviation increases significantly to 3.24%.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \(\overline{\Delta\phi_{s}}\) & \(\overline{\Delta\rho_{s}}\) & \(\overline{\Gamma}\) & \(\sigma\) \\ \hline SMC & 1.80\% & 0.98\% & 99.61\% & 0.57\% \\ Random & 7.32\% & 6.48\% & 95.74\% & 3.24\% \\ \hline \hline \end{tabular}
\end{table}
Table 1: Mean relative errors for the mode weight prediction using both Specified Mode Combinations (SMC) and random mode combinations for training the DNN.  
Figure 2: With a selected FMF and known parameters, the modes, which can be guided through the waveguide, can be calculated. Specified mode combinations are then generated, resulting in ensembles of a label vector and a corresponding intensity distribution.