Hi everybody,
I have following scenario. I have 4 classes (including background): “House”, “Door”, “Window”, “Background”. The two classes “Door” and “Window” obviously do not intersect. But both are in the class “House”.
First I subtracted the “Window” and “Door” masks from the “House” class and used a Multi-Class Segmentation approach using CrossEntropyLoss
which uses Softmax, but I would like to change it to a Multi-Label application where the “Door” and “Window” pixels should also be labeled as “House”.
For that, I wanted to use BCEWithLogitsLoss
which uses Sigmoid, but I don’t know how I can balance the classes. I have a list of weights that represent the average size of the classes. “House” having the smallest weight as it is the biggest class. E.g.: {'House': 1, 'Door': 20, 'Window': 25}
. I passed this information in the Multi-Class scenario to the weight
argument of CrossEntropyLoss
.
But how do I do it with BCEWithLogitsLoss
? Do I have to pass the list [1, 20, 25]
to pos_weight
for that?
Also, is my approach even the right way to do Multi-Label Segmentation?
Thanks in advance.