Source-linked AI summary
Boundary loss for highly unbalanced segmentation
Hoel Kervadec, Jihene Bouchtiba, Christian Desrosiers, Eric Granger, Jose Dolz, Ismail Ben Ayed
TL;DR
Highly unbalanced segmentation makes regional losses difficult to optimize because class contributions can differ greatly and destabilize training. The paper rewrites a contour-distance objective as a softmax-based regional integral, then combines it with regional losses; experiments report improved performance and stability across two challenging datasets. The method nevertheless requires a regional loss to avoid trivial near-local minima, while competing Hausdorff-based losses incur substantial recomputation and memory costs.
Problem
Highly unbalanced segmentation can make regional-loss terms differ by several orders of magnitude, causing unstable training and majority-class bias.
Method
The paper expresses a non-symmetric L2 contour distance as a regional integral over ground-truth boundary distances and softmax outputs, enabling combination with regional losses.
Results
Experiments on ISLES and WMH report more stable learning and significant Dice and Hausdorff-score gains, with consistent improvements and a large margin on one dataset.
Takeaways & Limitations
Boundary loss provides complementary boundary information while remaining compatible with standard regional losses and existing N-D segmentation architectures.
Takeaways & Limitations
The boundary loss should be combined with a regional loss to avoid trivial near-local minima, while Hausdorff-based comparison losses require costly per-epoch distance recomputation and whole-volume memory.
Abstract
from arXiv · showhide
Widely used loss functions for CNN segmentation, e.g., Dice or cross-entropy, are based on integrals over the segmentation regions. Unfortunately, for highly unbalanced segmentations, such regional summations have values that differ by several orders of magnitude across classes, which affects training performance and stability. We propose a boundary loss, which takes the form of a distance metric on the space of contours, not regions. This can mitigate the difficulties of highly unbalanced problems because it uses integrals over the interface between regions instead of unbalanced integrals over the regions. Furthermore, a boundary loss complements regional information. Inspired by graph-based optimization techniques for computing active-contour flows, we express a non-symmetric $L_2$ distance on the space of contours as a regional integral, which avoids completely local differential computations involving contour points. This yields a boundary loss expressed with the regional softmax probability outputs of the network, which can be easily combined with standard regional losses and implemented with any existing deep network architecture for N-D segmentation. We report comprehensive evaluations and comparisons on different unbalanced problems, showing that our boundary loss can yield significant increases in performances while improving training stability. Our code is publicly available: https://github.com/LIVIAETS/surface-loss .
1. Introduction
Regional losses such as cross-entropy and Dice become difficult to optimize when foreground and background sizes are highly unequal. The paper proposes a boundary loss that measures contours rather than regions and complements regional losses.
- Motivation: Highly unbalanced segmentations can make foreground and background terms differ by several orders of magnitude, affecting performance and training stability.In WMH segmentation, the foreground may be 500 times smaller than the background.
- Motivation: Cross-entropy can produce unstable training and decision boundaries biased toward majority classes when infrequent-label gradients are noisy.Increasing the class weight can amplify this noise and further destabilize optimization.
- Motivation: Regional Dice losses can still struggle with very small structures because misclassified pixels may cause large loss changes and unstable optimization.Generalized Dice improves on cross-entropy but remains a regional formulation.
- Contribution: The proposed boundary loss measures a distance on contours and integrates over region interfaces instead of using unbalanced regional integrals.It is intended to mitigate difficulties in highly unbalanced segmentation while providing information complementary to regional losses.
- Contribution: A non-symmetric L2 contour distance is rewritten as a regional integral, yielding a loss that is linear in softmax outputs and compatible with existing N-D architectures.This formulation avoids local differential computations involving contour points and can be combined with standard regional losses.
- Results: Evaluations on ISLES and WMH show more stable learning and significant gains in Dice and Hausdorff scores when boundary loss is combined with regional losses.The conclusion reports consistent improvements, including a large margin on one dataset.
2. Formulation
The formulation converts a contour-distance objective into a regional integral weighted by ground-truth boundary distance. Replacing binary region indicators with softmax probabilities produces a practical boundary loss that is best combined with a regional loss.
- Regional formulation: Regional segmentation losses integrate functions of softmax outputs over foreground and background regions.Cross-entropy uses f = -log(·), while generalized Dice uses regional integrals with f = 1 and normalization.
- Setting: The formulation is presented for two-region segmentation and extends straightforwardly to the multi-region case.
- Contour distance: The method represents boundary change using a non-symmetric L2 distance between nearby contours and an integral approximation over the region between them.The integral approximation avoids completely local differential computations involving contour points.
- Boundary loss: Replacing the binary indicator of the predicted region with softmax probabilities yields a boundary loss that approximates the distance between ground-truth and predicted boundaries.The ground-truth level-set function is pre-computed from the ground-truth region.
- Combined objective: The boundary loss can be combined with a regional loss and implemented in existing deep architectures, with α balancing the two terms.
- Boundary weighting: The boundary loss weights softmax predictions by distance to the ground-truth boundary, unlike regional losses that treat points within a region equally.
- Optimization: A regional loss is important early in training because an almost-empty foreground produces very low boundary-loss gradients and can form a trivial near-local minimum or saddle point.The regional term guides the first epochs, while the boundary term can become dominant later.
3. Experiments
The experiments evaluate boundary loss alongside different regional losses on two challenging, highly unbalanced brain-lesion segmentation tasks. The study also examines how to select and schedule the loss-balancing weight.
- Experimental design: The experiments compare boundary loss integrated with different regional losses and study strategies for selecting and scheduling α.The goal is to assess both performance effects and default weighting choices.
- Datasets: The evaluation uses two challenging brain-lesion segmentation tasks with highly unbalanced classes.The selected tasks are ISLES and WMH.
- ISLES: The ISLES training dataset contains 94 multimodal ischemic-stroke scans, split into 74 training and 20 validation examples.Each scan includes diffusion, perfusion, and manual ground-truth segmentation data.
ISLES:.
The WMH dataset is identified as a public dataset used in the evaluation.
- Dataset: The White Matter Hyperintensities dataset is a public dataset used for evaluation.
WMH:.
Experiments on ISLES and WMH combine the proposed boundary loss with regional losses, compare alternatives, and examine computational cost and α scheduling. The boundary term generally improves segmentation, but joint training and appropriate scheduling are important for stability and performance.
- Experimental setup: The experiments evaluate GDL, distance-weighted cross-entropy, focal, and Hausdorff losses, including combinations with the proposed boundary loss.The study also examines 3D distance maps and strategies for selecting or scheduling α.
- Quantitative evaluation: 13% DSC improvement was obtained on ISLES over Generalized Dice alone, while improvement over UNet cross-entropy or focal loss alone was about 3%.The reported gains varied with task difficulty, with larger gains when regional terms struggled.
- 3D distance maps: Computing the distance map from the whole 3D volume gives about a 1% DSC boost, with a larger effect for WMH than ISLES.The difference is attributed to slice spacing and correlation, making 3D information less helpful for ISLES.
- Comparison with Hausdorff loss: Hausdorff loss improved ISLES performance by around 7% over GDL alone, but remained below boundary loss on ISLES and had similar performance on WMH.The comparison is dataset dependent.
- Joint-loss requirement: Using the boundary loss alone can collapse predictions into empty foreground regions, whereas combining it with a regional loss avoids this trivial solution.The regional term guides early training, after which the boundary weight can become dominant.
- Quantitative evaluation: The boundary loss generally improves performance and learning-curve convergence across regional-loss settings and both datasets.The gap versus regional loss alone is especially visible with GDL and is consistent for both metrics and datasets.
- Computational complexity: The boundary-loss term adds negligible computational complexity through an element-wise product, unlike Hausdorff loss, which slows training by around 10%.The computational burden of Hausdorff loss is expected to increase for multiclass problems.
- Selection of α: Increasing α improves performance only up to a point, while increasing or rebalancing α performs better than any constant α in the reported study.Performance decreases from α = 1.5 onward, and α = 2 approaches boundary-loss-alone behavior.
4. Conclusion and future works
The paper concludes that boundary loss can be combined with standard regional losses and existing architectures to address highly unbalanced segmentation, improving performance and training stability. It identifies spatial regularization and extension beyond binary segmentation as future directions.
- Boundary loss can be combined with standard regional losses and implemented with existing deep network architectures for N-D segmentation.
- Experiments on two challenging, highly unbalanced datasets showed consistent performance improvements, including a large margin on one dataset, with enhanced training stability.
- Future works: The boundary loss produced typically smoother contours than regional losses, suggesting a spatial regularization effect that was not fully investigated.
- Future works: The formulation and experiments were limited to binary segmentation, motivating extensions to multi-region problems with competing distance maps and topological constraints.