The general approach of using nn.BCEWithLogitsLoss sounds reasonable for a multi-label segmentation, where each pixel might belong to more than a single class.
You could pass the pos_weight argument, but note that it’s defined as nb_negative/nb_positive. I’m not sure, if your current weights are calculates in this way.