StanfordMIMI / DDM2

[ICLR2023] Official repository of DDM2: Self-Supervised Diffusion MRI Denoising with Generative Diffusion Models
125 stars 20 forks source link

Question about the second stage #23

Open NwTbbetter opened 3 months ago

NwTbbetter commented 3 months ago

Hi, thank you for your contribution and sharing. I would like to ask, why does sqrt_alphas_cumprod_prev need append 1? And how should we solve the problem when the time step matched in the second stage is 0?

tiangexiang commented 3 months ago

Thanks for your interests in our work!

  1. During training, at time stamp t, noise are uniformly sampled based on the interval sqrt_alphas_cumprod_prev[t] and sqrt_alphas_cumprod_prev[t-1] (see https://github.com/StanfordMIMI/DDM2/blob/main/model/mri_modules/diffusion.py#L358). For a total number of N time stamps, we need N+1 sqrt_alphas_cumprod_prev values to define N intervals to sample from. Based on the cumprod nature of the variable, the last value to be appended must be 1.
  2. Normally speaking, it is very unlikely the matched state is 0 (this indicates a noise model with very small variance). This can only be possible if Stage1 failed or input MRI volumes are noiseless already. However, if you still want to run Phase3 even if the matched step is 0, you can manually clip the value to be higher. In this case, the Stage3 model will begin to hallucinate unreal information to the data, rather than 'denoise' the data.