LiverSegMRI
Sequence-agnostic whole-liver segmentation on abdominal MRI.
LiverSegMRI is a nnU-Net v2 (3d_fullres, nnUNetTrainerNoMirroring) based, sequence agnostic MRI segmentation model that segments the whole liver (3D) on a single abdominal MRI sequence. It handles:
- T1-weighted in- and opposed-phase
- T1W pre-contrast and dynamic post-contrast (early and late arterial, portal venous, transitional or delayed)
- T1W hepatobiliary phase
- T2-weighted
- Diffusion-weighted (DWI) and ADC
| Resource | Link |
|---|---|
| Code | github.com/TaouliLab/LiverSegMRI |
| Paper | Manuscript under review; journal, DOI and archive link will be added after publication |
Usage
pip install git+https://github.com/TaouliLab/LiverSegMRI.git
liversegmri predict -i /path/to/images -o /path/to/output
from liversegmri.inference import LiverSegMRI
model = LiverSegMRI(device="cuda") # downloads this repository on first use
model.predict(["/path/to/pvp.nii.gz"], output_dir="/path/to/output")
The model folder can also be used directly with nnU-Net v2:
from huggingface_hub import snapshot_download
from nnunetv2.inference.predict_from_raw_data import nnUNetPredictor
model_dir = snapshot_download("TaouliLab/LiverSegMRI")
predictor = nnUNetPredictor(tile_step_size=0.5, use_gaussian=True, use_mirroring=False)
predictor.initialize_from_trained_model_folder(model_dir, use_folds=(0, 1, 2, 3, 4), checkpoint_name="checkpoint_final.pth")
The study applied largest-connected-component filtering to the output, as the LiverSegMRI package does by default.
Files
| File | Description |
|---|---|
dataset.json |
nnU-Net dataset description (single channel; labels background = 0, liver = 1) |
plans.json |
nnU-Net plans (3d_fullres, 1 × 1 × 1 mm target spacing, patch size 96 × 160 × 160) |
fold_{0..4}/checkpoint_final.pth |
Final-epoch checkpoint of each cross-validation fold, exactly as trained |
Training data
- Training cohort: 10,494 MRI sequences from 1,058 patients.
- Sources:
- Icahn School of Medicine at Mount Sinai (USA): chronic liver disease with LI-RADS 3/4 observations; intrahepatic cholangiocarcinoma.
- Seoul National University Hospital (South Korea): intrahepatic cholangiocarcinoma.
- The public LLD-MMRI dataset (China).
- Reference masks: drawn manually from scratch on every sequence by radiologists in 3D Slicer, with adjudication by an abdominal radiologist.
- Segmentation convention: the liver label includes the parenchyma and all intrahepatic lesions; the gallbladder and major vessels are excluded.
Training procedure
| Setting | Value |
|---|---|
| Framework | nnU-Net v2, 3d_fullres, nnUNetTrainerNoMirroring |
| Schedule | 1,000 epochs × 250 iterations per fold, batch size 2 |
| Optimization | Initial learning rate 0.01 with polynomial decay; weight decay 3 × 10⁻⁵; deep supervision |
| Hardware | One NVIDIA A100 (40 GB) per fold, about 45 hours per fold |
Evaluation
Patient-wise mean Dice:
| Test set | Patients | LiverSegMRI | TotalSegmentator MRI | MRAnnotator |
|---|---|---|---|---|
| External: Duke Liver Dataset and CirrMRI600+ | 487 | 0.944 | 0.886 | 0.889 |
| Internal: held out | 189 | 0.985 | 0.880 | 0.894 |
| Development: out-of-fold | 1,058 | 0.983 | — | — |
External test set, LiverSegMRI vs comparators:
| Metric | LiverSegMRI | TotalSegmentator MRI | MRAnnotator |
|---|---|---|---|
| HD95 (mm) | 6.6 | 15.3 | 27.0 |
| Volume error (%) | 5.0 | 13.9 | 12.5 |
- By field strength: in Mount Sinai patients with DICOM metadata, performance was similar at 1.5 T and 3.0 T.
- Comparisons with the other models: all paired comparisons were significant with Holm-adjusted P < .001.
Performance across sequence types and liver morphology
Radar plots of patient-wise mean Dice for the three models, by MRI sequence type (A, internal test; B, external test) and by morphologic subgroup (C, internal; D, external). Each axis is one sequence type or subgroup; the values under each plot list the models in the same order as the axes. LiverSegMRI encloses both comparators on every axis.
Relative to conventional T1-weighted phases, Dice falls by 0.011 on DWI and 0.016 on ADC for LiverSegMRI, against 0.071 and 0.085 for TotalSegmentator MRI and 0.181 and 0.145 for MRAnnotator. Subgroup performance (C, D) stays close to the whole-cohort level for LiverSegMRI in cirrhosis, irregular borders, prior resection, left lobe extension, exophytic lesions and ascites.
ADC = apparent diffusion coefficient, AP = arterial phase, DWI = diffusion-weighted imaging, EAP = early arterial phase, HBP = hepatobiliary phase, PVP = portal venous phase, T1W = T1-weighted, T2W = T2-weighted, TP/DP = transitional/delayed phase.
Representative segmentations
Representative qualitative comparison of liver segmentation across MRI sequences and challenging morphologic subgroups. Examples from external and internal test cohorts comparing reference annotations (red) with segmentations generated by LiverSegMRI (blue), TotalSegmentator MRI (orange), and MRAnnotator (green).
- A–D, Portal venous phase T1-weighted imaging in a cirrhotic patient with left lobe elongation.
- E–H, T2-weighted imaging in a cirrhotic patient with severe ascites.
- I–L, Diffusion-weighted imaging in a patient with a large intrahepatic cholangiocarcinoma extending to the liver margins.
LiverSegMRI demonstrates more consistent boundary delineation across heterogeneous sequences and complex liver morphologies.
See the paper for sequence-wise, subgroup, failure, and label-matched analyses.
Intended use and limitations
- Intended use: research on whole-liver segmentation of axial abdominal MRI in adults. Examples are volumetry, quantitative MRI, and localization for downstream analyses.
- Not a medical device. Outputs must be reviewed and must not be used for clinical decision-making.
- Performance is lower on external data (Dice 0.944) than on internal data. It may degrade further with severe artifacts, low-field or nonstandard protocols, non-axial acquisitions, or pediatric patients.
- Gross failures (Dice < 0.50) were rare: 2 of 1,047 external sequences, both T2-weighted images of cirrhotic livers with ascites.
- Whole liver only: no segmental, vascular, or lesion labels.
Citation
The article is not yet published. Until it is, please cite this model repository; the journal, year and DOI below will be completed after publication.
@misc{liversegmri,
title = {LiverSegMRI: Development and External Validation of a Deep Learning Model for Automated Liver Segmentation across Multiparametric MRI Sequences and Comparison with Generalist Segmentation Models},
author = {Yuce, Murat and Tordjman, Mickael and Meribout, Anis and Ozkaya, Efe and Lee, Jung-Oh and Lee, Jeong Min and Akinci D'Antonoli, Tugba and Wasserthal, Jakob and Mei, Xueyan and Taouli, Bachir},
note = {Manuscript under review; journal, year and DOI to be added after publication},
url = {https://huggingface.co/TaouliLab/LiverSegMRI}
}
License
CC BY-NC 4.0: non-commercial research use with attribution.
- Downloads last month
- 27

