Project-MONAI / research-contributions

Implementations of recent research prototypes/demonstrations using MONAI.
https://monai.io/
Apache License 2.0
1.01k stars 334 forks source link

Preprocessing of dataset for Self-Supervised Pre-Training of Swin Transformers #162

Open marvnmtz opened 1 year ago

marvnmtz commented 1 year ago

Thank you for releasing the pretraining code. As I try to reproduce it, I stumbled over some questions.

The first question regards the pre-processing, and more specifically the spacing of the data. You wrote that for the BTCV challenge a spacing of 1.5 x 1.5 x 2.0 mm is used. Does the same hold for the pretraining data.

You also said that you excluded full air (voxel = 0) patches. I cannot really find the part in the code where this is done. Could you describe, how and where this is done?

tangy5 commented 1 year ago

Hi @marvnmtz , thanks for these question. For pretraining, we didn't set the specific spacing, and the model try to learn with variant pixdim for images. BTW, we also tried to pre-train model with fix 1.0x1.0x1.0 isotropic resolutions, performance are very much the same. This won't impact much for downstream tasks.

For the "excluding full air patches", the "CropForeground" transform automatically did this:

https://github.com/Project-MONAI/research-contributions/blob/c812e5f3b7a56c998035514846aa3292394c4097/SwinUNETR/Pretrain/utils/data_utils.py#L81

Thanks for the interests for the work. Hope these helps.