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

The conversion augmentation always returns an roi. #116

Closed
AjeyPaiK opened this issue Oct 12, 2022 · 1 comment
Closed

The conversion augmentation always returns an roi. #116

AjeyPaiK opened this issue Oct 12, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@AjeyPaiK
Copy link
Member

AjeyPaiK commented Oct 12, 2022

In my loss implementation, I use the ROIs to precisely backpropagate loss contributions from only those pixel regions in the H&E images over which there is an ROI defined containing our classes of interest.

A generic representation of my loss looks like this:

if batch["roi"] is not None: 
    batch_loss = loss_fn(rois*preds, rois*targets)
else:
    batch_loss = loss_fn(preds, targets)

If the training batch doesn't contain roi (meaning, there are no ground truth labels), then the loss function should not consume rois.

But right now, the dlup transform always outputs an empty roi (filled with zeros) even though there is no mask corresponding to any label in a particular tile.

So, the loss curve looks like this:
image

Meaning, the loss computation happens only when there is a tile with a label and all other time, my model outputs become zero because they get multiplied by the "roi" every time even though there is no ROI.

I handle this within my own codebase. Although, it would be nice if the transform returned an ROI array only if there is a corresponding label within it else, it should return None.

@AjeyPaiK AjeyPaiK added the bug Something isn't working label Oct 12, 2022
@jonasteuwen
Copy link
Contributor

This is expected behaviour. If there is a ROI name and no ROI present the output should be zeros.

@jonasteuwen jonasteuwen added wontfix This will not be worked on and removed bug Something isn't working labels Oct 12, 2022
@AjeyPaiK AjeyPaiK reopened this Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants