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 by minimizing a cost function that combines multiple weighted objectives for various targets and organs at risk. This cost function is defined as:
Here, and are the importance weights (the hyperparameters optimized by TEXTGRAD) that balance the various objectives for PTV targets and OARs, respectively. denotes the dose influence matrix, which specifies the dose per fluence unit delivered to each voxel in the volume by each beamlet. and 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 . The Heaviside function is used to ensure the objective considers only positive values. The minimization is constrained to positive values and ensures that — the minimum dose received by 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.