Dice for empty images?

Does every test image have kelp instances?
If not, what Dice do you use for empty predictions and empty GT, since it is not defined due to 0/0. Do you use 1 or 0 for such cases?

1 Like

@dmitryakonovalov Good questions. No, every test image does not have kelp instances. Dice is calculated for every positive pixel in the test set overall, rather than for each image and then averaged.

1 Like

Add small smoothing parameter to both denominator and enumerator, in that case you would have proper gradients even for empty images.