Open JaekwangChung opened 2 years ago
I actually have exactly the same issue as you, I trained my own Swin-UNETR on my brain MRI data with 7 tissues (keeping the same monai data transforms as in the BTCV/BRATS case) and in the segmentation outputs at test time, I get this weird out-of-skull prediction. The prediction looks good but the out-of-skull artifacts make it very bad when evaluating metrics like dice score, ...
See pictures:
< Inference on a brain MRI > < Inference on another brain MRI >
Hey @JaekwangChung and @charlesmoatti !!! Try with the parameter "ignore_empty" to False in DiceMetric!
Describe the bug I evaluated BTCV dataset using below SwinUNETR codes and pre-trained model of 'Swin UNETR/Base' (swin_unetr.base_5000ep_f48_lr2e-4_pretrained.pt) https://github.com/Project-MONAI/research-contributions/tree/main/SwinUNETR/BTCV
I can see many false positive noises at the boundary of the volume on some BTCV models. (See below screenshots)
It seems to be a problem similar to the following issue. https://github.com/Project-MONAI/research-contributions/issues/93
How can I remove these false positive noises?
To Reproduce
Go to '...' https://github.com/Project-MONAI/research-contributions/tree/main/SwinUNETR/BTCV
Install '....' conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch pip install git+https://github.com/Project-MONAI/MONAI.git@07de215c pip install nibabel==3.1.1 pip install tqdm==4.59.0 pip install einops==0.4.1 pip install tensorboardX==2.1 pip install scipy
Run commands '....' test.py --json_list=dataset_0.json --data_dir=../dataset/Abdomen2 --feature_size=48 --infer_overlap=0.7 --workers=8 --sw_batch_size=2 --pretrained_model_name=swin_unetr.base_5000ep_f48_lr2e-4_pretrained.pt --exp_name=result ==> Added 'sliding windows batch size option' (sw_batch_size) and set to 2 because of GPU memory shortage.
Expected behavior There should be no false positive noise or it should be kept to a minimum.
Screenshots Inference on case img0035.nii.gz Mean Organ Dice: 0.771858516264921 Inference on case img0036.nii.gz Mean Organ Dice: 0.8404263705815952 Inference on case img0037.nii.gz Mean Organ Dice: 0.8325490601052332 Inference on case img0038.nii.gz Mean Organ Dice: 0.7960240923146462 Inference on case img0039.nii.gz Mean Organ Dice: 0.8385704222867443 Inference on case img0040.nii.gz Mean Organ Dice: 0.822130831278294 Overall Mean Dice: 0.816926548805239
< Inference from img0035.nii.gz >
< Inference from img0039.nii.gz >
< Inference from img0040.nii.gz >
Environment (please complete the following information):
Additional context Add any other context about the problem here.