cchen-cc / SIFA

[TMI'20, AAAI'19] Synergistic Image and Feature Adaptation
255 stars 70 forks source link

Do not understand the rotation issue in the test set #10

Closed mathilde-b closed 4 years ago

mathilde-b commented 4 years ago

Hello, in your code you have a few lines which say that the orientation is not the same in the test data and in the train data. Is that also the case in the test data you released 'test_ct_image&labels', or did you release after correcting this ? If not, are all subjects in the same (wrong) orientations in the test, or do some have different orientations (ex 1 coronal, 1 transverse,..) Thanks !

            # This is to make the orientation of test data match with the training data
            # Set to False if the orientation of test data has already been aligned with the training data
            if True:
                data = np.flip(data, axis=0)
                data = np.flip(data, axis=1)
                label = np.flip(label, axis=0)
                label = np.flip(label, axis=1)
cchen-cc commented 4 years ago

The default setting matches with the released data. So no need to change if using the released data.

mathilde-b commented 4 years ago

ok thanks a lot for this ! I do have three follow up questions :) : 1/ first, it seems that in the training set and validation set, the 3D reconstruction cannot be made, as the name of subjects is not available (the names are sliceXXXX.tfrecords). On the contrary, on the test set, the 3D reconstruction is possible (subjects are 1003, 1008, 1019, 1014) Can you confirm this ?

2/ To evaluate your results in the training, val sets, did you calculate every metric 2D and then only calculated 3D dices on the test set ? Or did you not use 3d metrics at all and did everything 2D? for example, is the Dice 3D or 2D in the metrics you report in your paper ?

3/ the aspect of the heart seems systematically different in the test set (slices from subjects 1003, 1014, 1019, 1008) then in the training and validation sets. Specifically, the heart is BIGGER in the test set than in the training/val sets. It looks like there was a zooming maybe in the test set. You can see this in the size histograms (ie size of everything that is not background) I attach. Is this correct or is there a problem with the data ? Isn't this shift unfortunate ? It seems to be compromising my results, where I get really good results on the validation set, but it drops on the test set completely, I think because of this. Or is it something else, like pixel intensity ? should I do a normalization of some sort on the test data ? I'm using your nii format as input to my network , not transforming to png. The test set is also lighter colored, i also checked with histograms.. Thanks !

test_sizes_GT_hist

mathilde-b commented 4 years ago

Here are two examples of slices to illustrate my point:

This is in the test set, bigger and lighter

Screenshot 2020-06-19 at 15 31 34

(i standardized the name, this is subject_1003)

this is in the test set, structures are quite small

Screenshot 2020-06-19 at 15 31 18

(i add a 9 as a validation flag in the name, this is slice1172)

thanks ! :)

cchen-cc commented 4 years ago

1/ You are right. The training and validation sets contain slices with augmentation so that 3D reconstruction cannot be made.

2/ For training and validation sets, I calculated metric in 2D as the purpose is only to check that whether the training is going well. For the test set, I calculated 3D dice, which is reported in the paper.

3/ The histograms you drawn are based on all the data volumes in the training/validation set and test set or only one volume? The size of structures varies from volume to volume, but there shouldn't be consistent difference between training/validation and test set.

If you are using the released data, directly running the code should give you results similar to that reported in the paper. Are you having problems getting reasonable results?

cheng-01037 commented 4 years ago

Also noticed that your first grid of images is CT while the second is MRI. Please note they are from different patients and different hospitals.

Halleyawoo commented 3 years ago

@mathilde-b Hello, can you provide the code for the visualization part, thank you very much