JunMa11 / SegLossOdyssey

A collection of loss functions for medical image segmentation
Apache License 2.0
3.81k stars 602 forks source link

Prediction Input Shape #24

Closed kirmans closed 3 years ago

kirmans commented 3 years ago

Hi @JunMa11,

I would like to ask if your prediction tensor in IoUloss and Diceloss consists of only 1 class. For multi-class segmentation can i use softmax function before the calculation of loss ? I am using different architecture than you so i don't know your input shape.

thanks

JunMa11 commented 3 years ago

Hi @kirmans ,

The direct answer is yes. The label is one-hot encoded.

Is your architecture based on nnU-Net? I tested all the loss functions with nnU-Net. If you use your own implementations, The dice loss implementation in monai is more flexible https://github.com/Project-MONAI/MONAI/blob/21a3c16fcba5f99a797ddc6e6595cdf2f18cdd57/monai/losses/dice.py#L25 .

Hope the answer can help you.

Best, Jun