-
Notifications
You must be signed in to change notification settings - Fork 0
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
Evaluation of ms lesion segmentation algorithm #21
Comments
Here is a graph presenting the results of the investigations done: This shows a comparison between:
As we can see on the graphs, the explorations did not outperform the current SOTA model. As suggested by @jcohenadad exploring the nnUNet data augmentation strategies could help : link to data augmentation |
Very interesting investigations @plbenveniste ! |
I am currently running some experiments on all the data after it was reformated. The input data is the following (stored on moneta): One thing I had to do was set Here are my findings:
|
Other findings:
For now, my conclusions are:
TODO:
|
The best model is stored in The inference was performed on the trainining, validation and testing set using the following command on kronos: conda activate venv_monai
CUDA_VISIBLE_DEVICES=1 python ms-lesion-agnostic/monai/test_model.py --config ms-lesion-agnostic/monai/config_test.yml --data-split train
CUDA_VISIBLE_DEVICES=2 python ms-lesion-agnostic/monai/test_model.py --config ms-lesion-agnostic/monai/config_test.yml --data-split test
CUDA_VISIBLE_DEVICES=3 python ms-lesion-agnostic/monai/test_model.py --config ms-lesion-agnostic/monai/config_test.yml --data-split validation The results of these inferences are stored in the same folder as the best model. |
I ran the following command line to get the performance of the model (for test set): python ms-lesion-agnostic/monai/plot_performance.py --pred-dir-path ~/net/ms-lesion-agnostic/results/2024-07-18_10\:46\:21.634514/test_set/ --data-json-path ~/net/ms-lesion-agnostic/msd_data/dataset_2024-07-22_seed42_lesionOnly.json --split test
|
From a visual analysis of the validation set, no clear behaviour appeared:
Moving on to a more precise analysis of the results. |
When looking at the results on the training set, I noticed that the model performs rather poorly on the basel dataset. I was wondering if maybe it was linked to the field of views of the images. On the train set:
From this, I have two conclusions:
Next steps to be discussed. |
To deal with the problem caused by the differences in terms of protocol when segmenting lesions (some segment lesions in the brain stem and others stop at C1), we decided to remove the regions of the images which are above C1. To do so, we will use the contrast-agnostic model to segment the spinal cord and remove all voxels above the highest segmented point in the Inferior-superior direction. |
Warning I just realize I was doing a big mistake in the test inference script. I am cropping the image to the size of the kernel: [64, 128, 128] in RPI before inference. Because of this, the model doesn't see the entire image. I am currently working on fixing this. This means I will also have to recompute the models performances |
I removed the cropping of the image before doing inference. It is now giving more accurate results. This can be seen with the fact that fewer predictions have a dice score of 1: this happened when the images were cropped and the cropped image didn't contain any lesion. However, it also raised the question of which threshold to use on the soft prediction: this is being explored in this issue #32 |
The result is disappointing. I think the strategy I used is problematic. What I was doing was creating multiple predictions, threshold at 0.5, then calculate each dice score and then average the dice score. TODO:
|
TTA second strategy In a second attempt to improve the results of TTA, I did the following: python ms-lesion-agnostic/monai/compute_performance_tta_sum.py --path-pred ~/net/ms-lesion-agnostic/tta_exp/test_set/ --path-json ~/net/ms-lesion-agnostic/msd_data/dataset_2024-07-24_seed42_lesionOnly.json --split test --output-dir ~/net/ms-lesion-agnostic/tta_exp/perf_output_sum_image Then to compute the figure, I did the following: python ms-lesion-agnostic/monai/plot_performance.py --pred-dir-path ~/net/ms-lesion-agnostic/tta_exp/perf_output_sum_image/ --data-json-path ~/net/ms-lesion-agnostic/msd_data/dataset_2024-07-24_seed42_lesionOnly.json --split test Here is the output: This second strategy is not as effective as I thought it be ! The results are a bit disappointing as well |
Now I want to evaluate the normal (meaning no TTA) AttentionUnet model on the following metrics: Dice, PPV, Sensitivity and F1 score. CUDA_VISIBLE_DEVICES=1 python ms-lesion-agnostic/monai/test_model.py --config ms-lesion-agnostic/monai/config_test.yml --data-split test To plot the performance: python ms-lesion-agnostic/monai/plot_performance.py --pred-dir-path ~/net/ms-lesion-agnostic/results/2024-07-18_10\:46\:21.634514/test_set/ --data-json-path ~/net/ms-lesion-agnostic/msd_data/dataset_2024-07-24_seed42_lesionOnly.json --split test Here are the results: |
Opening this issue to discuss the results and the performances of the models trained to segment MS lesions in the spinal cord.
The text was updated successfully, but these errors were encountered: