V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation

What is the formula for the dice loss used in segmentation tasks?


Ldice=12ABA+B\mathcal{L}_{dice} = 1 - \frac{2 \cdot |A \cap B|}{|A| + |B|}Where AA and BB are the ground truth and predicted mask.

In PyTorch this can be implemented as:

def dice_loss(input, target):

smooth = 1.

iflat = input.view(-1)

tflat = target.view(-1)

intersection = (iflat * tflat).sum()



return 1 - ((2. * intersection + smooth) /

          (iflat.sum() + tflat.sum() + smooth))

Machine Learning Research Flashcards is a collection of flashcards associated with scientific research papers in the field of machine learning. Best used with Anki or Obsidian. Edit MLRF on GitHub.