Paper commentary
Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations
Generalised Dice overlap works as a loss for highly unbalanced segmentations
- Problem Segmentation networks struggle when the target label is very rare, because the background dominates training. Common losses such as weighted cross-entropy and the Dice loss can then fail to train at all.
- Method The authors train with GDL v, a Generalised Dice loss that weights each label by its inverse squared volume. Unlike weighted cross-entropy, it scales the small foreground term up so the background does not drown it out.
- Results In 3D, GDL v reached a median DSC of 0.74 with HighResNet. WCE scored 0 at every setting.
Why rare foreground labels stall training
Brain tumors and white matter lesions occupy a very small share of a scan, so the foreground label is far rarer than the background. Such imbalance is known to destabilize segmentation methods that are otherwise well established. One response is to resample training patches, which risks losing variability, and another is to change the loss, which is the route this study takes.
The authors ask how three existing losses behave as the learning rate, patch size and imbalance change, in 2D and in 3D.
The imbalance is concrete in the experiments: training patches were kept only if they held at least one foreground voxel. Even so, the median foreground fraction of a 3D patch fell to 0.2% at worst. Table 1 shows the same pattern, with DeepMedic's imbalance ratio dropping to 0.002 at the largest patch with batch size 1. So the larger patches were the more unbalanced training sets, and that is the regime the study probes.
Weighting overlap by label volume
The key idea is to keep an overlap score in the Dice family but scale each label's terms by its volume, so the small foreground label is not drowned by the background. Crum et al. proposed the generalized overlap score for evaluation, and it had not been used to train discriminative models before this work. The authors propose it as a training loss for deep convolutional networks.
For reference voxel values r_ln and predicted probabilities p_ln, with label index l and voxel index n, the loss takes the following form. \[ \mathrm{GDL} = 1 - \frac{2\sum_{l=1}^{2} w_l \sum_{n} r_{ln}\,p_{ln}}{\sum_{l=1}^{2} w_l \sum_{n} \left(r_{ln} + p_{ln}\right)} \] In the GDL v variant, \( w_l = 1/\left(\sum_{n=1}^{N} r_{ln}\right)^2 \), so the large background term is down-weighted relative to the small foreground term.
The authors say this correction reduces the usual link between region size and Dice score.
The baselines each handle imbalance in a different way. WCE weights the foreground term by \( w = \frac{N - \sum_n p_n}{\sum_n p_n} \), which is built from the background and foreground probability masses. DL2 combines a foreground overlap term with a background overlap term, and an epsilon term guards against division by zero. SS weights squared errors on foreground and background voxels separately, with lambda set to 0.05 as suggested by Brosch et al.
Because the networks are trained with stochastic gradient descent, the gradient of GDL with respect to each predicted probability matters. The authors derive that gradient for the two-class case and note that it extends to more than two classes.
Networks and training grid
The authors reimplemented UNet and TwoPathCNN in TensorFlow for the 2D experiments. UNet is a U-shaped network with a downsampling path, an upsampling path and connections between them at each scale. TwoPathCNN runs a local and a global subnetwork in parallel and concatenates their features before a final fully connected layer.
The 3D experiments used DeepMedic, which trains a full-resolution pathway and a downsampled pathway in parallel. They also used HighResNet, a compact network with residual connections and dilated convolutions that keeps the input resolution throughout.
Three patch sizes, S, M and L, were paired with batch sizes of 5, 3 and 1, in that order. The networks were trained without data augmentation, so the comparison isolates the effect of the loss.
The 2D runs stopped after 1000 iterations and the 3D runs after 3000, which the authors judged enough for all metrics to converge. The 3D data are an in-house set of 524 subjects with age-related white matter hyperintensities. Each subject's T1-weighted, T2-weighted and FLAIR data were z-scored against the white matter intensity distribution.
The 2D networks were applied to BRATS, where the task is to localize healthy tissue and tumor.
Learning rate tolerance in 2D
The 2D results point to the learning rate as the main difference between the losses. This is the gap the authors point to when they say WCE and DL2 handle a fast learning rate poorly. The same cell shows a limit, because SS scored 0.77 (0.11), so SS was not uniformly worse.
The authors say the efficiency of SS depended more on the network than that of the other losses. Figure 1 summarizes medians over the last 200 iterations as isolines across learning rate and effective patch size. The authors read these isolines as showing the robustness of GDL v, and the isolines were linearly interpolated for display.
3D results under stronger imbalance
With HighResNet, WCE gave a median DSC of 0 (0) at every patch size and learning rate. The authors say WCE was unable to train under the stronger imbalance of the 3D setting.
So DL2 sits close to GDL v at that setting, and the larger gap is to SS.
The authors add that DL2 failed to train at higher rates. The large-patch rows at 10−3 don't fully support this, since DL2 scored 0.62 (0.18) and GDL v scored 0.49 (0.34) with HighResNet.
For DeepMedic the authors observe a strong dependence on hyperparameters, which they say made it agnostic to the choice of loss.
The authors observed that learning rate mattered more for small patches. The authors found 10−4 the best learning rate across the 3D cases.
Held-out test and one example
The final HighResNet model segmented the test data, and Figure 3 compares DSC across patch sizes and learning rates. WCE is left out of that comparison because it could not cope with the imbalance.
The authors describe GDL v as more robust than the other losses across experiments, with small variations for less unbalanced samples. Only the final HighResNet model was evaluated on this held-out set.
The authors say GDL v picks up punctate lesions better in that example.
Limitations
The 2D and 3D training runs had fixed budgets of 1000 and 3000 iterations. At 10−5 in 3D, the loss had no plateau after 3000 iterations, so those runs had not settled.
The 2D comparison uses BRATS alone, and the 3D comparison uses one in-house set of 524 subjects. Training used no augmentation, and only HighResNet was carried to the held-out test set.
The most unbalanced case in the study was a foreground-background ratio of 0.02% in 3D white matter lesions. The authors leave more extreme imbalance, such as lacunes and perivascular spaces at about 1/100000, to future work.
Paper info
- Authors
- Carole H Sudre, Wenqi Li, Tom Vercauteren, Sébastien Ourselin, M. Jorge Cardoso
- Venue
- arXiv · Preprint
- First published
- 2017-7-11
- Added
- 2026-11-12
- Updated
- 2017-7-14
- Version
- v3
- arXiv
- 1707.03237
- DOI
- 10.1007/978-3-319-67558-9_28
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Carole H Sudre, Wenqi Li, Tom Vercauteren, Sébastien Ourselin, M. Jorge Cardoso (2017). Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations. arXiv:1707.03237v3. https://doi.org/10.1007/978-3-319-67558-9_28
BibTeX
@article{sudre2017generalised,
title = {{Generalised Dice overlap as a deep learning loss function for highly unbalanced segmentations}},
author = {Carole H Sudre and Wenqi Li and Tom Vercauteren and Sébastien Ourselin and M. Jorge Cardoso},
year = {2017},
eprint = {1707.03237},
archivePrefix = {arXiv},
doi = {10.1007/978-3-319-67558-9_28},
url = {https://arxiv.org/abs/1707.03237v3}
}