Thank you very much! This was very helpful.
Given that I have much more background pixels than classes, I would initialize cross entropy loss as:
criterion = nn.CrossEntropyLoss(weight = tensor([0.3, 1, 1, 1])  to reduce the weight value of the background?
Thanks again! Life saver