What is the best loss function for a Binary Segmentation problem with a class imbalance

Hi Mahammad!

In what sense did they not “work well?”

This post suggests using BCEWithLogitsLoss together with its
pos_weight constructor argument, possibly augmented with something
like (a differentiable version of) the Dice coefficient (if you can show that
it actually improves training and performance).

Have you tried that yet?


K. Frank