# Numerical Estimation of Bending in Holographic Volume Gratings by Means of RCWA and Deep Learning
## 3 Results
### Deep Learning-Based Bending Estimator  
In this section, we present and show the results of the two deep learning models developed: one strictly based on FNNs architecture and the other one being a hybrid of CNNs and FNNs for the estimation of bending parameters as three-order polynomial coefficients alongside optical depth and index modulation. The models were trained using simulated data generated across a range of standardised index modulations, optical depths, and the three coefficients (\(a_{1}\), \(a_{2}\), \(a_{3}\)) characterising the third-degree bending polynomial (\(a_{0}\) leaves the grating's diffraction efficiency pattern invariant). To ensure a fair comparison between the two models and to investigate the impact of CNN layers on the training process, both architectures were constructed to possess a comparable number of weights. A five feedforward layer model, with interleaved Rectified Linear Unit (ReLU) activation functions and 20% dropouts (to prevent overfitting), was employed as our first simpler FNN model, with a total 1,459,120 weights, as the code image shows in Appendix A.1. For our hybrid model instead, we used 1- to 64- and 64- to 128-channel seven-sized kernel CNN layers with interleaved ReLU activation functions [39] and a maximum pooling of two kernels before three more straightforward feedforward layers interleaved again with ReLU activation functions and 20% dropouts, with a total number of weights of 1,247,808, as shown in Appendix A.2. We opted for an L1 mean absolute error loss function and a batch size of 100. For the optimisation algorithm, we chose Root Mean Square Propagation (RMSProp) after we tried various optimisation algorithms and observed that it yielded faster convergence and improved stability compared to others such as Adam, Adagrad, or Stochastic Gradient Descent (SGD). RMSProp is designed to address some of the limitations of traditional gradient descent methods, such as the sensitivity to learning rates and the scaling of gradients, by adjusting the learning rates for each parameter in the neural network based on the magnitudes of their gradients. It also scales down the gradients of parameters with more significant updates and those with more minor updates. This helps prevent gradients from exploding or vanishing [40; 41]. A learning rate of \(1\times 10^{-5}\) with a momentum of 0.8 was chosen for the training. FNN Only Versus Hybrid Model Comparison  
In this section, the FNNs architecture and the hybrid of CNNs and FNNs are compared in terms of their accuracy, robustness, and generalisation. A dataset of 18, 000 (17,000 for training and 1000 for testing) Shooting method solved RCWA bending simulations of diffraction patterns with \(a_{1}\), \(a_{2}\), and \(a_{3}\) bending parameters ranging from \(-0.5\) to \(0.5\), optical depths of 10-20 \(\upmu\)m, and index modulations of 0.01-0.03. The reason behind keeping an amount of 17,000 of data for the training and 1000 of data for the test is that while the test set modes up only 5.6% of the total dataset, it was indeed large enough to validate the model itself by allowing us to employ a larger amount of data for the training. Wepresent both the bending-only (BO) estimation and bending and n1, d estimation versions of the models. The recording theta and the object theta were symmetrically set to 15 and \(-\)15 degrees, respectively, and the recording lambda was set to 633 nm. The simulations were conducted for an air medium air, with a medium average refraction index of 1.63. Both trainings were conducted with 8000 epochs. This choice was empirically founded, as, after approximately this number of epochs, the training and validation losses stabilised, offering no significant improvement with further epochs. Regarding the simulation time and computational performance, both the RCWA-SM simulations and the deep learning models were developed fully in Python and executed in a computer with the following main specs: Intel(r) Core(tm) i7 13700, 16 GB RAM DDR4-3200 MHz, and 512 GB PCIe NVMe.