Brain-tumor segmentation with U-Net.
A patient-level evaluation of U-Net-family architectures on multimodal MRI, built under an undergraduate research 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.
Overview
This project is funded by a TÜBİTAK 2209-A undergraduate research grant and 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 in this project went into the second half of that sentence.
Problem framing
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 differences 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 for this project (public as bratsarticle) is designed around closing those three gaps before comparing any architectures.
Methodology
Data & preprocessing
Inputs are multimodal MRI volumes (T1, T1ce, T2, FLAIR) with tumor sub-region labels. Intensities are z-score normalised per volume over non-zero voxels only — ignoring the surrounding air rather than scaling against it — which in practice mattered more to segmentation quality than any single architectural change.
Because the positive (tumor) class is a small fraction of total voxels, training uses patch-based sampling biased toward tumor-containing regions, combined with a soft-Dice-plus-cross-entropy loss so the network cannot get a good loss by predicting background everywhere.
Splitting & training
The unit of the train/validation/test split is the patient, not the slice or the patch — the single most common source of inflated scores in segmentation work, and the first thing the pipeline enforces. Three U-Net-family architectures (standard U-Net, BU-Net, and U-Net+RES) are trained under a bounded, matched 2D protocol with multiple random seeds per architecture, to separate real differences from training noise.
An analysis plan — which metrics, which comparisons, which significance thresholds — was written and frozen before the held-out test set was touched, and the test set itself was evaluated exactly once, under that plan.
Evaluation
The primary metrics are the Dice similarity coefficient and Intersection-over-Union (IoU), per tumor sub-region:
Rather than reporting a single mean, the project reports Dice and IoU as median and interquartile range across patients, plus an explicit count of patients falling below a set threshold — a distribution is much harder to be wrong about than a single averaged headline number.
Reproducibility
The repository ships one training script, one config file and a synthetic-data smoke test that runs on CPU in under two minutes, plus a clean-clone reproduction audit — cloning the repo fresh and re-running the pipeline end to end — so the results aren't tied to one machine's state.
Status & findings
The pipeline has run end to end: an audited 369-subject cohort, a patient-level 258/37/74 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. This is one internal held-out subset of a single dataset, evaluated once with 2D slice models. It says nothing about clinical utility or external generalisation, and it is not a comparison against 3D, transformer-based or self-configuring systems, none of which were run here.
What's next
- 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 behind this project — normalisation, patch sampling, the validation-split bug that cost two weeks — are in Notes.