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

Big in SSIM implementation, don't use this code for perceptual quality estimation #22

Open
zakajd opened this issue Jan 21, 2021 · 3 comments

Comments

@zakajd
Copy link

zakajd commented Jan 21, 2021

Hi
This code contains the same error as skimage, you can read full description here: scikit-image/scikit-image#5192

Shortly, when used for estimation of perceptual quality, authors of original paper proposed to downsample images first to make SSIM focus on major differences between reference and distorted inputs.

So what?
If you are using this implementation as a loss function for CNN, you're likely leading it in the wrong direction.

Alternatives
You can find correct implementation of SSIM, MS-SSIM and some other metrics here:
https://github.com/photosynthesis-team/piq

@zakajd zakajd changed the title Big in implementation, don't use this code for perceptual quality estimation Big in SSIM implementation, don't use this code for perceptual quality estimation Jan 21, 2021
@jorge-pessoa
Copy link
Owner

Thank you for raising this issue. I will look into adding an optional flag that applies the correct average pooling before the SSIM computation. Note that this is also an issue on the original SSIM from which this repository was forked so you may want to raise this issue there as well.

I will leave the issue open until this is resolved in master.

@charleneolive
Copy link

I don't think it's an error per say, it's not very explicitly mentioned in the paper either, although during the experiments the authors did mention that they downsampled the images. In addition there are two implementations by the author here: http://www.cns.nyu.edu/~lcv/ssim/, with the second implementation similar to the first but with an additional preprocessing step. Nevertheless, I think it's good to take note of this for any perceptual quality tasks:)

@zakajd
Copy link
Author

zakajd commented May 29, 2021

While it's not an error, usage of SSIM without preprocessing leads to a significantly worse performance as a "perceptual quality estimator" which is 90% of its use cases nowadays.

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

3 participants