Abstract
Muscle quantity and quality are critical biomarkers for health outcomes, yet automated segmentation in MRI remains challenging due to high variability in sequences and anatomical locations. We present SegmentAnyMuscle, an ensemble deep learning model that achieves high-accuracy muscle segmentation across 11 body regions and 19 MRI sequences. By integrating the self-configuring nnU-Net with a fine-tuned Segment Anything Model (SAM) using a "Mixture of Adapters" strategy, our approach significantly outperforms standard architectures. The model achieved a Dice Similarity Coefficient (DSC) of 88.45% on common sequences and 86.21% on challenging cases, demonstrating robust performance across diverse clinical protocols and patient demographics.
Introduction
Muscle quantity and quality serve as vital indicators for metabolic function and post-surgical recovery. While Computed Tomography (CT) is frequently utilized for these assessments, it lacks the superior soft-tissue contrast of Magnetic Resonance Imaging (MRI) and involves ionizing radiation. However, MRI automation is hindered by "non-quantitative" variability; pixel intensities fluctuate based on scanner manufacturers, sequence types (e.g., T1, T2, Dixon), and acquisition parameters.
Existing automated tools are typically limited to specific anatomical targets or require rare whole-body scans. There is a pressing need for a "universal" model capable of handling the heterogeneity of clinical MRI protocols and anatomical locations without requiring manual tuning for each new application.
Methods
Model Architecture
The SegmentAnyMuscle framework employs an ensemble approach combining two state-of-the-art models:
- nnU-Net: A self-configuring framework that automatically optimizes its architecture and training pipeline based on dataset characteristics such as spacing and intensity distribution.
- Fine-tuned SAM: The Segment Anything Model was adapted using a "Mixture of Adapters" strategy. Small, trainable adapter layers were inserted into the transformer blocks to specialize the foundation model for musculoskeletal MRI without retraining the entire network.
The final segmentation is derived by averaging the probability maps from both models. This ensemble was compared against several baselines, including standard UNet, AttentionUNet, and SwinUNet.
Dataset and Training
The study utilized a retrospective cohort of 362 MRI exams from 160 patients at Duke University Health System (2016–2020). The dataset encompasses 11 body locations—including the chest, abdomen, spine, hip, thigh, knee, lower leg, and extremities—and 19 distinct MRI sequences.
The data was partitioned into training/validation (316 MRIs) and two test sets: Test Set A (28 common sequences) and Test Set B (18 challenging cases with atrophy, hardware artifacts, or high noise). To augment the training data, a pairing strategy was used to transfer masks between perfectly aligned annotated and unannotated scans of the same patient.
Results
The ensemble model demonstrated superior performance, achieving a DSC of 88.45% on Test Set A and 86.21% on Test Set B. It outperformed the standard U-Net by a massive margin—13.46% and 22.94% on these sets, respectively. Furthermore, predicted muscle volumes showed a near-perfect correlation with ground truth measurements (Pearson r ≥ 0.99), validating its reliability for calculating the Skeletal Muscle Index (SMI).
Key insights include:
- Complementary Strengths: The ensemble approach suggests that the convolutional strengths of nnU-Net and the global context of transformer-based SAM are highly complementary in medical imaging.
- Generalizability: The model maintained consistent performance across different patient demographics (age, sex, race) and even on anatomical regions minimally represented in the training set, such as the wrist.
- Clinical Efficiency: Manual segmentation of a full MRI volume can take an expert 5 to 11 hours. This model provides near-instantaneous results, enabling "opportunistic screening" during routine clinical scans.
Discussion and Conclusion
While SegmentAnyMuscle provides a robust solution for binary muscle segmentation, limitations remain. The current model does not distinguish between individual muscle groups or assess left-right asymmetry. Additionally, as the data originated from a single institution, external validation is necessary to confirm broader generalizability. Performance on severely diseased tissue also remains an area for improvement. Future work will focus on multi-class segmentation to enable more granular clinical analysis of specific muscle degeneration linked to functional outcomes.
The code and model weights are publicly available on GitHub to support further research and clinical application.
Summary updated