Closed thomashopkins32 closed 1 year ago
Here is one issue with partially overlapping blood vessel masks with the glomerulus masks. EDIT: Sorry the image here should be transposed.
When we load the dataset, we have the coordinates of each polygon. So what we can do is remove the blood vessel polygons that have any (or all) overlapping coordinates with the glomerulus.
The issue remains as to how to avoid penalizing the model for predicting blood vessels in the glomerulus region. We can do something like this:
max(prediction_mask - glomerulus_mask, 0)
I am not sure what this would do to the training objective if we backprop on this. Maybe we shouldn't accumulate gradients on this by using
with torch.no_grad():
but I do not like this option either. The model still has parameters tied to these output pixels and forcing them to 0 does not make sense for training.
A robust solution to this problem is really to predict the glomerulus regions. This way the model can learn to say "This is the glomerulus so I should not predict blood vessels in this region" rather than penalizing it when it could not know any better.
So the ground truth mask can have the following:
0 - background
1 - blood vessel
2 - glomerulus
And our model will output 3 channels corresponding to these.
When we build the ground truth masks, we should create the glomerulus masks first then overlay the blood vessel masks on top of it. This will make it so no blood vessels are cut off like in the image above.
This will have an impact on how we can handle the unsure masks. I am thinking we try using them as true targets and see if we have an improvement in mAP.
For reference: #5
We have 3 different types of annotated masks available:
I need to see how that annotation is being passed for scoring on the hidden test set. Does Kaggle discard predictions in the region internally?
What should I do with predictions from my model that fall in the glomerulus during training? I should look into this more but here are some ideas: