Open ramonemiliani93 opened 3 years ago
Hi Ramone,
Thanks for the interest, this is really a corner case. Are you allowed to share any of such examples, with real-world data?
Did you try to train in-spite with the boundary at 0.5? Though the distance would be slightly off, I would not necessarily affect the minimization process much.
I will try to keep thinking about this in the coming days. Your suggested erosion might be enough.
Best,
Hoel
Hi Hoel,
Unfortunately I have no data to share, any other synthetic example will have the same problem. Using skimage.morphology.ball
and slicing it through the middle may yield a better toy problem.
I agree the optimization shouldn't be affected by this; with the current implementation I did not train for long so I am unable to tell you about the results, on the other hand, the binary erosion is working. I have to train for longer and compare with only regional loss.
If you come up with something keep me posted.
Best,
Ramón
Hi Ramón,
Thank you for your useful feedback. I suppose I could (should) add some unit test for that. (I have some partial unit-testing file somewhere locally, that I haven't included in the repo.) That might help to decide how to deal with this corner case.
I have some deadlines coming up and I will not have time to handle that right now, so I will snooze this until late October.
Best,
Hoel
Hi Hoel,
Wish you the best with your deadlines! Yes, if at some point you add the unit test files, I could help you resolve the corner case.
Best,
Ramón
I just added a basic test.py
in 8f4457416a583e33cae71443779591173e27ec62
Feel free to play around and add new test-cases, this would help to define the issue.
It seems that now the codebase triggers some deprecation warnings (I have updated my machine, so brand-new python, numpy and pytorch), I will investigate those.
Hi, when the resolution for the distance maps is heterogeneous the formula in
one_hot2dist
will yield non-zero values in the boundaries. For example:Here the boundaries will be
0.5
instead of0
. Maybe eroding one of the masks could help generalize: