Reproducibility
The original Kaggle cohort has been recovered with a source receipt and hashed patient/slice manifest. A new native-weight replay is recorded separately from the legacy reports; see the evaluation contract and commands. This verifies the new run without establishing the historical checkpoint's training membership.
Legacy reported aggregates — metric-definition audit pending. Stored values are retained for traceability, not as verified performance claims. The Dice/IoU definitions, checkpoint/config lineage and per-patient evaluation manifest need reconciliation before comparisons.
Random seeds
seed: 42inconfigs/config.yamlis threaded throughseed_everything()at the start ofsrc/brain_mri_segmentation/training/train.py.- Lightning's
deterministic="warn"mode avoids thenll_loss2d_forward_out_cuda_templatecrash while still catching non-deterministic kernels elsewhere. - Patient-level split is deterministic:
prepare.pyshuffles TCGA patient dirs withrandom.Random(seed=42)before the 88/11/11 partition - re-running always produces the same split.
Dependencies
pyproject.tomldeclares direct deps;uv.lockis committed and pins every transitive package version + hash..python-version=3.13- CI + local dev must match.- CUDA torch pinned via
[[tool.uv.index]] pytorch-cu124on Win/Linux. - CI runs the suite against Python 3.12 + 3.13 via a matrix strategy.
Data
data/sample/(8 paired image+mask TIFs) is in git - CI + smoke tests work without any external download.data/raw/anddata/processed/are DVC-tracked. DVC remote is local-only by default.- Kaggle source:
kaggle_3m/(Buda et al., TCGA-LGG). 110 patient subdirs with paired*.tif+*_mask.tif.
Docker
Dockerfileis multi-stage (base,training,serving);.dockerignorekeeps context minimal.- Published images live at
ghcr.io/kiselyovd/brain-mri-segmentation:<tag>. - Base image:
python:3.13-slim-bookworm.
Model weights
- Published to HF Hub at
kiselyovd/brain-mri-segmentation. Pin the actual HF commit explicitly; do not infer a release-to-checkpoint mapping without a recorded receipt. - Weights ship as
model.safetensors.
One-command reproduction
git clone https://github.com/kiselyovd/brain-mri-segmentation
cd brain-mri-segmentation
uv sync --all-groups
bash scripts/sync_data.sh "/path/to/Brain MRI segmentation/kaggle_3m"
uv run python -m brain_mri_segmentation.data.prepare --raw data/raw --out data/processed
uv run python -m brain_mri_segmentation.training.train +experiment=sota
uv run python -m brain_mri_segmentation.evaluation.evaluate --checkpoint artifacts/checkpoints/best.ckpt --out reports/metrics.json
The evaluator now requires a hash-verified split manifest and writes model/code/data identities, confusion counts and prediction/target arrays. Preparation requires an empty output destination, apart from .gitkeep. Recovery of the missing historical U-Net checkpoint and legacy metric definitions remains unresolved; a new training run is a separate experiment.