Closed MichaelMalike closed 2 years ago
Hi @MichaelMalike, pls try setting argument _dataaugmentation in supervised_train.py and semi-supervised_train.py to False and then check if it works. Tell us about it if you still encounter the same problem.
Hi @MichaelMalike, pls try setting argument _dataaugmentation in supervised_train.py and semi-supervised_train.py to False and then check if it works. Tell us about it if you still encounter the same problem.
Thank you for your reply. I set the argument data_augmentaion to False, and it works: python test.py --pretrained_model semi_supervised_CARes_Unet_epoch_1200.pth semi_supervised_CARes_Unet_epoch_1200.pth test_loss: 0.8345553353428841 test_dice: 0.7124384014556805
But what's the effect if the argument is set to False?
Thank you for your reply. I set the argument data_augmentaion to False, and it works: python test.py --pretrained_model semi_supervised_CARes_Unet_epoch_1200.pth semi_supervised_CARes_Unet_epoch_1200.pth test_loss: 0.8345553353428841 test_dice: 0.7124384014556805
But what's the effect if the argument is set to False?
Normally when training neural networks we do data augmentaion to improve performance, which means that this argument should be set to True so that we could RandomHorizontalFlip()
or RandomVerticalFlip()
or RandomRotation(90)
those input images.
But in our experiments on COVID-SemiSeg Dataset, it was quite strange that this trick did not work on this dataset and it even made results worse. The authors who constructed this dataset and proposed Inf-Net & Semi-Inf-Net did not discuss about it in their paper. And in their segmentation experiments on this dataset, it seems that they did not do such data augmentation either. We're still confused about it and trying to figure out the reason.
Thank you for your reply. I set the argument data_augmentaion to False, and it works: python test.py --pretrained_model semi_supervised_CARes_Unet_epoch_1200.pth semi_supervised_CARes_Unet_epoch_1200.pth test_loss: 0.8345553353428841 test_dice: 0.7124384014556805 But what's the effect if the argument is set to False?
Normally when training neural networks we do data augmentaion to improve performance, which means that this argument should be set to True so that we could
RandomHorizontalFlip()
orRandomVerticalFlip()
orRandomRotation(90)
those input images.But in our experiments on COVID-SemiSeg Dataset, it was quite strange that this trick did not work on this dataset and it even made results worse. The authors who constructed this dataset and proposed Inf-Net & Semi-Inf-Net did not discuss about it in their paper. And in their segmentation experiments on this dataset, it seems that they did not do such data augmentation either. We're still confused about it and trying to figure out the reason.
Got it, thanks for the detailed explanation.
Hello, I am new to medical AI. I downloaded the source code you published and the data set you used(COVID-SemiSeg Dataset) and followed your steps to try, but the model I trained, the train_dice is close to zero, and the pictures generated by the test are almost all black. Is there something wrong with my environment or operations?
My software versions: python 3.6.9 torch 1.9.1.post3 torchfile 0.1.0 torchvision 0.10.0a0 numpy 1.19.5 Pillow 8.3.1 matplotlib 3.3.4
My Directories: Train-Image: 50 images from COVID-SemiSeg Dataset - LungInfection - Doctor-label - Imgs Train-Mask: 50 images from COVID-SemiSeg Dataset - LungInfection - Doctor-label - GT Test-Image: 48 images from COVID-SemiSeg Dataset - LungInfection-Test - Imgs Test-Mask: 48 images from COVID-SemiSeg Dataset - LungInfection-Test - GT Unlabeled: 1600 images from COVID-SemiSeg Dataset - LungInfection - Pseudo-label - Imgs
My Steps: python supervised_train.py python fake_labels_generator.py --model_path path\to\model --Image_dir .\Unlabeled --Mask-dir .\Pos-Mask python semi-supervised_train.py --semi_img_path .\Unlabeled
I didn't change the code except add the following line: +opt.model_type = 'CARes_Unet' without this line, the code cannot be executed successfully.
Some logs of the first step(python supervised_train.py): Ranger optimizer loaded. Gradient Centralization usage = True GC applied to both conv and fc layers optimizer: Ranger epoch: 1.000000, train loss = 1.309405, train dice = 0.226865 ,Time 00:00:06 epoch: 2.000000, train loss = 1.285836, train dice = 0.240907 ,Time 00:00:03 epoch: 3.000000, train loss = 1.264786, train dice = 0.235244 ,Time 00:00:02 epoch: 4.000000, train loss = 1.238122, train dice = 0.242067 ,Time 00:00:03 epoch: 5.000000, train loss = 1.214054, train dice = 0.216643 ,Time 00:00:03 epoch: 6.000000, train loss = 1.189567, train dice = 0.180630 ,Time 00:00:02 epoch: 7.000000, train loss = 1.172193, train dice = 0.145249 ,Time 00:00:02 epoch: 8.000000, train loss = 1.157961, train dice = 0.084073 ,Time 00:00:02 epoch: 9.000000, train loss = 1.132760, train dice = 0.097764 ,Time 00:00:02 epoch: 10.000000, train loss = 1.126971, train dice = 0.087522 ,Time 00:00:03 epoch: 11.000000, train loss = 1.115980, train dice = 0.057715 ,Time 00:00:02 epoch: 12.000000, train loss = 1.109360, train dice = 0.023946 ,Time 00:00:02 epoch: 13.000000, train loss = 1.091736, train dice = 0.047724 ,Time 00:00:02 epoch: 14.000000, train loss = 1.093312, train dice = 0.047009 ,Time 00:00:03 epoch: 15.000000, train loss = 1.092521, train dice = 0.022571 ,Time 00:00:03 epoch: 16.000000, train loss = 1.085156, train dice = 0.011974 ,Time 00:00:03 epoch: 17.000000, train loss = 1.079304, train dice = 0.016279 ,Time 00:00:02 epoch: 18.000000, train loss = 1.075902, train dice = 0.009922 ,Time 00:00:02 ...... ...... epoch: 1194.000000, train loss = 0.964429, train dice = 0.000000 ,Time 00:00:03 epoch: 1195.000000, train loss = 0.970529, train dice = 0.000000 ,Time 00:00:03 epoch: 1196.000000, train loss = 0.972669, train dice = 0.000000 ,Time 00:00:03 epoch: 1197.000000, train loss = 0.970826, train dice = 0.000000 ,Time 00:00:02 epoch: 1198.000000, train loss = 0.971703, train dice = 0.000000 ,Time 00:00:02 epoch: 1199.000000, train loss = 0.974997, train dice = 0.000000 ,Time 00:00:02 epoch: 1200.000000, train loss = 0.974482, train dice = 0.000000 ,Time 00:00:02 Learning rate decay: lr=5.000000000000005e-18 model_copy is saved !
Please let me know if I have any mistakes in the environment or operations. Thank you!