## 2 Methods  
Figure 1 summarizes the flowchart of the study, from data acquisition to model development. The RT treatment data from 36 patients who received intensity modulated radiotherapy (IMRT) for cancer of the left breast in DIBH, whose characteristics are summarized in Table 1, were analysed. The treatment delivered a prescribed dose of 40.05 Gy in 15 fractions, using mostly 2 or 3 (average 2.6, 95% confidence intervals (CI) 2-4) intensity modulated tangential photon beams of 6 MV, with a dose rate of 600 monitor units per minute. All patients were imaged with a non-contrast-enhanced pre-treatment CT using a 32-slice scanner (Toshiba Aquillion LB, Toshiba Medical Systems Europe, Zoetermeer, the Netherlands). Both an FB and a DIBH CT planning scan were acquired, in order to compare the treatment plans generated on each modality (Figure 2). CT scans were contoured and planned using Varian Eclipse version 16.1 (Varian Medical System, Palo Alto, CA, USA), with a 2.5 mm grid size. The contoured regions of interest included the combined lungs, left lung, heart, contralateral (right) breast, and LAD. Dose distributions were calculated using the Anisotropic Analytical Algorithm. The DIBH was performed by the Real-time Position Management (RPM) system installed on a Varian Truebeam linear accelerator. The RPM consists of an infrared camera mounted on the wall of the treatment unit, infrared lights, and a marker box with infrared reflective markers placed on the patient's chest. During the treatment, the reflective marker box is placed near to the xiphoid process, and the patient's respiratory cycle is measured using the RPM during acquisition of the planning CT. The infrared camera measures the position of the infrared markers during this time, as a surrogate for the patient's breathing.  
During delivery of DIBH RT, the RPM system triggers beam-hold to the linear accelerator, if the patient's breathing is outside the inspiration phase. [46]. The window in amplitude of the inspiration phase, which typically is of 2-8 mm, is selected during treatment planning, based on the respiratory signal acquired during the acquisition of pre-treatment CT, and is used for automated triggering of beam-on and beam-off during treatment.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Variable** & **Value** \\ \hline Sex & Female \\ \hline Age mean (95\% CI) & 52 (41, 69.5) \\ \hline Prescribed dose & 40.05 Gy/15 fractions \\ \hline Sequential boost & 18/36 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Treatment and patient data of the cohort in the study.  
In order to assess the dosimetric benefit of DIBH in terms of dose to the organs at risk for cardiovascular disease, for each DIBH patient a treatment plan was also calculated on the CT acquired in the FB modality, as shown in the Figure 2. The decrease in the maximum dose to the LAD, \(\Delta\)D\({}_{\text{L}}\), and between the DIBH and FB plan, was calculated, and its median value, \(med(\Delta\)D\({}_{\text{L}})\) among the patient cohort was used to split the patients into two classes with lower/higher \(\Delta\)D\({}_{\text{L}}\). The patients with \(\Delta\)D\({}_{\text{L}}\) higher than \(med(\Delta\)D\({}_{\text{L}})\), were considered eligible for DIBH. For better dosimetric comparison, we also collected dose indexes of the planning target volume (PTV) and organs at risk. These included the minimum dose covering at least 95% of the PTV, V95%, and, for the organs at risk, the V15%, the hottest dose level covering at least 15% of the organ for the lung, and the maximum dose, Dmax, to the heart and contralateral breast.  
The respiratory waveforms in the superior-inferior and anterior-posterior directions acquired for selection of the DIBH window, were exported for each patient, in the digital imaging and communications in medicine (DICOM) format. The statistical analysis and the implementation and evaluation of the BLSTM neural network, was performed in the MATLAB R2022b (The MathWorks, Inc., Apple Hill Drive, Natick, MA, USA) environment.