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

Portilla Simoncelli Model - Number of statistics don't match paper #151

Closed
kbonnen opened this issue Dec 7, 2021 · 2 comments · Fixed by #216
Closed

Portilla Simoncelli Model - Number of statistics don't match paper #151

kbonnen opened this issue Dec 7, 2021 · 2 comments · Fixed by #216

Comments

@kbonnen
Copy link
Collaborator

kbonnen commented Dec 7, 2021

One section of Portilla & Simoncelli 2000 (pg 60, first column) provides a summary of the statistics calculated in the Portilla-Simoncelli model. It appears to be both missing statistics and to be wrong in some places. I've marked the statistics that are correct in the paper with ☑️, the ones that are incorrect with ❌.

  • Marginal statistics:
    skewness and kurtosis of the partially reconstructed lowpass images at each scale (☑️ 2(N +1) parameters)
    variance of the high-pass band (☑️1 parameter),
    and [pixel statistics] mean variance, skew, kurtosis, minimum and maximum values of the image pixels (☑️6 parameters),
  • Raw coefficient correlation: Central samples of the auto-correlation of the partially reconstructed low-pass images, including the lowpass band (❌ (N + 1)·(M^2 +1)/2 parameters) These characterize the salient 2 spatial frequencies and the regularity (linear predictability) of the texture, as represented by periodic or globally oriented structures.
  • Coefficient magnitude statistics:
    Central samples of the auto-correlation of magnitude of each subband (❌ N · K · (M^2+1) parameters),
    cross-correlation of each 2 subband magnitudes with those of other orientations at the same scale (❌ N · K · (K-1)/2 parameters), and
    cross- correlation of subband magnitudes with all orientations at a coarser scale (❌ K^2 · (N − 1) parameters). These represent structures in images (e.g., edges,bars, corners), and "second order” textures.
  • Cross-scale phase statistics: cross-correlation of the real part of coefficients with both the real and imaginary part of the phase-doubled coefficients at all orientations at the next coarser scale (❌ 2K^2·(N − 1) parameters). These distinguish edges from lines, and help in representing gradients due to shading and
    lighting effects.

For our texture examples, we have made choices of N = 4, K = 4 and M = 7, resulting in a total of ❌ 710 parameters. We emphasize that this is a universal (non- adapted) parameter set.

The conclusion that there are 710 parameters for these choices of scale (N=4), orientation (K=4), and spatial extent (of the correlations M=7) is wrong, or at least does not matched the code published for the Portilla-Simoncelli model. Given the code released with this paper the following is more accurate (I've marked the statistics that are correct in the original paper with ☑️, the ones that are corrected with ✅, and the ones that are absent in the original paper with ⭐.):

  • Marginal statistics:
    skewness and kurtosis of the partially reconstructed lowpass images at each scale (☑️ 2(N +1) parameters)
    variance of the high-pass band (☑️ 1 parameter),
    and [pixel statistics] mean variance, skew, kurtosis, minimum and maximum values of the image pixels (☑️ 6 parameters),
  • Raw coefficient correlation: Central samples of the auto-correlation of the partially reconstructed low-pass images, including the lowpass band. (✅ (N·M^2 parameters) These characterize the salient 2 spatial frequencies and the regularity (linear predictability) of the texture, as represented by periodic or globally oriented structures.
  • Coefficient magnitude statistics:
    Central samples of the auto-correlation of magnitude of each subband (✅ N·K·M^2 parameters),
    cross-correlation of each 2 subband magnitudes with those of other orientations at the same scale (:white_check_mark: ** (N+1) · K^2 parameters**), and
    cross- correlation of subband magnitudes with all orientations at a coarser scale (✅ K^2 · N parameters). These represent structures in images (e.g., edges,bars, corners), and "second order” textures.
  • Cross-scale phase statistics: cross-correlation of the real part of coefficients with both the real and imaginary part of the phase-doubled coefficients at all orientations at the next coarser scale (✅ (2K)^2·N parameters). These distinguish edges from lines, and help in representing gradients due to shading and
    lighting effects.
    Also completely missing from the paper:
  • means of the pyramid bands + residuals (:star: 2+N*K parameters)
  • cross-correlation of the real parts with those of other orientations at the same scale (:star: (2K)^2·(N+1) parameters)

For our texture examples, we have made choices of N = 4, K = 4 and M = 7, resulting in a total of ✅ 1784 parameters. We emphasize that this is a universal (non- adapted) parameter set.

It is true that a subset of the parameters in this 1784 are always zero (meaning that they are effectively place holders, not real statistics/parameters). However these zeros do not fully account for the 1074 parameter difference between 1784 and 710.

I have attached a matlab script that demonstrates this issue for the matlab implementation (which has an identical implementation in this repository). This script is saved as a .txt file because github won't accept .m files -- Just change the ending to .m and it will work in matlab.
NumberOfParameters.txt
.

@billbrod
Copy link
Collaborator

Eero thinks the extra parameters probably result from two places: symmetry of the correlations (they only counted half, since the second half are duplicates of the first) and the zeros (in addition to the placeholders, things that have to be zero, like means of the output of bandpass filters).

@dherrera1911
Copy link
Collaborator

The extra statistics in the PS code with respect to the paper are due to 3 reasons: Redundant statistics due to symmetry, the computing of statistics that are not reported in the paper and not used for synthesis, and the presence of placeholder values. I am working on contributing a short tutorial that indicates how to obtain the papers statistics from the output of the model.

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

Successfully merging a pull request may close this issue.

3 participants