I am currently tackling a semantic segmentation problem where, for each sample, my goal is to segment two masks corresponding to two objects. Notably, object two is typically located inside object one, and its size is significantly smaller. I am utilizing an encoder-decoder architecture, employing a single decoder that outputs two channels—one for each object mask.
Regarding the selection of the loss function, I am considering a hybrid approach that combines binary cross-entropy with the soft Dice loss function. I am uncertain whether to apply this hybrid loss function to the entire output (both channels simultaneously) or to compute the hybrid loss for each channel individually and then sum these individual losses.
Are the two approaches equivalent ? if not, are the two approaches valid ?