aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.37k stars 647 forks source link

Why dice smoothing only applied in denominator? #610

Open fiskrt opened 1 year ago

fiskrt commented 1 year ago

Hi, is there a reason why the dice smoothing is only applied in the denominator:

https://github.com/aim-uofa/AdelaiDet/blob/f60e856dcf3bc8ac5c023e14caa7551c93df3c63/adet/modeling/condinst/dynamic_mask_head.py#L57-L58

and not like loss = 1. - ((2 * intersection + eps) / (union + eps))

This causes all zero-input predictions to always maximize the loss even if it's completely correct.