Please install PyTorch and download the MICCAI-21 dataset for new lesion segmentation and MICCAI-16 for self-supervised pre-training. Then, run standard provided preprocessing on them and put them in under the 'miccai-processed' folder for the MICCAI-21 (MSSEG-2) dataset and the 'miccai-2016' folder for the MICCAI-16 (MSSEG) dataset. Finally, download model checkpoints for both self-supervised pre-training and new lesion segmentation from here and extract it into the root directoy.
To pretrain model using self-supervised learning you have to cache MRI testing dataset the first time. Hence run code like below ONLY ONCE
python run.py --pretraining --cache-mri-data
Then, after caching data for future runs you can use
python run.py --pretraining
To train new lesion segmentation model without self-supervised pre-trained weights, run as below:
python run.py --f 0 --bl-multiplier 10
where 'f' specifies the fold you wish the model to be trained on and 'bl-multiplier' determine boundary loss coefficient.
To train new lesion segmentation model with self-supervised pre-trained weights, run as below:
python run.py --pre-trained --f 0 --bl-multiplier 10
To get same results as the paper, run as below:
python test.py
The results of each fold will then be save under 'Results' folder and the average results accross five-fold will be printed.