How to measure two classes segmentation results?

I am working on the segmentation task with 2 classes :vessel and background.
It seems to have two options.
1 .output is 1 channel mask,grayscale image,using binary cross entropy as loss function.I am confused with how the metric like FP TP caculated,should I set the threshold to turn the grayscale picture to black and white picture then caculate the metric?
2 .output is 2 channel mask,using cross entropy, get the mask by output.argmax(dim=1),and it looks like easier to caculate the FP and TP
Is there a best option between them?

Both options are valid and your explanations are correct.

The difference is in treating the segmentation use case as a binary segmentation (first option) with nn.BCEWithLogitsLoss and a single output channel or as a 2-class multi-class segmentation (second option) with two output channels.
From what I saw in other posts the first option is often preferred, but the second one should also work.
@KFrank is an expert in these topics and might want to add something. :wink:

1 Like