You could try to use the multi-label approach with nn.BCEWithLogitsLoss, where your model output and target would have the shape [batch_size, nb_classes, height, width]. The target should have values in the range [0, 1], where a 1 in the nb_classes dimension denotes that this class is active in the current pixel location. This would also allow you to predict overlapping lanes.
Alternatively, a multi-class segmentation might also work, where you would use nn.CrossEntropyLoss with an output of [bathc_size, nb_classes, height, width]. The target would have the shape [batch_size, height, width] and contain values in the range [0, nb_classes-1].
I’m not sure which approach would work best.
I think the post-processing of your current might work quite well, as your use case is not really a multi-class or multi-label approach.