SAMora: Enhancing SAM through Hierarchical Self-Supervised Pre-Training for Medical Images

Shuhang Chen, Hangjie Yuan, Pengwei Liu, Hanxue Gu, Tao Feng, Dong Ni · DOI

Introduction

Meta’s Segment Anything Model (SAM) has revolutionized general image segmentation, demonstrating remarkable zero-shot capabilities. However, its performance often falters when applied to the specialized domain of medical imaging. Medical scans present unique challenges: they are highly complex, exhibit significant anatomical variation, and require expert knowledge for accurate annotation. Furthermore, acquiring large-scale labeled datasets is often hindered by high costs and strict legal restrictions.

Existing "prompt-free" fine-tuning methods for SAM typically rely on small labeled datasets, failing to leverage the vast quantities of unlabeled medical data available in clinical databases. Moreover, medical images are inherently hierarchical, containing critical information across multiple scales—from global organ layouts to regional structures and fine-grained pixel-level tissue variations. Current adaptations of SAM often fail to capture and integrate these multi-scale features effectively. To address these limitations, researchers have introduced SAMora, a framework designed to enhance SAM through hierarchical self-supervised pre-training.

The SAMora Framework

SAMora adopts a two-stage learning process that leverages unlabeled data to build a robust foundation for medical image segmentation.

Stage 1: Hierarchical Self-Supervised Pre-Training

Instead of updating the entire SAM model, which is computationally expensive and risks catastrophic forgetting, SAMora utilizes lightweight Low-Rank Adaptation (LoRA) modules. Three separate LoRA "experts" are attached to a frozen SAM encoder, each trained on 100,000 unlabeled medical images using a specific self-supervised learning (SSL) objective:

  • Image-Level (Global): This expert focuses on broad anatomical context using contrastive learning (SimCLRv2) within a Teacher-Student distillation framework.
  • Patch-Level (Regional): By employing a Masked Autoencoder (MAE) approach to reconstruct missing image patches, this expert learns intermediate structural relationships.
  • Pixel-Level (Fine-Grained): A denoising autoencoder objective is used to capture subtle, high-resolution tissue variations and local textures.

Stage 2: Fine-Tuning with Hierarchical Fusion

After pre-training, the model is fine-tuned on a smaller labeled dataset. To effectively combine the insights from the three LoRA experts, the authors introduced the Hierarchical LoRA Attention (HL-Attn) module. Unlike simple averaging or gating, HL-Attn uses a cross-attention mechanism to sequentially fuse features from the bottom up—integrating pixel-level details first, followed by patch-level structures, and finally global context.

The two-stage SAMora framework: Stage 1 involves hierarchical self-supervised pre-training of LoRA experts on unlabeled data, while Stage 2 focuses on fine-tuning with the HL-Attn fusion module.

Experimental Setup

The framework was pre-trained on a diverse collection of 100,000 unlabeled CT images sampled from major challenges like AMOS22, LiTS, KiTS, and the Medical Segmentation Decathlon. For evaluation, the researchers used several benchmark datasets:

  • Synapse: A multi-organ abdominal CT dataset.
  • LA: A Left Atrial MRI dataset.
  • PROMISE12: A Prostate MRI dataset.

Performance was assessed in both fully supervised and few-shot settings (e.g., using only 5-10% of the training data) to test the model's efficiency and generalization.

Key Insights and Ideas

The development of SAMora yielded several critical insights into medical image segmentation:

  • Complementarity of Scales: Visual analysis confirms that individual LoRA experts often miss specific structural details. Accurate segmentation of complex organ boundaries requires the synergy of global, regional, and pixel-level features.
  • Preserving Nuance through HL-Attn: Standard fusion techniques like linear weighting tend to "wash out" the unique characteristics of specialized experts. The HL-Attn mechanism is crucial for preserving and effectively integrating these distinct features.
  • Bottom-Up Fusion: The researchers found that fusing features from the finest scale (pixel) to the coarsest (image) yields superior results, suggesting that high-level spatial understanding is best built upon a foundation of fine-grained detail.
  • Efficiency via Unlabeled Data: By performing the heavy lifting during the self-supervised phase, SAMora significantly reduces the need for extensive labeled data and compute time during downstream adaptation.

Performance Evaluation

SAMora achieves state-of-the-art results across multiple benchmarks while demonstrating exceptional efficiency.

Quantitative comparison of SAMora against various baselines on the Synapse dataset. SAMora consistently outperforms existing methods in both 10% few-shot and fully supervised settings.

Key results include:

  • Efficiency Gains: SAMora reduces the required fine-tuning epochs by 90% compared to standard baselines (e.g., 20-30 epochs vs. 200-300), drastically lowering the barrier for clinical deployment.
  • Few-Shot Dominance: In a 10% training data setting on the Synapse dataset, SAMora achieved a Mean Dice score of 79.41%, representing a 4.09% improvement over the SAMed baseline.
  • State-of-the-Art Accuracy: In fully supervised scenarios, the H-SAMora variant reached a Mean Dice score of 84.34% on Synapse, surpassing established non-SAM models like SwinUnet.
  • Adaptability: The framework is architecture-agnostic; its successful application to SAM2 (as SAMora-2) demonstrates its potential for future foundation models.

Conclusion and Future Work

While SAMora significantly advances medical image segmentation, it still requires a small amount of high-quality labeled data for fine-tuning and can be sensitive to extreme image noise. Future research will focus on incorporating weakly labeled data—such as bounding boxes or scribbles—which are much easier to obtain than voxel-level masks. This direction aims to further enhance the model's scalability and generalization across a wider array of clinical tasks.

Summary updated

BibTeX
@inproceedings{chen2025samora,
  author = {Shuhang Chen and Hangjie Yuan and Pengwei Liu and Hanxue Gu and Tao Feng and Dong Ni},
  title = {{SAMora: Enhancing SAM through Hierarchical Self-Supervised Pre-Training for Medical Images}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure