[Paper Review] Zero-Shot Refinement of Buildings' Segmentation Models using SAM
This paper proposes a zero-shot refinement method for building instance segmentation in remote sensing by leveraging the Segment Anything Model (SAM) through prompt engineering with a pre-trained CNN as a prompt generator. The approach significantly improves segmentation accuracy—achieving a 5.47% IoU gain and 4.81% F1-score improvement on out-of-distribution WHU Buildings data—by using bounding-box prompts to enhance SAM’s localization and recognition capabilities without fine-tuning.
Foundation models have excelled in various tasks but are often evaluated on general benchmarks. The adaptation of these models for specific domains, such as remote sensing imagery, remains an underexplored area. In remote sensing, precise building instance segmentation is vital for applications like urban planning. While Convolutional Neural Networks (CNNs) perform well, their generalization can be limited. For this aim, we present a novel approach to adapt foundation models to address existing models' generalization dropback. Among several models, our focus centers on the Segment Anything Model (SAM), a potent foundation model renowned for its prowess in class-agnostic image segmentation capabilities. We start by identifying the limitations of SAM, revealing its suboptimal performance when applied to remote sensing imagery. Moreover, SAM does not offer recognition abilities and thus fails to classify and tag localized objects. To address these limitations, we introduce different prompting strategies, including integrating a pre-trained CNN as a prompt generator. This novel approach augments SAM with recognition abilities, a first of its kind. We evaluated our method on three remote sensing datasets, including the WHU Buildings dataset, the Massachusetts Buildings dataset, and the AICrowd Mapping Challenge. For out-of-distribution performance on the WHU dataset, we achieve a 5.47\% increase in IoU and a 4.81\% improvement in F1-score. For in-distribution performance on the WHU dataset, we observe a 2.72\% and 1.58\% increase in True-Positive-IoU and True-Positive-F1 score, respectively. Our code is publicly available at this Repo (https://github.com/geoaigroup/GEOAI-ECRS2023), hoping to inspire further exploration of foundation models for domain-specific tasks within the remote sensing community.
Motivation & Objective
- To address the generalization gap of foundation models like SAM in remote sensing, particularly for building footprint segmentation.
- To overcome SAM’s lack of recognition capabilities by integrating a pre-trained CNN as a prompt generator to enable object classification and tagging.
- To explore effective prompting strategies that enhance SAM’s performance on remote sensing imagery without fine-tuning.
- To evaluate the method on in-distribution and out-of-distribution remote sensing datasets, demonstrating robustness across domains.
- To provide a publicly available codebase to inspire further research on adapting foundation models to domain-specific remote sensing tasks.
Proposed method
- A pre-trained CNN is used to generate segmentation masks from RGB satellite images, which are then used to create spatial prompts for SAM.
- Multiple prompting strategies are evaluated: single-point, negative-point, multiple-points (random and skeleton-based), and bounding-box prompts.
- The bounding-box prompt, derived from the CNN’s predicted mask, is used as input to SAM to refine segmentation outputs.
- The method operates in a zero-shot manner, requiring no model fine-tuning or additional annotations.
- The CNN-generated masks serve as both localization and recognition signals, enabling SAM to segment buildings more accurately.
- The approach combines the CNN’s domain-specific localization with SAM’s strong zero-shot generalization for improved instance segmentation.

Experimental results
Research questions
- RQ1Can SAM be effectively adapted for building instance segmentation in remote sensing without fine-tuning?
- RQ2Which prompting strategy—point-based, multiple-point, or bounding-box—yields the highest segmentation accuracy for buildings in remote sensing imagery?
- RQ3Does integrating a pre-trained CNN as a prompt generator improve SAM’s recognition and segmentation performance on remote sensing data?
- RQ4How does the proposed method perform on out-of-distribution remote sensing datasets compared to baseline CNN models?
- RQ5Why do skeleton-based multiple-point prompts not outperform random multiple-point prompts in this setting?
Key findings
- On the out-of-distribution WHU Buildings dataset, the bounding-box prompt strategy improved IoU by 5.47% and F1-score by 4.81% compared to the baseline CNN.
- For in-distribution performance on the WHU dataset, the method achieved a 2.72% increase in True-Positive-IoU and a 1.58% improvement in True-Positive-F1-score.
- The bounding-box prompt outperformed all other prompting strategies, including single-point, negative-point, and multiple-point prompts.
- The method achieved strong performance on the Massachusetts Buildings and AICrowd Mapping Challenge datasets, with notable improvements in TP-IoU and TP-F1.
- Surprisingly, the skeleton-based multiple-point prompt did not outperform the random multiple-point strategy, suggesting that point distribution pattern may not be critical for SAM’s performance in this context.
- The integration of a pre-trained CNN as a prompt generator successfully equipped SAM with recognition capabilities, enabling it to segment and tag buildings accurately in remote sensing imagery.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.