Radiation toxicity is harmful tissue or organ injury caused by radiation exposure. In radiotherapy, a beam aimed at a tumor can also deliver dose to nearby organs. Treatment must balance tumor control against the risk of exceeding those organs’ dose limits. section 8.4
Toxicity in a treatment simulation
A simulated treatment targets 70 Gy to a tumor over 30 fractions while tracking four organs at risk. Two have limits of 20 Gy and 15 Gy. Dose delivery and spillover vary, so the agent must adjust decisions as cumulative doses and tumor response change. section 8.4
The simulation uses dose-limit violations as a proxy for toxicity risk: its reward penalizes excess organ dose, weighted by organ risk. A separate failure check detects sufficiently large overdoses. These rules model the trade-off; they do not directly predict tissue injury. section 8.4
Listing 8.5 Computing the reward signal
def _compute_reward(
self,
dose_change: np.ndarray,
done: bool,
success: bool,
failure: bool,
prev_tumor_dose: float,
):
tumor_dose = self.cum_doses[0]
oar_doses = self.cum_doses[1:]
oar_limits = self.organ_limits[1:]
oar_risk = self.organ_risk_weights[1:]
prev_error = np.abs(prev_tumor_dose - self.target_dose) #A
curr_error = np.abs(tumor_dose - self.target_dose) #A
tumor_error = curr_error / self.target_dose #B
tumor_reward = -1.5 * tumor_error #B
if curr_error < prev_error: #C
direction_bonus = 0.3 #C
else:
direction_bonus = -0.15 #C
violations = np.maximum(0.0, oar_doses - oar_limits) #D
weighted_violations = violations * oar_risk #E
organ_penalty = -0.3 * np.sum(weighted_violations) #E
tumor_size_penalty = -0.4 * self.tumor_size #F
step_penalty = -self.step_cost #G
reward = (
tumor_reward
+ direction_bonus
+ organ_penalty
+ tumor_size_penalty
+ step_penalty
) #H
if done:
if success:
reward += 200.0 #I
if failure:
reward -= 200.0 #J
return float(reward)
The reward calculation shows how excess organ doses become a weighted penalty alongside tumor-related rewards and penalties. section 8.4
