Spinal Vertebrae Segmentation β nnUNet Model
Pre-trained nnUNetv2 model for automatic segmentation of 25 vertebrae classes (C1βC7, T1βT12, L1βL6, T13) from CT scans. Trained on the VerSe 2020 dataset using a Residual Encoder U-Net (ResEncUNet-M) architecture in 3D low-resolution configuration.
Test set performance: Mean Dice 0.729, Mean IoU 0.672 (73 cases). Outperforms general medical segmentation models on the same dataset. (specifically, TotalSegmentator with Dice 0.708).
Model Details
| Property | Value |
|---|---|
| Framework | nnUNetv2 |
| Configuration | 3d_lowres |
| Planner | nnUNetResEncUNetMPlans |
| Folds | 0, 1 |
| Input | CT (NIfTI, .nii.gz) |
| Labels | 26 classes (background + C1βC7, T1βT13, L1βL6) |
Download
Option 1: Hugging Face CLI
pip install huggingface_hub
huggingface-cli download lukatman/verse-vertebrae-segmentation-nnunet --local-dir ./downloaded_model
Option 2: Git
git clone https://huggingface.co/lukatman/verse-vertebrae-segmentation-nnunet
Usage with nnUNet
1. Install nnUNetv2
pip install nnunetv2
Set environment variables:
export nnUNet_raw="/path/to/nnUNet_raw"
export nnUNet_preprocessed="/path/to/nnUNet_preprocessed"
export nnUNet_results="/path/to/nnUNet_results"
2. Place the model in nnUNet_results
The downloaded folder contains nnUNet_results/nnUNetTrainer__nnUNetResEncUNetMPlans__3d_lowres/. Copy it into your nnUNet results directory under the dataset name:
# After downloading, create the dataset folder and copy the model
mkdir -p $nnUNet_results/Dataset001_VerSe
cp -r downloaded_model/nnUNet_results/nnUNetTrainer__nnUNetResEncUNetMPlans__3d_lowres \
$nnUNet_results/Dataset001_VerSe/
3. Run inference
nnUNetv2_predict -d 001 -c 3d_lowres -f 0 -p nnUNetResEncUNetMPlans \
-i /path/to/input/ct/scans \
-o /path/to/output/predictions
Use -f 1 for fold 1, or run both with -f 0 1 for ensemble.
Label Mapping
| Label | Vertebra |
|---|---|
| 1β7 | C1βC7 (cervical) |
| 8β19 | T1βT12 (thoracic) |
| 20β25 | L1βL6 (lumbar) |
| 26 | T13 (rare variant) |
Project & Citation
- GitHub repository: lukatman/spinal-vertebrae-segmentation β full code, preprocessing scripts, and evaluation results.
- Dataset: VerSe 2020 β Large-Scale Vertebrae Segmentation Challenge.