Skip to content
ModelListedExternal
Browse files

Spinopelvic Seg Checkpoints

5-fold nnU-Net v2 ResEnc-L ensemble for spine + pelvis CT segmentation, trained with an LSTV-aware merged-label scheme that collapses L5/L6 into a single lastlumbar class to handle lumbosacral transitional vertebrae.

KindOtherVersionCheckpoint bestCgrade

Model source

Kind
Other
File size
1.06 GB
Version
vCheckpoint best
Updated
Nov 1, 2026
Source
Hugging Face

Source description

spinopelvic-seg-checkpoints

5-fold nnU-Net v2 ResEnc-L ensemble for spine + pelvis CT segmentation, trained with an LSTV-aware merged-label scheme that collapses L5/L6 into a single last_lumbar class to handle lumbosacral transitional vertebrae.

Companion code, inference scripts, and evaluation pipeline: anonymous-mlhc/spinopelvic-seg

Training dataset: anonymous-mlhc/CTSpinoPelvic1K

Model summary

ArchitecturennU-Net v2, ResEnc-L (ResEncUNet) 3D
Configuration3d_fullres
PlannernnUNetResEncUNetPlans_100G (100 GB GPU memory target)
TrainernnUNetTrainerWandB_500ep_LSTVOversample (custom, in companion repo)
Folds5-fold cross-validation ensemble
Classes9 contiguous: background, L1, L2, L3, L4, last_lumbar, sacrum, left_hip, right_hip + ignore
Training epochs500 per fold
Training hardwareNVIDIA H200 / A100-80GB

The 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).

Files

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.

Quickstart

1. Install dependencies

pip install nnunetv2 huggingface_hub
git clone https://github.com/anonymous-mlhc/spinopelvic-seg.git
cd spinopelvic-seg
pip install -r requirements.txt

2. Download checkpoints

hf download anonymous-mlhc/spinopelvic-seg-checkpoints \
    --repo-type=model \
    --local-dir nnunet/results/Dataset803_SpineSurgCTFullMerged

3. Set environment

export nnUNet_raw=$PWD/nnunet/raw
export nnUNet_preprocessed=$PWD/nnunet/preprocessed
export nnUNet_results=$PWD/nnunet/results
export PYTHONPATH=$PWD/tools:$PYTHONPATH   # makes the custom trainer importable

4. Run inference

Input files must follow nnU-Net's channel-suffix convention (CASE_0000.nii.gz):

nnUNetv2_predict \
    -i  /path/to/input_cts \
    -o  /path/to/predictions \
    -d  803 \
    -c  3d_fullres \
    -p  nnUNetResEncUNetPlans_100G \
    -tr nnUNetTrainerWandB_500ep_LSTVOversample \
    -f  0 1 2 3 4 \
    -chk checkpoint_best.pth

Drop -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 scheme

LabelClass
0background
1L1
2L2
3L3
4L4
5last_lumbar (L5 in normals; L5/L6 fused in lumbarization)
6sacrum
7left_hip
8right_hip
9ignore (excluded from loss and metrics)

Intended use

  • Research-grade segmentation of spine and pelvis on CT for ML benchmarking, anatomy analytics, and downstream LSTV-related studies.
  • LSTV characterization — the merged-label scheme is designed for studies that need to characterize the lumbosacral junction without forcing a per-case decision on vertebral count.

Out-of-scope use

  • Clinical diagnostic use. Not FDA-cleared, not CE-marked, no clinical validation.
  • Patient-specific surgical planning without expert review.
  • Pediatric CT. Training data is adult.
  • Severe pathology (large tumors, hardware artifacts, multi-level fusion) is underrepresented in the training set.

Training

Trained on the CTSpinoPelvic1K dataset (companion HuggingFace dataset repo). 5-fold cross-validation at the patient-token level with stratification on match-type × LSTV subtype to prevent patient leakage and ensure each fold sees the LSTV-subtype distribution.

The custom trainer (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.

See the companion repo for the full training pipeline (make preprocess, make train-array), the trainer source (tools/nnunet_wandb_variant.py), and ablation configurations.

Evaluation

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.

License

Apache-2.0. See the companion repo.

Sources

1 source
Hugging FacePrimaryVersion 425c17bc895da0ef0937b68d40b892885838a2e3
huggingface.co/anonymous-mlhc/spinopelvic-seg-checkpoints/tree/425c17bc895da0ef0937b68d40b892885838a2e3

Verified Nov 1

Download files

Model artifacts

10 artifacts

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_0/checkpoint_best.pth

pth · 1.06 GB · SHA-256 d4317bf64b86…6cfb · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_0/checkpoint_final.pth

pth · 1.06 GB · SHA-256 08f06f054468…b037 · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_1/checkpoint_best.pth

pth · 1.06 GB · SHA-256 21b902c2cbfc…b621 · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_1/checkpoint_final.pth

pth · 1.06 GB · SHA-256 37dba76df317…3c48 · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_2/checkpoint_best.pth

pth · 1.06 GB · SHA-256 a98aa781069c…79fc · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_2/checkpoint_final.pth

pth · 1.06 GB · SHA-256 eb8b530883bb…a2ef · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_3/checkpoint_best.pth

pth · 1.06 GB · SHA-256 ee5e8d13811e…9f4d · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_3/checkpoint_final.pth

pth · 1.06 GB · SHA-256 ee819e5ff700…63ed · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_4/checkpoint_best.pth

pth · 1.06 GB · SHA-256 64923f44699b…0603 · Hugging Face

Download file

Dataset803_SpineSurgCTFullMerged/nnUNetTrainerWandB_500ep_LSTVOversample__nnUNetResEncUNetPlans_100G__3d_fullres/fold_4/checkpoint_final.pth

pth · 1.06 GB · SHA-256 5cc99ea96252…51f3 · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: apache-2.0 tags: - medical-imaging - segmentation - ct - spine - pelvis - lstv - nnunet library_name: nnunetv2 pipeline_tag: image-segmentation datasets: - anonymous-mlhc/CTSpinoPelvic1K --- # spinopelvic-seg-checkpoints 5-fold nnU-Net v2 ResEnc-L ensemble for **spine + pelvis CT segmentation**, trained with an LSTV-aware merged-label scheme that collapses L5/L6 into a single `last_lumbar` class to handle lumbosacral transitional vertebrae. Companion code, inference scripts, and evaluation pipeline: [**anonymous-mlhc/spinopelvic-seg**](https://github.com/anonymous-mlhc/spinopelvic-seg) Training dataset: [**anonymous-mlhc/CTSpinoPelvic1K**](https://huggingface.co/datasets/anonymous-mlhc/CTSpinoPelvic1K) ## Model summary | | | |---|---| | **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 | The `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). ## Files ``` 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. ## Quickstart ### 1. Install dependencies ```bash pip install nnunetv2 huggingface_hub git clone https://github.com/anonymous-mlhc/spinopelvic-seg.git cd spinopelvic-seg pip install -r requirements.txt ``` ### 2. Download checkpoints...

Source context: 0 downloads · 0 likes · Pipeline image-segmentation · Library nnunetv2 · Repo anonymous-mlhc/spinopelvic-seg-checkpoints