EasyDeepLearn

Write Dice loss and its role in segmentation.

medium

Answer

  • Dice = 1 - 2 * |P ∩ G| / (P  +  G)( \mid P \mid \; + \; \mid G \mid ) — one minus the Dice coefficient (F1 on binary masks).
  • Directly optimizes overlap between predicted and ground-truth masks.
  • Robust to foreground/background imbalance in medical images where the target is 1% of pixels.
  • Often combined with BCE (Dice + BCE, or Dice + focal) for stability and calibration.
Check yourself — multiple choice
  • Same as cross-entropy
  • 1 - 2·|P∩G|/(P+G)( \mid P \mid + \mid G \mid ) — direct overlap loss, robust to foreground/background imbalance in segmentation
  • Only for regression
  • Ignores intersection

Dice loss: overlap-based, robust to imbalance — standard in medical segmentation.

#losses#segmentation#computer-vision

Practise Deep Learning

214 interview questions in this topic.

Related questions