Use patch_overlap in patch based inference
See original GitHub issueHi @fepegar I have trouble with the use of the patch_overlap
attribute in the patch based inference pipeline. Indeed, reading NiftyNet tutorial I thought I did not need to use patch_overlap
(i.e. keep it to 0).
However, after some experiments I’ve seen that I get much better results using a non zero patch_overlap
(4 for example) which seems intuitive as it should be harder to predict classes in the patches’ borders as less context information is available.
That would have been fine is this was the end of the story but I discovered something else. Indeed, visualizing the predictions with the different values of patch_overlap
I realized that when I had a non zero value I got all the borders of my whole volume that were totally wrong (value of 0.5 in my case while background should be 0 and grey matter 1). Quantitatively it results in a increase of Dice Loss of more than 0.1 compared to the same prediction with a crop of the border of the volume. After diving into the code I have the impression that all patches are aggregated by cropping them to remove overlapping voxels but no special action is made for border patches so it takes the default 0 value set when _output_tensor
is created.
Should there be a specific handling of patches on the border or is there something I missed with the use of the patch_overlap
variable? Thanks for your help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (13 by maintainers)
Top GitHub Comments
Haha yes I understand! If you need help regarding some issues I’ll be glad to give a hand!
😂 that’s an open secret! Thanks Romain!