Suppose  I have a ground-truth image with every pixel labeled as 0 or 1.And I want to train a CNN to produce a confidence map,which every pixel’s value varies from 0 to 1.if the pixel in ground-truth labeled as 1,its counterpart in output should be 1 or closed to 1(that’s why I call it confidence map)
I tried to treat it as a regression problem,so I setted the result to be a 1-channel output map and I used MSELoss.
But it seems failed after 1k epoches training.
1.jpg1544×516 47.4 KB

left:input,mid:ground-truth;right:output.
I want to know How to modify my loss function and the output of network to get a desirable result.Thx for ur help!