Skip to content
Snippets Groups Projects
Commit cecacfdf authored by Lukasz Tomasz Bienias's avatar Lukasz Tomasz Bienias
Browse files

Not important

parent 55778c80
Branches
No related tags found
No related merge requests found
File moved
File moved
# 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.
...@@ -45,6 +45,8 @@ clust_data2 = np.array(['Dice Index', dice_index_A_mean, dice_index_B_mean]) ...@@ -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)) clust_data =np.vstack((clust_data1, clust_data2))
pp = PdfPages('table_1_dcan.pdf') 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]))) #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=',') #savetxt('python/sa_fcn_table.csv', csv_data, delimiter=',')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment