MedNeXt-B + Kervadec Boundary Loss — BraTS 2023 GLI (5-fold CV)
3D segmentation of brain tumor regions (NCR, edema, enhancing tumor) on multi-modal MRI (T1, T1ce, T2, FLAIR), trained on the BraTS 2023 GLI challenge dataset using nnU-Net v2 with the MedNeXt-B backbone (Roy et al., MICCAI 2023) and the fixed-weight boundary loss of Kervadec et al. (MedIA 2021) as an auxiliary term, at the published configuration λ = 0.05, θ0 = 30 (≈ 3 % of the balanced-λ calibration) — this is the expert K of the paper "Precision Pays".
This repository ships the 5 cross-validation folds of the model (300 epochs each). Use the same fold-of-the-patient at inference, or ensemble all 5 folds for higher robustness (BraTS-style soft voting).
Per-fold validation Dice (best EMA, foreground-mean)
| Fold | Best EMA Dice | Trained epochs |
|---|---|---|
| fold 0 | 0.9369 | 300 |
| fold 1 | 0.9353 | 300 |
| fold 2 | 0.9414 | 300 |
| fold 3 | 0.9343 | 300 |
| fold 4 | 0.9356 | 300 |
Mean across folds : 0.9367.
Official BraTS-2023 results (lesion-wise, n = 1 196, published in the companion paper v2.6)
- Null alone, as pre-specified : lesion-wise Dice vs the baseline +0.0002 (Holm p = 0.34) — the paper's honest primary finding.
- Wins as a consensus veto : vetoing the SDT model (D∧K), lesion-wise HD95 -9.95 mm (p = 2.3e-20) vs the baseline.
- Multi-seed confirmation (3 seeds): as primary model with a baseline veto, lesion-wise Dice WT +3.89 pp (Wilcoxon p = 0.005).
The boundary loss buys precision, not recall: it removes spurious components that the SDT model keeps. Read the paper for the full recall–precision axis.
Files
fold_{0..4}/model.safetensors— network weights (weights-only, no optimizer state)fold_{0..4}/metadata.json— trainer name, λ_Kervadec = 0.05, θ0 = 30, best EMA Dice, mirroring axesfold_{0..4}/plans.json— nnU-Net architecture plan (patch size 128³, BS 2, MedNeXt-B)
Usage
import torch
from safetensors.torch import load_file
from huggingface_hub import hf_hub_download
# Pick a fold (0–4), or load all 5 for ensembling
fold = 0
weights_path = hf_hub_download(repo_id="guillaume-cassez/mednext-kervadec-brats2023gli", filename=f"fold_{fold}/model.safetensors")
plans_path = hf_hub_download(repo_id="guillaume-cassez/mednext-kervadec-brats2023gli", filename=f"fold_{fold}/plans.json")
state_dict = load_file(weights_path)
# Build the MedNeXt model with nnU-Net v2 (see https://github.com/MIC-DKFZ/nnUNet)
# and load the state_dict :
# model.load_state_dict(state_dict)
For the full inference pipeline (preprocessing, sliding-window prediction, TTA) you need :
- nnU-Net v2 : https://github.com/MIC-DKFZ/nnUNet
- MedNeXt trainers : https://github.com/MIC-DKFZ/MedNeXt
- The patient should be preprocessed with the same
nnUNetPlans_96GB_mednextplan (plans.json).
At inference the boundary term is not part of the network : the state dict is a plain MedNeXt-B segmentation model (auxiliary head absent), so test-time cost is identical to the baseline.
Training details
- Backbone : MedNeXt-B (Roy et al., MICCAI 2023)
- Framework : nnU-Net v2, custom trainer
nnUNetTrainerMedNeXtKervadec - Auxiliary loss : Kervadec boundary loss, fixed weight λ = 0.05, θ0 = 30 (calibrated ≈ 3 % of λ_eq)
- Input : 4-modality MRI (T1, T1ce, T2, FLAIR), patch 128³, BS 2, BF16
- Hardware : RTX PRO 6000 Blackwell (96 GB)
- Schedule : 300 epochs per fold
- Cross-validation : 5-fold stratified by patient ID over 1 196 patients
Companion artefacts
- 📄 Companion paper (v2.6, 2026-09-22) : Precision Pays: A Fixed-Weight Boundary Loss Anchors the Precision End of a Recall–Precision Axis and Wins as the Consensus Veto under the Official BraTS-2023 Metrics — Guillaume Cassez, Stanislas Larnier · CC-BY-4.0 · official BraTS-2023 lesion-wise metrics, 5-fold cross-validation, n = 1 196 patients. Concept DOI (always resolves to the latest version) : 10.5281/zenodo.22906446
- 🌐 Paper page : https://guillaume-cassez.fr/imagerie-medicale/brats/boundary-loss-kervadec/
- 🏥 Medical imaging hub : https://guillaume-cassez.fr/imagerie-medicale/
- 🧠 Interactive 3D viewer : https://guillaume-cassez.fr/imagerie-medicale/brats/2023-distance-map/viewer/ — 1 196 patients, four experts and the consensus operators side by side with ground truth (WebGL, nothing to install)
- 📊 Per-patient metrics : https://guillaume-cassez.fr/imagerie-medicale/brats/2023-distance-map/ranking/
- 💻 Code : the trainer, evaluation pipeline and per-patient CSVs ship inside the Zenodo deposit above (
code/anddata/folders of the paper bundle). Paper 1's standalone repository : https://github.com/guillaume-cassez/brats-moe-distmap-fusion-1 - 🤝 Sister models (same programme, same folds, same evaluation code path) :
Related publications (same research programme, BraTS 2023 GLI)
Open-access Zenodo preprints, all evaluated under the official BraTS-2023 lesion-wise metrics:
- Two Models That Agree Beat the Best of Them Alone: Parameter-Free Connected-Component Consensus That Beats the Baseline under the Official BraTS-2023 Metrics (v10) — 10.5281/zenodo.19695263 · paper page
- Precision Pays: A Fixed-Weight Boundary Loss Anchors the Precision End of a Recall–Precision Axis and Wins as the Consensus Veto under the Official BraTS-2023 Metrics (v2.6) — 10.5281/zenodo.22906446 · paper page
- The Gate Does Not Choose: An Expert-Initialised Mixture-of-Experts Outperforms Training-Free Consensus under the Official BraTS-2023 Metrics (v0.13) — 10.5281/zenodo.22776410 · paper page
License
Weights: MIT. The companion paper is CC-BY-4.0.