liveBook · Manning

Radiation toxicity

As explained in Applied Reinforcement Learning

Harmful tissue or organ injury caused by radiation exposure.

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

How Applied Reinforcement Learning covers it

How deep it goes
Implements dose-limit penalties and overdose checks in a simulation without directly modeling tissue injury.
Examples
Uses a 30-fraction simulation with a 70 Gy tumor target and four organs at risk.
What you can do after
Evaluate how a simulated treatment policy balances tumor dose against organ-dose violations.
How it connects
Connects radiation toxicity with fractionated radiotherapy, dose limits, reinforcement learning, and reward signals.

This explainer was generated by Manning's knowledge graph from the text of Applied Reinforcement Learning. The section links point to the parts of the book it draws on.