BodyCompositionCT-ResEncL

BodyCompositionCT-ResEncL is a 3D nnU-Net v2 model for segmenting native body-composition compartments and supporting anatomical structures in CT. This is a five-fold ResEnc L ensemble. For single-checkpoint inference, see BodyCompositionCT-ResEncM.

Model overview

Property Value
Task Mutually exclusive 3D semantic segmentation
Input One CT volume
Architecture nnU-Net v2, 3d_fullres, ResEnc L
Checkpoints Five cross-validation folds, used as an ensemble
Training set 1,656 CT scans
Native output Background plus seven foreground labels
License CC BY 4.0

Native output labels

ID Label Description
0 Background
1 Muscle Muscle compartment
2 Bone Bone
3 Subcutaneous Subcutaneous compartment
4 Abdominal Abdominal compartment, with organs and larger vessels excluded
5 Thoracic Thoracic compartment, with organs and larger vessels excluded
6 Heart Heart
7 Lungs Lungs

Labels 1, 3, 4, and 5 denote anatomical compartments rather than final attenuation-defined tissue masks. The muscle compartment can contain inter- and intramuscular connective tissue, smaller vessels, and larger fat-attenuation regions. IMAT is not a separate model class; CT-visible IMAT can be derived downstream within label 1 using HU-thresholding. All downstream tissue measurements should state their HU range, cleanup rules, and source compartment.

The machine-readable mapping is stored in dataset.json.

Training data and target construction

The training set contains 750 CT scans from SAROS and 906 from the TotalSegmentator v2 dataset. Another 332 cases (150 SAROS and 182 TotalSegmentator) were reserved and were not used for training.

Targets were constructed from dense BOA Task542 body-region predictions, sparse expert-reviewed SAROS labels, and TotalSegmentator-derived anatomical masks. Reviewed SAROS labels replaced predictions on annotated slices. TotalSegmentator muscle, bone, lung, tracheal, body-trunk, organ, vessel, and neural masks supplied corrections and exclusions. HU-guided candidate selection, morphological cleanup, model-assisted completion, and manual review produced the final seven foreground labels.

Only the open TotalSegmentator total and body tasks were used for target construction; the separately licensed tissue_types and vertebrae_body tasks were not used.

Training logs, plans, configuration snapshots, progress plots, and internal cross-validation summaries are included with the model.

Inference

The model uses the standard nnU-Net v2 results layout. The commands below were tested with nnU-Net v2 2.5.2. Input files must be unwindowed CT NIfTI volumes containing Hounsfield-unit values and named <case>_0000.nii.gz. Do not normalize or resample them manually; nnU-Net applies the preprocessing stored in the plans.

For integration with preprocessing and downstream tissue derivation, see the BodyComposition pipeline.

Set the nnU-Net results directory and download the model:

export nnUNet_results="/path/to/nnUNet_results"

hf download fhofmann/BodyCompositionCT-ResEncL \
  --local-dir "${nnUNet_results}/Dataset611_Tissue"

Optionally verify the model artifacts:

cd "${nnUNet_results}/Dataset611_Tissue"
sha256sum -c MODEL_ARTIFACTS.sha256

Run five-fold ensemble inference:

nnUNetv2_predict \
  -d Dataset611_Tissue \
  -i INPUT_FOLDER \
  -o OUTPUT_FOLDER \
  -f 0 1 2 3 4 \
  -tr nnUNetTrainer \
  -c 3d_fullres \
  -p nnUNetResEncUNetLPlans

Cross-validation selected largest-component postprocessing for label 6 (heart):

MODEL_FOLDER="${nnUNet_results}/Dataset611_Tissue/nnUNetTrainer__nnUNetResEncUNetLPlans__3d_fullres"

nnUNetv2_apply_postprocessing \
  -i OUTPUT_FOLDER \
  -o OUTPUT_FOLDER_POSTPROCESSED \
  -pp_pkl_file "${MODEL_FOLDER}/crossval_results_folds_0_1_2_3_4/postprocessing.pkl" \
  -plans_json "${MODEL_FOLDER}/plans.json" \
  -dataset_json "${MODEL_FOLDER}/dataset.json"

With NumPy 2.4 or newer, use acvl-utils>=0.2.6,<0.3 for this postprocessing step.

The checkpoints and postprocessing file are serialized PyTorch/Python artifacts. Load them only from a trusted copy of this repository.

Evaluation status

The included cross-validation summary reports internal five-fold cross-validation across the 1,656 training cases; each case was evaluated by a fold that did not train on it.

Intended use and limitations

The model is intended to provide compartment masks for research pipelines, including downstream body-composition measurements derived with CT attenuation thresholds.

  • It is not intended for diagnosis, treatment decisions, or stand-alone clinical measurement.
  • Training targets combine automated segmentations, deterministic corrections, and manual review; residual source-model and labeling errors can remain.
  • Performance may vary across populations, scanners, acquisition protocols, contrast phases, artifacts, implants, and uncommon anatomy.
  • The targets focus on the body trunk; extremity use is out of scope.
  • External validation is required for each intended population and measurement definition.

License and attribution

The trained weights, model documentation, metadata, and included training/evaluation records are released under CC BY 4.0. Reuse requires appropriate credit, a link to the license, and an indication of changes. See LICENSE for the attribution format.

Training source data, source annotations, upstream checkpoints, and third-party software are not redistributed and retain their original terms:

Upstream material Role Terms
SAROS labels and split metadata Sparse reviewed labels CC BY 4.0
SAROS source CT scans Training images Collection-specific TCIA terms, including restricted, CC BY, and CC BY-NC collections
BOA Task542 weights Dense initial body-region predictions MIT
TotalSegmentator v2 dataset Training CT scans and anatomical labels CC BY 4.0
TotalSegmentator total and body tasks Corrections and exclusions Apache-2.0
nnU-Net v2 Training framework and architecture Apache-2.0

See THIRD_PARTY_NOTICES.md for source links and the complete provenance and license summary.

References

Questions and feedback are welcome in the repository's Community section.

Downloads last month
6
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support