-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New Feature: Dice Loss #6435
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
Comments
@oke-aditya Just wanted to follow up on this. Is this a feature you still intend to build? Thanks! |
yes once I finish swin transformer 3d over the weekend. Next would be this. |
That's awesome! I didn't know you were prioritizing Swin 3d. Sounds awesome! No rush! |
Could I give it a try? Seems like a good issue to start with. |
Thank you @oke-aditya! |
Well I was originally thinking dice loss is binary classification for semantic segmentation models. Where you want to separate background and the object. I think our semantic segmentation models output is a logit score for each pixel belong to a class. In a sense semantic segmentation models are not multi class. They distinguish object vs background. A multi class case can be combined and handled with binary classification loss. You can do one vs rest, for each class and combine the losses. My reference implementation Additionally Read for discussion with multi class dice loss. cc @datumbox as he has great experience in semantic segmentation models and he can tell you definite answer. |
Ahh alright, shouldn't be too hard to add binary dice loss. In the discussion here - pytorch/pytorch#1249 (comment) there were mentions of multiclass dice loss, also I think Kornia supports multiclass dice loss. So just wanted to confirm once. |
🚀 The feature
Followup to #6323
Addition of Dice Loss to torchvision.
Motivation, pitch
Mainly Dice loss is used for semantic segmentation.
I want to understand the technical aspects of adding it to torchvision. Are we going to support boolean tensors or outputs from the semantic segmentation models?
Few references.
pytorch/pytorch#1249 (comment)
https://github.com/rogertrullo/pytorch/blob/rogertrullo-dice_loss/torch/nn/functional.py#L708
MONOAI
https://docs.monai.io/en/stable/_modules/monai/losses/dice.html#DiceLoss
https://kornia.readthedocs.io/en/latest/_modules/kornia/losses/dice.html#dice_loss
Alternatives
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: