Dynamically evolving segment anything model with continuous learning for medical image segmentation

Zhaori Liu, Mengyang Li, Hu Han, Enli Zhang, Shiguang Shan, Zhiming ZhaoarXiv 2025 · DOI

Abstract

Medical image segmentation faces challenges from evolving clinical demands and diverse data sources. Foundation models like the Segment Anything Model (SAM) often suffer from catastrophic forgetting when fine-tuned on new tasks. This paper introduces EvoSAM, a framework enabling SAM to continuously learn new medical imaging tasks without forgetting previous knowledge. By employing task-specific LoRA experts and a ridge-regression matcher, EvoSAM achieves near-zero forgetting and superior segmentation accuracy across diverse clinical scenarios.

Introduction

Medical imaging is a dynamic field where clinical requirements, imaging technologies, and data sources (e.g., different hospitals or scanners) are constantly changing. While foundation models like the Segment Anything Model (SAM) have revolutionized image segmentation, their application in the medical domain is hindered by "catastrophic forgetting." This phenomenon occurs when a model, upon being fine-tuned for a new task (such as prostate MRI segmentation), overwrites the knowledge it acquired from previous tasks (such as surgical blood vessel segmentation).

Continual learning scenarios for surgical vessels and prostate MRI.

EvoSAM addresses this challenge by transforming SAM into a "lifelong learner" that can accumulate knowledge dynamically. The framework allows for the continuous integration of new clinical scenarios without requiring the model to be retrained from scratch on all previous data.

Methodology

EvoSAM introduces two primary innovations to facilitate continuous learning:

  • LoRA Experts (Parameter Isolation): Instead of updating all of SAM’s parameters, EvoSAM utilizes Low-Rank Adaptation (LoRA). It adds small, trainable matrices to the model while keeping the original weights frozen. Crucially, EvoSAM creates a new set of LoRA parameters (an "expert") for every new task. This physical separation ensures that knowledge for one task does not interfere with another, effectively preventing forgetting.
  • Ridge Regression Expert Matcher: During inference, the model must determine which expert to use. EvoSAM employs a pre-trained CLIP model to extract features from the user-provided Region of Interest (ROI). A ridge regression-based classifier then automatically selects the most relevant LoRA expert for that specific image.
  • Incremental Learning: The matcher is updated using cumulative statistics (Gram matrices), allowing it to recognize new tasks without storing or revisiting data from previous tasks, which is vital for maintaining patient privacy.

Experimental Setup

The model was evaluated on two challenging scenarios designed to simulate real-world clinical evolution:

  1. Surgical Blood Vessel Segmentation: A sequence of tasks where the variety of vessel categories to be segmented expands over time.
  2. Multi-site Prostate MRI Segmentation: A dataset involving six different clinical sites, each with unique imaging conditions and hardware, testing the model's ability to generalize across different hospital environments.

Results and Key Insights

EvoSAM demonstrated significant improvements in both accuracy and knowledge retention compared to standard fine-tuning and other continual learning baselines.

Performance metrics comparing EvoSAM to baseline methods.

Superior Accuracy and Zero Forgetting

On the surgical blood vessel task, EvoSAM achieved an average mDice score of 72.42%, significantly outperforming standard sequential fine-tuning (58.26%). While traditional methods like Elastic Weight Consolidation (EWC) or Knowledge Distillation still exhibit performance drops of 1-5%, EvoSAM achieved nearly 0% forgetting (specifically 0.04% to 0.07%) across multiple tasks. Interestingly, the authors observed instances of positive knowledge transfer, where learning new tasks improved performance on earlier ones as the expert matcher became more robust.

Clinical Efficiency

A user study involving three surgical clinicians (an associate chief surgeon, a resident, and a trainee) confirmed the practical utility of EvoSAM. By providing more accurate initial segments, the model significantly reduced the manual refinement time required for surgeons to produce clinical-grade masks, enhancing workflow efficiency.

Discussion and Future Work

While EvoSAM effectively eliminates catastrophic forgetting through parameter isolation, the linear growth of LoRA experts could eventually lead to memory constraints if the number of tasks becomes extremely large. Furthermore, because experts are independent, the model does not explicitly share common knowledge between highly similar tasks.

Future research directions include moving toward online learning (adapting from a single image) and developing personalized models that can adjust to the specific preferences and habits of individual clinicians.

Summary updated

BibTeX
@misc{liu2025dynamically,
  author = {Zhaori Liu and Mengyang Li and Hu Han and Enli Zhang and Shiguang Shan and Zhiming Zhao},
  title = {{Dynamically evolving segment anything model with continuous learning for medical image segmentation}},
  year = {2025},
  eprint = {2503.06236},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.06236},
}
Figure