SAMReg: SAM-enabled Image Registration with ROI-based Correspondence

Shiqi Huang, Tingfa Xu, Ziyi Shen, Shaheer Ullah Saeed, Wen Yan, Dean C. Barratt, Yipeng HuarXiv 2024 · DOI

Abstract

Image registration is a critical task in medical imaging, traditionally requiring either slow iterative optimization or large labeled datasets for deep learning. We present SAMReg, a training-free, zero-shot framework that utilizes the Segment Anything Model (SAM) to establish spatial correspondences. By matching automatically segmented "pseudo-regions" (ROIs), SAMReg achieves state-of-the-art performance across diverse 2D and 3D modalities without task-specific training or expert annotations.

Introduction

Image registration—the process of aligning multiple images into a single coordinate system—is essential for clinical workflows such as longitudinal tumor tracking and multi-modal fusion. Existing solutions face a significant trade-off: iterative methods are prone to local minima and high latency, while deep learning methods typically demand extensive manual segmentations for training, limiting their generalizability to new organs or modalities.

SAMReg addresses this gap by reformulating registration as a matching problem between regions. It leverages the foundational capabilities of SAM to identify consistent anatomical or structural landmarks (pseudo-ROIs) across images, enabling a general-purpose registration tool that requires no fine-tuning or manual labels.

Methodology

The fundamental shift in SAMReg is the move from dense pixel-wise mapping to ROI-based correspondence. Instead of mapping every pixel, the framework matches "Regions of Interest" (ROIs) generated by SAM. The algorithm follows a structured three-step pipeline to align a "moving" image to a "fixed" image.

The SAMReg pipeline: (1) ROI Embedding via SAM encoder and mask generation, (2) ROI Matching using prototype vectors and cosine similarity, and (3) DDF Generation for final alignment.
  1. ROI Embedding: Images are processed through SAM’s image encoder to extract high-dimensional features. Simultaneously, SAM’s "everything" mode generates a comprehensive set of segmentation masks (ROIs) for both images.
  2. ROI Matching: For each mask, a "prototype vector" is calculated by pooling features within the mask boundaries. A similarity matrix is then constructed using cosine similarity to find optimal matches between the fixed and moving ROIs.
  3. DDF Generation: The matched ROI pairs are used to optimize a Dense Displacement Field (DDF), balancing alignment accuracy (using Dice and MSE scores) with transformation smoothness.

This approach relies on "pseudo-ROIs"—consistent boundaries identified by SAM that may not correspond to named anatomical structures but serve as robust landmarks for spatial alignment.

Experiments and Results

SAMReg was evaluated across five diverse datasets: 3D MR (Prostate and Cardiac), 3D CT (Lung), 2D Fundus (Retina), and 2D RGB (Aerial).

Qualitative comparison of registration results on Retina and Aerial datasets. SAMReg (Ours) demonstrates superior alignment of target regions compared to unsupervised baselines like VoxelMorph.

Performance Benchmarks

  • Outperforming Baselines: SAMReg consistently outperformed NiftyReg (a standard iterative tool) and VoxelMorph (a popular unsupervised learning model) in terms of Dice scores and Target Registration Error (TRE).
  • Competitive with Supervised Learning: Remarkably, SAMReg achieved results comparable to LabelReg, a model specifically trained on ground-truth labels, despite being entirely zero-shot.
  • Cross-Domain Versatility: The model's success on non-medical aerial datasets highlights its robustness to varying image characteristics and its ability to generalize beyond clinical anatomy.

Discussion and Conclusion

SAMReg demonstrates that "one registration is worth two segmentations." By utilizing SAM's zero-shot segmentation capabilities, the framework eliminates the need for costly manual labels and task-specific training. While current implementation processes 3D volumes as 2D slices, future work involving native 3D foundation models could further enhance performance. Overall, SAMReg provides a powerful, "plug-and-play" solution for complex image registration tasks across multiple domains.

Summary updated

BibTeX
@misc{huang2024samreg,
  author = {Shiqi Huang and Tingfa Xu and Ziyi Shen and Shaheer Ullah Saeed and Wen Yan and Dean C. Barratt and Yipeng Hu},
  title = {{SAMReg: SAM-enabled Image Registration with ROI-based Correspondence}},
  year = {2024},
  eprint = {2410.14083},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.14083},
}
Figure