ivadomed / model-spinal-rootlets

Deep-learning based segmentation of the spinal nerve rootlets
5 stars 2 forks source link

Ventral rootlets - results of first segmentation model #36

Closed LouisThomasLapointe closed 6 months ago

LouisThomasLapointe commented 8 months ago

1) Dataset The first training was done on 14 subjects (segmented manually by LTL) from the spine-generic and OpenNeuro datasets. Manual segmentation of the ventral rootlets was done while the dorsal rootlets' segmentation were taken from the D5 dataset described here. 2) Model training nnUNet 3d_fullres model trained on 14 subjects. To initialize the dataset, the following command was used: nnUNetv2_plan_and_preprocess -d 101 --verify_dataset_integrity -c 3d_fullres

For starting the training, the following command was used: CUDA_VISIBLE_DEVICES=0 nnUNetv2_train 101 3d_fullres 0

For running the inference on new images, the following command was used: nnUNetv2_predict -i nnUNet_raw/Dataset103_M1/imagesTr -o nnUNet_raw/Dataset103_M1/labelsTr -d 101 -c 3d_fullres -f 0 Where the Dataset103_M1 folder contains the images on which inference was run.

3) Results

Here are the learning curves for the training. ![progress](https://github.com/ivadomed/model-spinal-rootlets/assets/146556291/a1b21630-d6d5-49b6-848d-56455f3a2e7a)

Here is an example of the prediction the model give: The image image The segmentation image

We can see that, while not perfect, the predictions the model can produce are promising for a first training on a relatively small dataset. There is some obvious problem with the model, mainly incorrect labelisation of pixels around the rootlets as rootlets pixel, incomplete segmentation of an individual rootlet and incorrect labelisation of rootlets pixels as background pixel. Those errors are all visible in the image below. image image

Finally, there is some rootlets, especially in the lower cervical levels, that are associated with the wrong spinal level. The problem is rare, but tends to happen in already challenging to segment MRI images or ones where the levels are really close one to another. image

jcohenadad commented 8 months ago

Very nice results @LouisThomasLapointe ! Keep up the good work 😊

valosekj commented 8 months ago

@LouisThomasLapointe nice results! 🚀

Finally, there is some rootlets, especially in the lower cervical levels, that are associated with the wrong spinal level. The problem is rare, but tends to happen in already challenging to segment MRI images or ones where the levels are really close one to another.

This happened to us during dorsal rootlets training in a few subjects too. We QCed the predicted images and fixed the problematic levels manually.

A two minor comments/suggestions:

  1. Could you upload a TSV file listing the subjects you used for the training/testing to training/dataset_creation? You can name the file V1.tsv (V = ventral). Please inlcude two columns: file_name (e.g., sub-amu01_T2w.nii.gz) and folder (train/test). You can do so by cloning the repo, creating a new branch, adding the file, committing the file, pushing the file, and opening a PR. Tutorial here. - done in https://github.com/ivadomed/model-spinal-rootlets/pull/38
  2. Can you please try to generate QC for the predicted images? It will allow us a convenient assessment of the rootlets across all subjects. To do so: download and install the latest SCT, run the first sct_qc command from this comment (you will need SC seg which is used to crop the image; you can get it by running sct_deepseg_sc), loop across all predicted images.
valosekj commented 6 months ago

Closing -- see summary: https://github.com/ivadomed/model-spinal-rootlets/issues/42