Radiotherapy is used to treat more than half of all cancer patients, either alone or in combination with other treatments like surgery, chemotherapy, or immunotherapy. It works by directing high-energy radiation beams at the patient's body to destroy cancer cells. Since every patient's anatomy is unique, radiotherapy must be personalized. This means customizing the radiation beams to effectively target the tumor while minimizing harm to nearby healthy tissue.
Personalizing radiotherapy involves solving large and complex optimization problems. These problems need to be solved quickly due to the limited time available in clinical settings. Currently, they are often solved using gross approximations, which can lead to less effective treatments. This might result in the tumor not receiving enough radiation or healthy tissues being exposed to excessive radiation. The CompressRTP project aims to solve these optimization problems both rapidly and accurately. This ongoing project currently includes tools introduced in our latest three publications [1, 2, 3].
The optimization problems in radiotherapy are highly complex due to the "curse of dimensionality" since they involve many beams, beamlets (small segments of beams), and voxels (3D pixels representing volume). However, much of this data is redundant because it comes from discretizing a system that is inherently continuous. For example, radiation doses delivered from adjacent beamlets are highly correlated, and radiation doses delivered to neighboring voxels are very similar. This redundancy means that large-scale radiotherapy optimization problems are highly compressible, which is the foundation of CompressRTP.
Dimensionality reduction and compression have a rich history in statistics and engineering. Recently, these techniques have re-emerged as powerful tools for addressing increasingly high-dimensional problems in fields like big data and machine learning. Our goal is to adapt and adopt these versatile methods to embed high-dimensional radiotherapy optimization problems into lower-dimensional spaces so they can be solved efficiently. A general radiotherapy optimization problem can be formulated as:
Subject to
CompressRTP currently addresses the following two issues with this problem:
-
Matrix Compression to Address the Computational Intractability of
$A$ :-
The Challenge: The matrix
$𝐴$ is large and dense (approximately 100,000–500,000 rows and 5,000–20,000 columns) and is the main source of computational difficulty in solving radiotherapy optimization problems. -
Traditional Approach: This matrix is often sparsified in practice by simply ignoring small elements (e.g., zeroing out elements less than 1% of the maximum value in
$𝐴$ ), which can potentially lead to sub-optimal treatment plans. -
CompressRTP Solutions: We provide a compressed and accurate representation of matrix
$𝐴$ using two different techniques:-
(1.1) Sparse-Only Compression: This technique sparsifies
$𝐴$ using advanced tools from probability and randomized linear algebra. (NeurIPS paper, Sparse-Only Jupyter Notebook) -
(1.2) Sparse-Plus-Low-Rank Compression: This method decomposes
$𝐴$ into a sum of a sparse matrix and a low-rank matrix. (ArXiv paper, Sparse-Plus-Low-Rank Jupyter Notebook)
-
(1.1) Sparse-Only Compression: This technique sparsifies
-
The Challenge: The matrix
-
Fluence Compression to Enforce Smoothness on
$𝑥$ :-
The Need for Smoothness: The beamlet intensities
$𝑥$ need to be smooth for efficient and accurate delivery of radiation. Smoothness refers to small variations in the intensity of neighboring beamlets in two dimensions. - Traditional Approach: Smoothness is often achieved implicitly by adding regularization terms to the objective function that discourage variations between neighboring beamlets.
- CompressRTP Solution: We enforce smoothness explicitly by representing the beamlet intensities using low-frequency wavelets, resulting in built-in wavelet-induced smoothness. This can be easily integrated into the optimization problem by adding a set of linear constraints. (PMB paper, Wavelet Jupyter Notebook)
-
The Need for Smoothness: The beamlet intensities
Matrix sparsification has been extensively studied in the machine learning community for applications such as low-rank approximation and Principal Component Analysis (PCA). This technique is also a key part of an emerging field known as randomized linear algebra. The main idea is to carefully sample and scale elements from the original dense matrix
In radiotherapy optimization, we can replace the original dense matrix
Subject to
In our paper, we introduced Randomized Minor Rectification (RMR), a simple yet effective matrix sparsification algorithm equiped with robust mathematical properties. The core principle of RMR is to deterministically retain the large elements of a matrix while probabilistically handling the smaller ones. Specifically, the RMR algorithm converts a dense matrix
Figure Explanation: The figure above compares the proposed RMR algorithm with four existing sparsification algorithms in terms of feasibility and optimality gaps. These gaps were calculated by solving both the original and surrogate optimization problems for 10 lung cancer patients, whose data is publicly available on PortPy. The results demonstrate that the RMR algorithm outperforms the existing methods.
Figure Explanation: The figure above illustrates the discrepancies in Dose Volume Histogram (DVH) plots between the actual dose (
Implementation in PortPy:
If you are using PortPy for your radiotherapy research, you can apply RMR sparsification by simply adding the following lines of code. For more details, see Sparse-Only Jupyter Notebook.
from compress_rtp.utils.get_sparse_only import get_sparse_only
# Apply RMR sparsification to the matrix A
S = get_sparse_only(matrix=A, threshold_perc=10, compression='rmr')
# Replace the original matrix A with the sparsified matrix S
inf_matrix.A = S
The rows of matrix
Figure Explanation: The low-rank nature of matrix
The matrix
Subject to
Decomposing a matrix into the sum of a sparse matrix and a low-rank matrix has found numerous applications in fields such as computer vision, medical imaging, and statistics. Historically, this structure has been employed as a form of prior knowledge to recover objects of interest that manifest themselves in either the sparse or low-rank components. However, the application presented here represents a novel departure from conventional uses of sparse-plus-low-rank decomposition. Unlike traditional settings where specific components (sparse or low-rank) hold intrinsic importance, our primary goal is not to isolate or interpret these structures. Instead, we leverage them for computationally efficient matrix representation. In this case, the structure serves purely as a tool for optimizing computational efficiency while maintaining data integrity.
Note: Both sparse-only and sparse-plus-low-rank compression techniques serve the same purpose. We are currently investigating the strengths and weaknesses of each technique and their potential combination. Stay tuned for more results.
Implementation in PortPy:
In PortPy, you can apply the sparse-plus-low-rank compression using the following lines of code. Unlike the sparse-only compression using RMR, which did not require any changes other than replacing
from compress_rtp.utils.get_sparse_plus_low_rank import get_sparse_plus_low_rank
S, H, W = get_sparse_plus_low_rank(A=A, threshold_perc=1, rank=5)
The fluence smoothness required for efficient and accurate plan delivery is typically achieved by adding an additional "regularization" term to the objective function. This term measures local variations in adjacent beamlets to discourage fluctuating beamlet intensities. However, a significant limitation of this method is its focus on local complexity within each beam—it assesses variations between adjacent beamlets but overlooks the global complexity of the entire plan. Another challenge is that achieving an optimal balance between plan complexity and dosimetric quality requires careful fine-tuning of the importance weight associated with the smoothness term in the objective function.
To address these challenges, we treat the intensity map of each beam as a 2D image and represent it using wavelets corresponding to low-frequency changes. The compressed representation of fluence using low-frequency wavelets induces built-in local and global smoothness that can be achieved without any hyperparameter fine-tuning. This approach can be easily incorporated into the optimization by adding a set of linear constraints in the form of
Figure Explanation: As illustrated in the figure above, the treatment plan achieved using wavelet compression is not only more conformal to the tumor but also less complex. This is evidenced by a smaller duty cycle compared to the plan achieved by adding only a regularization term to the objective function.
Implementation in PortPy:
In PortPy, you can incorporate wavelet smoothness by adding the following lines of code. For detailed explanation, see Wavelet Jupyter Notebook.
from compress_rtp.utils.get_low_dim_basis import get_low_dim_basis
# Generate the matrix W of low-frequency wavelets
W = get_low_dim_basis(inf_matrix=inf_matrix, compression='wavelet')
# Add the variable y
y = cp.Variable(W.shape[1])
# Add the constraint Wy = x
opt.constraints += [W @ y == opt.vars['x']]
Name | Institution |
---|---|
Mojtaba Tefagh | University of Edinburgh, Scotland |
Gourav Jhanwar | Memorial Sloan Kettering Cancer Center |
Masoud Zarepisheh | Memorial Sloan Kettering Cancer Center |
CompressRTP code is distributed under Apache License 2.0 with Commons Clause, and is available for non-commercial academic purposes.
@article{Adeli2024Randomized,
title={Randomized Sparse Matrix Compression for
Large-Scale Constrained Optimization in Cancer
Radiotherapy},
author={Adeli, Shima and Tefagh, Mojtaba and Jhanwar, Gourav and Zarepisheh, Masoud},
journal={accepted at NeurIPS},
year={2024}
}
@article{tefagh2023built,
title={Built-in wavelet-induced smoothness to reduce plan complexity in intensity modulated radiation therapy (IMRT)},
author={Tefagh, Mojtaba and Zarepisheh, Masoud},
journal={Physics in Medicine \& Biology},
volume={68},
number={6},
pages={065013},
year={2023},
publisher={IOP Publishing}
}
@article{tefagh2024compressed,
title={Compressed radiotherapy treatment planning (CompressRTP): A new paradigm for rapid and high-quality treatment planning optimization},
author={Tefagh, Mojtaba and Jhanwar, Gourav and Zarepisheh, Masoud},
journal={arXiv preprint arXiv:2410.00756},
year={2024}
}