Oslandia / deeposlandia

Migrated to: https://gitlab.com/Oslandia/deeposlandia
MIT License
59 stars 16 forks source link

how to handle multi channel multi class labels #144

Closed amardeepjaiman closed 4 years ago

amardeepjaiman commented 4 years ago

Hi, How to handle multi class labels which are on different channels. I have dataset which has 3 class but classes are overlapping thats why i have put all the labels on 3 different channels instead on single channel with 3 different color values. Can you suggest how to create 1 hot vector from this 3 channel masks and if this Unet architecture with same loss functions training can be done ?

Thanks, Amardeep

delhomer commented 4 years ago

Hi @amardeepjaiman, Sorry for the answer delay... Have you solved your problem?

I assume that you are talking about semantic segmentation here.

Actually one uses the categorical cross-entropy as a loss function in order to get the most probable class amongst a set of classes, for a given pixel. I'm quite sure that this loss function won't fit your requirement, as it returns the probability for each label to be the best one. You could consider a threshold (like the final activation output larger than 0.2), but that would be a really dirt trick in that context.

It is based on a softmax function at the end of the process (the final activation function) ; your description lets me think that the sigmoid will be preferable. However that's quite out of the implemented code scope.

Do not hesitate to submit a PR if you think you can improve the project!

delhomer commented 4 years ago

I close the issue, due to the lack of activity in there.