TextSAM-EUS: Text Prompt Learning for SAM to Accurately Segment Pancreatic Tumor in Endoscopic Ultrasound

Pascal Spiegler, Taha Koleilat, Arash Harirpoush, Corey S. Miller, Hassan Rivaz +2 more
7/24/2025
cs.CVcs.AI

Official code: HealthX-Lab/TextSAM-EUS (26 stars, MIT, last commit 2026-01-28). 1 more implementation below.

Abstract

Pancreatic cancer carries a poor prognosis and relies on endoscopic ultrasound (EUS) for targeted biopsy and radiotherapy. However, the speckle noise, low contrast, and unintuitive appearance of EUS make segmentation of pancreatic tumors with fully supervised deep learning (DL) models both error-prone and dependent on large, expert-curated annotation datasets. To address these challenges, we present TextSAM-EUS, a novel, lightweight, text-driven adaptation of the Segment Anything Model (SAM) that requires no manual geometric prompts at inference. Our approach leverages text prompt learning (context optimization) through the BiomedCLIP text encoder in conjunction with a LoRA-based adaptation of SAM's architecture to enable automatic pancreatic tumor segmentation in EUS, tuning only 0.86% of the total parameters. On the public Endoscopic Ultrasound Database of the Pancreas, TextSAM-EUS with automatic prompts attains 82.69% Dice and 85.28% normalized surface distance (NSD), and with manual geometric prompts reaches 83.10% Dice and 85.70% NSD, outperforming both existing state-of-the-art (SOTA) supervised DL models and foundation models (e.g., SAM and its variants). As the first attempt to incorporate prompt learning in SAM-based medical image segmentation, TextSAM-EUS offers a practical option for efficient and robust automatic EUS segmentation. Code is available at https://github.com/HealthX-Lab/TextSAM-EUS .

View on arXivView PDF

Code Implementations(2)

MIT

[ICCV 2025 CVAMD] Official implementation of TextSAM-EUS

264Shell, PythonJun 3, 20258 months agoMIT
PyTorchMIT

TextSAM-EUS: Text Prompt Learning for SAM to Accurately Segment Tumor in Ultrasound Images

30Shell, PythonSep 18, 20258 months agoMIT
clipimage-processingmedicalmedical-ultrasound-imagepytorch+2 more

Similar Papers

Cite this paper

@article{spiegler2025textsameus,
  title  = {TextSAM-EUS: Text Prompt Learning for SAM to Accurately Segment Pancreatic Tumor in Endoscopic Ultrasound},
  author = {Pascal Spiegler and Taha Koleilat and Arash Harirpoush and Corey S. Miller and Hassan Rivaz and Marta Kersten-Oertel and Yiming Xiao},
  year   = {2025},
  eprint = {2507.18082},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.18082v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.18082.svg)](https://codeofpaper.com/paper/2507.18082)

Discussion