Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipping is missing in noisy image synthesis #74

Closed
guochengqian opened this issue Apr 24, 2020 · 2 comments
Closed

Clipping is missing in noisy image synthesis #74

guochengqian opened this issue Apr 24, 2020 · 2 comments

Comments

@guochengqian
Copy link

guochengqian commented Apr 24, 2020

Hi N2V team!
At first, thanks for your amazing work and reproducible code.
I can reproduce your result and obtain PSNR from 27.62 -> 27.68 for BSD68 grey level denoising.

However, I find there is a mistake in your code.
When you synthesize the Gaussian noisy image, you should always clip and transform them into unit8. (remember it is still an image).
Unfortunately, you did not clip them. (If you look at the training or the test_data, their data range can be from -40 to 350.

I have fixed the bug when I reproduce your result. If we add clip: np.clip(x, 0, 255.) in training and testing:
the final PSNR will be from 27.42 -> 27.49. (PNSR lower than before.)

However, this issue will not influence your major merit.
Please fix the mistake in your code, which will benefit the community and help the community always make a fair comparison.

Thank you!

@alex-krull
Copy link
Contributor

Hello guochengqian,
Thank you for pointing this out.
We consciously decided against clipping.
Even though photographs are often stored in 8 bit, this is not true for other types of images (e.g. in microscopy often 16 bit or even 32 bit float is used).
Clipping would change the distribution of the noise, making it no longer zero-centered, which we rely on in N2V. So to illustrate the principle, we decided against clipping in the paper.
Note that all the baselines we ran to compare our method against use the same unclipped data.
However, we do agree that people might expect the data to be clipped.
We will point this out in the example notebook and also include your suggested line as a comment so that it can be uncommented to enable clipping if desired.

Cheers, Alex

@guochengqian
Copy link
Author

guochengqian commented Apr 24, 2020

That is good. Thank you. Do mention that in the new version of the notebook. At least the data should be clipped even if they can be float type not uint8. There should never be a negative value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants