The goal of the project was to prepare a skull stripping method on images from the T1 sequence of head MRI. The method should extract the whole area covered by the brain, skipping bones, other soft tissues, etc.
The dataset was shared by a lecturer. It consisted of:
- 674 MRI labeled, train scans in NIfTI-1 Data Format
- 97 MRI test scans in NIfTI-1 Data Format.
tf_implementation - Implementation in Tensorflow
- Requirements listed in
environment.yml
- Segmentation model in
segmentation
folderdataset
folder -> all functions related directly to dataset (Train and validation ImageGenerator etc.)losses
folder -> Dice Lossmetrics
folder -> F1Score (Dice Score)models
folder -> Unet model with efficientnetb0 backboneutils
folder -> display utilities
- Training code ->
train.py
- Training code for Google Colab ->
train.ipynb
- Generating predictions code ->
generate_predictions.py
- Testing predictions code (Sending predictions to lecturer's server) ->
test_predictions.py
The model trained by me is available here. It's Unet based model with EfficientNetB0 backbone.
- split scans to train and validation sets
- generate image and label slices from X axis of each scan and save them to separate
images
andlabels
directories - create combined generator for images and labels for both train and validation set. Each image is preprocessed according to EfficientNetB0's rules and resized to target size -> 256,256
- compile model with loss=DiceLoss and metrics=DiceScore. Define callbacks to model: EarlyStopping, ModelCheckpoint and Reduce Learning Rate On Plateau.
- fit model using data from training generator and validation generator
- Evaluation set Dice Score: 0.9875
- Test set Dice Score: 0.9866