Predicting Lung Tumour Motion During Respiration Using ConvLSTM Neural Networks

My project uses a ConvLSTM neural network to predict lung tumour movement caused by breathing and predicts future positions, improving radiation therapy accuracy.
Emma Nguyen
Webber Academy
Grade 9

Problem

Currently, one of the most technologically advanced cancer treatment options offered is radiation therapy, in which high-energy rays are used to destroy cancerous cells. However, one main problem evident through this process is when tumours move as people breathe.

Specifically, during a normal respiratory cycle, a lung tumour can move from a few millimeters to over a centimeter. Technology like Medical Linear Accelerators (LINACs) are designed to hit tumours within millimeter position, but this can be compromised with tumour movement. In real systems, tumour position is initially identified through imaging technologies like fluoroscopy, cone-beam CT, or surface tracking systems. After imaging, the data is processed, transmitted, and used to reposition the radiation beam. This creates a significant delay of 100-300 milliseconds or more, meaning the beam will aim at where the tumour was, instead of where it actually is. This effect is known as system latency.

Here is a picture demonstrating lung tumour movement with breathing patterns:

Image

As shown in this picture, the lung tumour moves at different parts of the respiratory cycle. In figure a), the tumour is above the line at the peak exhale, while in figure b), the tumour moves to below the line at the 50% inhale phase.

Some of the current solutions to help compensate include:

  • Increased Safety Margin:
    • This is where the radius of the radiation beam is enlarged to cover a larger area for where the tumour could be. However, this exposes more healthy lung tissue to the dangerous effects of radiation.
  • Respiratory Gating:
    • This strategy is where the beam is turned on only during specific breathing phases (ex. peak of inhale) when motion is minimal. Although this does reduce exposure, it also increases treatment time and decreases efficiency.
  • Delayed Tracking (Control):
    • This is the control system where the beam aims at the last detected tumour position. This leads to lag and reduced targeting accuracy.

Generally, these solutions compromise one element for another (ex. sacrificing tissue safety for efficiency), and it is clear a better strategy is needed.

In my project, I addressed this by designing an AI-based compensation model that predicts tumour position during breathing. I started by using real, past 4D CT patient scans. I then trained a ConvLSTM neural network model to predict future tumour positions by analyzing past patterns. Overall, I evaluated the model to determine the possibility of using AI to reduce the effect of system latency in lung tumour radiation.

Method

Overview:

The goal of my project was to create a machine learning system that could predict lung tumour motion that was caused by breathing. I designed a Convolutional Long Short-Term Memory (ConvLSTM) neural network, which is a deep learning structure that uses convolutional layers and LSTM layers to analyze motion patterns over time through images. To summarize, my model, given a sequence of past tumour images, can predict the tumour’s position in the next phase of the respiratory cycle. Looking ahead, these accurate predictions would allow radiation therapy to anticipate motion and reduce the impact of latency.


Data Acquisition and Preprocessing:

To start off, I needed to obtain data to base and test my model off of. Using a past dataset with information on multiple patients from The Cancer Imaging Archive, I took a real 4D CT scan which contained multiple respiratory phases that included the lung and tumour imaging throughout. I organized each volume provided as number_phases, number_slices, heigh, width. I then identified the slice of the lung containing the most cross-section of the tumour across every phase of the breathing cycle. Each of these MRI scan images were cropped to a 128x128 pixel area that focused on mainly the tumour. This ensured my model only focused on relevant areas, similar to what would happen in real life.


Sequence Construction:

To analyze temporal motion, I structured the dataset into: Input X which had the first 9 phases (frames) of the tumour, and Target Y that would be the predicted position of the 10th frame. Neural Network Architecture: My model has two main parts: the ConvLSTM portion and the Conv2D layer. The purpose of the ConvLSTM portion of my model was to look at a sequence of past tumour images and learn both where the tumour is in each image (spatial) and how it moves over time (temporal). It had 16 “filters” that help detect different patterns in the images. The next part, the Conv2D layer, was used to take the information from the ConvLSTM layer and create the next predicted image to show the tumour’s next position. Overall, it would output a single grayscale image where the tumour’s location could be accessed. The model as a whole is measured using Mean Squared Error (MSE), which shows how different the predicted image is from the real next image. It also uses the Adam optimizer, which updates the model to reduce this error during training.


Training:

To maximize the final performance, I trained the model using sequences extracted from the 4D CT scans. For example, a parameter included Epochs=50. During the training process, the model would adjust itself to minimize the Mean Squared Error. After, the final model was saved for a final test. Evaluation and Visualization: For the final model, I evaluated its predictions using:

  1. Visual Overlay, where the predicted position was highlighted in green, and the actual position was highlighted in red, and the control group (delayed compensation) in cyan.
  2. Quantitative Metrics, like structural similarity (SSIM) and MSE to show the quality of each sequence.
  3. Temporal Assessment, where I compared both positions across the sequential frames.

In general, all these measurement strategies showed that predictions were accurate specifically and temporally.


Summary:

Overall, my project shows how a ConvLSTM neural network can learn from past tumour positions in 4D CT scans to predict future positions. My model specifically used preprocessed, real patient data to analyze a temporal sequence, and finally used image based prediction to provide an anticipated position. Long term, this project has the potential to improve radiation targeting accuracy, overall reducing the impact of system latency without exposing extra healthy tissue to radiation.

Analysis

When testing all ten patients with my model, I had a visualization method in which the actual position was highlighted in red, the predicted position in green, and the delayed position in blue. This meant that the closer the green dot was to the red dot in comparison to the blue, the more accurate and efficient my model. This is what was outputted after each patient. Because the data of each patient was different, every image created was different, as well as the predicted tenth image. Image To display the accuracy of my model compared to the delayed position, I chose to represent the calculated Mean Absolute Error (MAE), which showed by pixel length how off each dot was. After calculating the MAE for the predictive model and for the delayed position, I created a graph to display this data. On the x axis, I put all ten patients I tested, with the absolute error in pixels as the y axis. Image As shown in the graph, the blue bar representing the ConvLSTM predictions is drastically lower than the orange bar for eight out of ten patients. This indicates that the ConvLSTM model consistently produced smaller prediction errors compared to the delayed targeting method. For these patients, it shows that the model was able to anticipate tumour motion with much greater precision. The delayed method, which stayed in the previous position, often missed the tumour by hundreds of pixels, which in real life, could end up in radiation being delivered to surrounding healthy tissue rather than the tumour itself. On the other hand, the ConvLSTM model was able to predict the tumour’s position within tens of pixels, showing a very large improvement in accuracy.

The graph also shows the consistency of the ConvLSTM’s performance. Even though the amplitude or speed of tumour motion varied between individuals, the model still stayed in the 30-50 pixel range, much better than the range of 10-500 of the delayed targeting position. However, it is notable that for patients 4 and 10, the delayed position was more accurate. When looking at the patient data for these two patients, the tumour had less previous motion in the first 9 phases. This made it harder for my model to detect a pattern for movement, which therefore made it harder to predict. To summarize, this shows that my model works best when previous phase movement is clear and consistent, which is the case with most patients.

Overall, the contrast between the blue and orange bars shows the potential of my ConvLSTM system. Reducing prediction errors by such a large margin could translate directly into safer and more effective radiation therapy. Less error mean less exposure of healthy lung tissue, which could reduce side effects and long-term complications. These results also show that the ConvLSTM system could significantly improve treatment outcomes, mainly for patients with tumours that move more, while current delayed targeting strategies are insufficient and inefective. It clearly shows that in the majority of cases, AI-based prediction outperforms conventional methods.

Conclusion

To conclude, my project demonstrates that a ConvLSTM-based neural network can accurately predict lung tumour motion caused by breathing. By analyzing sequences of past tumour images from 4D CT scans, the model was able to predict the position of the tumour in the next phase of the respiratory cycle with much lower error compared to conventional delayed targeting methods. These results showed that, for majority of patients, the ConvLSTM model reduced prediction errors by a drastic amount, mainly in cases with more drastic tumour motion. This confirms that AI-based prediction can account for the spatial and temporal patterns of tumour movement that occur naturally during respiration.

In a real-world context, this system could be integrated with radiation therapy equipment to help with real-time tumour tracking. As a patient breathes, the system would use CT scans to continuously analyze imaging data and predict the tumour’s next position, allowing radiation beams to adjust in time before delivering the rays. This, in the long run, could reduce the risk of damaging healthy tissue while also ensuring that the tumour receives the needed dose, improving both the safety and effectiveness of treatment. It could also be initiated with other existing imaging modalities like cone-beam CT or fluoroscopy to enhance precision even more.

The potential of my project as a whole is very significant. By improving targeting accuracy with a prediction, it could reduce side effects and complications for patients, while staying efficient, increasing the overall success of radiation therapy. Moreover, because the model is capable of adapting to different respiratory patterns, it could be applied across many patient populations with different tumour behavior. In the long term, AI-based motion prediction could become very standardd in improving quality of life and treatment of patients.

Overall, my project not only shows that AI could predict tumour motion, but it also shows how these predictions could be used in real clinical applications. This machine learning as a whole demonstrates how AI can enhance precision medicine and improve the quality of life of citizens long term.

Citations

  1. “4D-Lung.” The Cancer Imaging Archive (TCIA), 24 Oct. 2024, www.cancerimagingarchive.net/collection/4d-lung/
  2. Abulimiti, Muyasha, et al. “Application of Four-Dimensional Cone Beam Computed Tomography in Lung Cancer Radiotherapy.” SpringerLink, BioMed Central, 12 July 2023, link.springer.com/article/10.1186/s13014-023-02259-8
  3. Handels, Heinz, et al. “4D Medical Image Computing and Visualization of Lung Tumour Mobility in Spatio-Temporal CT Image Data.” Science Direct, Dec. 2007, www.researchgate.net/publication/351163114_httpswwwsciencedirectcomsciencearticleabspiiS1051200421000968.
  4. Korreman, S S. “Image-Guided Radiotherapy and Motion Management in Lung Cancer.” National Library of Medicine, 17 June 2015, pmc.ncbi.nlm.nih.gov/articles/PMC4628536/
  5. "Landmark Registration Between the Four 4DCT Phases.” ResearchGate, www.researchgate.net/figure/Landmark-registration-between-the-four-4DCT-phases-end-exhale-and-end-inhale-with-and_fig1_225056470. Accessed 25 October 2025.
  6. “Lung Cancer Overview.” Harvard Health, 31 Mar. 2023, https://www.health.harvard.edu/a_to_z/lung-cancer-overview-a-toz.
  7. “Lung Cancer Overview.” Lung Cancer Research Foundation, 16 May 2024, www.lungcancerresearchfoundation.org/for- patients/print-and-digital-resources/living-with-lung-cancer/lung-cancer-overview/.
  8. “Lung Cancer--Patient Version.” National Cancer Institute, https://www.cancer.gov/types/lung. Accessed 12 November 2025.
  9. “Lung Cancer.” Mayo Clinic, Mayo Foundation for Medical Education and Research, 30 Apr. 2024, www.mayoclinic.org/diseases-conditions/lung-cancer/symptoms-causes/syc-20374620.
  10. “Lung Cancer: Types, Stages, Symptoms, Diagnosis & Treatment.” Cleveland Clinic, 31 Oct. 2022, my.clevelandclinic.org/health/diseases/4375-lung-cancer.
  11. “Measuring Lung Motion Leads to Better Radiation Treatment for Lung Cancer.” ScienceDaily, ScienceDaily, 13 Mar. 2007, www.sciencedaily.com/releases/2007/03/070312152108.htm.
  12. Munshi​, Anusheel, et al. “Tumour Motion in Lung Cancers: An Overview of Four-Dimensional Radiotherapy Treatment of Lung Cancers.” Asian Journal of Oncology, 12 June 2023, asjo.in/tumor-motion-in-lung-cancers-an-overview-of-four-dimensional- radiotherapy-treatment-of-lung-cancers/.
  13. “Physiological Modeling of Respiratory Motion Based on Ultra-Quality 4D-MRI in Patients with Lung and Liver Cancers.” National Cancer Institute, www.cancer.gov/research/participate/clinical-trials-search/v?id=NCI-2023-10650&r=1. Accessed 25 October 2025.
  14. “Promising New Imaging Technology Precisely Tracks Lung Tumour Motion.” ScienceDaily, ScienceDaily, 5 Oct. 2004, www.sciencedaily.com/releases/2004/10/041005074303.htm.
  15. Sarudis, Sebastian, et al. Systematic Evaluation of Lung Tumour Motion Using Four-Dimensional Computed Tomography, 11 January 2017, www.tandfonline.com/doi/pdf/10.1080/0284186X.2016.1244356.
  16. Shahbazi, Hesamedin, et al. “Evaluation of Malignant Lung Tumor Motion Comparing to Fix Point During Different Respiratory Phases on Four-Dimensional Computed Tomography.” National Library of Medicine, 19 Sept. 2024, pubmed.ncbi.nlm.nih.gov/39553348/.
  17. Shao, Kainan, et al. “Spandidos Publications.” Oncology Letters, Spandidos Publications, 1 Sept. 2025, www.spandidos- publications.com/10.3892/ol.2025.15161.
  18. Teo, Peng Thian Troy. “Autonomous Lung Tumor and Critical Structure Tracking Using Optical Flow Computation and Neural Network Prediction.” The University of Manitoba, https://mspace.lib.umanitoba.ca/server/api/core/bitstreams/4dc1b4a5- eea8-4c77-80e4-6217d0fa4016/content. Accessed 25 November 2025.
  19. Ting, Lai-Lei, et al. “Tumor Motion Tracking Based on a Four-Dimensional Computed Tomography Respiratory Motion Model Driven by an Ultrasound Tracking Technique.” National Library of Medicine, 10 Jan. 2020, pubmed.ncbi.nlm.nih.gov/31956526/.

Acknowledgement

I would first like to thank my teacher, Dr. Beatriz Garcia-Diaz, my school, and CYSF for providing the opportunity to participate this year. Additionally, I would like to express my gratitude to my parents and mentor, Audrey Lo, for their constant support and help with my project.