Hausdorff and IoU are stopped changing while dice metric is decreasing #1403
-
Hello everyone, and thanks for such a great framework. I need help using Hausdorff and IoU, where they stop learning when reaching a specific value! While the loss and dice metric keeps changing. surface_distance also has a problem since it is always equal to "inf". These are three measurements (it is the same for the following 30 epochs):
This is my code:
Inside testing part in each epoch:
Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
This warning is related to the surface distance problem. Could anyone suggest a solution: /usr/local/lib/python3.10/dist-packages/monai/metrics/surface_distance.py:163: UserWarning: the prediction of class 1 is all 0, this may result in nan/inf distance. |
Beta Was this translation helpful? Give feedback.
Hi @al3ms , Hausdorff Distance should be calculated on one-hot format predictions. In your case, after doing sigmoid activation, it may also need to use a threshold to do binarization on the predictions.
Can also check here:
https://github.com/Project-MONAI/MONAI/blob/30915adf6da70ac0dceacd9fc4afba6d0dce04a1/monai/metrics/hausdorff_distance.py#L154