Write Dice loss and its role in segmentation.
mediumAnswer
- Dice = 1 - 2 * |P ∩ G| / — 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|/ — 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
- How does YOLO / SSD / RetinaNet differ from two-stage detection?
- Why is U-Net so popular for segmentation?
- How does Mask R-CNN extend Faster R-CNN for instance segmentation?
- What is a Feature Pyramid Network (FPN)?
- Explain focal loss and why it's used in dense detection.
- What are IoU / Jaccard and Tversky losses?