Universal Loss Reweighting to Balance Lesion Size Inequality in 3D Medical Image Segmentation

Boris Shirokikh, Alexey Shevtsov, Anvar Kurmukov, Alexandra Dalechina, Egor Krivov, Valery Kostjuchenko, Andrey Golanov, Mikhail Belyaev

TL;DR

This paper introduces inverse weighting (iw), a simple yet powerful loss function modification that tackles "size inequality" in 3D medical image segmentation. By assigning weights to voxels that are inversely proportional to the volume of the lesion they belong to, the authors significantly boost the detection of small, clinically critical lesions without sacrificing the segmentation quality of larger ones.

What Problem Does This Paper Address?

In medical imaging, not all targets are created equal. Deep learning models for segmentation face a "twofold" imbalance problem:

  1. Class Imbalance: There are vastly more "background" voxels than "lesion" voxels (often a 1000:1 ratio).
  2. Size Imbalance: Within the lesion class, a single large tumor might contain 50 times more voxels than a tiny nodule.

Standard loss functions like Binary Cross-Entropy (BCE) or Dice Loss are voxel-wise; they treat every voxel as equally important. Consequently, the network "ignores" small lesions because missing a 5-voxel nodule barely impacts the total loss compared to slightly miscalculating the boundary of a 500-voxel tumor. In clinical practice, however, missing a small metastasis can be a matter of life and death. While previous research has focused heavily on class imbalance, this paper specifically targets the neglected issue of size inequality.

Methods

The authors propose a Universal Loss Reweighting strategy. During training, they split the ground-truth labels into $K$ connected components (individual lesions) plus the background.

They calculate a weight $w_j$ for every voxel in a specific lesion $L_j$ using the formula: $$w_j = \frac{\sum_{k=0}^{K} |L_k|}{(K + 1) \cdot |L_j|}$$

The "Magic" of the Formula: * Inverse Proportionality: The weight is inversely proportional to the lesion's volume ($|L_j|$). A tiny lesion gets a massive weight, while a giant lesion gets a smaller one. * Equal Contribution: This math ensures that every single lesion—regardless of size—contributes approximately equally to the total loss. * Universality: This weighting can be "plugged into" almost any existing loss function. The authors demonstrate this with BCE, Focal Loss, Dice Loss, and Asymmetric Similarity Loss (ASL).

Datasets

The researchers validated their approach on three distinct 3D imaging tasks:

  • LUNA16: A public dataset of 816 CT scans for lung nodule detection.
  • LiTS: A public dataset of 131 CT scans for liver tumor segmentation.
  • Metastases (Private): A large dataset of 1,952 MRI scans for detecting multiple brain metastases.

These datasets are particularly challenging because they contain many small targets (e.g., lung nodules < 10mm or brain metastases < 5mm).

Key Insights and Ideas

  • Detection vs. Delineation: The authors distinguish between finding the lesion (detection) and drawing its boundaries (delineation). Standard Dice scores over-emphasize delineation of large objects.
  • The Object Dice Score: To get a fairer view, they use "Object Dice"—averaging the Dice score across unique lesions rather than voxels. This prevents large lesions from masking poor performance on small ones.
  • Class Imbalance vs. Size Imbalance: They show that popular methods like Weighted Cross-Entropy (WCE) and Generalized Dice Loss (GDL) only solve the class imbalance problem. They don't help the network distinguish between a few large lesions and many small ones.
  • Stability: Interestingly, Dice-based losses were found to be more stable than BCE-based losses when modified with inverse weighting, likely because Dice is inherently designed for segmentation tasks.

Key Results

The "inverse weighting" (iw) modification led to substantial gains in detection quality across the board:

  • Massive Recall Boost: On the LUNA16 dataset, adding inverse weighting to standard BCE increased the average object-wise recall from 0.42 to 0.67.
  • Small Lesion Performance: The most dramatic improvements were seen in the "small" category (the hardest targets).
  • State-of-the-Art Delineation: While the primary goal was better detection, the method maintained high-quality delineation (Object Dice) comparable to or better than standard state-of-the-art losses.
  • Outperforming GDL: Their method consistently outperformed the Generalized Dice Loss (GDL) in terms of detection recall across almost all scenarios.

Limitations and Future Work

  • Delineation Trade-off: On the LiTS dataset, the authors noted a slight decrease in delineation quality when using inverse weighting. They hypothesize this is a "side effect" of the model being forced to find much harder, noisier small cases, which brings down the average score.
  • Complexity of Pipelines: The study used a standard 3D U-Net. The authors suggest that future work should explore how this reweighting interacts with more complex, multi-stage detection pipelines.
  • Hyperparameter Sensitivity: While the weighting is "universal," some loss functions (like Focal Loss) have their own hyperparameters that might need re-tuning when inverse weighting is applied.

Summary updated

BibTeX
@inproceedings{shirokikh2020universal,
  author = {Boris Shirokikh and Alexey Shevtsov and Anvar Kurmukov and Alexandra Dalechina and Egor Krivov and Valery Kostjuchenko and Andrey Golanov and Mikhail Belyaev},
  title = {{Universal Loss Reweighting to Balance Lesion Size Inequality in 3D Medical Image Segmentation}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2020},
  url = {https://openreview.net/forum?id=J4qr9IOovXQ},
}
Figure