Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API_loss for multi_classes semantic segmentation #27

Closed
DAgalaxy opened this issue Oct 11, 2022 · 6 comments
Closed

API_loss for multi_classes semantic segmentation #27

DAgalaxy opened this issue Oct 11, 2022 · 6 comments

Comments

@DAgalaxy
Copy link

Hello,

I would like to apply your API_loss to my 3_classes semantic segmentation task, but i am not sure it will be work or not after some modification?
Do you have any advice? Look forward to your reply~

Thanks, best wish!

@Karel911
Copy link
Owner

Hello @DAgalaxy,
I cannot be definitely sure but, perhaps it can work with your task.
The logit of your network returns the shape of X \in R^(B, 3, H, W)?

@DAgalaxy
Copy link
Author

DAgalaxy commented Oct 11, 2022 via email

@Karel911
Copy link
Owner

How about the ground truth? It was encoded with 0, 1, and 2?
The API loss highly depends on the shape of GTs.
If I'm right, maybe you used nn.CrossEntropyLoss().

@DAgalaxy
Copy link
Author

My data's GT are encoded with 0,1,2 ids default, but I can transform it to one-hot with 3 channels, if so, can I use region_based loss like iou_loss or Dice_loss?

@Karel911
Copy link
Owner

Karel911 commented Oct 12, 2022

Yes, it is possible. Just calculate the API loss per each channel.
The example form of loss is L = CELoss(logit, original GT) + API(map with prob_class0, encoded channel 0) + API(map with prob_class1, encoded channel 1) + API(map with prob_class2, encoded channel 2)

@DAgalaxy
Copy link
Author

Got it! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants