From cecacfdf172f0ec99ba518f0d697bae239b22def Mon Sep 17 00:00:00 2001 From: Lukasz Tomasz Bienias <lutobi@iapetus.imm.dtu.dk> Date: Tue, 24 Mar 2020 12:00:02 +0100 Subject: [PATCH] Not important --- mask_rcnn/LICENSE => LICENSE | 0 mask_rcnn/MANIFEST.in => MANIFEST.in | 0 documentation.md | 77 ++++++++++++++++++++++++++++ table_1_dcan.py | 2 + 4 files changed, 79 insertions(+) rename mask_rcnn/LICENSE => LICENSE (100%) rename mask_rcnn/MANIFEST.in => MANIFEST.in (100%) create mode 100644 documentation.md diff --git a/mask_rcnn/LICENSE b/LICENSE similarity index 100% rename from mask_rcnn/LICENSE rename to LICENSE diff --git a/mask_rcnn/MANIFEST.in b/MANIFEST.in similarity index 100% rename from mask_rcnn/MANIFEST.in rename to MANIFEST.in diff --git a/documentation.md b/documentation.md new file mode 100644 index 00000000..63201931 --- /dev/null +++ b/documentation.md @@ -0,0 +1,77 @@ +# Documentation +This documentation is meant to describe structure of the package as well as all files included in the paper package for the article "Insights into the behavior of +multi-task deep neural networks for medical image segmentation", which can be read [here](https://ieeexplore.ieee.org/document/8918753). + +## Structure description +The package consists of two main parts: Mask R-CNN and SA-FCN. Each network has dedicated folder with architecture itself as well as all peripherals. Due to +different characteristics of both models, its folder structure is slighlty different and will be described separately. + +### Mask R-CNN +Folder structure is divided into: +* logs - contains trained models as well as informations about events and training +* python - contains all python codes, which defines networks, training, prediction, post-processing and score calculation processes +* network_predictions - contains prediction samples, which are produced by the predicting process +* post_processing - contains samples generated by matlab files, which carries out post-processing actions +* samples - contains original dataset + +Files which are not included in the abovementioned folders are: +* LICENSE - consists license for the package +* README.md - describes the repository +* documentation.md document which you are reading now +* mask_rcnn_coco.h5 - pretrained weight for Mask RCNN model +* requirements.txt - describes environemnt necessary to run the end to end training +* run_it.sh - bash script which runs all files +* setup.py + +Also files defining network, training, prediction and post processing differes for Mask R-CNN and SA-FCN. That is why we focus on them separately. + +In the mask_rcnn/python directory you can find the following files: +* config.py - base configurations class, which defines default parameters of the Mask R-CNN network. +* model.py - the main Mask R-CNN model implementation. +* parallel_model.py - multi-GPU support for Keras. +* utils.py - common utility functions and classes. +* visualize.py - display and visualization functions. + +In the mask_rcnn/samples/glands directory you can find the following files: +* glands.py - conducts training of the model. +* predict.py - conducts prediction process on trained model. +* predict_x5.py - conducts prediction process on five different trained models. + +In the mask_rcnn/post_proceesing directory you can find the following files: +* F1scores.m - calculates f1 score for detection. +* ObjectDice.m - calculates an object-level Dice index. +* ObjectHausdorff.m - calculates ojbect-level hausdorff distance between segmented objects and its corresponding ground truth objects +* calculate_scores_automatic.m - calculates abovementioned scores and saves post processed samples. This script conducts operations on single, predefined model. Also saves calculated scores into .csv file. +* calculate_scores_automatic_x5.m - calculates abovementioned scores and saves post processed samples. This script conducts operations on all five models automatically. Also saves calculated scores into .csv files. +* save_table_to_pdf.py - generates table from previously saved .csv files and saves it to .pdf file. + +### SA-FCN +Folder structure is divided into: +* dataset/glands/ - contains original dataset. +* models - contains trained models. +* network_predictions - contains prediction samples, which are produced by the predicting process +* post_processing - contains samples generated by matlab files, which carries out post-processing actions +* python - contains all python codes, which defines networks, training, prediction, post-processing and score calculation processes + + +Files which are not included in the abovementioned folders are: +* README.md - describes the repository +* requirements.txt - describes environemnt necessary to run the end to end training +* run_it.sh - bash script which runs all files + + +In the sa_fcn/python directory you can find the following files: +* Gland_loader.py - loads samples into the SA-FCN model. +* fcn.py - consists architecture of SA-FCN netwrok as well as different version of FCN models. +* train.py - conducts training of the model. +* predict.py - conducts prediction process on trained model. +* predict_x5.py - conducts prediction process on five different trained models. +* save_table_to_pdf.py - generates table from previously saved .csv files and saves it to .pdf file. + + +In the sa_fcn/post_proceesing directory you can find the following files: +* F1scores.m - calculates f1 score for detection. +* ObjectDice.m - calculates an object-level Dice index. +* ObjectHausdorff.m - calculates ojbect-level hausdorff distance between segmented objects and its corresponding ground truth objects +* pp_our_automatic.m - calculates abovementioned scores and saves post processed samples. This script conducts operations on single, predefined model. Also saves calculated scores into .csv file. +* pp_our_automatic_x5.m - calculates abovementioned scores and saves post processed samples. This script conducts operations on all five models automatically. Also saves calculated scores into .csv files. diff --git a/table_1_dcan.py b/table_1_dcan.py index 1ee5f20e..3d1bf56b 100644 --- a/table_1_dcan.py +++ b/table_1_dcan.py @@ -45,6 +45,8 @@ clust_data2 = np.array(['Dice Index', dice_index_A_mean, dice_index_B_mean]) clust_data =np.vstack((clust_data1, clust_data2)) pp = PdfPages('table_1_dcan.pdf') +pp = PdfPages('table_1_dcan.png') + #csv_data = np.vstack((np.array([f1_score_A_mean, f1_score_B_mean]), np.array([dice_index_A_mean, dice_index_B_mean]))) #savetxt('python/sa_fcn_table.csv', csv_data, delimiter=',') -- GitLab