mfcs:

But, in the case of Cross Entropy Loss…does it make sense for the target to be a matrix, in which the elements are the values ​​of the color bins (classes) that have the highest probability, that for each pixel and the CNN’s output to be a tensor with 313 layers , in which each pixel has a probability distribution? Would Cross Entropy Loss calculate the error correctly?


This sounds like a classical segmentation use case and should be possible.
Soft targets should also be possible to create using nn.KLDivLoss, and you should also be able to use one’s and zeros as the target values.