How ola-vish/lung-tumor-segmentation works
Project type and purpose
• This is a Python-based machine-learning pipeline for lung tumor segmentation.
• It ingests raw CT scans (NIfTI files), preprocesses them, trains segmentation models (SegNet, U-Net via PyTorch/PyTorch Lightning), and runs inference to produce tumor masks.
• It uses Weights & Biases for logging and tracks experiments via checkpoints.
File structure
Top-level files:
• setup.py, requirements.txt, LICENSE, README.md – packaging and docs
• images/ – example outputs
• .gitignore
project/ (main package)
• datasets/
– lung_tumor_dataset.py: DataLoader wrapper & augmentation
• loggers/
– image_logger.py: wandb image logging
• models/
– segnet.py, unet.py: raw model definitions
– lit_segmentation_model.py: PyTorch Lightning Module wrapping training/validation/etc.
• preprocessing.py – CLI entry for data normalization, cropping, saving preprocessed NIfTI.
• train.py – CLI entry to kick off training via the Lightning module, checkpointing, wandb init.
• inference.py – CLI entry to load a trained checkpoint, run the model on new CT scans, and save predicted masks.
README for additional insights
• Requires Python 3.7, wandb login.
• Workflow: preprocessing → train → inference.
• Input/Output: raw scans/labels folder → preprocessed data folder → model checkpoints → prediction folder.
• External dependencies: Medical Decathlon dataset, wandb service.