Skip to content

An attempt at tumor segmentation with UNET and SegNet on the lung tumor dataset from the Medical Decathlon data.

License

Notifications You must be signed in to change notification settings

Ola-Vish/lung-tumor-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  1. Clone the project, cd into project directory and run pip install -e .
  2. Install the packages from the requirements.txt file in your python env.
  3. Download the medical decathlon lung tumor data and extract it to a folder.
  4. Run: python preprocessing.py --input_data_dir <extraction_path>/imagesTr --input_labels_dir <extraction_path>/labelsTr --output_dir <path_to_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)
  5. Run: python train.py --preprocessed_input_dir <path_to_output_dir> (This is the output directory you provided in the previous step)
  6. Inference : run python inference.py --path_to_ckpt <path_to_ckpt> --path_to_ct_scan <path_to_nifty_ct_scan> --path_to_result_dir <output_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:

Side by Side

Here is the prediction for an entire ct scan

predicted.mp4

As we can see, it's not accurate but still a nice result 😄

It is still a work in progress

About

An attempt at tumor segmentation with UNET and SegNet on the lung tumor dataset from the Medical Decathlon data.

Topics

Resources

License

Stars

Watchers

Forks

Languages