Closed hnguyentt closed 4 years ago
The segmentation model and weights are available in https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/inprogram/segmentation and https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/inprogram/segmentation/lung_checkpoint.pth which are in the inprograming branch. Codes in this branch havn't been well organized.
The reason for bad results, I think, might come from diffenrent spacing or different CT scan areas. I suggest to change the code in https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/master/data/dataset.py in line 382 and 383. Since CTs in our experiments were all in spacing of 1x1x1, we simply use NO.-300 to NO.-40 in Z direction as lung areas. The better way is to use lung segmentaions to ditermine lung areas. I will also fix these codes in latter commit.
I hope it will help.
Thank you very much for your detailed instructions. I will try and let you know the results.
The spacing in my CT scans model is also 1x1x1.
The segmentation model and weights are available in https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/inprogram/segmentation and https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/inprogram/segmentation/lung_checkpoint.pth which are in the inprograming branch. Codes in this branch havn't been well organized.
The reason for bad results, I think, might come from diffenrent spacing or different CT scan areas. I suggest to change the code in https://github.com/ChenWWWeixiang/OpenCovidDetector/blob/master/data/dataset.py in line 382 and 383. Since CTs in our experiments were all in spacing of 1x1x1, we simply use NO.-300 to NO.-40 in Z direction as lung areas. The better way is to use lung segmentaions to ditermine lung areas. I will also fix these codes in latter commit.
I hope it will help.
The model lung_checkpoint.pth has 3-class output. I don't know why it is three. It should be 2: lung or no lung, shouldn't it? What is the third class?
I also have another question: Why the image and the mask in your example data do not have the same shape:
Imag shape:
(297, 295, 390)
Mask shape:(282, 302, 390)
The mismatch of shape came from padding and pooling layer of old version segmentation. The new version Unet model will work well. The Unet lung segmentation model output left and right lung as seperate classes so there are 3-class output.
May I ask what segmentation model you use in the evaluation?
The segmentation model we used in our preprint is deeplabV1 and we now use Unet which might be a better method. You can find the implement in https://github.com/ChenWWWeixiang/OpenCovidDetector/tree/inprogram/segmentation
Hi @ChenWWWeixiang ,
I tested your unet model and thought that your deeplabV1 worked much better than your unet model. Could please share your trained deeplabv1 model? Following is the comparison:
Segmentation by your deeplabV1 (your example data):
Segmentation by your unet on your example data:
Hi @nguyenhoa93
I have checked my codes and your result.
First, I think you might be using "checkpoint_200000.pth" rather than "lung_checkpoint.pth"and the former is a half-done checkpoint to segment lesion area.
Then, I fixed a stupid bug in unet.py that input images had been divided by 255 outside in predict.py and was divided by 255 again in unet.py. The code works now.
And the DeeplabV1 version model was developed by my collegue, there may be some time to get the pretrained weight. If Unet works, I suggest to use the new version model.
Thank you @ChenWWWeixiang
One more question: Did you take raw data as input for your segmentation model? And then resampled them and put resampled data and resampled segmentation to diagnosis model?
Yes
Hello,
I used data from this repository to build a segmentation model: https://www.kaggle.com/kmader/finding-lungs-in-ct-data Then I tested my own data on your diagnosis network, the result was not good. I think that was because of the segmentation model.
Could you please share with us your trained segmentation model to test?