davidiommi / Pytorch--3D-Medical-Images-Segmentation--SALMON

Segmentation deep learning ALgorithm based on MONai toolbox: single and multi-label segmentation software developed by QIMP team-Vienna.
https://zmpbmt.meduniwien.ac.at/wissenschaft-forschung/qimp/
MIT License
120 stars 26 forks source link
deep-learning monai monai-toolbox mri nnunet organs pytorch segmentation transformers unet unet-3d unet-pytorch unetr

Salmon-logo-1

SALMON v.2: Segmentation deep learning ALgorithm based on MONai toolbox

This is my "open-box" version if I want to modify the parameters for some particular task, while the two above are hard-coded. The monai 0.5.0 folder contains the previous versions based on the old monai version.


Requirements

Follow the steps in "installation_commands.txt". Installation via Anaconda and creation of a virtual env to download the python libraries and pytorch/cuda.


Python scripts and their function

Use first "organize_folder_structure.py" to create organize the data. Modify the input parameters to select the two folders: images and labels folders with the dataset. Set the resolution of the images here before training.

.
├── Data_folder                   
|   ├── CT               
|   |   ├── 1.nii 
|   |   ├── 2.nii   
|   |   └── 3.nii                     
|   ├── CT_labels                         
|   |   ├── 1.nii 
|   |   ├── 2.nii   
|   |   └── 3.nii  

Data structure after running it:

.
├── Data_folder  
|   ├── CT  
|   ├── CT_labels 
|   ├── images              
|   |   ├── train             
|   |   |   ├── image1.nii              
|   |   |   └── image2.nii                     
|   |   └── val             
|   |   |   ├── image3.nii             
|   |   |   └── image4.nii
|   |   └── test             
|   |   |   ├── image5.nii              
|   |   |   └── image6.nii
|   ├── labels              
|   |   ├── train             
|   |   |   ├── label1.nii              
|   |   |   └── label2.nii                     
|   |   └── val             
|   |   |   ├── label3.nii             
|   |   |   └── label4.nii
|   |   └── test             
|   |   |   ├── label5.nii              
|   |   |   └── label6.nii

Training:

Sample images: the following images show the segmentation of carotid artery from MRI sequence

Imageresult

Sample images: the following images show the multi-label segmentation of prostate transition zone and peripheral zone from MRI sequence

Image1result1!


Inference:

Sample script inference

Some note:

Check more examples at https://github.com/Project-MONAI/tutorials/blob/master/3d_segmentation/.

UneTR Notes from the authors:

Feature_size and pos_embed are the parameters that need to changed to adopt it for your application of interest. Other parameters that are mentioned come from Vision Transformer (ViT) default hyper-parameters (original architecture). In addition, the new revision of UNETR paper with more descriptions is now publicly available. Please check for more details: https://arxiv.org/pdf/2103.10504.pdf

Now let's look at each of these hyper-parameters in the order of importance: