# Atmospheric Turbulence Study with Deep Machine Learning of Intensity Scintillation Patterns
## 4 DNN Architecture, Implementation, Performance Characterization and Optimization
### Cn^2 Net Training, Validation and Performance Evaluation  
Development of the Cn^2 Net model for \(C_{n}^{2}\) prediction based on processing of laser beam intensity scintillation patterns included:  
Figure 5: Topology of the Cn^2 Net model used for \(C_{n}^{2}\) prediction based on DNN-processing of short-exposure intensity scintillation images. * Generation of datasets (see Sections 2 and 3). * Design and optimization of Cn^2 Net model architecture. * Optimization of Cn^2 Net trainable weights via a cost function minimization performed through a set of training steps (epochs) performed with \(N_{model}\) topologically identical DNN models processing instances from a training subset of a selected dataset (e.g., SIM, or ATM). * Validation of the fully trained Cn^2 Net models through computation of the \(C_{n}^{2}\) prediction error by applying a subset of training data (validation data subset) that has never been used for training (never \"seen\" by DNN). * Cross-dataset performance evaluation of the fully trained Cn^2 Net through computation of \(C_{n}^{2}\) prediction error for a dataset (inference dataset) that has never been used for training and validation (e.g., SIM-KO for training and SIM-TA or ATM#1 for prediction). During Cn^2 Net training the data were supplied by batches containing \(M_{B}\) = 32 instances (scintillation images and the corresponding \(C_{n}^{2}\) values). After processing the \(m\)-th set of \(M_{FEB}\) scintillation images (the Cn^2 Net sliding input data window) from a selected training data subset \(\left\{I(\mathbf{r}_{i,j},m+l)\right\}\), (\(i\), \(j\) = 1,..., 128, \(l\) = 0,..., \(M_{FEB}\)-1), the Cn^2 Net receives another \(M_{FEB}\) = 16 frames \(\left\{I(\mathbf{r}_{i,j},m+m_{shift}+l)\right\}\), where \(m_{shift}\) is a parameter (sliding window shift) defining the number of incrementally updated scintillation images inside the sliding window. With \(1\leq m_{shift}\leq M_{FEB}\) a single image frame is reprocessed by the DNN multiple (\(M_{FEB}/m_{shift}\)) times. This multiple reappearance of the same image frame at the DNN input was used for several reasons: to enrich the dataset, reduce \(C_{n}^{2}\) prediction error, and furthermore to stabilize the training process. From this viewpoint the sliding window shift \(m_{shift}\) can be considered as an additional (along with \(M_{FEB}\) and dropouts number) DNN fine-tuning parameter. In Cn^2 Net the sliding window shift of \(m_{shift}\) = 4 was chosen through a set of DNN model performance optimizations using the ATM and SIM datasets. In the machine learning experiments we typically trained \(N_{model}\) = 20 identical Cn^2 Net models with different initial values of trainable parameters. The results obtained in all model outputs were averaged (averaging over DNN models). As a cost function (also commonly known as a loss function) for Cn^2 Net model training we used the mean square error (\(MSE\)):  
\[MSE\ =\ \frac{1}{M_{B}}\sum_{m=1}^{M_{B}}\left[c_{n}^{2}(m)-\overline{c}_{n}^{2} (m)\right]^{2}, \tag{2}\]  
where \(M_{B}\) is the number of instances in the input data batch, and \(c_{n}^{2}(m)\) and \(\overline{c}_{n}^{2}(m)\) are correspondingly normalized by the factor \(C_{n,0}^{2}\ =\ 1{\cdot}10^{-14}\text{m}^{-2/3}\) true and predicted by Cn^2 Net values of the refractive index structure parameter (\(c_{n}^{2}\ =\ C_{n}^{2}/C_{n,0}^{2}\)). The Cn^2 Net model training and validation results are illustrated in Figure 5(a). In this example we used the SIM-KO dataset composed of 15,000 computer simulated scintillation images corresponding to the cosine-type \(C_{n}^{2}(m)\) dependence described by Equation (1) and shown in Figure 5(a) as the ground truth curve. The SIM-KO dataset was subdivided into training (SIM-KO-T) and validation (SIM-KO-V) data subsets correspondingly containing 10,000 and 5000 instances.