Brain-tumor segmentation with U-Net
A patient-level evaluation of U-Net-family architectures on multimodal MRI, under a TÜBİTAK 2209-A grant. The split was frozen before the test set was opened, every figure regenerates from tracked artifacts, and the limits of the result are stated with it.
Funded by a TÜBİTAK 2209-A undergraduate research grant, this project asks one narrow question: under a fixed, matched training protocol, do specific U-Net variants segment brain tumors better than a standard U-Net baseline — and does that hold on a test set nobody touched until the analysis plan was frozen?
Semantic segmentation on medical images is easy to get impressive-looking numbers from and hard to get trustworthy ones. Most of the engineering effort went into the second half of that sentence.
Multimodal brain MRI (T1, T1ce, T2, FLAIR) plus tumor sub-region labels — the BraTS-style setup — is a well-studied benchmark, which also means it is easy to overfit to its own quirks. Three failure modes are common in student and research projects alike:
- Split leakage. Splitting by slice or patch instead of by patient lets the model memorise a patient's anatomy across train and validation, inflating scores.
- Undocumented preprocessing. Skull-stripping tool, intensity normalisation and scanner field strength all shift results, but rarely get reported precisely enough to reproduce.
- Mean-only reporting. A single averaged Dice score hides a heavy-tailed distribution — most patients segment well, and a long tail segments badly, which is exactly the tail a clinician would notice.
The pipeline (public as bratsarticle) is designed around closing those three gaps before comparing any architectures.
- Input
- Multimodal MRI volumes — T1, T1ce, T2, FLAIR.
- Preprocess
- Per-volume z-score normalisation over non-zero voxels only — ignoring the air around the brain rather than scaling against it. In practice this mattered more than any single architectural change.
- Split
- 258 / 37 / 74 patients. The unit of the split is the patient, never the slice or the patch. Frozen before test access.
- Train
- Standard U-Net, BU-Net and U-Net+RES under a bounded, matched 2D protocol, multiple seeds per architecture. Patch sampling biased toward tumor regions, soft-Dice-plus-cross-entropy loss.
- Evaluate
- One logged held-out opening, under an analysis plan written before the test set was touched.
Primary metrics are the Dice similarity coefficient and Intersection-over-Union, per tumor sub-region:
Rather than a single mean, results are reported as median and interquartile range across patients, plus an explicit count of patients falling below a threshold. A distribution is much harder to be wrong about than an averaged headline number.
The pipeline has run end to end: an audited 369-subject cohort, a patient-level split, tested implementations, matched development runs, multi-seed confirmation, an analysis plan frozen before any test access, one logged held-out evaluation, and every figure and table generated from tracked artifacts. A clean clone with no local data or checkpoints verified 230 tracked artifacts, passed 108 tests, and regenerated every output byte-for-byte.
A manuscript and a response-to-reviewer document live in the repository from an internal review round; the work has not been submitted to a journal or conference, and nothing here has been peer reviewed. The scope is narrow on purpose — one internal held-out subset of a single dataset, evaluated once, with 2D slice models. It says nothing about clinical utility or external generalisation.
- Better skull-strip QA before training, potentially a learned skull-stripping step.
- Histogram matching across scanners, rather than per-volume normalisation alone.
- Per-patient temperature scaling so uncertainty estimates are properly calibrated.
- An out-of-distribution test set from a different scanner or institution, evaluated once, at the very end.
Longer field notes on the day-to-day decisions — normalisation, patch sampling, the validation-split bug that cost two weeks — are in Notes.