question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use patch_overlap in patch based inference

See original GitHub issue

Hi @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:closed
  • Created 3 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
GFabiencommented, Jun 4, 2020

Thanks for the screenshot. I’ll look into this tomorrow (I’m trying to work on the library only on Fridays, I have a PhD to do 😅).

Haha yes I understand! If you need help regarding some issues I’ll be glad to give a hand!

1reaction
fepegarcommented, Jun 4, 2020

come on ! that library could become more important than your phd (for sure more usefull)

😂 that’s an open secret! Thanks Romain!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory-efficient Patch-based Inference for Tiny Deep Learning
Patch -based inference effectively reduces the peak memory usage of existing networks by4-8×. Co-designed with neural networks, MCUNetV2 sets a record ...
Read more >
Patch‐based generative adversarial neural network models ...
This training set was used for all the performance comparisons using both pix2pix and CycleGAN models, as well as different preprocessing and ...
Read more >
Memory-Efficient Patch-based Inference for Tiny Deep Learning
Patch -based inference effectively reduces the peak memory usage of existing networks by. 4-8×. Co-designed with neural networks, MCUNetV2 sets a record ImageNet....
Read more >
Introducing Hann windows for reducing edge-effects in patch ...
Experiments. We present an experiment where six different methods for combining the results of patch-based image segmentation are compared. The ...
Read more >
Memory-efficient Patch-based Inference for Tiny Deep Learning
Patch -based inference effectively reduces the peak memory usage of existing networks by 4-8x. Co-designed with neural networks, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found