Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the evaluation results of synapse not reaching the level of the paper, #78

Open
ASCI02 opened this issue Jul 29, 2024 · 5 comments

Comments

@ASCI02
Copy link

ASCI02 commented Jul 29, 2024

First of all, thank you for your excellent work. I have followed your steps to train the model on the synapse dataset and then evaluated it, but the result I obtained was only 0.8638526351861252. I understand that there might be some discrepancy, but the result is significantly lower than expected. Are there some detailed settings that have not been made public? If possible, please inform me. Below is part of the content from my evaluation file
"mean": {
"1": {
"Accuracy": 0.998657093644419,
"Dice": 0.8479975310456979,
"False Discovery Rate": 0.20889159480622957,
"False Negative Rate": 0.03930279119994839,
"False Omission Rate": 0.00013919367103899154,
"False Positive Rate": 0.0012081377903464345,
"Jaccard": 0.7627434971988629,
"Negative Predictive Value": 0.999860806328961,
"Precision": 0.7911084051937705,
"Recall": 0.9606972088000516,
"Total Positives Reference": 115561.58333333333,
"Total Positives Test": 158912.5,
"True Negative Rate": 0.9987918622096537
},
"10": {
"Accuracy": 0.9998240917377723,
"Dice": 0.7663670871785314,
"False Discovery Rate": 0.18122477756846053,
"False Negative Rate": 0.24555561145875057,
"False Omission Rate": 9.999149942430817e-05,
"False Positive Rate": 7.599327323995486e-05,
"Jaccard": 0.6353516399531766,
"Negative Predictive Value": 0.9999000085005757,
"Precision": 0.8187752224315394,
"Recall": 0.7544443885412496,
"Total Positives Reference": 15261.75,
"Total Positives Test": 14635.25,
"True Negative Rate": 0.9999240067267597
},
"11": {
"Accuracy": 0.9995659818911203,
"Dice": 0.8200419504751024,
"False Discovery Rate": 0.13332194919158954,
"False Negative Rate": 0.21263713167420595,
"False Omission Rate": 0.00029348285479180886,
"False Positive Rate": 0.0001410687372232211,
"Jaccard": 0.6991175380144169,
"Negative Predictive Value": 0.9997065171452082,
"Precision": 0.8666780508084103,
"Recall": 0.7873628683257939,
"Total Positives Reference": 42044.916666666664,
"Total Positives Test": 36767.416666666664,
"True Negative Rate": 0.9998589312627768
},
"12": {
"Accuracy": 0.9999655788657217,
"Dice": 0.7341160324680612,
"False Discovery Rate": 0.25930794548195624,
"False Negative Rate": 0.2562280618432938,
"False Omission Rate": 1.5434259001815032e-05,
"False Positive Rate": 1.8989249479221353e-05,
"Jaccard": 0.5834289373180755,
"Negative Predictive Value": 0.9999845657409981,
"Precision": 0.7406920545180439,
"Recall": 0.7437719381567063,
"Total Positives Reference": 2093.3333333333335,
"Total Positives Test": 2165.3333333333335,
"True Negative Rate": 0.9999810107505209
},
"13": {
"Accuracy": 0.999962717385909,
"Dice": 0.7390265292858933,
"False Discovery Rate": 0.2627450982806246,
"False Negative Rate": 0.2436348630660118,
"False Omission Rate": 1.7573534143480063e-05,
"False Positive Rate": 1.97118810078926e-05,
"Jaccard": 0.5929833058276595,
"Negative Predictive Value": 0.9999824264658566,
"Precision": 0.7372549017193754,
"Recall": 0.7563651369339883,
"Total Positives Reference": 2450.75,
"Total Positives Test": 2519.1666666666665,
"True Negative Rate": 0.9999802881189921
},
"2": {
"Accuracy": 0.9997822312377777,
"Dice": 0.8733454879439214,
"False Discovery Rate": 0.11384628133799028,
"False Negative Rate": 0.13691050112803535,
"False Omission Rate": 0.00014495952815063974,
"False Positive Rate": 7.329979330860288e-05,
"Jaccard": 0.8322771568821644,
"Negative Predictive Value": 0.9998550404718495,
"Precision": 0.8861537186620096,
"Recall": 0.8630894988719647,
"Total Positives Reference": 73265.0,
"Total Positives Test": 70832.75,
"True Negative Rate": 0.9999267002066913
},
"3": {
"Accuracy": 0.9997748789639517,
"Dice": 0.8753217646049097,
"False Discovery Rate": 0.11798308329616229,
"False Negative Rate": 0.13106948876535726,
"False Omission Rate": 0.00012613355501851127,
"False Positive Rate": 9.943509030216346e-05,
"Jaccard": 0.8376290873872634,
"Negative Predictive Value": 0.9998738664449814,
"Precision": 0.8820169167038375,
"Recall": 0.8689305112346428,
"Total Positives Reference": 73942.5,
"Total Positives Test": 73059.66666666667,
"True Negative Rate": 0.9999005649096979
},
"4": {
"Accuracy": 0.9999027573103243,
"Dice": 0.7019076972177962,
"False Discovery Rate": 0.2391666702619987,
"False Negative Rate": 0.2607527924828959,
"False Omission Rate": 5.433529634845218e-05,
"False Positive Rate": 4.2933821660271855e-05,
"Jaccard": 0.5923179343938021,
"Negative Predictive Value": 0.9999456647036515,
"Precision": 0.7608333297380012,
"Recall": 0.7392472075171039,
"Total Positives Reference": 9870.416666666666,
"Total Positives Test": 9144.75,
"True Negative Rate": 0.9999570661783398
},
"5": {
"Accuracy": 0.9999284802484277,
"Dice": 0.7859994912096306,
"False Discovery Rate": 0.19657391831445872,
"False Negative Rate": 0.19981177576084005,
"False Omission Rate": 3.762295571920989e-05,
"False Positive Rate": 3.390873478323342e-05,
"Jaccard": 0.6532811515462691,
"Negative Predictive Value": 0.9999623770442807,
"Precision": 0.8034260816855413,
"Recall": 0.8001882242391599,
"Total Positives Reference": 6148.5,
"Total Positives Test": 6028.5,
"True Negative Rate": 0.9999660912652168
},
"6": {
"Accuracy": 0.998165835752708,
"Dice": 0.9606366802950771,
"False Discovery Rate": 0.03209041883876928,
"False Negative Rate": 0.045915344085172394,
"False Omission Rate": 0.0011099276976853196,
"False Positive Rate": 0.0007701325262892874,
"Jaccard": 0.9247390511599275,
"Negative Predictive Value": 0.9988900723023146,
"Precision": 0.9679095811612308,
"Recall": 0.9540846559148276,
"Total Positives Reference": 813503.4166666666,
"Total Positives Test": 796908.4166666666,
"True Negative Rate": 0.9992298674737107
},
"7": {
"Accuracy": 0.9978665676434897,
"Dice": 0.8213783935282041,
"False Discovery Rate": 0.07830232643992856,
"False Negative Rate": 0.23743359521999277,
"False Omission Rate": 0.0018321548191929991,
"False Positive Rate": 0.0003127595002620313,
"Jaccard": 0.7279004760411034,
"Negative Predictive Value": 0.998167845180807,
"Precision": 0.9216976735600716,
"Recall": 0.7625664047800073,
"Total Positives Reference": 220097.5,
"Total Positives Test": 165129.41666666666,
"True Negative Rate": 0.999687240499738
},
"8": {
"Accuracy": 0.9998454878927551,
"Dice": 0.9260722616470306,
"False Discovery Rate": 0.05992965043327159,
"False Negative Rate": 0.08569103776204541,
"False Omission Rate": 8.78194983011542e-05,
"False Positive Rate": 6.686607078647729e-05,
"Jaccard": 0.8628836471486713,
"Negative Predictive Value": 0.9999121805016987,
"Precision": 0.9400703495667283,
"Recall": 0.9143089622379544,
"Total Positives Reference": 36828.0,
"Total Positives Test": 36154.583333333336,
"True Negative Rate": 0.9999331339292136
},
"9": {
"Accuracy": 0.9997237096245818,
"Dice": 0.8893857244491098,
"False Discovery Rate": 0.0882442086885407,
"False Negative Rate": 0.13016862494041498,
"False Omission Rate": 0.0001706856755630291,
"False Positive Rate": 0.00010597618760058158,
"Jaccard": 0.8023176955212987,
"Negative Predictive Value": 0.9998293143244371,
"Precision": 0.9117557913114593,
"Recall": 0.8698313750595851,
"Total Positives Reference": 46719.333333333336,
"Total Positives Test": 44452.083333333336,
"True Negative Rate": 0.9998940238123993
}
}

@mathntanzi0
Copy link

I am experiencing the same issue. I was able to get results consistent with the paper for the ACDC dataset, but not for the Synapse dataset using the provided weights. Were you able to resolve the issue?

I got an average Dice score of 0.8687, with the spleen Dice score dropping by 5.8 (95.77 to 89.98) compared to the results in the paper.


Mean_Dice
Dice_spleennan
Dice_right_kidneynan
Dice_left_kidneynan
Dice_gallbladdernan
Dice_livernan
Dice_stomachnan
Dice_aortanan
Dice_pancreasnan
Mean_hd
hd_spleennan
hd_right_kidneynan
hd_left_kidneynan
hd_gallbladdernan
hd_livernan
hd_stomachnan
hd_aortanan
hd_pancreasnan


dsc:nan
hd:nan


img0001.nii.gz
Dice_spleen: 0.9755
Dice_right_kidney: 0.9388
Dice_left_kidney: 0.9638
Dice_gallbladder: 0.6285
Dice_liver: 0.9784
Dice_stomach: 0.9433
Dice_aorta: 0.9298
Dice_pancreas: 0.7665
hd_spleen: 1.0000
hd_right_kidney: 4.1231
hd_left_kidney: 1.4142
hd_gallbladder: 108.4119
hd_liver: 1.4142
hd_stomach: 3.1623
hd_aorta: 2.0000
hd_pancreas: 6.0828
DSC:0.8905590196396521
hd:15.951064841892167


img0002.nii.gz
Dice_spleen: 0.9594
Dice_right_kidney: 0.9566
Dice_left_kidney: 0.9625
Dice_gallbladder: 0.8408
Dice_liver: 0.9729
Dice_stomach: 0.9364
Dice_aorta: 0.9355
Dice_pancreas: 0.8675
hd_spleen: 1.0000
hd_right_kidney: 1.0000
hd_left_kidney: 1.0000
hd_gallbladder: 3.6056
hd_liver: 1.4142
hd_stomach: 2.0000
hd_aorta: 1.7321
hd_pancreas: 2.2361
DSC:0.9289596440817888
hd:1.748485452863219


img0003.nii.gz
Dice_spleen: 0.5328
Dice_right_kidney: 0.9588
Dice_left_kidney: 0.7768
Dice_gallbladder: 0.8749
Dice_liver: 0.9587
Dice_stomach: 0.3903
Dice_aorta: 0.8011
Dice_pancreas: 0.8663
hd_spleen: 79.7183
hd_right_kidney: 1.4142
hd_left_kidney: 42.2374
hd_gallbladder: 5.4772
hd_liver: 3.6056
hd_stomach: 79.5676
hd_aorta: 80.4301
hd_pancreas: 2.4495
DSC:0.7699645623511835
hd:36.86247917469585


img0004.nii.gz
Dice_spleen: 0.9203
Dice_right_kidney: 0.9485
Dice_left_kidney: 0.9597
Dice_gallbladder: 0.5265
Dice_liver: 0.9595
Dice_stomach: 0.7297
Dice_aorta: 0.9231
Dice_pancreas: 0.6837
hd_spleen: 6.6332
hd_right_kidney: 1.7321
hd_left_kidney: 1.7321
hd_gallbladder: 12.3693
hd_liver: 5.7446
hd_stomach: 125.0538
hd_aorta: 1.4142
hd_pancreas: 20.4939
DSC:0.831376667470058
hd:21.89664177092648


img0008.nii.gz
Dice_spleen: 0.9258
Dice_right_kidney: 0.2921
Dice_left_kidney: 0.0000
Dice_gallbladder: 0.9030
Dice_liver: 0.9692
Dice_stomach: 0.8890
Dice_aorta: 0.9317
Dice_pancreas: 0.8463
hd_spleen: 2.8284
hd_right_kidney: 75.1186
hd_left_kidney: 172.1801
hd_gallbladder: 1.4142
hd_liver: 1.4142
hd_stomach: 3.0000
hd_aorta: 1.4142
hd_pancreas: 4.1231
DSC:0.719641460073984
hd:32.686610539770776


img0022.nii.gz
Dice_spleen: 0.9657
Dice_right_kidney: 0.9526
Dice_left_kidney: 0.9552
Dice_gallbladder: 0.9124
Dice_liver: 0.9662
Dice_stomach: 0.9521
Dice_aorta: 0.9359
Dice_pancreas: 0.8758
hd_spleen: 1.0000
hd_right_kidney: 1.0000
hd_left_kidney: 1.0000
hd_gallbladder: 1.0000
hd_liver: 1.0000
hd_stomach: 1.0000
hd_aorta: 2.0000
hd_pancreas: 1.4142
DSC:0.9394818842300497
hd:1.176776695296637


img0025.nii.gz
Dice_spleen: 0.7079
Dice_right_kidney: 0.9507
Dice_left_kidney: 0.9583
Dice_gallbladder: 0.9348
Dice_liver: 0.9542
Dice_stomach: 0.7145
Dice_aorta: 0.9506
Dice_pancreas: 0.8037
hd_spleen: 127.6946
hd_right_kidney: 1.0000
hd_left_kidney: 1.0000
hd_gallbladder: 1.0000
hd_liver: 3.0000
hd_stomach: 24.1868
hd_aorta: 1.0000
hd_pancreas: 2.4495
DSC:0.8718485564891292
hd:20.16635249209642


img0029.nii.gz
Dice_spleen: 0.9706
Dice_right_kidney: 0.9557
Dice_left_kidney: 0.9544
Dice_gallbladder: 0.8729
Dice_liver: 0.9810
Dice_stomach: 0.9541
Dice_aorta: 0.9462
Dice_pancreas: 0.8315
hd_spleen: 1.0000
hd_right_kidney: 1.0000
hd_left_kidney: 1.0000
hd_gallbladder: 5.4358
hd_liver: 1.0000
hd_stomach: 1.0000
hd_aorta: 1.4142
hd_pancreas: 5.0990
DSC:0.9333107503220871
hd:2.1186289131818543


img0032.nii.gz
Dice_spleen: 0.9562
Dice_right_kidney: 0.9436
Dice_left_kidney: 0.9465
Dice_gallbladder: 0.9062
Dice_liver: 0.9698
Dice_stomach: 0.9295
Dice_aorta: 0.9432
Dice_pancreas: 0.8381
hd_spleen: 1.4142
hd_right_kidney: 1.4142
hd_left_kidney: 1.4142
hd_gallbladder: 1.4142
hd_liver: 2.0000
hd_stomach: 12.7279
hd_aorta: 1.4142
hd_pancreas: 4.1231
DSC:0.929136775368061
hd:3.240261937355124


img0035.nii.gz
Dice_spleen: 0.9615
Dice_right_kidney: 0.9397
Dice_left_kidney: 0.9409
Dice_gallbladder: 0.0000
Dice_liver: 0.9704
Dice_stomach: 0.8945
Dice_aorta: 0.9320
Dice_pancreas: 0.8269
hd_spleen: 1.0000
hd_right_kidney: 1.4142
hd_left_kidney: 1.4142
hd_gallbladder: 0.0000
hd_liver: 1.4142
hd_stomach: 2.0000
hd_aorta: 1.0000
hd_pancreas: 3.6056
DSC:0.8082492105387211
hd:1.4810239953229092


img0036.nii.gz
Dice_spleen: 0.9629
Dice_right_kidney: 0.9641
Dice_left_kidney: 0.9603
Dice_gallbladder: 0.6933
Dice_liver: 0.9702
Dice_stomach: 0.9453
Dice_aorta: 0.9125
Dice_pancreas: 0.7829
hd_spleen: 1.4142
hd_right_kidney: 1.4142
hd_left_kidney: 1.4142
hd_gallbladder: 5.9161
hd_liver: 2.2361
hd_stomach: 1.4142
hd_aorta: 2.8284
hd_pancreas: 6.3246
DSC:0.8989518307047997
hd:2.870248056896842


img0038.nii.gz
Dice_spleen: 0.9590
Dice_right_kidney: 0.9442
Dice_left_kidney: 0.9448
Dice_gallbladder: 0.6601
Dice_liver: 0.9664
Dice_stomach: 0.9434
Dice_aorta: 0.9320
Dice_pancreas: 0.8702
hd_spleen: 1.4142
hd_right_kidney: 1.0000
hd_left_kidney: 1.0000
hd_gallbladder: 2.4495
hd_liver: 1.4142
hd_stomach: 2.2361
hd_aorta: 1.4142
hd_pancreas: 2.0000
DSC:0.9025181016496431
hd:1.6160248009252816


Mean_Dice
Dice_spleen0.8998161952760841
Dice_right_kidney0.8954604433282313
Dice_left_kidney0.8602558833418179
Dice_gallbladder0.7294332916804648
Dice_liver0.9680816597037009
Dice_stomach0.8518548406047529
Dice_aorta0.9228020534933029
Dice_pancreas0.8216279411844165
Mean_hd
hd_spleen18.84309401759633
hd_right_kidney7.635881944665086
hd_left_kidney18.90053895402733
hd_gallbladder12.374486200149457
hd_liver2.1381041426139404
hd_stomach21.445718683192094
hd_aorta8.171803301214341
hd_pancreas5.033438537357125


dsc:0.8686665385765965
hd:11.817883222601964

@mathntanzi0
Copy link

This is the output from running the evaluation script as specified in the README.

/home/sntanzi/miniconda3/envs/unetr_pp/lib/python3.8/site-packages/scipy/init.py:138: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.3)
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion} is required for this version of "
Unsupported operator aten::mul encountered 108 time(s)
Unsupported operator aten::add encountered 67 time(s)
Unsupported operator aten::linalg_vector_norm encountered 42 time(s)
Unsupported operator aten::clamp_min encountered 42 time(s)
Unsupported operator aten::expand_as encountered 42 time(s)
Unsupported operator aten::div encountered 42 time(s)
Unsupported operator aten::softmax encountered 42 time(s)
Unsupported operator aten::add_ encountered 65 time(s)
Unsupported operator aten::leaky_relu_ encountered 46 time(s)
Unsupported operator aten::feature_dropout encountered 21 time(s)
Unsupported operator aten::mul_ encountered 2 time(s)
###############################################
I am running the following nnFormer: 3d_fullres
My trainer class is: <class 'unetr_pp.training.network_training.unetr_pp_trainer_synapse.unetr_pp_trainer_synapse'>
For that I will be using the following configuration:
num_classes: 13
modalities: {0: 'CT'}
use_mask_for_norm OrderedDict([(0, False)])
keep_only_largest_region None
min_region_size_per_class None
min_size_per_class None
normalization_schemes OrderedDict([(0, 'CT')])
stages...

stage: 0
{'batch_size': 2, 'num_pool_per_axis': [4, 5, 5], 'patch_size': array([ 80, 160, 160]), 'median_patient_size_in_voxels': array([138, 240, 240]), 'current_spacing': array([3.21640606, 1.61430703, 1.61430703]), 'original_spacing': array([3. , 0.75781244, 0.75781244]), 'do_dummy_2D_data_aug': False, 'pool_op_kernel_sizes': [[2, 2, 2], [2, 2, 2], [2, 2, 2], [2, 2, 2], [1, 2, 2]], 'conv_kernel_sizes': [[3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]}

stage: 1
{'batch_size': 2, 'num_pool_per_axis': [3, 5, 5], 'patch_size': array([ 64, 128, 128]), 'median_patient_size_in_voxels': array([148, 512, 512]), 'current_spacing': array([3. , 0.75781244, 0.75781244]), 'original_spacing': array([3. , 0.75781244, 0.75781244]), 'do_dummy_2D_data_aug': True, 'pool_op_kernel_sizes': [[2, 2, 2], [2, 2, 2], [2, 2, 2]], 'conv_kernel_sizes': [[1, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]}

I am using stage 1 from these plans
I am using batch dice + CE loss

I am using data from this folder: /home/sntanzi/lustre/unetr_plus_plus/DATASET_Synapse/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse/Task002_Synapse/unetr_pp_Data_plans_v2.1
###############################################
2024-09-12 16:31:29.226961: Using dummy2d data augmentation
[0.57142857 0.28571429 0.14285714]
Total trainable parameters: 42.95 M
MAdds: 47.94 G
2024-09-12 16:31:32.016939: loading checkpoint /mnt/lustre/users/sntanzi/unetr_plus_plus_Test/unetr_pp/evaluation/unetr_pp_synapse_checkpoint/unetr_pp/3d_fullres/Task002_Synapse/unetr_pp_trainer_synapse__unetr_pp_Plansv2.1/fold_0/model_final_checkpoint.model train= False
I am here !!!
True
loading dataset
loading all case properties
2024-09-12 16:31:36.721042: Using splits from existing split file: /home/sntanzi/lustre/unetr_plus_plus/DATASET_Synapse/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse/Task002_Synapse/splits_final.pkl
2024-09-12 16:31:36.746819: The split file contains 5 splits.
2024-09-12 16:31:36.747149: Desired fold for training: 0
2024-09-12 16:31:36.747416: This split has 18 training and 12 validation cases.
/mnt/lustre/users/sntanzi/unetr_plus_plus_Test/unetr_pp/training/network_training/network_trainer_synapse.py:345: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
saved_model = torch.load(fname, map_location=torch.device('cpu'))
img0001 (2, 147, 451, 451)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 147, 451, 451)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 28, 55, 83], [0, 54, 108, 162, 215, 269, 323], [0, 54, 108, 162, 215, 269, 323]]
number of tiles: 196
computing Gaussian
prediction done
Inference Time (k=img0001): 100.07151055335999 sec.
img0002 (2, 139, 487, 487)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 139, 487, 487)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 25, 50, 75], [0, 60, 120, 180, 239, 299, 359], [0, 60, 120, 180, 239, 299, 359]]
number of tiles: 196
using precomputed Gaussian
prediction done
Inference Time (k=img0002): 100.3103621006012 sec.
img0003 (2, 198, 607, 607)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 198, 607, 607)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 27, 54, 80, 107, 134], [0, 60, 120, 180, 240, 299, 359, 419, 479], [0, 60, 120, 180, 240, 299, 359, 419, 479]]
number of tiles: 486
using precomputed Gaussian
prediction done
Inference Time (k=img0003): 248.2944803237915 sec.
img0004 (2, 140, 401, 401)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 140, 401, 401)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 25, 51, 76], [0, 55, 109, 164, 218, 273], [0, 55, 109, 164, 218, 273]]
number of tiles: 144
using precomputed Gaussian
prediction done
Inference Time (k=img0004): 73.51100087165833 sec.
img0008 (2, 148, 492, 492)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 148, 492, 492)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 28, 56, 84], [0, 61, 121, 182, 243, 303, 364], [0, 61, 121, 182, 243, 303, 364]]
number of tiles: 196
using precomputed Gaussian
prediction done
Inference Time (k=img0008): 101.2293291091919 sec.
img0022 (2, 148, 519, 519)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 148, 519, 519)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 28, 56, 84], [0, 56, 112, 168, 223, 279, 335, 391], [0, 56, 112, 168, 223, 279, 335, 391]]
number of tiles: 256
using precomputed Gaussian
prediction done
Inference Time (k=img0022): 130.67318439483643 sec.
img0025 (2, 142, 562, 562)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 142, 562, 562)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 26, 52, 78], [0, 62, 124, 186, 248, 310, 372, 434], [0, 62, 124, 186, 248, 310, 372, 434]]
number of tiles: 256
using precomputed Gaussian
prediction done
Inference Time (k=img0025): 131.4058916568756 sec.
img0029 (2, 100, 591, 591)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 100, 591, 591)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 18, 36], [0, 58, 116, 174, 232, 289, 347, 405, 463], [0, 58, 116, 174, 232, 289, 347, 405, 463]]
number of tiles: 243
using precomputed Gaussian
prediction done
Inference Time (k=img0029): 124.09257483482361 sec.
img0032 (2, 144, 500, 500)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 144, 500, 500)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 27, 53, 80], [0, 62, 124, 186, 248, 310, 372], [0, 62, 124, 186, 248, 310, 372]]
number of tiles: 196
using precomputed Gaussian
prediction done
Inference Time (k=img0032): 100.53988647460938 sec.
img0035 (2, 157, 622, 622)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 157, 622, 622)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 31, 62, 93], [0, 62, 124, 185, 247, 309, 370, 432, 494], [0, 62, 124, 185, 247, 309, 370, 432, 494]]
number of tiles: 324
using precomputed Gaussian
prediction done
Inference Time (k=img0035): 166.99217009544373 sec.
img0036 (2, 184, 504, 504)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 184, 504, 504)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 30, 60, 90, 120], [0, 63, 125, 188, 251, 313, 376], [0, 63, 125, 188, 251, 313, 376]]
number of tiles: 245
using precomputed Gaussian
prediction done
Inference Time (k=img0036): 126.27710151672363 sec.
img0038 (2, 167, 660, 660)
debug: mirroring True mirror_axes (0, 1, 2)
step_size: 0.5
do mirror: True
data shape: (1, 167, 660, 660)
patch size: [ 64 128 128]
steps (x, y, and z): [[0, 26, 52, 77, 103], [0, 59, 118, 177, 236, 296, 355, 414, 473, 532], [0, 59, 118, 177, 236, 296, 355, 414, 473, 532]]
number of tiles: 500
using precomputed Gaussian
prediction done
Inference Time (k=img0038): 256.394300699234 sec.
Total Images: 12
Total Time: 1659.7917926311493 sec.
Time per Image: 138.31598271926245 sec.
2024-09-12 17:01:03.844637: finished prediction
2024-09-12 17:01:03.845222: evaluation of raw predictions
2024-09-12 17:01:12.895104: determining postprocessing
Foreground vs background
before: 0.8360412193984949
after: 0.7968751986036177
1
before: 0.8998353135365158
after: 0.8771534310778962
10
before: 0.7743821281219098
after: 0.7563978759201335
11
before: 0.821625634924699
after: 0.8218531423339309
Removing all but the largest region for class 11 improved results!
min_valid_object_sizes None
12
before: 0.7318294222676073
after: 0.7333933631569619
Removing all but the largest region for class 12 improved results!
min_valid_object_sizes None
13
before: 0.737392876834185
after: 0.7378588381963712
Removing all but the largest region for class 13 improved results!
min_valid_object_sizes None
2
before: 0.8955066818170025
after: 0.9028959441850466
Removing all but the largest region for class 2 improved results!
min_valid_object_sizes None
3
before: 0.8602533792789305
after: 0.8758235669771519
Removing all but the largest region for class 3 improved results!
min_valid_object_sizes None
4
before: 0.7294448414913872
after: 0.7320045171854456
Removing all but the largest region for class 4 improved results!
min_valid_object_sizes None
5
before: 0.7836210679718717
after: 0.7900392701623545
Removing all but the largest region for class 5 improved results!
min_valid_object_sizes None
6
before: 0.9680828363528399
after: 0.9692370735987633
Removing all but the largest region for class 6 improved results!
min_valid_object_sizes None
7
before: 0.8518455346655008
after: 0.8314739499185277
8
before: 0.922795114524353
after: 0.9199012540199375
9
before: 0.89192102039363
after: 0.89192102039363
done
for which classes:
[11, 12, 13, 2, 3, 4, 5, 6]
min_object_sizes
None
force_separate_z: None interpolation order: 1
separate z: True lowres axis [0]
separate z, order in z is 0 order inplane is 1
force_separate_z: None interpolation order: 1
separate z: True lowres axis [0]
separate z, order in z is 0 order inplane is 1
force_separate_z: None interpolation order: 1
separate z: True lowres axis [0]
separate z, order in z is 0 order inplane is 1
done

@2vfbg
Copy link

2vfbg commented Oct 12, 2024

I meet the same question

@WuWeiZero
Copy link

@mathntanzi0

这是运行 README 中指定的评估脚本的输出。

/home/sntanzi/miniconda3/envs/unetr_pp/lib/python3.8/site-packages/scipy/init.py:138:用户警告:此版本的 SciPy 需要 NumPy 版本 >=1.16.5 和 <1.23.0(检测到版本 1.24.3) warnings.warn(f“此版本的”遇到不支持的运算符 aten::mul 遇到 108 次“不支持的运算符 aten::mul} 需要 NumPy 版本 >={np_minversion} 和 <{np_maxversion} 不支持的运算符 aten::遇到 add 67 次 遇到不支持的运算符 aten::linalg_vector_norm 遇到 42 次 遇到不支持的运算符 aten::clamp_min 遇到 42 次 遇到不支持的运算符 aten::expand_as 遇到 42 次 遇到不支持的运算符 aten::d iv 遇到 42 次 遇到不支持的运算符 aten::softmax 42 次 遇到不支持的运算符 aten::add_ 遇到 65 次遇到不支持的运算符 aten::leaky_relu_ 46 次 遇到不支持的运算符 aten::feature_dropout 遇到 21 次 遇到不支持的运算符 aten::mul_ 遇到 2 次 ############################################### 我正在运行以下 nnFormer: 3d_fullres 我的训练器类是:<类 'unetr_pp.training.network_training.unetr_pp_trainer_synapse.unetr_pp_trainer_synapse'>为此,我将使用以下配置: num_classes: 13 种模式: {0: 'CT'} use_mask_for_norm OrderedDict([(0, False)]) keep_only_largest_region None min_region_size_per_class None min_size_per_class None normalization_schemes OrderedDict([(0, 'CT')]) 阶段...

stage: 0 {'batch_size': 2, 'num_pool_per_axis': [4, 5, 5], 'patch_size': array([ 80, 160, 160]), 'median_patient_size_in_voxels': array([138, 240, 240]), 'current_spacing': array([3.21640606, 1.61430703, 1.61430703]), 'original_spacing': array([3. , 0.75781244, 0.75781244]), 'do_dummy_2D_data_aug': False, 'pool_op_kernel_sizes': [[2, 2, 2], [2, 2], [2, 2, 2], [2, 2, 2], [1, 2, 2]], 'conv_kernel_sizes': [[3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]}

stage: 1 {'batch_size': 2, 'num_pool_per_axis': [3, 5, 5], 'patch_size': array([ 64, 128, 128]), 'median_patient_size_in_voxels': array([148, 512, 512]), 'current_spacing': array([3. , 0.75781244, 0.75781244]), 'original_spacing': array([3. , 0.75781244, 0.75781244]), 'do_dummy_2D_data_aug': True, 'pool_op_kernel_sizes': [[2, 2, 2], [2, 2], [2, 2, 2]], 'conv_kernel_sizes': [[1, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3], [3, 3, 3]]}

我正在使用这些计划中的第 1 阶段,我正在使用批量骰子 + CE 损失

我正在使用此文件夹中的数据: /home/sntanzi/lustre/unetr_plus_plus/DATASET_Synapse/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse/Task002_Synapse/unetr_pp_Data_plans_v2.1 ############################################### 2024-09-12 16:31:29.226961:使用 dummy2d 数据增强 [0.57142857 0.28571429 0.14285714] 可训练参数总数:42.95 M MAdds:47.94 G2024-09-12 16:31:32.016939:加载检查点 /mnt/lustre/users/sntanzi/unetr_plus_plus_Test/unetr_pp/evaluation/unetr_pp_synapse_checkpoint/unetr_pp/3d_fullres/Task002_Synapse/unetr_pp_trainer_synapse__unetr_pp_Plansv2.1/fold_0/model_final_checkpoint.model train= 错误 我在这里 !!真实加载数据集加载所有案例属性 2024-09-12 16:31:36.721042:使用现有拆分文件中的拆分:/home/sntanzi/lustre/unetr_plus_plus/DATASET_Synapse/unetr_pp_raw/unetr_pp_raw_data/Task02_Synapse/Task002_Synapse/splits_final.pkl 2024-09-12 16:31:36.746819:拆分文件包含 5 个拆分。 2024-09-12 16:31:36.747149:训练所需的折叠数:02024-09-12 16:31:36.747416:此拆分有 18 个训练和 12 个验证案例。 /mnt/lustre/users/sntanzi/unetr_plus_plus_Test/unetr_pp/training/network_training/network_trainer_synapse.py:345:FutureWarning:您正在使用 with(当前默认值),它隐式使用默认 pickle 模块。可以构造恶意的 pickle 数据,这些数据将在 unpickling 期间执行任意代码(有关详细信息,请参见 https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models)。在将来的版本中,的默认值将翻转为 。这限制了在 unpickling 期间可以执行的函数。将不再允许通过此模式加载任意对象,除非用户通过 .我们建议您为无法完全控制加载文件的任何使用案例开始设置。请在 GitHub 上打开一个问题,了解与此实验性功能相关的任何问题。 saved_model = torch.load(fname, map_location=torch.device('cpu')) img0001 (2, 147, 451, 451) debug: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: True data shape: (1, 147, 451, 451) 补丁大小: [ 64 128 128] 步长 (x, y, and z): [[0, 28, 55, 83], [0, 54, 108, 162, 215, 269, 323], [0, 54, 108, 162, 215, 269, 323]] 瓦片数: 196 计算高斯预测完成 推理时间 (k=img0001): 100.07151055335999 秒 img0002 (2, 139, 487, 487) 调试: 镜像 真mirror_axes (0, 1, 2) step_size: 0.5 做镜像: 真数据形状: (1, 139, 487, 487) 补丁大小: [ 64 128 128]步长(x、y 和 z):[[0, 25, 50, 75], [0, 60, 120, 180, 239, 299, 359], [0, 60, 120, 180, 239, 299, 359]] 瓦片数: 196 使用预先计算的高斯预测完成 推理时间 (k=img0002): 100.3103621006012 秒 img0003 (2, 198, 607, 607) debug: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: 真实数据形状:(1, 198, 607, 607) patch 大小: [ 64 128 128] 步长 (x, y, and z): [[0, 27, 54, 80, 107, 134], [0, 60, 120, 180, 240, 299, 359, 419, 479], [0, 60, 120, 180, 240, 299, 359, 419, 479]] 瓦片数: 486 使用预先计算的高斯预测完成 推理时间 (k=img0003): 248.2944803237915 秒 img0004 (2, 140, 401, 401) debug: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: 真实数据形状: (1, 140, 401, 401) 补丁大小: [ 64 128 128] 步长 (x, y, and z): [[0, 25, 51, 76], [0, 55, 109, 164, 218, 273], [0, 55, 109, 164, 218, 273]] 瓦片数量: 144 使用预先计算的高斯预测完成 推理时间 (k=img0004): 73.51100087165833 秒 img0008 (2, 148, 492, 492) debug: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: True data shape: (1, 148, 492, 492) 补丁大小: [ 64 128 128] 步长 (x, y, and z): [[0, 28, 56, 84], [0, 61, 121, 182, 243, 303, 364], [0, 61, 121, 182, 243, 303, 364]] 瓦片数量: 196 使用预先计算的高斯预测完成 推理时间 (k=img0008): 101.2293291091919 秒 img0022 (2, 148, 519, 519) 调试: 镜像 真mirror_axes (0, 1, 2) step_size: 0.5 执行镜像: 真数据形状: (1, 148, 519, 519) 补丁大小: [ 64 128 128] 步长 (x, y 和 z): [[0, 28, 56, 84], [0, 56, 112, 168, 223, 279, 335, 391], [0, 56, 112, 168, 223, 279, 335, 391]] 瓦片数:256 使用预先计算的高斯预测完成 推理时间 (k=img0022):130.67318439483643 秒 img0025 (2, 142, 562, 562) 调试:镜像 真mirror_axes (0, 1, 2) step_size:0.5 执行镜像:真数据形状:(1, 142, 562, 562) 补丁大小:[ 64 128 128]步骤(x、y 和 z):[[0, 26, 52, 78], [0, 62, 124, 186, 248, 310, 372, 434], [0, 62, 124, 186, 248, 310, 372, 434]] 瓦片数:256 使用预先计算的高斯预测完成 推理时间 (k=img0025):131.4058916568756 秒 img0029 (2, 100, 591, 591) debug:镜像 True mirror_axes (0, 1, 2) step_size:0.5 执行镜像: 真实数据形状:(1, 100, 591, 591) 图块大小:[ 64 128 128] 步长(x、y 和 z):[[0, 18, 36], [0, 58, 116, 174, 232, 289, 347, 405, 463], [0, 58, 116, 174, 232, 289, 347, 405, 463]] 瓦片数:243 使用预先计算的高斯预测完成 推理时间 (k=img0029):124.09257483482361 秒 img0032 (2, 144, 500, 500) debug: 镜像 真mirror_axes (0, 1, 2) step_size: 0.5 do mirror: 真数据形状: (1, 144, 500, 500) 补丁大小: [ 64 128 128] 步长 (x, y, and z): [[0, 27, 53, 80], [0, 62, 124, 186, 248, 310, 372], [0, 62, 124, 186, 248, 310, 372]] 瓦片数量: 196 使用预先计算的高斯预测完成 推断e 时间 (k=img0032):100.53988647460938 秒 img0035 (2, 157, 622, 622) 调试:镜像真mirror_axes (0, 1, 2) step_size:0.5 做镜像: 真数据形状:(1, 157, 622, 622) 补丁大小: [ 64 128 128] 步长 (x, y, and z): [[0, 31, 62, 93], [0, 62, 124, 185, 247, 309, 370, 432, 494], [0, 62, 124, 185, 247, 309, 370, 432, 494]] 瓦片数: 324 使用预先计算的高斯预测完成 推理时间 (k=img0035):166.99217009544373 秒 img0036 (2, 184, 504, 504) 调试: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: 真实数据形状: (1, 184, 504, 504) 补丁大小: [ 64 128 128]步长(x、y 和 z):[[0, 30, 60, 90, 120], [0, 63, 125, 188, 251, 313, 376], [0, 63, 125, 188, 251, 313, 376]] 瓦片数: 245 使用预先计算的高斯预测完成 推理时间 (k=img0036): 126.27710151672363 秒 img0038 (2, 167, 660, 660) debug: 镜像 True mirror_axes (0, 1, 2) step_size: 0.5 do mirror: 真实数据形状:(1, 167, 660, 660) 块大小: [ 64 128 128] 步长 (x, y, and z): [[0, 26, 52, 77, 103], [0, 59, 118, 177, 236, 296, 355, 414, 473, 532], [0, 59, 118, 177, 236, 296, 355, 414, 473, 532]] 瓦片数: 500 使用预先计算的高斯预测完成 推理时间 (k=img0038):256.394300699234 秒 图像总数: 12 总时间:1659.7917926311493 秒 每张图像的时间:138.31598271926245 秒 2024-09-12 17:01:03.844637:完成预测 2024-09-12 17:01:03.845222:原始预测评估 2024-09-12 17:01:12.895104:确定后处理 前景与背景 之前:0.8360412193984949 之后:0.7968751986036177 1 之前:0.8998353135365158 之后:0.8771534310778962 10 之前:0.7743821281219098 之后:0.7563978759201335 11 之前:0.821625634924699 之后:0.8218531423339309 删除类 11 的最大区域之外的所有区域改进了结果! min_valid_object_sizes 无 12 之前:0.7318294222676073 之后:0.7333933631569619 删除类 12 的最大区域之外的所有区域改进了结果! min_valid_object_sizes 无 13 之前:0.737392876834185 之后:0.7378588381963712删除类 13 中除最大区域之外的所有区域改进了结果! min_valid_object_sizes 无 2 之前:0.8955066818170025 之后:0.9028959441850466 删除第 2 类除最大区域之外的所有区域,结果得到了改善! min_valid_object_sizes 无 3 之前:0.8602533792789305 之后:0.8758235669771519 删除除 3 类最大区域之外的所有区域,改善了结果! min_valid_object_sizes 无 4 之前:0.7294448414913872 之后:0.7320045171854456 删除除 4 类最大区域之外的所有区域,结果得到了改善! min_valid_object_sizes 无 5 之前:0.7836210679718717 之后:0.7900392701623545 删除除 5 类最大区域之外的所有区域,改善了结果! min_valid_object_sizes 无 6 之前:0.9680828363528399 之后:0.9692370735987633 删除类 6 中除最大区域之外的所有区域改进了结果! min_valid_object_sizes 无 7 之前: 0.8518455346655008 之后: 0.8314739499185277 8 之前: 0.922795114524353 之后: 0.9199012540199375 9 之前: 0.89192102039363 之后: 0.89192102039363 完成 哪些类: [11, 12, 13, 2, 3, 4, 5, 6] min_object_sizes无 force_separate_z: 无 插值顺序: 1 个单独的 z: 真正的低分辨率轴 [0] 单独的 z,z 中的顺序是 0 平面内的顺序是 1 force_separate_z: 无 插值顺序: 1 个单独的 z: 真正的低分辨率轴 [0] 单独的 z,z 中的顺序是 0 平面内的顺序是 1 force_separate_z: 无 插值顺序: 1 个单独的 z: 真正的低分辨率轴 [0] 分离 z,z 中的顺序为 0,平面内的顺序为 1 完成torch.load``weights_only=False``weights_only``True``torch.serialization.add_safe_globals``weights_only=True

Hello, can I ask you which code you got this result by running? I am running the evaluation code given by the author and do not have such detailed results

@mathntanzi0
Copy link

WuWeiZero

Hello, I run the unetr_pp/inference/predict_simple.py and unetr_pp/inference_synapse.py files. For your information, you can look at the evaluation script of the BraTs dataset 'run_evaluation_tumor.sh', it's evaluated in the same manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants