Segmentation, Dose Prediction, and Next-Organ-at-Risk Ranking for Head & Neck Radiotherapy
Final Year Project — Department of Computer Science, National University of Computer and Emerging Sciences (FAST-NUCES), Islamabad, Pakistan Session 2022–2026
Supervised by Dr. Labiba Fahad
| Name | Roll Number |
|---|---|
| Sohaib Shahzad | 22I-2034 |
| Maaz Ali | 22I-1873 |
| Siraj Ali | 22I-2033 |
Radiotherapy for head & neck cancer requires delivering enough radiation to destroy the tumour while sparing nearby organs at risk (OARs) such as the spinal cord, brainstem, parotids, mandible, and larynx — all packed tightly around the tumour site. Manual contouring of these structures is slow, inconsistent between clinicians, and stops at anatomy: it tells you where the organs are, but not how much radiation dose they are actually likely to receive.
OAR-Guard closes that gap. It's an end-to-end pipeline that goes from raw CT/MRI scans all the way to a ranked, patient-specific list of the organs most at risk of harmful radiation exposure — with an interactive dashboard a clinician can actually use.
The pipeline in one line:
CT/MRI scan → Tumour + OAR segmentation → 3D dose prediction (C3D) → per-organ dose statistics → risk score → ranked "Next Organ at Risk" → interactive dashboard
Existing research in this space tends to stop at one of two places:
- Segmentation-only work — accurate organ/tumour contours, measured by Dice/Hausdorff scores, with no connection to actual dose or clinical risk.
- Dose-prediction-only work — predicts a 3D dose volume, but doesn't break it down per-organ or produce anything a planner could rank and act on.
Very little work connects the two into a single, patient-specific pipeline that ends in an interpretable ranking. OAR-Guard is built specifically to close that gap — see docs/METHODOLOGY.md for the full research context.
- Patient data preparation & preprocessing — CT/MRI normalization, registration, formatting into a multi-channel 3D tensor.
- Tumour extraction — identifies the treatment target volume.
- Organ-at-risk extraction — segments anatomical structures (MONAI 3D segmentor, SAM, vision transformers) that need protecting.
- C3D dose prediction — a cascaded 3D CNN (encoder–decoder) predicts a full volumetric dose map (Gy) from the multi-channel patient representation.
- Organ mask processing — aligns segmentation masks with the predicted dose volume.
- Organ-wise dose statistics — mean dose, max dose, top-1% dose, fraction above 20 Gy, per organ.
- Risk score computation:
Risk Score = 0.5 × Mean Dose + 0.3 × Max Dose + 0.2 × Top-1% Dose
- Patient-specific organ ranking — sorts organs from highest to lowest predicted risk (the "Next Organ at Risk").
- Visual & tabular output generation — dose heatmaps, top-3 organ summary, risk-score bar charts, full ranking table.
- Interactive dashboard — tabbed web interface (Overview, Heatmap Explorer, Ranking Table, Downloads) for exploring per-patient results without writing code.
See docs/METHODOLOGY.md for full architectural detail and docs/RESULTS.md for evaluation metrics and results.
- Segmentation: MONAI, SAM (Segment Anything Model), SegResNetDS, Vision Transformers, CLIP
- Dose Prediction: Cascade 3D CNN (C3D), DCNN, PyTorch
- Dataset: OpenKBP — public head & neck radiotherapy planning dataset
- Interface: Interactive web dashboard (clinician-facing)
- Training hardware: NVIDIA RTX 4060 / RTX 4090
The dataset, trained model checkpoints, and other large artifacts are not stored in this repository (GitHub isn't built for multi-GB medical imaging data). They're hosted on Google Drive instead:
🔗 Dataset & Model Weights — Google Drive
After downloading, place the contents according to data/README.md and models/README.md before running the pipeline.
oar-guard/
├── src/
│ ├── segmentation/
│ │ ├── tumour/ # Tumour segmentation model + training/inference
│ │ └── organ_at_risk/ # OAR segmentation (SAM, CLIP, network, training scripts)
│ └── dose_prediction/ # C3D + DCNN dose prediction models, data loaders, training/eval
├── dashboard/ # Interactive clinician-facing dashboard app
├── data/ # Dataset placeholder — see data/README.md (Drive-hosted)
├── models/ # Trained model checkpoints — see models/README.md (Drive-hosted)
├── notebooks/ # Exploratory / experiment notebooks
├── results/ # Generated outputs (heatmaps, tables, exports)
├── docs/
│ ├── METHODOLOGY.md # Full pipeline & architecture writeup
│ └── RESULTS.md # Evaluation metrics & results
├── tests/ # Unit tests
├── requirements.txt
├── .gitignore
└── README.md
# 1. Clone the repo
git clone https://github.com/sohaib0075/OAR-Guard-FYP.git
cd OAR-Guard-FYP
# 2. Create environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
# 3. Download the dataset & model weights from the Drive link above,
# then place them per data/README.md and models/README.md
# 4. Run the pipeline (example)
python src/segmentation/tumour/segmenter.py --patient pt_339
python src/segmentation/organ_at_risk/inference_demo.py --patient pt_339
python src/dose_prediction/C3D/test.py --patient pt_339
# 5. Launch the dashboard
cd dashboard
python app.pyExact script flags above are placeholders — update this section with the real arguments your scripts expect.
| Metric type | Metrics used |
|---|---|
| Segmentation | Dice Similarity Coefficient |
| Dose / risk | Mean dose, max dose, top-1% dose, fraction above 20 Gy, risk score |
| Deployment | Inference time, model size, memory usage |
| Usability | Clinician feedback, visualization clarity |
Representative Dice scores obtained during development:
| Organ | Dice Score |
|---|---|
| Mandible | 0.81 |
| Spinal Cord | 0.78 |
| Brainstem | 0.76 |
| Mean | 0.75 |
Full results are in docs/RESULTS.md.
- Risk score weighting (0.5 / 0.3 / 0.2) is empirically chosen, not clinically validated.
- The system is for research purposes only — it is not connected to any clinical planning system and dose predictions are not a clinician-approved treatment protocol.
- Output is optimized for accuracy and clarity of risk ranking, not full anatomical fidelity.
- Clinical validation of the risk-scoring formula against expert-annotated cases.
- Extending beyond head & neck to other anatomical regions.
- Tighter integration with clinical planning systems.
Full Harvard-style references are listed in the final report submitted alongside this project.
This project is released under the MIT License unless your department requires otherwise — update as appropriate for your submission.