Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Semantic Segmentation Loss functions

Does it make sense to combine cross-entropy loss and dice-score in a weighted fashion for a binary segmentation problem ?

Optimizing the dice-score produces over segmented regions, while cross entropy loss produces under-segmented regions for my application.

like image 484
HuckleberryFinn Avatar asked May 24 '18 20:05

HuckleberryFinn


1 Answers

I suppose there's no harm in combining the two losses as they are quite "orthogonal" to each other; while cross-entropy treats every pixel as an independent prediction, dice-score looks at the resulting mask in a more "holistic" way.
Moreover, considering the fact that these two losses yields significantly different masks, each with its own merits and errors, I suppose combining this complementary information should be beneficial.
Make sure you weight the losses such that the gradients from the two losses are roughly in the same scale so you can equally benefit from both.

If you make it work, I'd be interested to hear about your experiments and conclusions ;)

like image 189
Shai Avatar answered Jan 01 '23 20:01

Shai