Machine learning approach for proton range verification using real-time prompt gamma imaging with Compton cameras: addressing the total deposited energy information gap

Objective. Compton camera imaging shows promise as a range verification technique in proton therapy. This work aims to assess the performance of a machine learning model in Compton camera imaging for proton beam range verification improvement. Approach. The presented approach was used to recognize Compton events and estimate more accurately the prompt gamma (PG) energy in the Compton camera to reconstruct the PGs emission profile during proton therapy. This work reports the results obtained from the Geant4 simulation for a proton beam impinging on a polymethyl methacrylate (PMMA) target. To validate the versatility of such an approach, the produced PG emissions interact with a scintillating fiber-based Compton camera. Main results. A trained multilayer perceptron (MLP) neural network shows that it was possible to achieve a notable three-fold increase in the signal-to-total ratio. Furthermore, after event selection by the trained MLP, the loss of full-energy PGs was compensated by means of fitting an MLP energy regression model to the available data from true Compton (signal) events, predicting more precisely the total deposited energy for Compton events with incomplete energy deposition. Significance. A considerable improvement in the Compton camera’s performance was demonstrated in determining the distal falloff and identifying a few millimeters of target displacements. This approach has shown great potential for enhancing online proton range monitoring with Compton cameras in future clinical applications.


Introduction
Proton therapy offers precise tumor targeting by leveraging the maximum dose deposition at the end of proton trajectories, known as the Bragg peak, and the limited penetration of protons in the matter (Wilson 1946, Knopf andLomax 2013).This approach effectively minimizes damage to neighboring tissues, making it particularly suitable for tumors located near sensitive organs.The lower dose received by healthy tissues in proton therapy reduces the risk of long-term secondary effects, further enhancing its therapeutic benefits compared to photon therapy.Nevertheless, inherent uncertainties in the proton range, stemming from factors such as anatomical changes, uncertainties in particle stopping power, patient setup errors, and imaging reconstruction artifacts, necessitate the use of conservative safety margins (Paganetti 2012, Kraan 2015).While these margins ensure treatment safety, they significantly limit the potential advantages of proton therapy over photon therapy.
Achieving online monitoring of dose distribution in proton therapy can be accomplished through the detection of the secondary gammas, neutrons, or positron emitters produced during nuclear reactions between protons and atomic nuclei of the tissue.Unlike positron emitters (Moteabbed et al 2011) or neutrons (Ytre-Hauge et al 2019), the spatial distribution of emitted prompt gammas (PGs) closely correlates with the range of protons at the beam's end (Min et al 2006).Significantly, the energy and intensity of PGs are directly related to the amount of energy deposited by the protons at a specific location in the tissue.Hence, measuring the energy and intensity of the PGs can provide insights into the deposited dose within the patient's body.
Additionally, as the PGs exhibit nearly instantaneous emission (within 1 ns), ensuring their distribution remains unaffected by physiological processes (Knopf et al 2009).These characteristics make PG monitoring highly valuable for accurately verifying the proton beam range during treatment (Krimmer et al 2018).
Over the past decade, various research groups have developed and evaluated monitoring systems for PG based on different methods such as PG timing (Golnik et al 2014, González et al 2015, Krimmer et al 2017), gamma-ray spectroscopy (Verburg andSeco 2014, Hueso-González et al 2018), and PG imaging.In the case of the latter, two main approaches have been pursued: passive collimation employing knife-edge-slit cameras (Kim 2009, Kim et al 2012, Verburg et al 2013, Jan et al 2017) and active collimation, with significant emphasis placed on the improvement of Compton cameras (Peterson et al 2010, Robertson et al 2011, Muñoz et al 2021).A promising candidate for online range verification in proton therapy is the Compton camera, an electronically collimated imaging system that utilizes the kinematics of the Compton effect.The unique advantage of the Compton camera is its capability to simultaneously capture both the spatial and spectral distribution of PG emissions (Gillam et al 2011, Draeger et al 2018, Muñoz et al 2020).Typically, a Compton camera consists of two or more detection modules: the first module, known as the scatterer in which each PG interacts via the Compton effect, while the subsequent interaction of the scattered photon takes place in the second module, referred to as the absorber.By analyzing the deposited energies and positions of these interactions, it becomes feasible to reconstruct the PG emission distribution.
Despite its potential, there are challenges to overcome for the reliable implementation of the Compton camera methodology in clinical settings.Firstly, the raw data acquired from the Compton camera does not explicitly present the chronological order of registered PG interaction sequences within the detection setup (Muñoz et al 2021, Polf et al 2022).Additionally, the detector is susceptible to a high background component of incoming particles, such as neutrons, which can result in unwanted events.These issues contribute to a noisy and impractical reconstructed PG depth profile for clinical use (Polf andParodi 2015, Basalyga et al 2020).Besides other limitations such as finite energy and spatial resolution of the detection system, the detection of high-energy PG lines generated during irradiation would be challenging for Compton cameras.Two-plane Compton cameras detect a large fraction of PGs with an incomplete energy deposition leading to degraded reconstructed images of the PG depth distributions.To overcome this limitation, three-plane and multistage Compton cameras have been developed to handle higher energy lines of PGs.However, their limited coincidence detection efficiency (5−8 × 10 −6 ) currently impedes real-time proton range verification (McCleskey et al 2015, Llosá et al 2016, Draeger et al 2018).Therefore, preserving the high coincidence detection efficiency 1−2 × 10 −5 (Lerendegui-Marco et al 2022, Polf et al 2022) advantage of two-plane Compton cameras while enhancing their performance represents a promising approach for achieving online monitoring of proton range verification.One notable example is the SiPM and scintillation fiber-based Compton camera (SiFi-CC) prototype (Kasper et al 2020) which is capable of coincidence detection efficiency of 2 × 10 −5 in the context of a proton beam administration of 3 × 10 8 protons, rendering it a chosen candidate for the studies at hand.To address the challenges in Compton camera imaging, on the one hand, an approach based on machine learning (ML) identification of Compton events has been successfully developed in this study, enhancing the signal-tototal ratio by a factor of three.On the other hand, we have been able to significantly improve the quality of the reconstructed PG vertex distribution by applying an energy regression model to those events with incomplete deposited energies.Subsequently, additional simulations were performed along the beam direction on the location of the Bragg peak to investigate the effect of target displacements.Following the simulations, an event selection process was carried out using the trained ML model for each displacement scenario.The results reveal an improvement in the SiFi-CC performance, showing a few millimeters of target displacements can be achieved.

Compton camera simulations
The simulated data used in this study were generated from the first version of the SiFi-CC prototype (Kasper et al 2020).The SiFi-CC consists of 1 × 1 × 100 mm 3 fibers made of LYSO:Ce scintillator material.The stack fibers are arranged into layers with a pitch of 1.3 mm in each transverse direction.Moreover, every second layer is shifted by half a fiber.The detection system consists of a scatterer with 76 fibers along the z axis arranged in 10 layers along the x axis, having a volume of 12.7 × 100 × 98.8 mm 3 .The absorber with the same number of fibers as the scatterer along z direction consists of 30 layers of fibers along the x axis and its size is 38.7 × 100 × 98.8 mm 3 .Figure 1 in the left panel displays a top view of the detection setup configuration.More details about the geometry configuration can be found in Kasper et al (2020), andKazemi Kozani andMagiera (2022).All the simulation studies in this work were performed with Geant4 version 10.6 (Agostinelli et al 2003).The predefined QGSP_BIC_HP_EMZ physics list (Geant4 Collaboration 2020) was used to define the physical processes and their corresponding probabilities in the study.Production threshold values were set to 0.1 mm to obtain the best compromise for an accurate simulation in terms of spatial dose distribution and computation time (Zahra et al 2010, Kazemi et al 2015).
For this study, a total of 10 10 protons of 180 MeV proton beam impinging on a polymethyl methacrylate (PMMA) phantom with the dimension of 50 × 50 × 368.2 mm 3 was simulated.The energy distribution of the proton beam was assumed as a Gaussian distribution with σ E = 0.2 MeV.Additionally, the spatial spread of the beam along the directions perpendicular to the beam axis at the entrance of the phantom was modeled as a Gaussian distribution with 2.5 mm standard deviation, a value commonly observed in clinical proton beams (Eickhoff et al 2012).Figure 1 in the right panel illustrates the depth distribution of the emitted PGs during the irradiation of the PMMA phantom.Distinct emission patterns can be discerned along the path of protons within the PMMA target for each of the spectral lines, namely 2.31 MeV from 14 N, 4.44 MeV from 12 C, and 6.13 MeV from 16 O.These patterns are linked to the different energy dependencies of the underlying nuclear crosssections (Verburg et al 2012).Notably, the 4.44 MeV PG line exhibits a pronounced intensity in production near the Bragg peak region (z = 0).This characteristic makes it particularly well-suited for directly evaluating the range of protons in the tissue.The Geant4 simulation output contains the interaction positions as well as the corresponding deposited energies within the SiFi-CC modules for all the hits.Moreover, the interaction type, position, and primary energy of all incoming photons reaching the detector (perfect data) were stored for event classification described in the following.To take into account experimental effects on the imaging resolution, the resolutions on interaction position and deposited energy were included in the simulations.Besides the measured energy resolution of 7% at 511 keV and position resolution of 1.3 mm along the x and z axes, the y-coordinate of position resolution was obtained from look-up tables (Wrońska et al 2020).

Machine learning 2.2.1. Preprocessing phase
For event selection, the simulated data were initially labeled as either true Compton (signal) or background events during the preprocessing phase.The signal/background classification procedure is shown in figure 2.
Previous studies (Kazemi Kozani and Magiera 2022) suggested considering the uncertainties of the interaction positions and energies as reliable criteria for distinguishing signal events from background events.The expected precision in determining the interaction positions within the scatterer was 2.6 mm along the x and z axes, and 10 mm along the y axis.Additionally, the expected uncertainty in the total deposited energy values i.e. the sum of deposited energy in the scatterer and the absorber, in the SiFi-CC was assumed to be 12% of the primary energy of the incoming photon.Therefore, events that underwent a Compton scattering in the scatterer, followed by any interactions in the absorber, and subsequently fulfilled all the mentioned criteria were classified as signal events.Conversely, background events encompassed those events either interacted via Compton scattering but were absorbed incompletely within the detector, referred to as bad Compton events, or were produced by other processes called non-Compton events.Table 1 shows the number of events labeled as signal or background in the training data set.This study specifically focused on PG events that involved a total of up to five interactions, with one interaction occurring in the scatterer and the remaining interactions taking place in the absorber.
For the purpose of image reconstruction in this study, the interaction position and corresponding deposited energy in the scatterer, as well as the most probable interaction position selected by the trained ML model (described in the following section) and the total deposited energy of all interactions in the absorber, were used.Therefore, it is essential to accurately recognize each Compton event's interactions in chronological order within the absorber and discriminate more effectively signal events from background events.

Event selection
A multilayer perceptron (MLP) neural network has been implemented using TMVA version 4.3.0(Speckmayer et al 2010) to classify recorded events within the detector, reducing background events at the end.Besides eight features including interaction positions and the corresponding deposited energies in each module, an additional feature called 'internal scattering angle' based on Compton scattering properties defined by the Klein-Nishina cross-section for the identification of scattering sequences (Kazemi Kozani and Magiera 2022) was fed to the MLP as input.The final output was a binary classification to distinguish signal events from background events.A flowchart of the event selection process in this study is shown in figure 3.
The MLP consists of three fully connected hidden layers of 60, 40, and 10 neurons, respectively.The number of training epochs was set to 3000.A sigmoid activation function was used in all hidden layers as well as the output layer, producing a value between 0 and 1.The binary cross entropy loss function was applied to minimize the difference between actual and predicted event labels while training the MLP model.The sufficiently small value of the learning rate (0.0005) was chosen to obtain the loss function score as low as possible and mitigate overtraining.For the MLP output values higher than 0.5, the model predicts the event as a signal (1) otherwise as a background (0).The first half of all statistics of the simulated data was used as the training data.Two equally sized training and validation sets were used to optimize the MLP model parameters.Subsequently, the trained MLP was employed for event selection in the second half of all statistics as the test data set.
It should be noted that TMVA also provides classification probabilities for each event besides the MLP model's response typically used to cut for event classification purposes.Therefore, for each event with more than one interaction within the absorber, the model provides the classification probabilities.For example, for an event with three interactions in the absorber, the model generates a probability value for the event with each   interaction.The greater the probability value, the higher the occurrence of the event (signal or background) with that interaction position in the absorber.Therefore, when selecting events by the MLP model, the position with the highest occurrence probability among all the interactions within the absorber was chosen as the final position of the event.

Energy correction
As previously described in section 1, a large number of PG reaching and interacting within the Compton camera is not completely absorbed.In this study, the number of such events (bad Compton) exceeds 30% of the total events in the training dataset (as shown in table 1). Figure 4 illustrates the discrepancy between the total deposited energy of bad Compton events and the corresponding primary energy of PG events in the SiFi-CC prototype.
It can be seen that the total deposited energy has a broad deviation from the PG primary energy for each event.It introduces a significant error in determining the reconstructed PG distal falloff position accurately.To address this issue, an energy correction approach is proposed using a regression model.This regression model aims to correct the deposited energy values for the remaining background events, specifically the bad Compton events, after the initial event selection process.Figure 5 displays the energy correction process via the MLP regression model.
In the study, an MLP regression model was applied only to signal events to compensate for the energy loss observed in the total deposited energy of bad Compton events.Since the total deposited energy of signal events accurately reflects the primary energy of PGs, the total deposited energies of signal events were taken as the target values for training the regression model.Three features used as input for the MLP regression model are listed as follows.
• Deposited energy of the Compton events in the scatterer.
• Deposited energy of the Compton events in the absorber.
• Compton scattering angle.During the preprocessing phase for each bad Compton event, an assigned total deposited energy was introduced as an additional variable.Each assigned total deposited energy was obtained by using a set of information from the interaction position and deposited energy of signal events in the scatterer available in the dataset.The whole energy correction process of bad Compton events is depicted in figure 6.
Similar to the method mentioned in the earlier section 2.2.1, considering the same uncertainties of the interaction positions and energy in the scatterer were used as the criteria for assigning total deposited energy to bad Compton events.In other words, for each bad Compton event, the absolute difference between its interaction position and that of signal events in the scatterer was limited to 2.6 mm along the x and z axes and 10 mm along the y axis as the interaction positions precision.Moreover, 12% of the deposited energy of the Compton event in the scatterer was taken into account as the uncertainty of the deposited energy in the scatterer for each bad Compton event.If each bad Compton event fulfilled all the mentioned criteria, the total deposited energy of that Compton event would be assigned to that bad Compton event.It is noted that in the case of a number of total deposited energy candidates of signals, the one with the closest deposited energy in the scatterer to that of the bad Compton event was selected as its assigned total deposited energy.If one of the mentioned criteria was not met, the total deposited energy of the bad Compton event would be kept as the assigned total deposited energy.It should be noted that the primary energy of the PGs was present as a spectator variable (Speckmayer et al 2010) and was not utilized during the whole energy correction procedure, except for displaying its correlation with the recovered total deposited energy for bad Compton events and for predicted Compton events after event selection during the training and test phases, respectively.
Table 2 provides the hyperparameter configuration of the MLP model used in this study.Consequently, the recovered total deposited energies of bad Compton events in the training data were obtained from applying energy correction generated by the MLP model to their assigned total deposited energies.

Image reconstruction and range estimation
The vertex distributions of predicted Compton events, obtained from the trained MLP model, were reconstructed using the standard list-mode maximum likelihood expectation maximization (LM-MLEM) algorithm (Wilderman et al 1998), incorporating the regression-refined energy information.To estimate range shifts within the target, additional simulations were performed with the same statistics as the initial one for  different target displacements of ±2, ±5, and ±10 mm along the proton beam direction.For each displacement scenario, an event selection process was conducted using the trained MLP model mentioned in the initial study.Subsequently, images were reconstructed using LM-MLEM for each case.To compare the gradient of the depth profiles, specific depths were considered, including the depth at the maximum peak and the depths at 80% (R80) and 50% (R50) after the maximum peak.The range estimation parameters were calculated based on these depths.The peak position was obtained from the center of the corresponding voxel, and R80 and R50 were determined using linear interpolation between the voxels above and below the heights of 80% and 50% of the peak (Muñoz et al 2021).

Event selection employing MLP model
The event selection procedure was carried out using an MLP model, which is detailed in section 2.2.2.A total of 3.16 × 10 5 PG events were generated through Monte Carlo simulations using Geant4, labeled as signal or background events as explained in section 2.1.To evaluate the performance of the MLP model, the simulated dataset was split equally into training and test sets, each containing 1.58 × 10 5 events.The MLP hyperparameters were optimized using the training set, and the test set was subsequently employed to assess the MLP's performance.Table 3 presents the percentage of signal and background events in the test dataset before and after the event selection process performed by the trained MLP model.The trained MLP successfully selects events in the test dataset, achieving a recall of 80.0% (percentage of correctly predicted signal events out of the total signal events before selection) and a purity of 28.0% (percentage of correctly predicted signal events out of all events predicted by the model).This selection procedure enables the enhancement of the signal-to-total ratio by a factor of 3, which has a substantial impact on the quality of the reconstructed images.

Energy correction employing MLP model
As discussed in section 2.2.3, the produced energy correction was applied to the assigned total deposited energy of each bad Compton event in training data to assess the MLP model's performance; recovering their energy deposition.The linearity between the PGs' primary energy and the recovered total deposited energy for such events is illustrated in figure 7. The model's accuracy in predicting total deposited energy improves with an increasing number of interactions, as depicted.Furthermore, the model demonstrates the remarkable predictive capability for higher energies of PGs such as the well-known line, 4.44 MeV (Verburg and Seco 2014, Koide et al 2018), which are not collected properly within Compton cameras, especially two-plane designs.It should be noted that such an excellent performance of the MLP model occurs especially in the case of events with 4 and 5 interactions in total due to benefiting from the assigned total deposited energy which helps produce energy corrections for the bad Compton events.
Following the event selection process, it was found that the majority of background events were identified as bad Compton events (approximately 75% of all background events as shown in table 3).Therefore, it is needed to recover the total deposited energy of each incorrectly predicted Compton event using the energy corrections obtained from the regression model.Figure 8 displays the relation between the recovered total deposited energy of incorrectly predicted Compton events and the corresponding PGs' primary energy.As expected, there is a deviation between the recovered energy deposition of incorrectly predicted Compton events and their primary energy due to the MLP model's inefficiency in energy correction prediction especially for non-Compton events in which the assigned total deposited energy could not be defined.Moreover, a comparison of the deposited energy of incorrectly predicted Compton events before and after applying the energy regression model is depicted (see inset in figure 8).Notably, the 4.44 MeV PG line is visible after recovering energy deposition.Furthermore, the results indicate that, although the energy deposition below 1 MeV, which was not utilized in the subsequent image reconstruction (see section 3.3), was accurately recovered, the regression model effectively corrected the deposited energy for a reasonable number of incorrectly predicted Compton events with higher primary energies.Consequently, applying energy correction could contribute to a more accurate reconstruction of the PG distal falloff position distribution.

Image reconstruction and range shift assessment
In order to reconstruct the PG vertex distribution, it is crucial to filter out low-energy photons that are produced by radiative processes and are unrelated to the deposited dose and the primary proton range (Chin et al 2013).To achieve this, an energy threshold of 750 keV was applied to the recovered energy spectrum of predicted Compton events.The 2D profiles of the PGs were reconstructed using the LM-MLEM algorithm.A voxel-wise convergence criterion was applied to the LM-MLEM algorithm, and the final 2D profiles were refined using a Gaussian smoothing filter (Kohlhase et al 2019).Figure 9 illustrates the comparison of PG profiles before event selection (raw data) and obtained using events selected by the trained model, without and with regressionrefined energy information.As depicted, the PG distal falloff distribution obtained from the trained model shows a clear and distinct pattern compared to the one derived from the raw data.Additionally, in the reconstructed image of the predicted Compton events, there is a noticeable peak intensity at the Bragg peak position.However, without applying energy correction, there is a broader distribution of activity and even significant activity after the Bragg peak position.This inconsistency in falloff determination indicates the importance of energy regression study in improving the accuracy of determining the falloff position.
Figure 10 displays the 1D depth profiles of various scenarios: the raw data, events selected by the MLP model with and without energy correction, and correctly predicted Compton events from the trained MLP model.
The reconstructed falloff positions show a significant agreement between the predicted Compton events with energy correction and the correctly predicted Compton events.Furthermore, the activity tail beyond the  expected Bragg peak position is reduced when energy correction is applied to the predicted Compton events.Hence, the findings strongly suggest that incorporating energy correction into the MLP model output leads to a superior determination of the PG distal falloff position.To study range shifts within the target, the 2D reconstructed vertex images using MLP model output with regression-refined energy information corresponding to various target displacements are shown in figure 11.
As expected, all cases exhibit an emission distribution along the beam direction, with a peak of intensity observed at the end of the beam range.Figure 12 displays the depth profiles obtained from the PMMA target displacements shifted to the left (−10, −5, and −2 mm) and right (+2, +5, and +10 mm) of the central position, respectively.
The profiles clearly display that the distal edge is shifted consistently with the displacement of the target along the beam direction.To accurately estimate the range from different target displacements, a sufficient number of reconstructed events representing real coincidence events for a single proton beam spot (3 × 10 8 ) in clinical use is required.Previous studies (Kasper et al 2020) demonstrated that the SiFi-CC detector is capable of registering 5000 events of real coincidences.In this study, 10 random subsets were selected exclusively from the MLP model output with regression-refined energy information for the position at z = 0 and each target displacement.Each Figure 10.The depth profiles along the beam axis (z axis) for the raw data (cyan), the trained MLP model with energy correction (blue) and without energy correction (red), and the correctly predicted Compton events (green).The expected Bragg peak falloff position for the proton beam is indicated by the black line at z = 0.All reconstructed images reached convergence, and then profiles were normalized by their maximum intensity value.Gaussian smoothing with a kernel of 3 mm was applied to all reconstructed profiles.subset consisted of an average of approximately 1300 events obtained from multiplying the ratio of the total number of events after and before event selection (e.g. for the position at z = 0, 40800/158200) by the number of real coincidence events (5000) within the SiFi-CC detector.In each target displacement scenario and the position at z = 0, the 1D depth profiles of the PG reconstructed position were generated for all subsets.These profiles were obtained after reaching convergence and were further refined using a Gaussian smoothing filter with a 5 mm kernel.The positions corresponding to the maximum peak, as well as R80 and R50 after the maximum peak, were calculated by averaging the values over all subsets for each displacement and the position at z = 0. Finally, the absolute average deviation from the target displacement was computed to evaluate the SiFi-CC's capability in determining range shifts.The calculated parameters for each displacement scenario are provided in table 4.
The reconstructed positions of R80 and R50 exhibit better agreement with the expected (target) values, suggesting that these parameters are more robust to statistical fluctuations when determining range shifts.Among the target displacements considered, the R80 parameter produced the most accurate results, with an average deviation from the target values of 2.5 mm.In contrast, the average deviation from the expected values using the maximum peak and R50 parameters was 12.5 mm and 3.7 mm, respectively.

Discussion
The primary objective of this study was to utilize ML techniques to improve the performance of Compton cameras in verifying the range of proton beams.To achieve this goal, a software framework was developed to analyze pseudo-data generated by the Geant4 simulation.The simulation involved a 180 MeV proton beam interacting with a PMMA phantom, and the resulting PG emissions were detected using the SiFi-CC detector.While the earlier studies (Kasper et al 2020) demonstrated the excellent performance of the SiFi-CC prototype in high counting rate scenarios, the possibility of pulse pile-ups caused by random coincidences was not included in the simulation.Nevertheless, the ML methodology remains robust and versatile, making it suitable for improving the prototype's performance in more challenging situations that involve the consideration of random  coincidences.To enhance the accuracy of the reconstructed images, a two-step ML approach was employed.Firstly, an MLP model was trained for event selection to reduce background noise in the data set prior to image reconstruction.Furthermore, an MLP energy regression model was developed to compensate for the loss of fullenergy PGs in Compton events.By training the regression model using known data from signal events, it could predict the total deposited energy more accurately for Compton events with incomplete energy deposition.Overall, the proposed ML approach demonstrated enhanced signal/background separation and improved accuracy in determining the PG distal falloff distribution.
In order to assess the system's capability of detecting range shifts, data were collected following event selection with applied energy correction for the target at six different positions relative to the system.Subsequently, for each target displacement as well as the position at z = 0, 10 random subsets were selected from the corresponding MLP model output.Then, the 2D distribution vertex image was reconstructed for each of these positions.The maximum peak, as well as R80 and R50 after the maximum peak, were determined from the 1D depth profiles extracted from the reconstructed images.These parameters were obtained by calculating the averages across all subsets for each displacement and the position at z = 0. Finally, the absolute average deviation from the target displacement was calculated to determine the system's performance in detecting range shifts.Among the parameters considered, R80 and R50 proved to be more robust indicators of the beam range inside the target compared to the maximum peak position.This is attributed to the presence of statistical fluctuations in the reconstructed depth profiles, which may result in multiple peaks of high intensity before the distal edge.It was demonstrated that using the R80 parameter, the SiFi-CC is capable of detecting range shifts up to a maximum of 2.9 mm.
The findings of this study align with recent research efforts aimed at enhancing the performance of Compton cameras for proton range monitoring in clinical applications using various ML approaches.For instance, the MACACO II prototype developed at IFIC-Valencia (Muñoz et al 2021) demonstrated an improvement in performance through the incorporation of ML techniques and subsequent spectral reconstruction algorithms, achieving a remarkable 3 mm accuracy in determining proton range shifts.In another notable endeavor, a fully automated deep learning approach was applied to 3D reconstructed PG images, with a specific focus on regions where the proton beam was present (Jiang et al 2023).This approach effectively restored the true PG emissions within those regions, leading to reported proton range errors within 4 mm in all directions, particularly at high dose levels.
While this study has shown promising prospects for range verification in proton therapy, it is essential to perform measurements using SiFi-CC in proton beam facilities as well as in clinical settings.These measurements will serve as an experimental validation for the methods and results presented in this work.Furthermore, they will provide valuable insights that can help explore and optimize additional aspects of the ion-range monitoring application.

Conclusions
The performance of the SiFi-CC prototype was enhanced in the distal falloff determination and detection of 3 mm target displacements.This proposed ML approach demonstrates a considerable potential for improving online proton range monitoring using Compton cameras in future clinical applications.

Figure 1 .
Figure 1.Left: Top view of the simulated geometry and relative distances in the detection set-up.Right: Correlation between the PG energy and the emission depth for the PMMA phantom.

Figure 2 .
Figure 2. The signal/background classification during the preprocessing phase.

Figure 3 .
Figure 3.The event selection procedure using MLP neural network model, see text for more details.

Figure 4 .
Figure 4.The relation between the primary energy of PGs and total deposited energy of bad Compton events.Panels a, b, c, and d show the results for events containing 2, 3, 4, and 5 interactions in total, respectively.

Figure 5 .
Figure 5.The energy correction flowchart using MLP regression model applied only to signals.

Figure 6 .
Figure 6.The energy correction process for bad Compton events.

Figure 7 .
Figure 7.The relation between the primary energy of PGs and recovered total deposited energy of bad Compton events.Panels a, b, c, and d show results for events containing 2, 3, 4, and 5 interactions in total, respectively.

Figure 8 .
Figure8.The relation between the primary energy of PGs and recovered total deposited energy of incorrectly predicted Compton events.The total deposited energy of incorrectly predicted Compton events before (red) and after (blue) applying the MLP regression model is shown in inset.The plots were normalized to their maximum.

Figure 9 .
Figure 9.The comparison of reconstructed vertex distribution of raw data (a) and predicted Compton events achieved from training the MLP model without (b) and with (c) applied energy correction.The 2D PG profiles were obtained after reaching convergence and further refined by applying a Gaussian smoothing filter with a kernel size of 3 mm (3 voxels along the y and z axes).

Figure 11 .
Figure 11.2D reconstructed vertex images at 6 different target positions.Top row, from left to right: target at −10, −5, and −2 mm.Bottom row, from left to right: target at +2, +5, and +10 mm.The 2D PG profiles were obtained after reaching convergence and further refined by applying a Gaussian smoothing filter with a kernel size of 3 mm.

Figure 12 .
Figure 12. 1D depth profiles along the beam direction obtained from images shown in figure 11: (a) top row, (b) bottom row.All reconstructed images were at convergence, and then profiles were normalized by their maximum.Gaussian smoothing with a kernel of 3 mm was applied to all reconstructed profiles.

Table 1 .
Signal and background events in the training data set.

Table 2 .
Hyperparameters of the MLP regression model.The number N indicates the number of input features as neurons in each hidden layer.Also, the repetition of N shows the number of hidden layers used.The MSE stands for mean square estimator.

Table 3 .
Signal and background events in the test data set before and after MLP selection.

Table 4 .
The average calculated parameters from the vertex distribution reconstructed at each target position.