Skip to content

My graduate thesis - Topic: Brain Tumor Segmentation using Deep Learning

Notifications You must be signed in to change notification settings

sowwnn/Graduate-Thesis

Repository files navigation

Graduate Thesis: Brain Tumor Segmentaion using Deep Learning.

In my thesis, I proposed two method to segmentation 3D Brain MRI. First method using Attention mechanism to forcus on nessesary position. Second one using Fusion method to combine multiple trained model.

Detail: here


How to use?

You need to clone my repo and setup it.

~ git clone https://github.com/RC-Sho0/Graduate-Thesis.git

Move to source code folder.

~ cd Graduate-Thesis

Set it up

~ python utils/setup.py <!your wandb key or empty>

Prepair you datalist

~ python libs/data/prepare_datalist.py --path "<Your folder contain dataset>" --output "/{path of file}/datalist.json" --stage "train" --split 'true'

For training

With my first method names 3D Dual-Domain Attention, you need to configure information like exemple/exp.json

{
    "model_name": "//one in [segresnet, dynunet, vnet, swinunetr, dynunet_dda]",
    "att": "//Only use if model_name is dynunet_dda else []" 
    "project": "baseline",
    "model_trained": "//null for training stage, trained path for testing stage",
    "datalist": "//your datalist.json path",
    "config":{
        "loss": "mse",
        "max_epochs": 120,
        "name":"dda_+",
        "lr":3e-4,
        "tmax": 30,
        "results_dir":"//dir of outputs",
        "log": "//true if you want show on your wandb",
    }
}   

Training:

~ python seg_train.py --input <your exp.json file>

For 3D Dual-Fusion Attention method use just need to upload fusion_train.ipynb in kaggle and training 🤣


Predict

3D Dual-Domain Attention

Fill model_trained in exp.json then run

~ python libs/data/prepare_datalist.py --path "<Your folder contain dataset>" --output "/{path of file}/datalist.json" --stage "test" 

~ python 3d_dda.py --input <your exp.json file>

3D Dual-Fusion Attention

You need to add 2 more variable in exp.json is:

...
    "model_name": "fusion", 
    ...
    "model_trained": null, //null for
    "dynunet_trained": <path of dynunet trained>,
    "segresnet_trained": <path of segresnet trained>,
...

than run

~ python 3d_dda.py --input <your exp.json file>

That all :3


If you like that, please Star my repo 🌟 And if you want to support let follows my github 🎆

Authorized by Sho0

Releases

No releases published

Packages

No packages published