If your model only predicts the background class, the intersection part of the dice loss calculation would be zero and thus your dice loss should be high.
I don’t know if there is a clear way to add weighting to it, but you could try to combine the dice loss with e.g. nn.CrossEntropyLoss (and add weights there).