Voxel Histogram Loss in Radiotherapy
- Voxel histogram-based loss is defined to optimize deep learning predictions by aligning with dose–volume histogram criteria such as percentile doses and fraction constraints.
- It leverages differentiable surrogates for quantile and volumetric metrics, ensuring clinically compliant target coverage and organ-at-risk sparing.
- The approach integrates lossless bit-mask ROI encoding for computational efficiency, demonstrating significant improvements in clinical plan performance.
A voxel histogram-based loss is an objective function for supervised deep learning that directly optimizes histogram-derived metrics of a volumetric prediction, such as dose–volume histogram (DVH) criteria in radiotherapy dose planning. Unlike conventional voxel-wise regression losses (e.g., MAE), which lack alignment with clinical or evaluation objectives based on histogram-derived summary statistics, these loss functions enforce compliance with integral properties—percentile doses, fraction-of-volume constraints, and quantile doses—by operating on the spatial histogram of the predicted volume. Clinical use cases have shown that histogram-based losses can substantially improve compliance with target coverage and organ-at-risk constraints relative to traditional supervision.
1. Differentiable D-Metrics and Surrogate V-Metrics
The formulation begins with a predicted 3D dose distribution on a voxel grid and binary region-of-interest (ROI) masks for each structure . For each ROI, the per-voxel dose values are sorted in descending order (), with .
D-metrics include quantile-based and volume-based dose summaries:
- Quantile-based minimum dose (): , where
- Minimum dose in hottest 0 cc (1): 2, 3
- Maximum/minimum dose (4): 5
- Mean dose (6): 7
Modern deep learning frameworks (e.g., PyTorch’s top-k) allow differentiation through index-gathering operations to maintain end-to-end gradients through these metrics.
V-metrics (fractional volume above threshold) are approximated by sigmoidal surrogates to permit gradient-based optimization. For 8, where 9 is the Heaviside function and 0 a dose threshold, one substitutes 1 with 2. The resulting differentiable surrogate is
3
Selecting 4 to control surrogate error uses dose margin 5 and tolerance 6 to yield
7
where 8 is the fraction 9. In practice, 0 Gy and 1 yield 2 for PTV3 and 4 for PTV5 (Gao et al., 31 Mar 2026).
2. Combined Clinical DVH Metric Loss Formulation
The Clinical DVH Metric (CDM) loss is designed to optimize clinically relevant histogram metrics for each ROI. Clinical targets and constraints for each structure 6 are encoded as a set of metrics 7 using a template (e.g., JSON). For metric 8, with predicted and reference values 9 and 0, and weight 1:
2
where 3 is the set of ROIs. To maintain voxel-wise dose fidelity, a global mean-absolute-error term is included:
4
The final loss:
5
Typical settings: 6, 7; 8 for planning target volume (PTV) constraints, 9 for organs-at-risk (OAR).
3. Lossless Bit-Mask ROI Encoding for Efficient Training
Complex radiotherapy scenarios may have 20+ overlapping ROIs per case; conventional one-hot ROI masking is memory-intensive. All binary masks 0 are losslessly packed into a single 32-bit integer per voxel:
1
CPU-side preprocessing loops over voxels, bitwise-ORs ROI channels into 2. GPU-side, individual ROIs are decoded on demand with bitmasking. This scheme enables:
- Single-channel ROI input (vs 3 channels)
- 5× faster CPU-side preprocessing
- 80% reduction in CPU-to-GPU data transfer overhead
- 4.5% reduction in peak GPU memory usage These efficiency improvements enable training at full volumetric resolution and support complex ROI geometries.
4. Experimental Protocol and Quantitative Outcomes
Gao et al. (Gao et al., 31 Mar 2026) evaluated the CDM loss on 174 head-and-neck VMAT patients (n=137 train, n=37 test, Feb 2021–Jul 2025). CT was resampled to 4 mm5, cropped, intensity-normalized, and dose was normalized to 70 Gy. A 3D U-Net with InstanceNorm and bf16 precision served as the baseline architecture. Training used AdamW optimizer (lr=6, cosine-annealing, 1000 epochs, batch size 1, NVIDIA RTX 6000 Ada GPU).
Loss function comparison demonstrated:
| Loss Function | PTV Score (%) | OAR Score (Gy) | Dose Score (Gy) |
|---|---|---|---|
| MAE only | 1.544 ± 1.188 | 2.103 ± 0.704 | 1.300 ± 0.229 |
| MAE + DVH-curve | 0.992 ± 0.466 | 2.162 ± 0.518 | 1.385 ± 0.217 |
| MAE + DVH + CDM | 0.567 ± 0.300 | 1.933 ± 0.481 | 1.389 ± 0.228 |
| MAE + CDM | 0.491 ± 0.250 | 1.999 ± 0.497 | 1.370 ± 0.245 |
Only MAE+CDM satisfied all PTV 7 and 8 constraints on all test cases.
Bit-mask encoding reduced GPU memory from 20.50 GB to 19.57 GB (–4.5%) and per-epoch time from 241 s to 43 s (–82.2%).
Across architectures (with MAE+CDM loss), PTV Score ranged between 0.491% (3D U-Net, Pyfer, MedNeXt) and 0.699% (SwinUNETR).
5. Alignment with Clinical Evaluation Criteria
Empirical results demonstrate that voxel-wise MAE alone optimizes average-dose metrics (Dose Score=1.3 Gy) but does not ensure clinical coverage: PTV Score=1.544%, with mandatory 9 constraints violated in ≈20% of cases. DVH-curve losses reduce PTV Score to 0.992% but still fail constraints in ≈10% of patients. Directly optimizing DVH-derived D- and V-metrics with CDM loss achieves PTV Score=0.491%, meets all coverage/OAR constraints, and matches clinical plan performance.
This underscores that clinical acceptability is determined by integral dose–volume histogram features, not simply voxel-wise similarity. Optimizing objectives aligned with evaluation metrics produces compliant plans even for relatively simple model architectures.
6. Generalization and Applications Beyond Radiotherapy
While the presented framework is validated for head-and-neck radiotherapy, Gao et al. note that the CDM approach is template-driven and readily extendable to other anatomical sites (pelvis, lung) with edit to the clinical-criteria JSON. More broadly, any application requiring control over voxel histogram properties—such as segmentation tasks with class-volume constraints or quantitative image analysis—may benefit from differentiable histogram-based losses.
A plausible implication is that domains with evaluation metrics expressed as spatial quantiles or integrals may see substantial performance gains from histogram-supervised learning, in contrast to strictly voxel-wise losses.
7. Limitations and Prospects
Reported results are based on a single-institution cohort and clinical protocol; multi-institutional validation remains outstanding. Integration of CDM-based dose predictors with downstream decision modules (e.g., dose-mimicking, plan deliverability) is an open area. The current framework’s efficiency and flexibility derive from its template-driven, lossless encoding and modularity, suggesting it is well suited for extension to broader volumetric prediction problems involving histogram constraints (Gao et al., 31 Mar 2026).