I am currently working on implementing a weighted binary crossentropy loss function as described in the U-Net paper
def weighted_pixelwise_crossentropy(self, wmap): def loss(y_true, y_pred): return losses.binary_crossentropy(y_true, y_pred) * wmap return loss
Same as in the paper, wmap contains both a weight map for class balancing as well as a weight map to highlight object borders. In the images I use for training, for 1 foreground pixel there are roughly 30 background pixels, so I would have assumed using a weight map should have improved the training and validation accuracy. But I get roughly the same results as when not using any weight map at all. Does anybody have any potential ideas why this might be the case?