Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the code for DiceFocal loss? #16

Closed
aviadpinis opened this issue Nov 18, 2020 · 2 comments
Closed

Where is the code for DiceFocal loss? #16

aviadpinis opened this issue Nov 18, 2020 · 2 comments

Comments

@aviadpinis
Copy link

Hello, it's amazing repository thank you for share your code,

I have two questions:

I try to use in DiceTopK loss function and i not sure that I understood that parameters to use correctly in this loss function,
what is meaning in this paramaters:

  • batch_dice,
  • do_bg.

I would be very happy if you could explain them to me?

Also i search in your code for implementation for DiceFocal and i I can not find, Can you please direct me to link?

Thank you very much,
Aviad

@JunMa11
Copy link
Owner

JunMa11 commented Dec 14, 2020

Hi @aviadpinis ,

Sorry for my late reply.

  • batch_dice: treats the minibatch as a pseudo-volume and computes the Dice loss as if all voxels in the samples belonged to one training case.

A counterpart is

  • sample_dice: computes the dice loss for each sample in the minibatch independently and averages across the minibatch

  • do_bg: whether compute the background loss;

DiceFocal is the simple summation between Dice loss and Focal loss.

https://github.com/JunMa11/SegLoss/blob/bea91a4e72c78fe63335fe9333d6659489ceb1b4/test/loss_functions/dice_loss.py#L499

@JunMa11 JunMa11 closed this as completed Dec 17, 2020
@aviadpinis
Copy link
Author

Thank you,
you helped me a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants