Abstract
Researchers have developed a new "Balance loss" function that simultaneously tackles the two biggest challenges in medical image segmentation: the massive size difference between organs and background (inter-class imbalance) and the difficulty gap between clear interiors and blurry boundaries (intra-class imbalance). By correcting a hidden mathematical bias in error calculation during training, this unified loss achieves state-of-the-art accuracy across diverse tasks without the tedious manual hyperparameter tuning required by traditional methods.
Introduction
In medical imaging, the "Region of Interest" (ROI)—such as a tiny tumor or a specific organ—often occupies less than 1% of the total image. This presents a classic inter-class imbalance problem: a model could achieve 99% accuracy by simply predicting "background" for every pixel, rendering it clinically useless.
Furthermore, pixels within a single class are not uniform in difficulty. The interior of an organ is typically easy to classify, whereas the edges are often blurry and "hard." This phenomenon is known as intra-class imbalance. Existing solutions, such as Weighted Cross Entropy (WCE) or Focal Loss, typically address one of these issues but struggle with the other. Moreover, these losses often rely on dataset-specific hyperparameters that fail to generalize. The authors identify a fundamental culprit: a discrepancy between how False Positives (FP) and False Negatives (FN) are calculated during training (using soft probabilities) versus testing (using hard binarized thresholds).
Proposed Method: The Balance Loss
The researchers propose a two-pronged approach combined into a single Balance loss:
- Inter-class Balance Loss (Inter-CBL): Rather than assigning static weights, Inter-CBL identifies the "hardest" background pixels—specifically, a number of background pixels equal to the number of foreground pixels ($f$). By giving these hard background samples the same weight as the foreground, the model is forced to ignore the "easy" background bulk that typically drowns out the signal.
- Intra-class Balance Loss (Intra-CBL): An evolution of the "TopK" loss, Intra-CBL dynamically adjusts weights. As training progresses and the model improves on easy pixels, their weight automatically decreases. This shifts focus to difficult boundaries without the instability often associated with discarding data.
The final Balance loss is a linear combination of these two components, utilized in a two-stage training strategy: starting with Intra-CBL to stabilize the model, then switching to the full unified loss upon convergence.
Key Insights: The Soft vs. Hard Bias
A significant contribution of this work is the identification of the "Soft vs. Hard" bias. Inter-class imbalance does more than just obscure the minority class; it creates a mathematical bias. Because the background is so large, the sum of many tiny "soft" probabilities during training creates a massive False Positive value. This value does not exist when the image is binarized (thresholded) during testing.
The authors argue that the magnitude of this bias is tied to the absolute difference in the number of pixels between classes, rather than just their ratio. This explains why traditional weighting methods often fail to generalize across different organ sizes. Unlike TopK loss, which can cause model collapse, Intra-CBL maintains robustness by re-weighting all samples rather than discarding them.
Experimental Evaluation and Results
The method was evaluated on five distinct segmentation tasks across four public datasets: NIH Pancreas (high imbalance), KiTS19 (Kidney & Tumor), CVC-ClinicDB (Polyp), and BUSI (Breast Tumor).
The Balance loss consistently outperformed standard losses like Cross-Entropy, Dice, Focal, and Tversky loss:
- Accuracy Boost: On the difficult Kidney Tumor task, the Balance loss achieved a 66.8 Dice Similarity Coefficient (DSC), significantly higher than the 59.8 achieved by standard Cross-Entropy.
- Robustness: On the CVC-ClinicDB dataset, where specialized losses often underperform, the Balance loss maintained its lead, demonstrating effectiveness across both slight and extreme imbalance.
- Qualitative Improvement: Visual results indicate that the Balance loss significantly reduces over-segmentation (false positives) and under-segmentation (false negatives), producing masks that closely follow ground truth boundaries.
Conclusion and Future Work
While the Balance loss offers a robust solution to class imbalance, some limitations remain. The current implementation requires a two-stage training strategy for stability, which the authors aim to simplify into a single-stage process. Additionally, the focus has been primarily on binary segmentation; extending this logic to multi-class scenarios is a planned next step. Finally, while more robust than previous methods, the loss still utilizes a weighting parameter $\alpha$ to balance its components, though a default of 0.5 has proven effective across most cases.
Summary updated