-
Hi, I have the following code for training a UNETR 3D segmentation using a single class:
I was able to train it successfully (DSC=0.80) using two classes. Now I have merged all my classes into a single class and during training, the dice metric is stuck to 0.5 and it will not increase. I suppose the issue has to do with post_pred, post_label. (onehot or something there) when going from multi-class to single-class. Please let me know what I am doing wrong and how to fix this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
The code looks normal, I feel the post label and pred are correct:
I guess there is one class Dice is 1 and the other one is all 0, resulting Dice=0.5 all the time. Can you confirm the data and labels are correct after merging classes? |
Beta Was this translation helpful? Give feedback.
-
"It is strongly recommended to change include_background to False since there is no need to count background." -- For this to work, do I have to change some of the parameters like to_onehot to be one less than before, since the background is not counted, or do I leave it like it is? By the way, in this experiment, using two classes led to better results than using one class (DSC 0.83 vs 0.68). Increasing the feature_size to 32 and num_heads to 24 did produce a better result in both cases. |
Beta Was this translation helpful? Give feedback.
The code looks normal, I feel the post label and pred are correct:
I guess there is one class Dice is 1 and the other one is all 0, resulting Dice=0.5 all the time. Can you confirm the data and labels are correct after merging classes?