ivadomed / ms-lesion-agnostic

Deep Learning contrasts "agnostic" tool for MS lesion segmentation in the spinal cord
MIT License
4 stars 0 forks source link

Training of a MEDNEXT model #31

Open plbenveniste opened 3 weeks ago

plbenveniste commented 3 weeks ago

This issue describes the work done to train a MedNext model and to evaluate its performance.

Work is done under the branch plb/monai_unet.

The code containing the MedNext model is in this repo: https://github.com/MIC-DKFZ/MedNeXt

plbenveniste commented 3 weeks ago

Installation and setup

conda create -n venv_mednext python=3.9
conda activate venv_mednext
pip install -r ms-lesion-agnostic/monai/requirements.txt
git clone https://github.com/MIC-DKFZ/MedNeXt
cd MedNext
pip install -e .

Training

CUDA_VISIBLE_DEVICES=1 python ms-lesion-agnostic/monai/train_monai_mednext_lightning.py --config ms-lesion-agnostic/monai/config.yml
plbenveniste commented 2 weeks ago

I am also training (on kronos) two other MedNext model : input_channel = 32 or 64. To have sufficient memory for this, I reduced the number of samples produced by randCropByPosNeg from 4 to 2 and 1.

plbenveniste commented 1 week ago

I am currently running inference using the code in monai/test_model_mednext.py

The code was ran with the following command:

CUDA_VISIBLE_DEVICES=1 python ms-lesion-agnostic/monai/test_model_mednext.py --config ms-lesion-agnostic/monai/config_test.yml --data-split test

The plots were computed with the following command:

python ms-lesion-agnostic/monai/plot_performance.py --pred-dir-path /home/plbenveniste/net/ms-lesion-agnostic/results/2024-09-02_12:14:28.124188/test_set/ --data-json-path ~/net/ms-lesion-agnostic/msd_data/dataset_2024-07-24_seed42_lesionOnly.json --split test

Here are the results:

dice_scores_contrast