Papers
Topics
Authors
Recent
Search
2000 character limit reached

DSM Dice: Dual-Sampling Modulated Dice Loss

Updated 23 June 2026
  • The paper introduces DSM Dice, a dual-sampling loss that adaptively modulates Dice loss to balance segmentation of large and small exudates.
  • It employs a dual-branch framework with uniform and re-balanced sampling alongside a quadratic decay schedule to improve sensitivity and precision.
  • State-of-the-art results on the DDR dataset demonstrate significant improvements in IoU and AUPR compared to single-branch segmentation approaches.

Dual-sampling Modulated Dice Loss (DSM Dice) is a segmentation loss formulation designed to address the challenges of extremely unbalanced and size-variable object segmentation, specifically in the context of hard exudate segmentation from color fundus images. DSM Dice introduces a dual-branch learning framework and enforces adaptive, epoch-wise modulation between two branches biased toward large and small exudates, respectively. The approach combines uniform and re-balanced pixel sampling in the Dice loss, allowing for simultaneous optimization of both high sensitivity to small lesions and high precision on large lesions (Liu et al., 2020).

1. Mathematical Formulation

DSM Dice defines three central loss terms involving soft segmentation predictions Y^∈[0,1]H×W\hat{Y} \in [0,1]^{H \times W} and binary masks Y∈{0,1}H×WY \in \{0,1\}^{H \times W}, using pixel multisets U\mathcal{U} (uniform sampled) and R\mathcal{R} (re-balanced sampled), each of cardinality N=H⋅WN = H \cdot W. For any multiset S\mathcal{S}, the Dice score is defined as:

DSC(Y^[S],Y[S])=2⋅∑i∈Sy^iyi∑i∈Sy^i+∑i∈Syi\mathrm{DSC}(\hat Y[\mathcal{S}], Y[\mathcal{S}]) = \frac{2 \cdot \sum_{i \in \mathcal{S}} \hat y_i y_i}{\sum_{i \in \mathcal{S}} \hat y_i + \sum_{i \in \mathcal{S}} y_i}

with loss Ldice(S)=1−DSC(Y^[S],Y[S])L_{\mathrm{dice}}(\mathcal{S}) = 1 - \mathrm{DSC}(\hat Y[\mathcal{S}], Y[\mathcal{S}]).

(1) Uniform-sampling Dice loss:

Ldice(u)=1−2∑i∈Uy^iyi∑i∈Uy^i+∑i∈UyiL_{\mathrm{dice}}^{(u)} = 1 - \frac{2 \sum_{i \in \mathcal{U}} \hat y_i y_i}{\sum_{i \in \mathcal{U}} \hat y_i + \sum_{i \in \mathcal{U}} y_i}

(2) Re-balanced-sampling Dice loss:

Given N1N_1 exudate pixels and Y∈{0,1}H×WY \in \{0,1\}^{H \times W}0 background pixels per batch, sampled with replacement,

Y∈{0,1}H×WY \in \{0,1\}^{H \times W}1

(3) Final modulated loss:

With epoch-dependent mixing coefficient Y∈{0,1}H×WY \in \{0,1\}^{H \times W}2,

Y∈{0,1}H×WY \in \{0,1\}^{H \times W}3

Y∈{0,1}H×WY \in \{0,1\}^{H \times W}4 is introduced to denominators for numerical stability.

2. Pixel Sampling Schemes

DSM Dice loss employs two distinct multiset-based sampling distributions per image for Dice loss computation:

  • Uniform sampler: Each of the Y∈{0,1}H×WY \in \{0,1\}^{H \times W}5 pixel indices in Y∈{0,1}H×WY \in \{0,1\}^{H \times W}6 is drawn independently with probability Y∈{0,1}H×WY \in \{0,1\}^{H \times W}7 from Y∈{0,1}H×WY \in \{0,1\}^{H \times W}8, disregarding class balance.
  • Re-balanced sampler: The sampling rate Y∈{0,1}H×WY \in \{0,1\}^{H \times W}9 governs the ratio of exudate to background pixels. For U\mathcal{U}0 and U\mathcal{U}1, for U\mathcal{U}2,
    • Each exudate pixel U\mathcal{U}3 is sampled with U\mathcal{U}4,
    • Each background pixel U\mathcal{U}5 is sampled with U\mathcal{U}6,
    • U\mathcal{U}7 is drawn i.i.d. according to these weights.

The uniform scheme biases optimization toward large exudates (due to prevalence in pixel count), while the re-balanced scheme compensates for the under-representation of small exudates.

3. Easy-to-Difficult Modulation Schedule

DSM Dice transitions the learning focus from predominantly large exudate segmentation to improved sensitivity for small exudates by applying a quadratic decay schedule to the mixing coefficient:

U\mathcal{U}8

with U\mathcal{U}9 the current epoch and R\mathcal{R}0 the total training epochs. At epoch R\mathcal{R}1, full emphasis is on the uniform loss, favoring large exudates. As training progresses, increasing weight is given to the re-balanced loss, prioritizing small-exudate segmentation.

4. Training Workflow and Pseudocode

Training is conducted with a dual-branch network sharing feature extraction, with each branch paired to a respective sampling and loss computation:

N=Hâ‹…WN = H \cdot W7 Here, the uniform branch specializes in detection of large exudates, while the re-balanced branch improves sensitivity to small exudates through targeted sampling.

5. Hyper-parameter Configuration and Implementation Guidelines

Key parameters and procedural aspects influencing DSM Dice efficacy include:

  • Sample-rate R\mathcal{R}2: The fraction of exudate pixels in the re-balanced sampler. Empirical ablation (Table 1) identifies R\mathcal{R}3 as optimal, with R\mathcal{R}4 or R\mathcal{R}5 degenerating to single-branch training.
  • Epochs R\mathcal{R}6: Controls the speed of modulation from large- to small-exudate bias. Quadratic decay for R\mathcal{R}7 is smoother than linear.
  • Numerical stabilization: Inclusion of a small constant R\mathcal{R}8 in denominators.
  • Optimization: Uses standard practices, such as polynomial-decay learning rates and SGD.

A summary of key settings is provided below:

Parameter Recommended Value/Practice Effect
Sample-rate R\mathcal{R}9 0.5 Balances large- and small-lesion learning
Decay schedule N=Hâ‹…WN = H \cdot W0 Smooth transition; favors late sensitivity
N=Hâ‹…WN = H \cdot W1 N=Hâ‹…WN = H \cdot W2 Stabilizes denominator in Dice computation
Optimizer config Poly-LR decay, SGD Standard segmentation settings

6. Ablation Studies and Comparative Impact

DSM Dice loss was benchmarked on the public DDR dataset using dual-PSPNet architectures. Core findings include:

  • Sample-rate effect:
    • N=Hâ‹…WN = H \cdot W3: IoU=0.4069, AUPR=0.5468
    • N=Hâ‹…WN = H \cdot W4: IoU=0.4103, AUPR=0.5587 (optimal)
    • N=Hâ‹…WN = H \cdot W5: IoU=0.4068, AUPR=0.5491
    • N=Hâ‹…WN = H \cdot W6 as inverse frequency: IoU=0.3898, AUPR=0.5202
  • Branch comparisons:
    • Single-branch Dice (uniform only) under-segments small exudates.
    • Single-branch CBCE loss over-segments background.
    • Dual-branch + DSM yields high sensitivity for small lesions, high precision for large lesions.
    • Dual-PSPNet with DSM: IoU increases from 0.3822 (single Dice) to 0.4103; AUPR from 0.4730 to 0.5587.
    • Region-level F-score (σ=0.5): single PSPNet+Dice 0.6954, dual-PSPNet+DSM 0.7543.

These results demonstrate that DSM Dice achieves state-of-the-art performance by leveraging branch-specialized optimization and adaptive loss modulation, benefiting both pixel- and region-level segmentation (Liu et al., 2020).

7. Context and Significance in Medical Image Segmentation

DSM Dice was introduced to address the fundamental limitation of uniform pixel-wise Dice loss, which under-weights small but clinically important patterns in heavily imbalanced segmentation tasks. The dual-branch, dual-sampling structure, combined with an easy-to-difficult modulation schedule, enables more robust recognition across object scales, particularly improving detection of small pathologies such as micro-lesions. This approach can be generalized to other segmentation contexts characterized by similar class imbalance and object size variance, where standard losses may fail to capture rare or subtle structures effectively.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Dual-sampling Modulated Dice Loss (DSM Dice).