Skip to main content
TextGrad: Automatic "Differentiation" via TextMert Yuksekgonul et al.

G.2 Inner-loop optimization for treatment planning

We employ a two- loop optimization approach [109], which includes (i) an inner loop for inverse planning and (ii) an outer loop for optimizing the hyperparameters of the inner loop. The inner loop focuses on traditional fluence map optimization, seeking to determine the optimal fluence map xx by minimizing a cost function that combines multiple weighted objectives for various targets and organs at risk. This cost function is defined as:

min⁡∑t=1Ntwt([Kx]t−dt)2+∑s=1NswsΘ([Kx]s−ds)([Kx]s−ds)s.t.D95([Kx]t)=dt,x≥0,(26)\begin{array}{r l} & {\min \sum_{t = 1}^{N_{t}}w_{t}([K x]_{t} - d_{t})^{2} + \sum_{s = 1}^{N_{s}}w_{s}\Theta ([K x]_{s} - d_{s})([K x]_{s} - d_{s})}\\ & {\mathrm{s.t.} D_{95}([K x]_{t}) = d_{t},}\\ & {\qquad x\geq 0,} \end{array} \quad (26)

Here, {wt}t=1Nt\{w_{t}\}_{t = 1}^{N_{t}} and {ws}s=1Ns\{w_{s}\}_{s = 1}^{N_{s}} are the importance weights (the hyperparameters optimized by TEXTGRAD) that balance the various objectives for NtN_{t} PTV targets and NsN_{s} OARs, respectively. KK denotes the dose influence matrix, which specifies the dose per fluence unit delivered to each voxel in the volume by each beamlet. {dt}t=1Nt\{d_{t}\}_{t = 1}^{N_{t}} and {ds}s=1Ns\{d_{s}\}_{s = 1}^{N_{s}} are the scalar objective doses for each structure. The cost function essentially penalizes squared deviations from the target objective doses for the PTV targets and penalizes squared overdosing for the OARs only when doses exceed dsd_{s} . The Heaviside function Θ\Theta is used to ensure the objective considers only positive values. The minimization is constrained to positive xx values and ensures that D95D_{95} — the minimum dose received by 95%95\% of the structure volume — matches the prescribed dose for the clinical goal. We use matRad [65] with interior point algorithms to solve the inner-loop optimization.