Closed jenspetersen closed 4 years ago
Hi @jenspetersen ,
Thanks for your feedback! That's a very good point. Actually, we already discussed internally about overlapping in sliding window, and want to have it in a future version. I think that's a very important and valuable improvement to our evaluation method. Do you have any interest to submit a PR that enhances our existing sliding window method? Thanks.
@FabianIsensee, you already implemented this, is that something you would/could contribute?
Hi, yes I already did that a while ago and I actually rewrote the whole thing a couple of days ago because it was not easy to read and quite convoluted. At the moment I am very busy and, as much as I would like to, I cannot contribute in the near future. In case someone is interested, here is my implementation:
https://github.com/MIC-DKFZ/nnUNet/blob/master/nnunet/network_architecture/neural_network.py
The code for sliding window prediction in 3d is here:
2d is here:
Best, Fabian
Hi @madil90 ,
Could you please help develop this feature request? It will obviously improve the evaluation performance. Thanks.
@Nic-Ma Yes definitely. I'm looking at @FabianIsensee implementation and will start porting it to MONAI.
@Nic-Ma @madil90 Getting the patch weights with Gaussians is only one way to do this, but we should probably support other approaches. For example, the next two immediately come to mind.
Also, we need to be aware that not everything is a semantic segmentation model. E.g. weighted average of 2 predictions is not necessarily ideal for semantic regression models (image synthesis).
@mjorgecardoso Thanks, that's a very good point. I'll separate the weighting from overlapping in a way that we can implement other weighting algos later.
@mjorgecardoso Thanks, that's a very good point. I'll separate the weighting from overlapping in a way that we can implement other weighting algos later.
Hi @madil90 ,
Thanks for your help on this PR! Looking forward to your update of our sliding window.
Is your feature request related to a problem? Please describe. Image-scale predictions (e.g. segmentations) tend to become worse towards the outside of the image [citation needed, I know], resulting in non-smooth predictions when a sliding window approach is used.
Describe the solution you'd like An option to perform sliding window inference with overlapping patches (e.g. by half patch size) and weighting (e.g. a Gaussian over the image) so we put more weight on predictions from the center of a patch.