# 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
Cn^2 Net performance for \(C_{n}^{2}\) prediction was evaluated separately on training and validation data subsets using averaged over \(N_{\text{model}}\) DNN models normalized root mean square errors (RMSE) \(\sigma_{tr}(c_{n}^{2})\ =\ \varepsilon_{tr}(c_{n}^{2})/c_{n}^{2}\) and \(\sigma_{val}(c_{n}^{2})\ =\ \varepsilon_{val}(c_{n}^{2})/c_{n}^{2}\), where  
\[\varepsilon_{tr/val}^{2}(c_{n}^{2})\ =\ N_{\text{model}}^{-1}\sum_{n=1}^{N_{ \text{model}}}\left[c_{n}^{2}(n)-\overline{c}_{n}^{2}(n)\right]^{2}. \tag{3}\]Figure 6: Selected results of the Cn?2 Net model training and validation: (**a**) comparison of \(C_{n}^{2}\) true (solid curve) and predicted values (dots) computed for training (solid dots) and validation (circles) data subsets of the SIM-KO dataset; (**b**) prediction error standard deviations \(\sigma_{tr}\) and \(\sigma_{val}\) for DNN training and validation performed on the SIM-KO data subsets; (**c**) DNN learning curves for three different datasets. The results are averaged over \(N_{model}\) = 20 Cn?2 Net models in (**a**,**c**) and \(N_{model}\) =50 in (**b**). Index \(m\) corresponds to the image frame stamp in each dataset. Predicted (averaged over \(N_{model}\) = 20 DNN models) and true \(C_{n}^{2}\) values corresponding to both training and validation SIM-KO data subsets are compared in Figure 6a by the ground truth vs. prediction plots. The prediction accuracy within the entire range of \(C_{n}^{2}\) change in the SIM-KO dataset is illustrated in Figure 6b) by the normalized \(RMSE\) values \(\sigma_{tr}(c_{n}^{2})\) and \(\sigma_{val}(c_{n}^{2})\) characterizing prediction error standard deviations for DNN training and validation data subsets. Note that the prediction error standard deviation \(\sigma_{val}\) on the validation data subset is about 3-fold higher than \(\sigma_{tr}\). As can be seen from Figure 6b, \(\sigma_{tr}\) for the training data subset is of the order of 1-3% or even less for \(C_{n}^{2}>0.3C_{n,0}^{2}\) and rapidly increases when the turbulence strength declines. The characteristic size of turbulence-induced speckles under weak turbulence conditions approaches the image frame size. In this case the scintillation images are lacking in diversity of the spatial features that are required for efficient DNN training. The efficiency of DNN training is commonly characterized by so-called learning curves that show how sequential learning steps \(n_{epoch}\) (epochs) effect the \(RMSE\) prediction error computed on the entire training data subset and averaged over DNN models. The Cn^2 Net learning curves are presented in Figure 6c for three different datasets. For all datasets, the prediction error rapidly decreased during first 4-5 epochs and continued declining at a much smaller rate with further \(n_{epoch}\) increase. In most DNN experiments considered we terminated Cn^2 Net training after the first 20 epochs. Cn^2 Net model topology optimization, training, validation and \(C_{n}^{2}\) predictions were performed using a high-performance ASUS laptop computer. The DNN model was implemented with a Python 3.6 and Keras 2.2.4 Keras 2.2.4 Keras (2016) machine learning framework using TensorFlow 1.14 Keras (2016) backend. Training of \(N_{model}\) = 20 DNN models on a SIM dataset comprised of 15,000 scintillation frames and required approximately 60 min of computational time, while prediction of a single \(C_{n}^{2}\) value based on the processing of \(M_{FEB}\) =16 scintillation images by a fully trained 20 Cn^2 Net models was performed in approximately 0.14 s.