# Nearest Neighbours Graph Variational AutoEncoder
## 3 Results  
### Results on Energy Deposition Datasets  
We trained our VAE with the two energy deposition datasets described in the previous section. Here, we present the results that regard the reconstruction of the energy deposition distribution from the test set. The DL model was trained for 200 epochs and the best set of learnable parameters was chosen as the one that minimizes the validation loss. We set the latent space dimensionality to 1, for the Water Volume dataset, and to 2 for the other dataset. For the weight update, we used the Adam optimiser with an initial learning rate of 0.003 and an exponential scheduler with \(\lambda=0.9\). The hyperparameter \(\beta\) of the VAE, defined in Appendix B, was set to 1.  
To evaluate the performance of our model, we considered both local node-per-node and global reconstruction metrics. As a node-per-node reconstruction metric, we use the \(\delta\)-index, developed by [5]. This metric is inspired by the standard \(\gamma\)-index [34], used for the clinical validation of treatment plans, and is currently used in the field to evaluate DL models for energy deposition data generation. The reconstruction error on each node is defined as:  
\[\delta=\frac{X_{reco}-X_{GT}}{max(X_{GT})} \tag{3}\]  
where \(X_{reco}\) is the node feature predicted by the VAE, while \(X_{GT}\) is the ground truth node feature in the corresponding example. Then, as a reconstruction performance measure, we consider the 3% passing rate, which is the percentage of nodes with a \(\delta\) index smaller than 3%. In the water volume case, our Network reaches 99.4% of nodes with a 3% passing rate, while the water volume + Slab case reaches 98.4%, as reported in Table 1.  
While the errors on the \(r\) profile, total energy and overall reconstruction are quite low and around 1-3%, the errors on the \(z\) profile are around 6%. To understand such a result, we included in the analysis the variance in the Monte Carlo simulations. We fixed the particle energy and slab density to be the ones in the example in Figure 5b, and we ran 100 Monte Carlo simulations computing the mean and standard deviation of the energy deposition profile along the \(z\) axis. We also generated 100 energy deposition distributions for feeding our VAE the test set example relative to the chosen particles' energy and slab density, as well as computed the mean and standard deviation for the \(z\) profile.  
In Figure 6, we show the comparison of the standard deviation over the mean of the energy profile along the \(z\) axis between Monte Carlo simulations (left) and VAE reconstruction (right). The red dashed lines represent the slab with different (in this case higher) density, where most of the energy is released. Note that most of the errors in the reconstruction is relative to regions where there are fluctuations in the energy deposition, and so in our training set generated by Monte Carlo simulations, they are not negligible.  
Figure 5: **Energy profiles reconstruction**. Distribution of energy deposition along \(z\) and \(r\) axes from the test sets of the Water dataset (**a**) and the Water + Slab dataset (**b**). The blue lines correspond to the Monte Carlo simulated data, while the orange lines refer to the reconstructed data from our Network.  
Figure 6: **Standard deviations in MC and VAE**. Comparison of standard deviation over mean of the energy profile along the \(z\) axis between Monte Carlo simulations and VAE reconstruction in the Water + Slab setting. Values are estimated for 100 MC runs with fixed parameters and 100 VAE execution with the same example as input. Results demonstrate how VAE’s largest errors are in regions where energy deposition fluctuation, and so Monte Carlo’s ones, are not negligible.