Artificial intelligence based deconvolving on megavoltage photon beam profiles for radiotherapy applications

Objective. The aim of this work is an AI based approach to reduce the volume effect of ionization chambers used to measure high energy photon beams in radiotherapy. In particular for profile measurements, the air-filled volume leads to an inaccurate measurement of the penumbra. Approach. The AI-based approach presented in this study was trained with synthetic data intended to cover a wide range of realistic linear accelerator data. The synthetic data was created by randomly generating profiles and convolving them with the lateral response function of a Semiflex 3D ionization chamber. The neuronal network was implemented using the open source tensorflow.keras machine learning framework and a U-Net architecture. The approach was validated on three accelerator types (Varian TrueBeam, Elekta VersaHD, Siemens Artiste) at FF and FFF energies between 6 MV and 18 MV at three measurement depths. For each validation, a Semiflex 3D measurement was compared against a microDiamond measurement, and the AI processed Semiflex 3D measurement was compared against the microDiamond measurement. Main results. The AI approach was validated with dataset containing 306 profiles measured with Semiflex 3D ionization chamber and microDiamond. In 90% of the cases, the AI processed Semiflex 3D dataset agrees with the microDiamond dataset within 0.5 mm/2% gamma criterion. 77% of the AI processed Semiflex 3D measurements show a penumbra difference to the microDiamond of less than 0.5 mm, 99% of less than 1 mm. Significance. This AI approach is the first in the field of dosimetry which uses synthetic training data. Thus, the approach is able to cover a wide range of accelerators and the whole specified field size range of the ionization chamber. The application of the AI approach offers an quality improvement and time saving for measurements in the water phantom, in particular for large field sizes.


Introduction
In modern radiotherapy, the measurements in water tank systems still play an important role. In most cases, measurements in water are still mandatory for the commissioning of an accelerator. Moreover, accurate profile measurements of the linear accelerator beam are an essential part of the validation of a beam model used in treatment planning systems.
From the detector point of view, the measurement of a lateral profile of a megavoltage photon beam is challenging. The detector should measure the dose accurately in the center of the field, in the outer area as well as in the penumbra region. Whereas the behavior in the outer area is determined by the energy dependence of the detector, the measurement in the penumbra is significantly influenced by the size of the detector as well as its density compared to water.
For air-filled ionization chambers, the penumbra deformation has been discussed and investigated in the literature several times. Analytically, the problem can be described by a convolution (Garcia-Vicente et al 1998, Bednarz et al 2002, Laub and Wong 2003, Herrup et al 2005, Fox et al 2010, Looe et al 2013. Assuming that the transfer function or also called detector response function of the ionization chamber is known, the incorrect penumbra measurement can be corrected by a deconvolution. For an analytical deconvolution, the profile measurement as well as the detector response must be analytically definable (Ulmer and Kaissl 2003). Alternatively, iterative deconvolution approaches can be used (Looe et al 2010). Both approaches have already been described in the literature. However, both approaches have several limitations. Analytic approaches can only handle cases with suitable analytic description. Iterative methods tend to produce artifacts on real world noisy data. An analytical form of deconvolution is implemented in the BEAMSCAN software version 4.4. However, the implementation can only deconvolve filtered highenergy photon fields. The algorithm is not usable for high-energy photon fields without flattening filter (FFF) due to the missing analytical descriptiveness of the FFF field.
The other approach to solve the penumbra problem is an AI-based solution. Several studies (Liu et al 2018, Mund et al 2020, Schönfeld et al 2021 have demonstrated an AI-based approach where an AI was trained with a training dataset of profile data measured with an ionization chamber as well as undisturbed profile measurements measured with a silicon detector. However, this approach requires a huge amount of training data, which has to cover many different conditions, such as energy, depth, accelerator type to avoid overfitting.
The aim of this study is to implement an AI-based approach that does not need any measurements at the training stage and can therefore be easily scaled to cover a wide range of clinical settings.
Like in Liu et al the training is based on a dataset whose elements represent pairs of disturbed and undisturbed profiles. However, in contrast to Liu, the pairs in this study are not obtained by measurement. Instead, undisturbed profile shapes are randomly generated and disturbed based on classical convolution theory.
In a large data set of test measurements, which includes different FF and FFF energies as well as different accelerator types, the quality of the AI-based approach is demonstrated.

Generation of training data
The AI-training is based on synthetic training data consisting of pairs of undisturbed and disturbed profiles. One way to generate such data would be Monte Carlo simulation. However, Monte Carlo simulations are very time consuming, especially if a large number of treatment machines and energies are to be covered. Instead, the following approach was taken. The effect of a Semiflex3D ionization chamber on a measured beam profile is well understood and can be described by a convolution model. Virtual beam profiles unaffected by volume effects were randomly generated and then processed with a convolution corresponding to the Semiflex 3D disturbance. Figure 1 shows exemplary profiles of this synthetically generated training data set. Most profile shapes are quite exotic. This is to prevent the resulting neural net from overfitting on classic situations, like flat 10 cm × 10 cm fields.
The generation of the virtual profile data consists of two steps as shown in figure 2. In the first step, a very rough outline of the profile is created. For this, piecewise linear random functions are used as illustrated by the blue line in figure 2. In the second step, penumbras of different magnitudes are formed. Here, a sum of random Gaussian functions is convolved to the profile as illustrated by the red line in figure 2. Sigma values of these Gaussians are in the range of 0.8 mm to 15 mm. The choice was guided by the idea that penumbras can be well approximated by a sum of error functions and the sigmas cover typical values produced by such fits Harder 1996, Ulmer andKaissl 2003). Note however that it is not required for the training to be able to reliably produce realistic penumbras. Any penumbra distribution that generalizes to real penumbras is fine for our purposes.
The convolution with several Gaussian functions results in a superposition of these convolutions and thus different penumbra shapes are formed in each case. In this superposition, the weight of each kernel varies randomly with scan position.
The virtual profile data is then convolved with a Gaussian function with sigma=1.7 mm corresponding to the volume effect perturbation of the Semiflex 3D ionization chamber. Thus, artificially measured Semiflex 3D profile data is generated with this step as shown in figure 3. Furthermore, a noise with locally varying magnitude is added randomly. In real conditions, a measurement with a Semiflex3D ionization chamber has a low noise, but the noise added here can be of a higher magnitude. This is done to increase the robustness of the network. In addition, a random resampling with locally different resolutions is also implemented. This reflects the fact that there are many different measurement resolutions in practice.
All in all, a training data set with a total length of about 200 meters was generated. During each epoch this set is cycled through once. In addition, a synthetic cross validation data set was generated from the same distribution to detect overfitting. Figures 1-3 show a part of this training data set between 5 and 5.2 meters.
Based on this training dataset, the neuronal network training was applied. The neuronal network was implemented using the open source tensorflow.keras (Chollet 2015) machine learning framework and a UNet architecture (Ronneberger et al 2015).
Neuronal networks come in many varieties and not every architecture is suitable for every problem. A crucial property of the deconvolution problem is locality. Locality refers to the fact that the output at a given position only depends on the input at nearby positions. It does not depend on the input at far away positions. For instance, there is significant mutual information between microDiamond dose at position 100 mm and Semiflex 3D dose at 101 mm. There is no mutual information between microDiamond dose at position 100 mm and Semiflex3D dose at position 200 mm.
A standard approach to local problems are convolutional neuronal networks, so called convnets. Convnets are assembled from basic building blocks, all of which are local. The eponymous building block is a convolution operation by a narrow kernel typically 3-5 pixels wide. Other common building blocks are upsampling, downsampling and zeroing negative values (ReLu activation).  Process of generation of the virtual profile data. In a first step piecewise linear random functions are used for a rough outline (black line). In a second step a sum of random Gaussian functions is convolved to the profile to generate realistic penumbra shapes (red line).
Convnets are a large family of architectures and many of these architectures will perform reasonable on the deconvolution problem. There is however one more property of the deconvolution problem, that guided us in the choice of UNet.
In clinical practice profiles are scanned at various resolutions. The goal is to support all of them. In particular the finest practical resolution should be supported, which we assume is 0.1 mm. In comparison the distance over which there is mutual information between microDiamond and Semiflex 3D is on the order of 1 cm. At 0.1 mm resolution 1 cm translates into 100 pixels.
To cover a distance of 100 pixels by narrow 3-5 pixel kernels is awkward. Therefore, an architecture designed to cover such high pixel counts is preferable. UNet is such an architecture.
It uses upsampling and downsampling to operate at multiple resolutions, as shown in figure 4. While the 0.1 mm resolution parts alone would not be able to transport information over 1 cm, this task is easy for the 0.8 mm resolution parts. And information produced at 0.8 mm resolution feeds into the later stage 0.1 mm layers.
The total number of trainable parameters is 21.933. The loss function is given by the mean square error and optimized using the ADAM (Kingma and Ba 2014) optimizer. However, the overall approach is quite robust  with respect to these choices and good results can be achieved using other convnet architectures or training configurations.

Measurement of validation dataset
Measurements were performed using a BEAMSCAN water tank system and a Semiflex3D ionization chamber (T31021, PTW Freiburg, Germany) as well as a microDiamond (T60019, PTW Freiburg, Germany) detector on a Varian Truebeam, an Elekta VersaHD and a Siemens Artiste machine at energies of 6 MV, 6 MV FFF, 10 MV FFF and 18 MV. Profile measurements at [3, 10, 35] cm water depth with quadratic field sizes of [1, 1.5 , 2.5, 5, 10, 20, 30, 40] cm side length were collected. The source to surface distance (SSD) was 100 cm in case of the VersaHD measurements and SSD 90 cm in case of Truebeam and Artiste measurements. The profile measurements were measured with continuous scanning mode. The scanning speed was 20 mm s −1 for Semiflex 3D and 10 mm s −1 for microdiamond in case of the VersaHD measurements and 10 mm s −1 for Semiflex 3D and 5 mm s −1 for microDiamond in case of the Truebeam and Artiste measurement. The corresponding resolution is 1 mm. Note that the training data contained examples of many different resolutions and was in no way specialized on this resolution.

Validation of the AI approach
The validation data recorded with the Semiflex 3D ionization chamber were normalized and centered to the CAX and processed with the AI. The resulting profile was compared against the test data measured with the microdiamond detector normalized and centered to the CAX. The gamma algorithm described by Low et al (1998) was used for comparison. A location criterion of 0.5 mm was chosen to compare the centered profiles. Due to dose fluctuations and noise of the detectors, a dose criterion of 2% or 3% was chosen. Only data points with relative signal larger than 20% were analyzed.
As a test criterion it was defined that a profile passed the test, if all analyzed data points have a gamma value lower than 1.
In addition, the penumbra values of the test data were determined. For this, the penumbra width between 20% and 80% of the normalized profile was analyzed for water depths 30 mm and 100 mm. For water depth 350 mm the penumbra value was analyzed between 30% and 70%. values up to 2 mm are expected. For the validation of the AI approach only field sizes between 2.5 cm-40 cm according to the specification of the Semiflex 3D ionization chamber were considered.

Profile measurements
The results of the gamma analysis are shown in figures 5 and 6. 6.5% of the analyzed AI processed profiles (n=306) did not pass the gamma test (red squares in figures 5) and 3.3% passed the test with 3% dose criteria. So, 90% of the analyzed AI processed profiles passed the gamma test. This means that the AI processed Semiflex 3D measured profiles are within the gamma analysis comparable to the profiles measured with microDiamond.
The results of the non-processed Semiflex 3D measured profiles are shown in figure 6. Only 11% of the nonprocessed profiles passed the gamma test. Figure 5. Results of the gamma analysis between AI processed Semiflex 3D and microDiamond. Green square: Gamma comparison between AI processed Semiflex 3D measured profile and microDiamond measured profile with 0.5 mm/2% criteria and gamma value lower than 1. Yellow square: gamma comparison with 0.5 mm/3% and gamma value lower than 1. Red square: gamma comparison with 0.5 mm/3% and gamma value larger than 1.
None of the failed profiles can be attributed to the AI. The profiles show either jaw inaccuracies, detector noise at large water depth, cable effects of the detectors in the outer field area at large field sizes or irregularities in the profile due to linac problems. The failed points for the VersaHD at 5 cm × 5 cm is caused by jaw problems. The problem is only detectable at the right field size at Y profiles as shown in figure 7(a). The failed point at 2.5 cm × 2.5 cm field size is caused by linac output problems and the failed points at 350 mm water depth in X direction are caused by detector noise in the center of the field as shown in figures 7(b) and (c). Cable problems are responsible for the failed points at 40 cm × 40 cm.
However, most profiles show a significant improvement compared to the non-processed profile. As shown in figure 8 the TrueBeam Profile is clearly improved after AI processing. The gamma values of the AI processed Semiflex 3D measurement are below 0.3.
The results are provided in detail in table A1-A9 in the appendix.

Penumbra analysis
The penumbra values of the profile data were analyzed in detail. Figure 9 shows an exemplary profile of a 5 cm × 5 cm field measured at 30 mm depth at a Truebeam linac with 6 MV. The calculation of the penumbra width is visualized by marking the values at 20% and 80%. It can be observed that this example already shows a clear improvement between Semiflex 3D measurement and AI processed Semiflex 3D measurement compared to the microDiamond measurement. The penumbra value difference between Semiflex 3D and microDiamond measurement as well as AI processed Semiflex 3D measurement and microDiamond measurement are shown in figures 10 and 11 for all measurement data at FF beam qualities.
In the case of the non-processed Semiflex 3D data, the difference is on average 1.30 mm and takes values up to 2.1 mm. However, the AI processed Semiflex 3D data show a much smaller deviation from the microDiamond measurement. The mean penumbra width difference is 0.31 mm. 77% of the analyzed profiles showed a difference less than 0.5 mm (green squares), 99% of the analyzed profiles showed a difference less than 1 mm. Four AI processed profiles showed a deviation larger than 1 mm compared to the microDiamond profile (red squares). Figure 6. Results of the gamma analysis between non-processed Semiflex 3D and microDiamond. Green square: gamma comparison between non-processed Semiflex 3D measured profile and microDiamond measured profile with 0.5 mm/2% criteria and gamma value lower than 1. Yellow square: gamma comparison with 0.5 mm/3% and gamma value lower than 1. Red square: gamma comparison with 0.5 mm/3% and gamma value larger than 1.

Discussion
Until now, there is one further AI based approach for volume effect correction, published by Liu et al The approach of Liu et al is based on a training of the neural network based on measured data. Due to this, the approach differs fundamentally from the AI approach presented in this study. The training with measured data implies that the network can only be used for the accelerators for which training data are available. The approach presented here is also scalable with little effort to other ionization chamber types. It requires only that the lateral response function of the chamber is known with sufficient accuracy. In contrast, in Liu et al, a new data set of measurements is required to scale up to an additional detector type. This means that the effort required to  implement additional accelerator types and detector types is significantly higher than in the approach presented in this study.
The validation of the approach presented here was performed with a very large amount of data at three different accelerator types, FF and FFF beams, and energies between 6 and 18 MV. Measurements were always performed in three water depths and field sizes between 2.5 cm × 2.5 cm and 40 cm × 40 cm. As shown in figure 5 90% of the analyzed profile passed the gamma test. Also, the differences of the calculated penumbra width values as shown in figure 10 demonstrate a significant improvement for almost all conditions. The penumbra width could be calculated to less than 1 mm equal to the microDiamond in almost all cases (99%). On average, the improvement was even 0.31 mm. Liu et al describe a significantly better improvement in their study: On average, the penumbra deviation is between 0.1 and 0.2 mm. However, the neural network was trained exactly on the accelerator and the training data was a subset of the data used for validation. The same applies to the publications by Mund et al (2020Mund et al ( , 2021, Schönfeld et al (2021). Also in these studies, direct measurement data were used for training. Therefore, it is expected that the improvement is significantly better than for the approach described here. The approach presented here, on the other hand, is characterized by much greater generality. The validation measurements are completely independent of the synthetic training data. Furthermore, for the first time, the complete range between 2.5 and 40 cm was investigated in this study. Especially the large fields are attractive for the AI approach. Scanning the large fields with an ionization chamber offers a significant time saving compared to diode detectors.
The AI approach described in this study is adaptable to other detector types. The only way the training data depends on the Semiflex 3D chamber is through the lateral response function (approximated by a 1.7 mm Gaussian above). Thus, by switching the lateral response function it is possible to cover other detectors.
In Delfs et al (2018) the lateral response function of the Semiflex 3D ionization chamber was determined under the presence of different magnetic field strengths. The response function can no longer be described by a sigma value due to the asymmetry caused by the magnetic field. However, in a next step, the knowledge about the response function should be sufficient to extend the AI approach presented here to high field MR linacs like the Elekta Unity system. Generalizing the approach to more detectors or the MR setting is an interesting direction for future work.
Small field sizes below 2.5 cm are out of the specifications of the Semiflex 3D ionization chamber used in this study. Nevertheless, a 1 cm × 1 cm field was measured at 6 MV FFF with Semiflex 3D and microDiamond at the Elekta VersaHD and Varian Truebeam. The Semiflex 3D measurement was further processed with the AI approach. The profiles normalized to the CAX are shown in figure 12. There is a clear improvement due to the AI processing. Thus, the approach has been shown to be promising for small-field applications as well. Though, the Figure 10. Penumbra value difference between AI processed Semiflex 3D profiles and microDiamond measured profile. Green squares: penumbra difference lower than 0.5 mm. Yellow square: penumbra difference lower than 1 mm. Red square: penumbra difference larger than 1 mm. Figure 11. Penumbra value difference between non-processed Semiflex 3D profiles and microDiamond measured profile. Green squares: penumbra difference lower than 0.5 mm. Yellow square: penumbra difference lower than 1 mm. Red square: penumbra difference larger than 1 mm. AI approach is not trained to correct for dose output. Therefore, an absolute evaluation was not performed. However, an integration of output correction should be possible in further versions.

Conclusion
In this work, an AI-based approach to reduce the volume effect of ionization chambers in profile measurements was presented. Based on the UNet architecture, a neural network was trained with synthetic data with the goal of minimizing the volume effect in profile measurements of a Semiflex 3D ionization chamber. By using synthetic data for training, a large number of variations with respect to characteristics of different accelerator types such as gradient steepness or FFF or FF beams could be integrated into the data set. The approach was extensively tested with a large dataset of measured data from different accelerator types, different photon energies, and FFF and FF beams at different field sizes and water depths. To verify the result, the data was compared against a microDiamond measurement. The approach presented here is proven to be flexible with respect to accelerator type and energy. It can be applied for field sizes between 2.5 cm and 40 cm and offers a significant improvement of the penumbra measurement with a Semiflex 3D ionization chamber.

Conflict of interest
Jan Weidner, Julian Horn and Daniela Poppinga are employees of PTW Freiburg. Figure 12. 1 cm × 1 cm 6 MV FFF fields measured with Semiflex 3D (grey) and microdiamond (black) detector. Semiflex 3D measurements were processed with the AI based approach (red) and compared with gamma analysis with 0.5 mm/2% criteria. Left: Y profile at a TrueBeam machine, Right: X profile at a VersaHD machine.