# Neural Network-Assisted Interferogram Analysis Using Cylindrical and Flat Reference Beams
## 2 Materials and Methods
### Neural Network  
For this work, a neural network architecture based on Xception was used [58; 59; 60]. A distinctive feature of this model is the use of depthwise separable convolution.  
Since we are dealing with a regression problem, the use of such metrics as accuracy, confusion matrix, and other metrics applicable to classification problems is not possible. To control the accuracy in this case, the mean absolute error function was used as a loss function. The training of the neural network was implemented using a Nvidia Tesla K80 video card with 12 GB of built-in DDR5 video memory. Libraries for machine learning--the  
Figure 5: Target amplitude and phase distributions encoded in DMD pattern with experimentally obtained interferograms for single- and two-arm schemes with the tilted plane wave with \(\alpha\) indicated above the images; and reconstructed phase distributions from corresponding interferograms. RMSE of reconstructed phase distributions and target phase is indicated under corresponding images.  
Keras package. The essence of the \"depthwise separable convolution\" method is to split the transformations over the input tensor on each layer into two stages:  
* at the first stage, the tensor is convoluted with a \(1\times 1\) kernel. This operation is called \"pointwise convolution.\"
* at the second stage, standard convolution is performed. After that, the results of the convolution of the tensor obtained as a result of applying the \"pointwise convolution\" operation to the input tensor are summed up with all the filters of the layer and form the output tensor of the layer. This operation is called \"depthwise convolution.\"  
This technique allows you to significantly reduce the number of weights in the neural network, which significantly affects the learning rate required for training resources and the weight of the pre-trained model. Thus, the Xception architecture (Figure 6) is the best choice, providing sufficient training accuracy while requiring significantly fewer resources.  
Since the given problem is a regression problem and the Xception architecture was developed to solve the classification problem, the original architecture was modified. One fully connected layer was added, the dimension of which is equal to the number of Zernike functions (chosen to be 8).  
To obtain continuous values of the predicted coefficients, a linear activation function was used. To improve the convergence of the optimization algorithm, the network architecture was supplemented with a dropout layer in front of the output semi-connected layer.  
For each type of interferogram, a data set was prepared corresponding to the superposition of two aberrations. The dataset consists of 6000 images. 4000, 1000, and 1000 images were used for training, testing, and validation, respectively. The value of \(c_{nm}\) in the range from 0 to 1 and the type for the superposition of two aberrations were chosen randomly. Single-channel images of 299 \(\times\) 299 pixels of two types were fed to the input of the neural network: linear interferograms as well as cylindrical interferograms.  
Figure 6: Xception neural network architecture.