How illiaovcharenko/lung-segmentation works
This repository implements supervised lung-area segmentation for chest X-rays. The workflow is to prepare labeled images and saved train/validation/test splits, resize and augment image-mask pairs, train a U-Net variant, retain model weights, then evaluate predicted masks with Jaccard and Dice scores. The README identifies main.ipynb as the workflow entry point and documents both a basic and a VGG11-pretrained model. Notebook internals were not sampled, so links from that orchestration node reflect documented workflow rather than inspected calls; dataset source details are also limited.
Main entry points: main.ipynb Train/evaluate · data.py Image-mask pairs · metrics.py Overlap metrics · models.py VGG11 U-Net
Components 14
Data preparation
- Image-mask pairs
src/data.py - Transforms
src/data.py - Saved splits
splits.pk
Segmentation models
- Vanilla U-Net
src/models.py - VGG11 U-Net
src/models.py - unet-2v weights
models/unet-2v.pt - unet-6v weights
models/unet-6v.pt
Training workflow
- Train/evaluate
main.ipynb
Evaluation
- Overlap metrics
src/metrics.py - Predicted masks
- Evaluation results
Other components
- Researcher
- CXR dataset
- ImageNet VGG11
Connections 14
- Researcher → Train/evaluate: runs workflow
- CXR dataset → Image-mask pairs: provides images
- Saved splits → Train/evaluate: defines partitions
- Image-mask pairs → Transforms: loads pairs
- Transforms → Train/evaluate: supplies batches
- Train/evaluate → Vanilla U-Net: trains model
- Train/evaluate → VGG11 U-Net: trains variant
- ImageNet VGG11 → VGG11 U-Net: initializes encoder
- Train/evaluate → unet-2v weights: saves best weights
- Train/evaluate → unet-6v weights: saves best weights
- Train/evaluate → Overlap metrics: evaluates masks
- Train/evaluate → Predicted masks: produces predictions
- Overlap metrics → Evaluation results: computes scores
- Researcher → Evaluation results: reviews scores