Views
No views yet
last_lumbar class to handle lumbosacral transitional vertebrae.| Architecture | nnU-Net v2, ResEnc-L (ResEncUNet) 3D |
| Configuration | 3d_fullres |
| Planner | nnUNetResEncUNetPlans_100G (100 GB GPU memory target) |
| Trainer | nnUNetTrainerWandB_500ep_LSTVOversample (custom, in companion repo) |
| Folds | 5-fold cross-validation ensemble |
| Classes | 9 contiguous: background, L1, L2, L3, L4, last_lumbar, sacrum, left_hip, right_hip + ignore |
| Training epochs | 500 per fold |
| Training hardware | NVIDIA H200 / A100-80GB |
last_lumbar class merges what would otherwise be separate L5 and L6
labels. This eliminates the L5↔L6 channel-swap failure mode that affects
fixed-class segmenters on sacralization-count cases (where the lumbar
spine has 4 mobile segments instead of 5).Dataset803_SpineSurgCTFullMerged/
└── nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/
├── plans.json
├── dataset.json
├── dataset_fingerprint.json
├── fold_0/
│ ├── checkpoint_best.pth
│ ├── checkpoint_final.pth
│ ├── debug.json
│ ├── progress.png
│ └── training_log_*.txt
├── fold_1/ (same structure)
├── fold_2/ (same structure)
├── fold_3/ (same structure)
└── fold_4/ (same structure)checkpoint_best.pth is the recommended inference checkpoint for each fold
(selected by validation EMA Dice). checkpoint_final.pth is the last
training epoch.1pip install nnunetv2 huggingface_hub
2git clone https://github.com/anonymous-mlhc/spinopelvic-seg.git
3cd spinopelvic-seg
4pip install -r requirements.txt1hf download anonymous-mlhc/spinopelvic-seg-checkpoints \
2 --repo-type=model \
3 --local-dir nnunet/results/Dataset803_SpineSurgCTFullMerged1export nnUNet_raw=$PWD/nnunet/raw
2export nnUNet_preprocessed=$PWD/nnunet/preprocessed
3export nnUNet_results=$PWD/nnunet/results
4export PYTHONPATH=$PWD/tools:$PYTHONPATH # makes the custom trainer importableCASE_0000.nii.gz):1nnUNetv2_predict \
2 -i /path/to/input_cts \
3 -o /path/to/predictions \
4 -d 803 \
5 -c 3d_fullres \
6 -p nnUNetResEncUNetPlans_100G \
7 -tr nnUNetTrainerWandB_500ep_LSTVOversample \
8 -f 0 1 2 3 4 \
9 -chk checkpoint_best.pth-f 0 1 2 3 4 to -f 0 for single-fold inference (~1 point Dice
hit vs the 5-fold ensemble, ~5× faster).| Label | Class |
|---|---|
| 0 | background |
| 1 | L1 |
| 2 | L2 |
| 3 | L3 |
| 4 | L4 |
| 5 | last_lumbar (L5 in normals; L5/L6 fused in lumbarization) |
| 6 | sacrum |
| 7 | left_hip |
| 8 | right_hip |
| 9 | ignore (excluded from loss and metrics) |
nnUNetTrainerWandB_500ep_LSTVOversample in the
companion code repo) adds: queue-based LSTV-case oversampling, CE
reweighting on the merged-lumbar and sacrum classes, dedicated LSTV
validation passes, and W&B logging with NaN-safe Dice aggregation and
offline fallback.make preprocess, make train-array),
the trainer source (tools/nnunet_wandb_variant.py), and ablation
configurations.tools/eval_full.py in the companion repo computes per-case Dice,
junction-DSC over a 40 mm L5/S1 window, voxel confusion blocks for the
L4 ↔ last_lumbar ↔ sacrum boundary classes, and last_lumbar specificity
on sacralization-count cases.