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

ENH dwidenoise: Optimal shrinkage #3022

Closed
Lestropie opened this issue Oct 9, 2024 · 3 comments
Closed

ENH dwidenoise: Optimal shrinkage #3022

Lestropie opened this issue Oct 9, 2024 · 3 comments

Comments

@Lestropie
Copy link
Member

Not familiar with what may be considered to be best practise here, but I at least have a basic sense of the concept.

Depending on where the upper threshold of the MP distribution is determined to be relative to the component eigenvalues, inclusion of components in the output DWI series could be fractional.

Lestropie added a commit that referenced this issue Nov 8, 2024
- Default behaviour is now to use optimal shrinkage based on minimisation of the Frobenius norm.
- Prior behaviour can be accessed using "-filter truncate".
Closes #3022.
@Lestropie
Copy link
Member Author

Animation below shows raw data, then denoising using eigenspectrum truncation, then optimal shrinkage.

@dchristiaens @jdtournier Would appreciate some input on the optimal shrinkage implementation:

  1. To make sure that my implementation is correct (some of the variable handling was already different to that in published manuscript)
  2. Given that the noise level threshold is determined based on choosing a specific component index, we want to make sure that the truncation / alignment of the optimal shrinkage function relative to that selection is correct; ie. check for off-by-one errors.

anim

@Lestropie Lestropie reopened this Nov 8, 2024
@Lestropie
Copy link
Member Author

The equation currently in use here is based on:
"Optimal Shrinkage of Singular Values"
https://ieeexplore.ieee.org/document/7820186/?arnumber=7820186

I have only just realised that this was not the reference in Lucilio's paper:
"Optimal Shrinkage of Eigenvalues in the Spiked Covariance Model"
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6152949/

@Lestropie Lestropie changed the title ENH dwidenoise: Soft component thresholding ENH dwidenoise: Optimal shrinkage Dec 6, 2024
@Lestropie
Copy link
Member Author

I believe that the implementation as at 471be56 in #3029 is consistent with the tensor MPPCA implementation:

  • Raw eigenvalues are divided by the size of the max matrix dimension and sigma^2 (as opposed to lambda_plus)
  • The same non-linear transform function is applied

The subsequent rescaling differs due to other implementation details:

  • They immediately produce rescaled versions of the eigenvalues by multiplying by the size of the max matrix dimension and sigma*2.
  • Our 3.0.4 implementation was based on producing a weights vector, originally with 1.0 for preserved components and 0.0 for truncated components. In my updated code I produce weights con a continuous scale, as the ratio of the input to and output from the non-linear transform function.

So I think that makes me confident enough that the current implementation is correct and adequate to close off this Issue. Any sanity checking from someone with experience in the mathematics in the course of reviewing #3029 once it's out of draft form would nevertheless be appreciated.

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

No branches or pull requests

1 participant