twke18 / Adaptive_Affinity_Fields

Adaptive Affinity Fields for Semantic Segmentation
https://jyhjinghwang.github.io/projects/aaf.html
Other
260 stars 62 forks source link

AAF for binary labels #10

Closed arc144 closed 5 years ago

arc144 commented 5 years ago

Hi, in the original implementation there are multiple labels (background, label 1, labels 2, etc..). In my application I have only one class besides background. Therefore I use sigmoid and have logits in the shape (B, H, W, 1). Should I expand my labels and predictions to (B, H, W, 2) where labels/pred[..., 1] = 1 - pred[..., 0]?

Or can I just compute for a single channel since background and foreground are complementary for the binary case?

Thank you, Kind regards

twke18 commented 5 years ago

Yes, you can just use a single channel in the case of binary classification.