TL;DR
RetSAM is a unified foundation framework that bridges the gap between pixel-level retinal image segmentation and clinical quantification. By training on over 200,000 fundus images using a clever multi-stage curriculum, it simultaneously segments anatomical structures, lesions, and phenotypic patterns to extract over 30 standardized biomarkers. RetSAM sets a new state-of-the-art across 17 public datasets, providing a robust, open-source pipeline for large-scale "oculomics" research.
What Problem Does This Paper Address?
Retinal imaging is a powerful, non-invasive window into both ocular and systemic health—a growing field known as oculomics. However, analyzing these images at scale faces a massive bottleneck.
Existing public datasets are highly fragmented; one dataset might label blood vessels, another the optic disc, and a third specific diabetic lesions. Because these datasets use inconsistent definitions and rarely provide overlapping labels, training a single model to recognize everything has been incredibly difficult. Furthermore, pixel-level segmentation maps are rarely paired with standardized quantification tools. Different research groups use different measurement rules, making it nearly impossible to reliably compare biomarkers (like vessel tortuosity or cup-to-disc ratios) across different populations and camera types.
Methods
The authors introduce RetSAM, an end-to-end framework designed to solve both the multi-task segmentation problem and the downstream quantification problem.
1. Network Architecture
Instead of using a single decoder for all classes—which often causes optimization conflicts when targets vary wildly in shape—RetSAM utilizes a single-encoder, multi-decoder design built on SwinUNETR (with a Swin-Base backbone). Images are processed at a $640 \times 640$ resolution. Independent decoder branches are assigned to specific task categories, preventing easier tasks from dominating more complex ones.
2. Three-Stage Training Strategy
To leverage both clean, specialized private data and massive, uncurated public data, the authors developed a three-stage curriculum:
- Stage 1 (Expert Training): Task-specific expert models are trained on high-quality, single-task private datasets.
- Stage 2 (Multi-Task Pre-training): These experts generate pseudo-labels for roughly 160,000 public fundus images. Strict confidence thresholding and topological filtering are applied to eliminate noisy labels. RetSAM is then pre-trained on this massive, unified multi-task dataset.
- Stage 3 (Task-Specific Adaptation): The encoder is frozen to preserve general representations, and the decoders are fine-tuned on private datasets to align perfectly with strict clinical annotation standards.
3. Deterministic Quantification Engine
After segmentation, RetSAM applies rule-based post-processing to convert masks into 30+ clinical biomarkers. For example, it skeletonizes vessel masks to compute fractal dimensions and tortuosity, and applies convex hull operations to smooth optic disc boundaries for accurate cup-to-disc ratio calculations.
Datasets
RetSAM was trained and evaluated on a massive hybrid corpus:
- Private Backbone: Over 50,000 high-resolution images from Airdoc’s screening services, meticulously annotated by experts across four specialized subsets (Artery/Vein, Optic Disc/Cup, 29 Lesion types, and Myopic features).
- Public Pre-training: 24 public datasets (~160,000 images) including EyePACS, DDR, Messidor, and ODIR, unified via pseudo-labeling.
- Evaluation Benchmarks: 17 public datasets (e.g., DRIVE, FIVES, REFUGE, IDRiD). Notably, the authors re-annotated four classic datasets (DRIVE, HRF, GAMMA, IDRiD) to add missing labels, creating a rigorous benchmark for simultaneous multi-target evaluation.
Key Insights and Ideas
- The Whole is Greater Than the Sum of Its Parts: Remarkably, RetSAM consistently outperformed the single-task "expert" models that generated its training pseudo-labels. Jointly modeling diverse targets forces the encoder to learn shared, robust fundus characteristics, making it less sensitive to noise.
- Exceptional Sample Efficiency: In label-scarce simulations, RetSAM matched or exceeded baseline models using only 5% of annotated data, proving that its multi-task pre-trained features are highly transferable.
- An "Anomaly" Safety Net: By including a generic "Possible Lesion" category during training, the model successfully localizes out-of-distribution (OOD) unseen lesions simply by recognizing that the texture deviates from normal background tissue.
Key Results
- State-of-the-Art Performance: RetSAM improved on prior best methods (including MedSAM, SAM2, and RetFound) by an average of 3.9 percentage points in Dice Similarity Coefficient (DSC) across 17 public datasets, with gains up to 15 percentage points on multi-task benchmarks.
- Preserving Topology: For vessel segmentation, RetSAM achieved a centerline Dice (clDice) score of 34.7%, outperforming SAM2-UNet by over 14%. This translates to significantly fewer fragmented capillary predictions.
- Cross-Modality Generalization: When tested on Ultra-Widefield (UWF) fundus imaging and Optical Coherence Tomography Angiography (OCTA), RetSAM provided a vastly superior initialization weight, converging faster and more accurately than general-purpose medical image encoders.
Limitations and Future Work
- Modality Constraints: RetSAM is heavily optimized for 2D color fundus photography. Its zero-shot performance on 3D volumetric modalities (like standard OCT) remains unproven and requires further study.
- Resolution Bottleneck: Because the model downsamples inputs to a fixed $640 \times 640$ size, it can occasionally omit fine, peripheral capillary networks when processing ultra-widefield (UWF) images.
- Rigid Task Configuration: Unlike interactive, prompt-based models (like the original SAM), RetSAM operates on a predefined, fixed set of clinical targets, which limits its flexibility for open-ended, interactive clinical inquiries.
Summary updated