# Deep Learning for Computational Mode Decomposition in Optical Fibers
## 2 Methodology
### Deep-Learning-Based Modal Decomposition  
DNNs are rapidly developing and have brought prominent impact on various applications, especially computational imaging [26]. The performance of DNNs in image classification and object recognition is well-adapted to understand the complexity of an MMF [27]. This approach does not require consideration of intermodal dispersion, mode coupling, and external perturbations because the network is a data-driven approach. Therefore, a DNN can be used to significantly simplify the evaluation of the output signal of an MMF. Therefore, an Image-to-vector DNN is designed. The architecture concept was inspired by a convolutional neural network model, which was introduced by [PERSON] and [PERSON] from the Visual Geometry Group (VGG) at Oxford University [28]. As shown in Figure 1, the DNN is divided into 5 blocks. The first block is composed of two convolutional layers, which perform the same convolutional operation. Several kernel sizes were tested for the respective convolutional layers. It was found that the output of the DNN converges fastest with \(3\times 3\) kernels. In order to guarantee a proper parameter depth, two convolutional layers with \(3\times 3\) kernels were used, which have the same receptive field as one convolutional layer with a \(5\times 5\) kernel [28]. Two convolutional layers use a rectified linear unit (ReLU) [29] activation function. Batch normalization is used to improve the performance of neural network and speed up the convergence [30]. The last layer of the first block is a \(2\times 2\) max pooling layer with a stride of 2, which reduces the size of the feature map by a factor of 2 and reduces the number of learnable parameters by a factor of 4. The second and third block are similar in structure to the first block, but the number of channels maps doubles, as indicated in Figure 1. The fourth block of the DNN consists of a fully connected layer, which can integrate all the previously collected feature information. The input filter size and the output size of this layer is \(8\times 8\times 512\) and \(1\times 1024\), respectively. In addition, a dropout is used to prevent overfitting. The last block of the DNN is represented by an output layer, which is also a fully connected layer with an input size of 1024 and an output size of \(2N-1\) (Equation (2)). In total, the DNN has 12 layers and 18,518,597 learnable parameters. The input of the DNN is an intensity-only image with the size of \(64\times 64\) pixels. The output is a \(2N-1\)-sized vector, which contains amplitude \(\rho\) and phase \(\phi\) information regarding the individual mode weights. It is important to note that there are some hurdles involved in specifying phase information. Ensembles of mode weights with the same amplitude distributions but different phase distributions can provide one and the same intensity image. This is the case if there are different phase values, but the same relative phase difference between the individual modes exists. For this reason, the phase of the fundamental mode was always set to zero and only the relative phase difference between the individual modes was taken into account. This leads to a label vector containing \(N-1\) phase values and solves the problem of ambiguity. In addition, a complex-valued mode field distribution \(\underline{E}_{\text{MMF}}\) provides the same intensity image as its conjugated complex distribution. For this reason, not the real phase difference were used as the label for the datasets, but the cosine \(\Psi\) of the phase difference [23]:  
\[\Psi=cos(\phi). \tag{5}\]  
With these arrangements, it could be guaranteed that an intensity distribution corresponds to one unique label vector. Further, to predict better results, the values of \(\Psi\) were scaled from \((-1,1)\) to \((0,1)\) so that the phase labels were in the same range as the amplitude labels. The precautions taken a priori must also be taken into account if information from the DNN's predictions is to be evaluated.