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

Questions about datasets #32

Open
DayrisRM opened this issue Apr 10, 2024 · 4 comments
Open

Questions about datasets #32

DayrisRM opened this issue Apr 10, 2024 · 4 comments

Comments

@DayrisRM
Copy link

Hi,
I have 2 questions regarding the datasets:
1- Can DDM2 be run with multi-shell datasets?
I see in the paper that DDM2 was run with:
- Hardi with b-value= 2000
- Sherbroke with b-value = 1000
- Parkinson with b-value= 2000
Can DDM2 be trained on a dataset with b-values = {0, 1000, 2000} ?
I am interested in training on a multi-shell dataset.

2- When I run the denoising process, the resulting dataset does not have the b0s.
Why are b0s not returned in the denoised dataset? Are b0s used in all other phases?

Thanks!

@tiangexiang
Copy link
Collaborator

  1. Yes, DDM2 can be trained on multi-shell datasets. However, I do think having different noise models for corresponding b-values in Stage1 is necessary since different b-vals usually have very different SNR. You can do this in Stage1 by separating the multi-shell data based on b-vals and training one noise model for each of them individually. You may also need to change the code in Stage2 a bit so it can accept multiple noise models but still match on the same Markov chain. Note that you should observe clear differences between the matched states for slices with different noise models (different b-vals). After the above modifications, you can run through Stage3 directly without modifications.

  2. This is expected. We don't run training and denoising on b0 volumes since they hardly contain visible noise. As a result, we don't return them as part of the denoised dataset.

@DayrisRM
Copy link
Author

Thanks a lot @tiangexiang!
Now 2. makes sense to me :)

Regarding what you suggested in 1, I gave it a go but I am not sure how to do it. I.e. in the current pipeline, stage 3 takes as input the model output by stage 1. So, if I train each shell separately in stage 1, I will have several noise models. How should I pass these to the stage 3?

I guess an alternative is to do what e.g. Patch2Self does. To denoise multi-shell data, they suggest removing noise from each shell separately and then merge the denoised data again.
Is this what you suggested (i.e. denoising each shell independently)? Or there is a way to merge the noise models from stage 1 before, so it can be passed to both stages 2 and 3? Would advantages do you foresee this would have with respect to denoising separately?

In any case, there is something conceptual that I do not completely understand. You mentioned that the SNR will be different at different bvals... but this is just because the signal gets more attenuated; the noise level is constant. In fact, I am working with some synthetic data simulated as follows:

  1. Simulate multi-shell noise-free data x, where x is the signal attenuation s/s0 --> Here, higher bvals will produce more signal attenuation (smaller x).
  2. Add noise with a fixed SNR - E.g. assume Gaussian noise n at SNR=5 --> When adding n to the signal attenuation x, the SNR per bval will be lower at higher bvals, but the noise level (and model) is the same.
    Hence, would not the noise model learnt by DDM2 be the same regardless of the bval? Or this procedure (separating by shells) is just because the network cannot handle the different signal levels at different bvals?

@tiangexiang
Copy link
Collaborator

yeah, indeed the most straightforward way is to treat different shell data as separate 4D acquisitions and run through Stage1-3 on them independently. After denoising, you can put them back together.
However, we can see that a better way to train the diffusion model (Stage 3 model) is to use all the shell data we have (so the model can understand the underlying anatomical pattern better). In my unprofessional observation, SNR for different b-val data are quite visually different (but as you mentioned, this seems not true). So I suggest to train Stage 1 + Stage 2 separately for individual shell and then combine them together to train one single Stage 3 model. Note that you need to change the code in Stage 3 to make this actually work, because for one slice in a specific shell, you will need to use its corresponding noise model (trained in Stage 1) and corresponding matched state (obtained in Stage 2).

@DayrisRM
Copy link
Author

Hi @tiangexiang!

Thanks for your explanation!
This seems like a very good approach. I will take a look at this approach in the future.

I have executed DDM2 for b-val = 2000, and I see some artifacts by slices compared to MPPCA. (Images below)

These results make me wonder if it would be better to use patches instead of slices 🤔.

In the article, you say that you created an alternative DDM2 design using 3D volume patches (Page 21).
Is this code available? How did you manage the overlap?

Can you share the code? I would be interested in exploring this approach in more detail.

Thanks!


MPPCA
mppca-denoised-snr10

DDM2
ddm2-denoised-snr10

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