Hi, everybody!
New pytorcher here. I am trying to implement a binary semantic segmentation approach using UNET.
To get myself started I took some code from this example. 3
My dataset contains some 250 images and I used rotations to expand that to nearly 1000.
Here is an example of my images and targets:
target mask|537x252 5
Now when I train the model two odd things happen:

The model achieves high accuracy very quickly, after just a couple of epochs.
All prediction masks are blank. The more epochs the blanker they are.

After a certain amout of reading, I believe the problem is that the targets in my images are fairly small.
The model thus gets a high accuracy for predicting zeroes for everything, thus essentially training itself to paint everything black.
The best solution appears to be:

Way more training epochs
A weighted scoring approach where positive pixels are favoured.

Any thoughts on this analysis and hints on how to achieve the weight scoring would be appreciated, I’m still very new to all this.
Cheers!