Lung Tumor Segmentation
A project I'm currently working on just for fun and educational purposes.
In this project, I used the lung tumor data from the Medical Decathlon competition
Using this project
In order for this project to log things properly, you need to:
- run wandb login in your terminal and provide your own key
To run this project yourself:
Python 3.7 is required.
- Clone the project, cd into project directory and run pip install -e .
- Install the packages from the requirements.txt file in your python env.
- Download the medical decathlon lung tumor data and extract it to a folder.
- Run: python preprocessing.py --input_data_dir /imagesTr --input_labels_dir /labelsTr --output_dir
(If you want to try this out on your own data - the expected format is Nifty for both the scan and the mask data. The scan and corresponding mask must have the same name and be in different folders)
- Run: python train.py --preprocessed_input_dir (This is the output directory you provided in the previous step)
- Inference : run python inference.py --path_to_ckpt --path_to_ct_scan --path_to_result_dir .
My SegNet checkpoint can be downloaded from this link and used with the inference script.
Results
So far, using the architecture proposed in the SegNet paper, I reached nice results (0.88 dice score, 0.75 IoU on the validation set)
Example result:
Here is the prediction for an entire ct scan
https://user-images.githubusercontent.com/17112442/143877689-bd9221f4-ff81-4072-a359-e077b1d37b06.mp4
As we can see, it's not accurate but still a nice result :smile:
It is still a work in progress