-
Download dataset from https://www.kaggle.com/datasets/awsaf49/brats20-dataset-training-validation
-
Within the downloaded dataset, move the "BraTS2020_TrainingData" folder into the "Dataset" folder, we ignore the ValidationData folder as it does not contain the mask files as the dataset was meant for a competition. Next, ensure that the "BraTS2020_TrainingData" folder contains the "MICCAI_BraTS2020_TrainingData" folder. This then contains all 369 data points, each of which consists of the 4 MRI modes and mask file.
-
Download the saved models from the https://drive.google.com/file/d/1g80HLTz_TKZcVFGG5Tl8YfXDDn8Ploh2/view?usp=sharing
-
Move the models folder into the project folder, ensuring the folder is named "saved_models"
-
Run code using the below steps
python3.9 -m venv venv
(mac)
source venv/bin/activate
(windows command prompt)
venv\Scripts\activate
pip install -r requirements.txt
-
Ensure that the dataset_path variable is defined correctly. In both training.ipynb and comparison.ipynb
-
Uncomment the third cell to generate the numpy dataset.
-
Run the proceeding cells sequentially. The notebook will visualise some data slices.
-
The models as stated above are commented out in the training file. You may uncomment them to train the model yourself, or use the models in the downloaded "saved_models" folder. The cells after each model can be uncommented as well to display the loss against epochs graphs for each trained model, after its respective model has been trained.
-
Ensure that virtual environment is activated
-
Ensure the model_path variable is correct. In this case running the very last model saved as "./saved_models/multi_channel_further/model_5.pth"
-
Start the application with
python3 app.py
-
Access any datapoint within the dataset folder, and upload the corresponding MRI mode to the correct box. For example the T1 mri scan should be uploaded using the button "T1".
-
Click the "Analyse" Button to use the model to create the predicted mask.
-
Once completed, the mask can be observed. You may also choose to upload the actual mask (tagged as the seg.nii file) within data point folder.
-
The sliders can be used to view the different layers of the model.