shaoyanpan / 2D-Medical-Denoising-Diffusion-Probabilistic-Model-

This is the repository for the paper "2D Medical Image Synthesis Using Transformer-based Denoising Diffusion Probabilistic Model".
https://iopscience.iop.org/article/10.1088/1361-6560/acca5c
MIT License
36 stars 11 forks source link

Hyper-parameters for image size 512*512 #6

Closed GritYu closed 10 months ago

GritYu commented 10 months ago

This is a great work, and I appreciate that you shared it with us. I want to work on the image size 512512, but the hyper-parameters of 256256 are not working. The outputs are just some random noise. Could you give me some advice for the parameters like num_res_blocks, attention_resolutions_window_size, and channel_mult? I would greatly appreciate it!

shaoyanpan commented 10 months ago

Hi:

Emm can you first try to downsample the images to 256x256 and see if they works? Cause based on my experience, with inappropriate hyper-parameters should not give you random noise, at least should be some noisy and distorted images. I would consider your issue as some normalization problem. But please try 256 first.

If I were u, for 512 images, I will try some thing like: num_channels=128 channel_mult = (0.5, 1, 1, 2, 2, 4, 4) attention_resolutions="64,32,16,8" num_heads=[4,4,8,8,8,16,16] window_size = [[4,4,4],[4,4,4],[4,4,4],[8,8,8],[8,8,8],[4,4,4],[4,4,4]] num_res_blocks = [2,2,2,2,2,2,2] sample_kernel=([2,2,2],[2,2,2],[2,2,2],[2,2,2],[2,2,2],[2,2,2],),

GritYu commented 10 months ago

Hi Shaoyan, thank you so much for your reply. I tried the code with 256 and it performed very well. I just want to try the larger image size. I appreciate the hyper-parameters you shared. Have a great day and happy holidays!

GritYu commented 10 months ago

Hi Shaoyan, the results look good with the parameters you shared. Thank you so much! I have another question about multi-GPU running. I tried to use torch.nn.DataParallel() for multi-GPU running, but the output is just random noise. I also ran the code on a single GPU with the same dataset and parameters, and it outputs well. Have you run the code on multi-GPU and could you tell me how to output the right results? I would greatly appreciate it!

shaoyanpan commented 10 months ago

Hi:

Emm that is a good question. I don't know how to use the parallel computing here. Sorry about it.

GritYu commented 10 months ago

Thanks for your reply! Happy New Year!