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

About the region loss #103

Open
igodrr opened this issue May 1, 2023 · 2 comments
Open

About the region loss #103

igodrr opened this issue May 1, 2023 · 2 comments

Comments

@igodrr
Copy link

igodrr commented May 1, 2023

Hi authers:
About the region loss
loss_dict["loss_region"] = loss_func( out_region * gt_mask_region[:, None], gt_region * gt_mask_region.long() ) / gt_mask_region.sum().float().clamp(min=1.0)
I think out_region * gt_mask_region[:, None] can't remove the loss of background. This operation makes all the channels of the background point to 0, which will all become 1/65 after passing through the softmax of CE_LOSS.
I don't know if my understanding is correct, hope to get your reply! Thanks very much!

@wangg12
Copy link
Member

wangg12 commented May 1, 2023

Hi, this formulation does not remove the loss of background, but tries to map the background to a "background" region. For truly remove the background loss, one might need to use the "ignore" trick. You can try that out. But I think it would not make a big difference.

@igodrr
Copy link
Author

igodrr commented May 2, 2023

Hi, thanks for your reply! But I think this can't map the background to a "background" region as I mentioned above, make all the channels of a pixel to 0 will make them all become 1/65 after passing through the softmax, so the loss of this "background pixel" is log(1/65). I don't quite understand what you mean by mapping the background into the "background" area. Is the purpose of this operation to eliminate the interference of the background? If yes, why not just ignore it?
Looking forward to your reply! Thanks 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