# Inverse Design of Distributed Bragg Reflectors Using Deep Learning
## 3 Results and Discussion  
### SNN Model Performance  
The mean absolute errors for the network discussed in Section 2.3 are shown in Figure 3, both with and without the addition of dropout. Without dropout, the training and validation curves converge at a very similar level, with the validation dataset slightly underperforming compared to the training dataset, suggesting a small amount of overfitting. With the application of dropout, the curves switch places, and the training curve converges at a noticeably higher level. This is unlikely due to the selection of validation samples as this is a direct result of applying dropout, and so is likely caused due to the effective'shrinking' of the network layers that occurs when training the model. When testing on validation and test data, all neurons are used again, which can result in a marginal increase in performance.  
The training begins to slow after around 12 epochs, where one can see that the curves begin to smooth out as a result of the adaptive learning rate. With dropout, the mean absolute error for the validation dataset is 0.0037, and it is 0.0036 for the test dataset. Considering that the range of possible reflectance values is 1, this is a strong result; however,  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Layer** & **Details** & **Number of Parameters** \\ \hline Input shape & Output shape = 81 & 0 \\ Dense layer & Output shape = 1000 & 82,000 \\ Dense layer & Output shape = 1000 & 1,001,000 \\ Dense layer & Output shape = 1000 & 1,001,000 \\ Dropout layer & 2\% dropout & 0 \\ Dense layer & Output shape = 500 & 500,500 \\ Dropout layer & 1\% dropout & 0 \\ Dense layer & Output shape = 500 & 250,500 \\ Dense layer & Output shape = 500 & 250,500 \\ Dense layer & Output shape = 6 & 3006 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Summary of final IDNN model architecture.  
Figure 3: Learning curves showing the mean absolute error (MAE) of the SNN network without (**a**) and with (**b**) the use of dropout. Curves representing both the training and validation datasets are shown, and the final MAE of the validation curves highlighted.  
to further analyse the model performance, predicted spectra were examined. Predictions were made for each sample in the test dataset, and by comparing these to the targets, the resulting percentage accuracy was calculated using (1).  
\[Accuracy=\frac{1}{N}\sum_{i=1}^{N}\frac{|R_{i}^{\prime}-R_{i}|}{R_{avg}}\times 100 \tag{1}\]  
where \(N\) is the number of test vectors, \(R_{i}^{\prime}\) is the predicted spectrum, \(R_{i}\) the ground truth, and \(R_{avg}\) is the average value of each spectrum. The 2328 test inputs yielded an average accuracy of 97.2%, with a possible accuracy of up to 99.4%. Figure 4 shows two sample spectra, one representing a 99% accurate graph, and one showing one of the lower-performing graphs. One can see that although the accuracy is only 77% for Figure 4a, the absolute errors are small. This is due to the way in which the accuracy was defined in (1). By dividing by the average reflectance value for each case, spectra with consistently low levels of reflectance will yield a higher percentage error for the same absolute errors. Nevertheless, this was preferable to dividing by the actual value, which could produce huge errors for expected values close to zero.