Preprint
Article

This version is not peer-reviewed.

Water Extraction from Near-Ground and Aerial Flood Imagery Through Semantic–Spatial Coordination with SAM3

Jiajun He  †
,
Tianmin Deng  *,†

  † These authors contributed equally to this work and share first authorship.

Submitted:

29 November 2026

Posted:

02 December 2026

You are already at the latest version

Abstract
Rapid extraction of visible floodwater from near-ground and aerial imagery supports disaster assessment and emergency mapping. With a single text prompt, frozen vision foundation models can miss water or return entirely empty outputs, leaving insufficient initial candidates for automatic spatial re-prompting. We propose a method based on Segment Anything Model 3 (SAM3), termed Semantic–Spatial Complementation and Recovery for SAM3 (SSCR-SAM3). The complementary text prompts "water" and "flood water" generate initial water candidates. Valid connected components are converted automatically into boxes for two-stage inference with joint text and spatial prompts on the full image. Initial foreground retention reduces coverage loss in the second prediction, and an empty regular output triggers conditional recovery at a preset lower threshold. The method keeps SAM3 pretrained weights frozen and requires neither target-task training nor per-image manual prompts. On 1040 near-ground flood images from Deepflood, the complete method increased pooled water intersection over union (IoU) from 83.91% with the default single-text configuration to 88.17%, while reducing empty outputs from 62 to 10. Applying the same fixed configuration to the 94 official aerial test images in AIFloodSense increased pooled water IoU from 42.88% to 78.13% and recall from 43.12% to 81.12%, with precision reaching 95.49%. Empty outputs decreased from 34 to 2, and per-image IoU improved in 90 images. The complete aerial inference procedure had a mean inference-component time of 566.98 ms, approximately 2.55 times that of the official default configuration. These results show that semantic complementarity, candidate-driven spatial refinement, and conditional recovery improve visible-water extraction from red, green, and blue (RGB) flood imagery acquired from different viewpoints without target-domain retraining. The method provides a reusable segmentation procedure for rapid flood assessment.
Keywords: 
;  ;  ;  ;  ;  ;  

1. Introduction

Flood emergency assessment requires usable information on water extent soon after imagery becomes available. The practical value of optical flood mapping depends on both data availability and processing timeliness [1,2]. Water extent provides the basis for identifying flooded roads, analyzing the distribution of affected land-cover features, and assessing disaster impacts. Ground-based surveillance imagery can continuously record changes in inundation at key locations, whereas aerial imagery shows the relationships between water, buildings, roads, and vegetation over a larger area. These observations provide complementary views of flood scenes [3,4,5,6]. Reliable water masks extracted from red, green, and blue (RGB) imagery connect image observation with delineation of water extent and subsequent spatial analysis. Public datasets such as FloodNet and AIFloodSense provide a clearer basis for evaluating pixel-level recognition in complex flood scenes [5,6]. For new regions and viewpoints, task annotation and model training add adaptation steps. Direct use of pretrained knowledge in new scenes, with fewer manual prompts for individual images, offers a practical route to timely water-extent information.
The visual appearance of floodwater depends on turbidity, reflected light, occlusion, and surrounding land-cover features. Wet roads and dark objects can also resemble water [3,7]. Supervised segmentation methods based on U-Net [8], the DeepLab family, and related architectures [9,10] have achieved good water-extraction results in ground-based and aerial imagery. Further studies have examined their applicability across regions, sensors, and observation conditions [3,7,11,12]. Developing these methods generally requires task annotations and corresponding training, so sample preparation and model adaptation remain practical considerations for new flood scenes. Unsupervised aerial flood segmentation using color, vegetation, and edge information has also been explored to reduce dependence on task-specific training [13]. These findings motivate further investigation of water extraction that uses the visual knowledge already encoded in pretrained models while reducing additional task training and per-image manual prompting.
Promptable vision foundation models provide a basis for this approach. Through large-scale pretraining, the Segment Anything Model (SAM) acquires general segmentation capabilities conditioned on prompts such as points and boxes, enabling pretrained knowledge to transfer to new image distributions and tasks [14]. Segment Anything Model 3 (SAM3) adds concept prompting, using short text descriptions and image exemplars to detect and segment regions corresponding to a target concept. This capability supports direct generation of candidate masks from water-related semantics [15]. Remote sensing studies nevertheless show that segmentation performance still depends on image scale, prompting strategy, and scene conditions [16]. How floodwater prompts and subsequent inference should be organized to improve target coverage therefore remains a research question.
Previous studies have explored several ways to use pretrained models. Ozdemir et al. combined candidate masks automatically generated by SAM with CLIP-based semantic classification to extract water bodies from high-resolution aerial and satellite imagery [17]. Du et al. used SAM3 text prompts for water monitoring at fixed sites and analyzed segmentation under day/night and rainfall conditions [18]. SegEarth-OV3 fused information from different SAM3 output branches for remote sensing open-vocabulary segmentation without additional training [19]. These studies show how candidate generation, prompt organization, and output fusion extend the uses of pretrained models. We focus on candidate-driven inference for floodwater, examining how complementary semantics provide a basis for generating spatial re-prompts and how initial foreground retention and conditional recovery jointly improve output coverage.
Our analysis of sample images found that a single text prompt detects only small water regions in some flood images and produces no foreground mask in others. In automatic refinement procedures that generate spatial boxes from an initial mask, the positions and number of boxes depend on the candidates already detected. Incomplete initial coverage leaves the subsequent spatial prompts with incomplete information, whereas a complete absence of candidates prevents this procedure from generating valid boxes. These two states require different subsequent operations. The first calls for additional valid candidates and spatial prompts that extend water coverage; the second requires a way to obtain a water response outside the regular procedure. We therefore ask how initial candidates and the spatial re-prompting they guide can be improved while keeping pretrained parameters frozen, and how images with empty regular outputs can retain a path to a valid segmentation result.
We propose Semantic–Spatial Complementation and Recovery for SAM3 (SSCR-SAM3) for water extraction from near-ground and aerial RGB flood imagery. Complementary water concepts first generate text-prompted candidates. These candidates are then converted automatically into spatial boxes for joint prompting on the full image. The initial masks are retained to combine water already detected with the spatial re-prompting results. If the regular mask formed by merging the two branches is empty, the water text prompt is run again at a preset lower instance confidence threshold. Inference uses frozen SAM3 pretrained weights throughout, with no manual point or box prompts for individual images. We developed and evaluated the method on near-ground imagery, then applied the resulting fixed inference configuration to the official AIFloodSense test set to evaluate aerial water extraction without target-domain task training. Controlled comparisons, ablations, and output-region analyses examine the effects of each component on water coverage, false positives, and computational cost.
The main contributions are as follows:
(1) SSCR-SAM3 integrates complementary semantic candidates, automatic spatial re-prompting, initial mask retention, and conditional recovery of empty outputs into one inference procedure, addressing both insufficient candidate coverage and empty regular outputs.
(2) Controlled comparisons using the same backbone and component ablations quantify component contributions, differences across images, and computational cost through paired per-image changes, exclusive true-positive water pixels, spatially added regions, and recovery statistics.
(3) Evaluation on near-ground and aerial RGB flood imagery combines external aerial validation with a fixed configuration, scene grouping, and error analysis to provide verifiable experimental evidence for water extraction without target-domain task training.
The source code and fixed inference configurations will be publicly released at https://github.com/JiajunHe-scholar/SSCR-SAM3 upon acceptance.
Section 2 reviews floodwater extraction, vision foundation models, and automatic prompting. Section 3 describes the method, and Section 4 specifies the datasets, comparison configurations, and evaluation protocol. Section 5 presents the results, Section 6 discusses the effects and applicability of the method, and Section 7 concludes the paper.

3. Materials and Methods

3.1. Task Definition and Overall Framework

SSCR-SAM3 takes a single RGB image I   ∈   R H × W × 3 as input and produces a binary water mask M ∈ {0,1}H×W at the original image size. The foreground represents the target water visible in the image, and H and W denote the original image height and width, respectively. The pretrained SAM3 weights θ remain frozen. Inference uses fixed text prompts and spatial boxes generated automatically from predictions, without additional task-specific training or per-image manual interaction. Throughout this paper, a mask union denotes a logical OR operation at corresponding pixel locations, and an empty mask denotes a binary mask in which all pixel values are zero.
SAM3 combines text concepts with image features to produce instances and masks corresponding to the prompted concept, and it supports spatial prompts for target localization [15]. We denote by G θ the union of the binary instance masks returned by the official processor for a given image, text prompt, spatial prompt set, and instance confidence threshold. This operation returns an empty mask when the processor accepts no instances. All masks are stored and merged in the original image pixel coordinates.
The framework comprises two complementary semantic branches and a conditional recovery branch (Figure 1). Each semantic branch first generates text candidates and converts connected components that meet the area criterion into positive box prompts. The text and boxes are then used jointly to re-prompt the model on the full image. The spatial prediction is combined with the initial text mask by a union operation, retaining the existing foreground and incorporating newly detected regions. The results of the two branches are merged to form the regular output. If the foreground remains empty, a preset text recovery step with a lower threshold is activated. Explicit mask states connect semantic candidate generation, spatial expansion, and conditional recovery, enabling automatic water extraction for each image.

3.2. Complementary Semantic Candidate Generation

Task-related semantic organization can provide foundation models with target descriptions at different levels [43]. For floodwater, we use the general water concept water and the flood-specific description flood water as the fixed prompt set Q . The two prompts generate candidates separately, allowing responses to both general water and the flood context to enter the subsequent spatial processing. Both branches use the same regular instance confidence threshold τ = 0.3. The text-stage mask is defined as
T q = G θ ( I ,   q ,   ∅ ;   τ ) ,   q   ∈   Q
where the spatial prompt set is empty and G θ generates the result from the image and text alone. The threshold τ determines whether an instance is accepted, while the binary masks are those returned by the official processor. We take the pixelwise union of all accepted instances for each prompt, without selecting a single mask based on instance scores. The text candidates from the two prompts are merged as
T = T water   ∪   T flood   water
This union retains the regions detected under both semantic conditions and provides a direct reference for analyzing prompt complementarity. The complete method preserves the text identity of each branch: boxes generated from water candidates are used jointly with water, and boxes generated from flood water candidates are used jointly with flood water. Each branch therefore maintains a consistent semantic condition and an explicit candidate source. Text OR in the subsequent ablation analysis is the result of Equation (2), used to assess semantic merging alone.

3.3. Automatic Spatial Re-Prompting and Initial Foreground Retention

Text candidates provide initial target locations that can be converted into spatial prompts to guide another water prediction using the full image. Following candidate-driven two-stage joint inference [44], we perform 8-connected component analysis on Tq in each branch and generate positive boxes from valid candidates. An area threshold limits the number of small candidates entering the spatial prompts:
a min   =   max ( 64 ,   ⌈ 10 − 4 HW ⌉ )
The area threshold combines a fixed minimum pixel count with a proportion of the image area. Valid connected components are sorted in descending order of area. Up to K = 5 components are selected per branch, and their tight axis-aligned bounding rectangles form the positive box set. This rule controls the number of spatial prompts, while all foreground pixels in the initial mask remain available for subsequent fusion.
Each rectangle is represented by the half-open interval [x₀,x₁) × [y₀,y₁). Its center coordinates and dimensions are normalized by the original image width and height to match the model’s spatial prompt interface:
b   =   ( x 0   +   x 1 2 W ,   y 0   +   y 1 2 H ,   x 1   −   x 0 W ,   y 1   −   y 0 H )
All candidate boxes in a branch form P q and are treated as positive spatial prompts. We supply P q in a single call to the existing image and text state of that branch and perform one joint inference on the full image to obtain the spatial result Bq. The model uses the box locations together with the full-image context to predict water again, potentially covering regions outside the initial mask. If a branch has no valid candidate boxes, its text result is retained. Both cases are expressed as
B q = G θ ( I ,   q ,   P q ;   τ ) P q   ≠   ∅ T q P q = ∅
Text prompting and joint text–box prompting produce predictions under different conditions, and their foreground coverage may be complementary. To use both the initial text response and the spatial re-prompting result, we retain regions of the initial mask not covered by the spatial result and merge them with the spatial prediction. When no valid box is available, the text mask is used directly. The foreground-retained branch results and the regular merged result are
U q = T q   ∪   B q ,   U = U water   ∪   U flood   water
Initial foreground retention merges text-detected regions with spatial completion results so that both predictions contribute to the final foreground. Equation (6) retains every pixel covered at the text stage and adds regions found through spatial re-prompting. We quantify these contributions through separate comparisons between the raw spatial result Bq and the foreground-retained result Uq , together with pixel composition analysis of newly added and restored regions (Section 5.3).

3.4. Conditional Recovery of Empty Regular Outputs

When neither semantic branch produces foreground, the candidate-driven spatial branches also lack a source of automatic boxes. SSCR-SAM3 uses a separate text recovery branch for this state. Let N(U) denote the total number of foreground pixels in the regular merged mask U. If N(U) = 0, one additional inference is performed with the water prompt and the preset instance confidence threshold τr = 0.1. The final water mask is defined as
M = U , N ( U ) > 0 , G θ ( I ,   water ,   ∅ ;   τ r ) , N ( U ) = 0 .
Where
N ( U ) = ∑ i = 1 H ∑ j = 1 W U ij .
Conditional recovery uses a preset lower instance acceptance threshold to provide additional candidates for images whose regular output contains no foreground. Checking whether U is empty restricts the additional inference to this explicit state; all other images retain their regular results. The recovery mask is used directly as the final output, making execution conditional on the prediction state. Branch conditions depend on fixed parameters and the current predictions, while ground truth is used for evaluation after inference.
Initial foreground retention ensures that any nonempty text branch contributes to the regular merged result. The recovery branch therefore processes images for which both regular text outputs are empty. The experiments separately report the number of recovered outputs, their segmentation quality, and the additional time cost. Low-threshold controls applied to the full near-ground dataset are also included to evaluate this execution strategy.

3.5. Algorithm and Execution

Algorithm 1 gives the complete SSCR-SAM3 procedure. The prompt set, instance thresholds, connected component filtering, and maximum number of boxes together define the fixed inference configuration. Section 4 describes the data scope, the origin of this configuration, and the software environment used for near-ground development and evaluation and aerial validation.
Algorithm 1. SSCR-SAM3 for floodwater extraction
Input: RGB image I; frozen SAM3; Q = {water, flood water}; τ = 0.3; τr = 0.1; K = 5.
Output: Binary water mask M at the original image size.
1 Compute the area threshold amin using Equation (3).
2 For each text prompt q ∈ Q, perform the following:
3 Perform text inference with q and τ, and merge accepted instances to obtain Tq and the branch feature state.
4 Analyze the 8-connected components of Tq, retain those with an area of at least amin, and select the first K in the prescribed order.
5 Normalize their tight bounding rectangles to form the positive box set Pq.
6 If Pq is nonempty: reuse the branch features and perform one joint full-image inference with q and all boxes in Pq to obtain Bq.
7 Otherwise: set Bq = Tq.
8 Set Uq = Tq ∪ Bq.
9 Merge the branches: U = Uwater ∪ Uflood water.
10 If U is empty: perform one additional text inference with water and τr, and assign the union of its instance masks to M.
11 Otherwise: set M = U.
12 Return M.
In the implementation, each text branch encodes the image separately, and spatial re-prompting reuses the image features computed within that branch. Conditional recovery constructs a new image state. The regular path contains two text-prompt forward passes and up to two joint-prompt forward passes. When recovery is triggered, both text results are empty and both spatial branches are skipped, so recovery images undergo three prompt forward passes in total. The complete method requires no more than four prompt forward passes. Image encoding time and the time of each inference component are recorded separately in the experiments.
Candidate generation, spatial coverage expansion, initial foreground retention, and empty-output recovery are implemented as reproducible operations and branches. The corresponding ablations retain the text union, spatial results, foreground-retained results, and complete outputs separately, allowing changes in final performance to be attributed to specific operations.

4. Experimental Setup

4.1. Datasets and Their Use

Near-ground and aerial RGB imagery are used for method development and evaluation and for validation across data sources with fixed settings, respectively. Both datasets are evaluated against their original pixel-level labels for visible water. Table 2 summarizes their scope and use.
The near-ground experiments use all 1040 image–label pairs in Deepflood, each measuring 512 × 384 pixels [3,47]. All images are used for method development and evaluation, and 120 are used for retrospective prompt analysis. Water is represented by 1 in the original 0/1 labels. Label reading and sample selection are described in Supplementary Section S1.
The aerial validation uses the 470 RGB images in AIFloodSense, each measuring 1024 × 768 pixels [5], with the official split of 376 training images and 94 test images. The 94 test images are the primary analysis set. Of the training images, 24 are used for initial checks. Results for the training portion and the full dataset are reported as supplementary descriptions. SAM3 weights remain frozen at every stage.
For AIFloodSense, Flood = 255 is mapped to water, while Sky = 170, Building = 85, and Background = 0 are mapped to non-water background. Model outputs are restored to the original image pixel grid without spatially resampling the ground truth (GT). Predictions of water in sky and building regions are counted as false positives. Paired segmentation examples from both observation types are presented in Section 5.1 and Section 5.2.
Aerial scene analysis uses the dataset authors’ urban/peri-urban and rural labels (62 and 32 images) and visible-sky and no-visible-sky labels (41 and 53 images). Images are also grouped by the GT water-area fraction: below 25%, from 25% to less than 50%, and at least 50% (12, 61, and 21 images). This fraction is the ratio of water pixels to all pixels in the original image and describes segmentation performance under different levels of water coverage.
Aerial statistics focus on the official 94 test images, grouped into 68 events by country, year, and flood event name. A supplementary sensitivity analysis uses 93 images after removing the test image from one pair of images derived from the same source across the official split. Event grouping and duplicate-image checks are described in Supplementary Section S1.

4.2. Fixed Inference Configuration and Computing Environment

SSCR-SAM3 uses the official SAM3 image model and pretrained checkpoint [15]. All SAM3 configurations keep the model weights frozen and use the same official implementation. Text prompts, instance confidence thresholds, automatic box rules, and recovery parameters were determined during near-ground development and then fixed for aerial validation. The regular method uses water and flood water, both with an instance confidence threshold of 0.3. Only an empty regular mask merged from the two branches triggers one additional water inference at a threshold of 0.1, whose prediction becomes the final result. The default SAM3 control uses water with an instance confidence threshold of 0.5.
Images are processed by the official processor with resolution set to 1008. Each configuration performs inference on the full image and takes the pixelwise union of Boolean instance masks on the original image grid. Automatic spatial prompts follow the 8-connected component filtering and tight box generation rules in Section 3.3, with the area threshold given by Equation (3) and up to 5 positive boxes per semantic branch. All boxes in a branch are supplied jointly with the corresponding text in one call. The initial foreground is then retained, and the two branch results are merged.
Aerial inference was timed on an NVIDIA RTX 3090 using BF16 automatic mixed precision. GPU synchronization was performed before and after calls, and the times of inference components were aggregated as defined in Section 4.4. The software environment and execution details are given in Supplementary Section S2, and the complete timing intervals are described in Supplementary Section S4.

4.3. Comparison Methods and Component Ablations

Component analysis uses the same SAM3 checkpoint, full images, and test list to control differences in pretrained representations and input processing. Comparing water 0.5 with water 0.3 assesses the instance confidence threshold. Comparing water 0.3 and flood water 0.3 separately with their pixelwise union, Text OR 0.3 (Equation (2)), assesses semantic merging. Text OR 0.3 is compared with Two-stage Union 0.3, the union of the two foreground-retained branch results (Equation (6)), to assess spatial re-prompting and fusion. The raw spatial result Bq and the result after initial foreground retention Uq are saved for each branch to assess foreground retention separately. Comparing Two-stage Union 0.3 with SSCR-SAM3 assesses conditional recovery. The full record fields are listed in Supplementary Section S2.
The near-ground experiments include three low-threshold controls applied to all images: water 0.1, flood water 0.1, and Text OR 0.1. They are compared in terms of IoU, precision, recall, F1, and the number of empty outputs. Aerial conditional recovery uses water 0.1 and is triggered by an empty regular merged mask.
Near-ground cross-model reference results use direct transfer of publicly available pretrained weights. U-Net uses UNetResNet–ResNet50 pretrained for river water segmentation [8,48], retains the authors’ input normalization, and performs inference on 256 × 256 tiles with weighted fusion. The model source, random state, and full inference parameters are given in Supplementary Section S3.
DeepLabV3+ uses Xception-65 pretrained on ADE20K [10,49]. Inputs are resized proportionally to a long side of 513 pixels, and the predicted class maps are restored to the original size using nearest-neighbor interpolation. The main result merges six classes, water, sea, river, swimming pool, waterfall, and lake, into water. A supplementary result uses the water class alone. Both transferred models use frozen publicly available weights.
The aerial experiments also list the supervised U-Net, DeepLabV3, and Swin-T results from the original AIFloodSense paper as performance references under target-domain training [5]. That study used 512 × 384 inputs, whereas we use frozen SAM3 and evaluate on the original image grid. Section 5.4 identifies the training conditions and result sources separately. Measured configurations sharing the same backbone undergo paired per-image comparisons on the same test samples.

4.4. Evaluation Metrics and Statistical Analysis

Evaluation targets the water foreground. We count correctly predicted water pixels as TP, pixels incorrectly classified as water as FP, and missed water pixels as FN. Intersection over union (IoU), precision (P), recall (R), and the F1 score jointly describe coverage and prediction quality [50]:
IoU   =   TP TP   +   FP   +   FN ,   F 1   =   2 TP 2 TP   +   FP   +   FN
P = TP TP + FP ,   R = TP TP + FN
Overall P, R, and F1 are calculated from pixel counts pooled over the evaluation set. Water IoU is reported using both pooled-pixel and equally weighted per-image aggregation. Pooled water IoU is defined as
IoU pooled = ∑ i = 1 N   TP i ∑ i = 1 N   ( TP i + FP i + FN i )
Mean per-image water IoU is the arithmetic mean of the individual image IoUs:
IoU image   =   1 N   ∑ i = 1 N   IoU i
Both IoU measures evaluate the water foreground. Ground truth contains water in every image in the primary analyses. For an empty prediction, per-image IoU, recall, and F1 are set to 0, while precision is undefined. Overall precision is still calculated from pooled TP and FP counts.
Paired analysis aligns images by sample ID, calculates the mean per-image difference, and reports the numbers of images with increased, unchanged, and decreased IoU:
Δ i   =   IoU i , A   −   IoU i , B ,   Δ ¯   =   1 N   ∑ i = 1 N   Δ i
Aerial 95% confidence intervals are obtained using an event-cluster bootstrap. We draw 68 groups with replacement from the 68 event groups and include all images in each selected group, retaining repeated selections. This is repeated 2000 times, calculating the equally weighted mean paired IoU difference across images in each replicate. The 2.5th and 97.5th percentiles form the interval. These intervals describe mean per-image differences, while changes in pooled IoU are reported separately. Execution settings are given in Supplementary Section S4.
Component analysis uses saved masks and GT to count shared and exclusive TP pixels from the two text prompts, TP/FP pixels newly added by spatial processing, and regions restored by initial foreground retention. Recovery analysis includes every image that triggers recovery and reports the number of nonempty recovered outputs and their segmentation quality. Sample counts are also reported for each scene group.
Inference cost is measured by timing individual components for each image in the same aerial computing environment, with GPU synchronization before and after calls. The measurements aggregate image encoding, text inference, automatic box generation, joint prompting, mask merging, and conditional recovery when triggered. We report the mean inference-component time of the complete method and the additional recovery cost. Detailed timing intervals are given in Supplementary Section S4.

5. Results

5.1. Overall Results on Near-Ground Flood Imagery

On the 1040 Deepflood images, SSCR-SAM3 achieves a pooled water IoU of 88.17% and a mean per-image IoU of 87.66%. These values exceed the default water 0.5 configuration by 4.26 and 4.91 percentage points, respectively (Table 3; Figure 2a,b). Precision and recall are 93.74% and 93.69%, respectively, indicating that the method expands water coverage while maintaining high precision. The number of empty outputs decreases from 62 to 10, increasing the proportion of images with a nonempty output from automatic processing.
The components produce successive gains of different magnitudes on the near-ground data. Lowering the instance confidence threshold for water from 0.5 to 0.3 increases mean per-image IoU from 82.75% to 85.29%; merging water and flood water further increases it to 86.16%. Spatial re-prompting with initial foreground retention raises this value to 86.40%, and conditional recovery then increases it to 87.66%. Of the 26 images with empty regular merged outputs, 16 yield nonempty results containing correctly identified water pixels, while the remaining 10 retain empty outputs.
The complete method achieves higher pooled IoU than the low-threshold configurations applied to all images. Relative to water 0.1, SSCR-SAM3 improves pooled IoU and precision by 3.86 and 4.63 percentage points, respectively, with 10 empty outputs remaining under both configurations. It also exceeds flood water 0.1 by 1.04 percentage points in pooled IoU. The low-threshold union of the two text outputs achieves a recall of 94.44%, a precision of 88.73%, and a pooled IoU of 84.32%. These results show that combining complementary candidates, spatial completion, and conditional recovery yields a better overall balance between coverage and false positives. The component contributions are examined in Section 5.3.
SSCR-SAM3 also achieves higher water extraction accuracy in the direct-transfer experiment using publicly available pretrained weights. The mean per-image IoU values for U-Net and DeepLabV3+ are 45.38% and 60.97%, respectively, compared with 87.66% for SSCR-SAM3. U-Net has a precision of 60.80% and a recall of 64.97%; DeepLabV3+ has a precision of 90.48%, a recall of 69.17%, and 102 empty outputs. SSCR-SAM3 improves pixel overlap, foreground precision, and recall, indicating better segmentation quality under this direct-transfer setting.

5.2. Fixed-Configuration Validation on Aerial Imagery

With the prompts and parameters fixed after near-ground development, SSCR-SAM3 achieves a pooled water IoU of 78.13% on the 94 official AIFloodSense test images. This is a gain of 35.25 percentage points over the default configuration at 42.88% (Table 4; Figure 2c,d). Recall increases from 43.12% to 81.12%, while precision remains high at 95.49%, indicating improved water coverage. The number of entirely empty outputs decreases from 34 to 2, corresponding to a reduction from 36.17% to 2.13% of the test images. These results show that the fixed method recovers water regions missed by the default text prompt.
Paired per-image comparisons show that the complete method improves IoU on 90 images, leaves it unchanged on 2, and decreases it on 2 (Figure 3). Mean IoU increases from 44.33% to 77.25%, a gain of 32.92 percentage points with a 95% event-cluster bootstrap confidence interval of [25.92, 38.99] percentage points. Relative to the single-text water and flood water configurations at the regular threshold of 0.3, the mean gains are 10.47 and 7.32 percentage points, respectively. Their corresponding 95% confidence intervals are [6.35, 14.52] and [4.49, 10.47] percentage points. All gain intervals lie above zero, supporting the improvement in segmentation accuracy achieved by the fixed method.
The near-duplicate sensitivity analysis yields consistent results. After excluding the test image from the cross-split pair of images sharing a source, pooled IoU on the remaining 93 images is 78.10%, close to the 78.13% in the main analysis. Supplementary results for all 470 images, comprising the 376 official training images and 94 official test images, are reported in Table S3.

5.3. Component Ablation with the Same Backbone

Comparisons using the same SAM3 checkpoint show distinct contributions from semantic merging, spatial processing, and conditional recovery (Table 5). At a threshold of 0.3, Text OR improves pooled IoU over water and flood water by 3.87 and 1.54 percentage points, respectively, and mean per-image IoU by 4.32 and 1.17 percentage points. The two text prompts produce 10 and 7 empty outputs, respectively, whereas their union produces 6. Thus, the two semantic prompts supply some candidates missing from the other prompt (Figure 4).
Spatial re-prompting and initial foreground retention further expand water coverage. From Text OR to Two-stage Union, pooled IoU increases from 71.73% to 75.28%, and mean IoU increases from 71.10% to 74.80%. IoU improves on 82 images, remains unchanged on 6, and decreases on 6. The mean gain is 3.70 percentage points, with a 95% event-cluster confidence interval of [2.47, 5.42] percentage points. Comparing B and U within each branch further separates the contribution of initial foreground retention.
Initial foreground retention yields gains in both semantic branches. In the water branch, pooled IoU increases from 69.00% to 72.04% and recall from 70.69% to 74.06%, with a precision of 96.34%. In the flood water branch, pooled IoU increases from 72.12% to 74.50% and recall from 73.76% to 76.58%, with a precision of 96.48%. IoU improves on 82 and 86 images in the two branches, respectively. These results show that retaining text-detected regions in the spatial re-prediction helps restore water already identified but omitted by the subsequent prediction (Figure 5b). The two branches also gain 0.49 and 0.50 percentage points in pooled IoU on the near-ground data; complete results are provided in Table S1.
Conditional recovery reduces the number of empty outputs from 6 to 2, further increasing pooled IoU from 75.28% to 78.13% and mean IoU from 74.80% to 77.25%. IoU improves on four images, while the other 90 retain their original results. The mean gain is 2.45 percentage points, with a 95% event-cluster confidence interval of [0.16, 4.98] percentage points. The recovery branch thus identifies additional water missed by the regular dual-text and spatial processing paths.

5.4. Published Supervised References and Water Prediction Quality

Table 6 summarizes the binary Flood segmentation results of SSCR-SAM3 and those reported in the original AIFloodSense study, showing performance under fixed-prompt inference and target-domain supervised training, respectively [5].
SSCR-SAM3 achieves a precision of 95.49%, exceeding the reported values of 88.37%–92.61% for the three listed supervised references. Its recall and IoU are 81.12% and 78.13%, respectively, compared with 89.94%–91.37% and 80.42%–84.29% for the supervised references. These results indicate a low proportion of false positives within the water foreground predicted by SSCR-SAM3, whereas the listed supervised references report higher recall. Figure 2 shows local water structures and corresponding errors in our predictions. These examples allow closer examination of boundaries and small fragmented regions in predictions with high precision.

5.5. Semantic Complementarity, Spatial Completion, and Recovery from Empty Outputs

Semantic complementarity provides additional correct water candidates for the complete method. Among the 94 official test images, both text outputs at 0.3 are nonempty on 83 images, only water is nonempty on 1, only flood water is nonempty on 4, and both are empty on 6. Regions exclusive to water and flood water contribute approximately 530,000 and 1,350,000 TP pixels, respectively, together with approximately 70,000 and 200,000 FP pixels (Figure 4). Regions detected by each branch expand the candidate sources for automatic spatial prompting, with flood water supplying more additional water pixels. Complete pixel counts are provided in Supplementary Section S4.
Spatial processing identifies additional water beyond the text union. From Text OR to Two-stage Union, the added regions contain approximately 1,480,000 TP pixels and 490,000 FP pixels, and the number of missed water pixels decreases on 88 images. Image aiflood_095 illustrates this process. The water 0.3 output is empty, whereas flood water 0.3 detects a small water region in the lower-left part of the image. An automatic box derived from this candidate guides joint inference on the full image. After retaining the initial foreground, the prediction extends to multiple visible water surfaces between buildings and vegetation, increasing IoU from 10.18% to 74.56% (Figure 5a). The coverage gain in this case comes from candidate-driven spatial completion.
Conditional recovery obtains a water response on images for which the regular dual-branch output is empty. In aiflood_220, regularly spaced vegetation alternates with visible water, and both branches at 0.3 produce empty outputs. After recovery, IoU reaches 82.84%, precision reaches 99.33%, and recall reaches 83.31% (Figure 5c). Among the six images that trigger recovery, four yield nonempty results containing correctly identified water (Table S4).

5.6. Scene Differences and Inference Cost

SSCR-SAM3 improves water extraction accuracy in every scene group (Figure 6). Pooled IoU increases from 43.61% to 76.87% for the 62 urban and peri-urban images and from 41.48% to 80.53% for the 32 rural images. For the 53 images without visible sky, it increases from 42.42% to 76.78%; for the 41 images with visible sky, it increases from 43.59% to 80.18%.
Results across water-area fractions also show consistent improvements. Mean IoU increases from 49.83%, 47.00%, and 33.44% to 77.89%, 74.64%, and 84.46% for the groups with water covering less than 25%, 25% to less than 50%, and at least 50% of the image, respectively. The largest gain occurs in the group with a water-area fraction of at least 50%. Group sizes and metrics are provided in Table S2, and per-image distributions are shown in Figure 6.
The complete method has a mean inference-component time of 566.98 ms, compared with 222.15, 446.48, and 552.58 ms for the default water 0.5, Text OR, and Two-stage Union configurations, respectively (Figure 7; Table S5). Image encoding for the two branches averages 344.16 ms in total and accounts for the main computational cost.
Conditional recovery improves coverage in images with empty outputs at a limited additional computational cost. Across the 6 images that trigger recovery, the recovery branch takes an average of 225.74 ms. Averaged over all 94 images, this adds 14.41 ms, or 2.61%, to the regular two-stage method. The other 88 images retain their regular results, concentrating the extra computation on images requiring recovery.

6. Discussion

6.1. Coverage Gains from Semantic–Spatial Coordination

SSCR-SAM3 expands the sources of valid candidates through complementary semantics and then uses automatic spatial prompts to extend water coverage. In the aerial results, water and flood water each identify correct water regions missed by the other branch, and their union reduces the number of empty single-text outputs. Semantic complementarity therefore improves both the initial masks and the basis for subsequent automatic box generation. Each branch retains its own text condition and passes the locations identified by either the general water description or the flood-context description to spatial re-prompting. This preserves the complementary information from both candidate sets in the subsequent segmentation.
Spatial re-prompting further expands the coverage of existing candidates. Starting from a small text candidate in aiflood_095, one joint text-and-box inference followed by initial foreground retention increases water IoU from 10.18% to 74.56%. This result shows that using candidate locations together with full-image context can recover dispersed visible water surfaces. Initial foreground retention merges complementary regions from the two predictions. The independent B→U comparisons for the water and flood water branches yield pooled IoU gains of 3.04 and 2.38 percentage points, respectively. This merging keeps foreground already detected by the text stage in the final segmentation, making fuller use of both predictions.
Conditional recovery restores a water response for images with empty regular outputs. Of the six aerial images that trigger recovery, four recover correctly identified water, contributing an overall pooled IoU gain of 2.85 percentage points. This component executes selectively according to the prediction state. Together with semantic candidate expansion and spatial completion, it forms a complete automatic inference procedure that improves coverage on regular images and recovers water from entirely empty outputs.

6.2. Trade-Off between Segmentation Quality and Inference Resources

While maintaining an aerial precision of 95.49%, the complete method increases recall from 43.12% under the default configuration to 81.12%; its main benefit is greater coverage of correctly identified water. At the same regular threshold of 0.3, it exceeds the single-text water configuration by 10.27 percentage points in pooled IoU, showing the combined benefit of complementary semantics, spatial processing, and conditional recovery. On the near-ground data, the complete method also exceeds the stronger flood water 0.1 reference by 1.04 percentage points in pooled IoU. This gain reflects the combined strategy’s balance between coverage and false positives.
Frozen-model inference obtains these gains directly from an existing model, without additional task training or per-image manual prompts. Direct transfer of publicly available pretrained U-Net and DeepLabV3+ weights provides reference results for using public weights on new data. The supervised results in the AIFloodSense study provide reported performance after target-domain training [5]. Table 6 shows the higher precision of SSCR-SAM3 and the higher recall and IoU of the supervised references. These differences reflect prediction quality and coverage under the respective resource conditions.
The accuracy gains require additional model computation. The complete method has a mean inference-component time of 566.98 ms, approximately 2.55 times that of the default configuration. Conditional recovery adds an average of 14.41 ms across all 94 images. Separate image encoding for the two branches is the main source of computation time, making encoding reuse and batch scheduling priorities for subsequent efficiency improvements.

6.3. Application to RGB Flood Observations

Near-ground monitoring provides continuous observations of selected areas, whereas oblique aerial imagery captures relationships among ground objects over a larger area [3,4,5,6]. The fixed configuration improves water extraction in urban and peri-urban scenes, rural scenes, and groups with different sky backgrounds, indicating its applicability to the image compositions examined here. In flood scenes containing interspersed buildings, roads, and vegetation, automatically obtaining water masks with more complete coverage can support rapid image interpretation, delineation of inundated areas, and annotation. Such masks also provide inputs for subsequent spatial analysis incorporating terrain or camera geometry [4,51].
This study uses RGB images containing actual water for near-ground development and evaluation and for aerial validation with a fixed configuration; the target is water visible in the image. For continuous monitoring, further evaluation could include real images without water and observation sequences split independently by event. Other methods requiring no additional task training could also be compared under a common protocol, and end-to-end performance could be assessed within the application’s processing chain.

7. Conclusions

We propose SSCR-SAM3, a method that combines semantic and spatial information for water extraction from near-ground and aerial RGB flood imagery. With SAM3 pretrained weights frozen, the method generates automatic spatial boxes from complementary water and flood water candidates. Full-image re-prompting and initial foreground retention expand water coverage, and conditional recovery handles empty regular outputs. The method thus automates the conversion from an input image to a water mask without additional task training or per-image manual points or boxes.
In development and evaluation on all 1040 Deepflood images, the complete method achieves a pooled water IoU of 88.17%, a gain of 4.26 percentage points over the default configuration. Empty outputs decrease from 62 to 10. With the near-ground configuration fixed, it achieves a pooled IoU of 78.13% on the 94 official AIFloodSense test images, a gain of 35.25 percentage points over the default configuration. Recall increases from 43.12% to 81.12%, precision remains at 95.49%, and empty outputs decrease from 34 to 2. Ablations with the same backbone further show that semantic complementarity, spatial processing, initial foreground retention, and conditional recovery each contribute segmentation gains.
These results show that combining fixed semantic prompts with automatic spatial prompts makes effective use of a foundation model’s pretrained capabilities and yields more complete water coverage across RGB flood scenes. The method supports image interpretation, delineation of inundated areas, and annotation of visible water, and can be used directly when resources for additional task annotation and training are limited. Future work will extend validation to water-free scenes and independent flood events and optimize the complete procedure through encoding reuse.

Supplementary Materials

The supplementary information can be downloaded at the website of this paper posted on Preprints.org. Supplementary Sections S1–S4 and Tables S1–S5 are provided in the separate Supplementary Materials file.

Author Contributions

Conceptualization and methodology, J.H. and T.D.; software, investigation, data curation, and visualization, J.H.; formal analysis and validation, J.H. and T.D.; writing—original draft preparation, J.H.; writing—review and editing, J.H. and T.D.; supervision and project administration, T.D.; funding acquisition, T.D.

Funding

This research was funded by the National Key Research and Development Program of China (grant number 2022YFC3800502) and the Key Projects of the Chongqing Technology Innovation and Application Development Program (grant numbers CSTB2022TIAD-KPX0118 and CSTB2022TIAD-KPX0113).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The Deepflood and AIFloodSense datasets used in this study are available from the sources cited in [3,47] and [5], respectively. Experimental settings and supplementary statistics are provided in the Supplementary Materials. The source code and fixed inference configurations will be publicly released at https://github.com/JiajunHe-scholar/SSCR-SAM3 upon acceptance.

Acknowledgments

The authors thank the maintainers of the public datasets and the SAM3 open-source project for providing research resources.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

Abbreviation Full term
CLIP Contrastive Language–Image Pre-training
GT Ground Truth
LoRA Low-Rank Adaptation
MNDWI Modified Normalized Difference Water Index
NDWI Normalized Difference Water Index
RGB Red, Green, Blue
SAM Segment Anything Model
SAM3 Segment Anything Model 3
SAR Synthetic Aperture Radar
SSCR-SAM3 Semantic–Spatial Complementation and Recovery for SAM3
IoU Intersection over Union
ASPP Atrous Spatial Pyramid Pooling
BF16 Brain Floating Point 16

References

  1. Zhang, M.; Chen, Z.; Wang, J.; Kar, B.; Pierce, M.; Tiampo, K.; et al. Optical Remote Sensing for Global Flood Disaster Mapping: A Critical Review Towards Operational Readiness. Remote Sens. 2025, 17(11), 1886. [Google Scholar] [CrossRef]
  2. Hernández, D.; Cecilia, J.M.; Cano, J.-C.; Calafate, C.T. Flood Detection Using Real-Time Image Segmentation from Unmanned Aerial Vehicles on Edge-Computing Platform. Remote Sens. 2022, 14(1), 223. [Google Scholar] [CrossRef]
  3. Wang, Y.; Shen, Y.; Salahshour, B.; Cetin, M.; Iftekharuddin, K.; Tahvildari, N.; et al. Urban flood extent segmentation and evaluation from real-world surveillance camera images using deep convolutional neural network. Environ. Model. Softw. 2024, 173, 105939. [Google Scholar] [CrossRef]
  4. Dale, J.E.; Dorosin, S.; Constantine, J.A.; Masteller, C.C. Community-scale urban flood monitoring through fusion of time-lapse imagery, terrestrial lidar, and remote sensing data. Hydrol. Earth Syst. Sci. 2026, 30(7), 2183–2206. [Google Scholar] [CrossRef]
  5. Simantiris, G.; Bacharidis, K.; Papanikolaou, A.; Giannakakis, P.; Panagiotakis, C. AIFloodSense: A Global Aerial Imagery Dataset for Semantic Segmentation and Understanding of Flooded Environments. Remote Sens. 2026, 18(6), 938. [Google Scholar] [CrossRef]
  6. Rahnemoonfar, M.; Chowdhury, T.; Sarkar, A.; Varshney, D.; Yari, M.; Murphy, R.R. FloodNet: A High Resolution Aerial Imagery Dataset for Post Flood Scene Understanding. IEEE Access 2021, 9, 89644–89654. [Google Scholar] [CrossRef]
  7. Li, W.; Li, Y.; Gong, J.; Feng, Q.; Zhou, J.; Sun, J.; et al. Urban Water Extraction with UAV High-Resolution Remote Sensing Data Based on an Improved U-Net Model. Remote Sens. 2021, 13(16), 3165. [Google Scholar] [CrossRef]
  8. Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. Med. Image Comput. Comput.-Assist. Interv. (MICCAI) 2015, 9351, 234–241. [Google Scholar] [CrossRef]
  9. Chen, L.-C.; Papandreou, G.; Schroff, F.; Adam, H. Rethinking Atrous Convolution for Semantic Image Segmentation. arXiv 2017, arXiv:1706.05587. [Google Scholar] [CrossRef]
  10. Chen, L.-C.; Zhu, Y.; Papandreou, G.; Schroff, F.; Adam, H. Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation. Comput. Vis. – ECCV 2018, 11211, 833–851. [Google Scholar] [CrossRef]
  11. Wieland, M.; Martinis, S.; Kiefl, R.; Gstaiger, V. Semantic segmentation of water bodies in very high-resolution satellite and aerial images. Remote Sens. Environ. 2023, 287, 113452. [Google Scholar] [CrossRef]
  12. Li, D.; Ye, F.; Huang, Y.; He, H. Deep Learning for Water Body Segmentation in Remote Sensing Imagery: A Review. Remote Sens. 2026, 18(17), 2972. [Google Scholar] [CrossRef]
  13. Simantiris, G.; Panagiotakis, C. Unsupervised Color-Based Flood Segmentation in UAV Imagery. Remote Sens. 2024, 16(12), 2126. [Google Scholar] [CrossRef]
  14. Kirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.; Gustafson, L.; et al. Segment Anything. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV); pp. 4015–4026. Available online: https://openaccess.thecvf.com/content/ICCV2023/html/Kirillov_Segment_Anything_ICCV_2023_paper.html (accessed on 26 November 2026).
  15. Carion, N.; Gustafson, L.; Hu, Y.-T.; Debnath, S.; Hu, R.; Suris Coll-Vinent, D.; et al. SAM 3: Segment Anything with Concepts. International Conference on Learning Representations (ICLR) 2026. Available online: https://proceedings.iclr.cc/paper_files/paper/2026/hash/e0982cbc81401df3430ee1ff780dc7a2-Abstract-Conference.html (accessed on 26 November 2026).
  16. Osco, L.P.; Wu, Q.; de Lemos, E.L.; Gonçalves, W.N.; Ramos, A.P.M.; Li, J.; et al. The Segment Anything Model (SAM) for remote sensing applications: From zero to one shot. Int. J. Appl. Earth Obs. Geoinf. 2023, 124, 103540. [Google Scholar] [CrossRef]
  17. Ozdemir, S.; Akbulut, Z.; Karsli, F.; Kavzoglu, T. Extraction of Water Bodies from High-Resolution Aerial and Satellite Images Using Visual Foundation Models. Sustainability 2024, 16(7), 2995. [Google Scholar] [CrossRef]
  18. Du, X.; Ding, H.; Chen, S.; Zhu, Y.; Wang, X.; Zhang, S.; et al. Zero-Shot Water Monitoring from Fixed Drainage Surveillance Imagery Across Day/Night and Rain/No-Rain Conditions: A SAM 3 Benchmark at 25 Urban Sites. Sensors 2026, 26(20), 6403. [Google Scholar] [CrossRef]
  19. Li, K.; Zhang, S.; Wang, Y.; Deng, Y.; Wang, Z.; Meng, D.; et al. SegEarth-OV3: Exploring SAM 3 for Open-Vocabulary Semantic Segmentation in Remote Sensing Images. arXiv 2025, arXiv:2512.08730. [Google Scholar] [CrossRef]
  20. McFeeters, S.K. The use of the Normalized Difference Water Index (NDWI) in the delineation of open water features. Int. J. Remote Sens. 1996, 17(7), 1425–1432. [Google Scholar] [CrossRef]
  21. Xu, H. Modification of normalised difference water index (NDWI) to enhance open water features in remotely sensed imagery. Int. J. Remote Sens. 2006, 27(14), 3025–3033. [Google Scholar] [CrossRef]
  22. Bonafilia, D.; Tellman, B.; Anderson, T.; Issenberg, E. Sen1Floods11: a georeferenced dataset to train and test deep learning flood algorithms for Sentinel-1. 2020 IEEE/CVF Conf. Comput. Vis. Pattern Recognit. Work. (CVPRW) 2020, 835–845. [Google Scholar] [CrossRef]
  23. Sazara, C.; Cetin, M.; Iftekharuddin, K.M. Detecting floodwater on roadways from image data with handcrafted features and deep transfer learning. 2019 IEEE Intelligent Transportation Systems Conference (ITSC), 2019; pp. 804–809. [Google Scholar] [CrossRef]
  24. Song, S.; Zhang, C.; Zhang, P.; Li, P.; Song, F.; Zhang, L. Urban Waterlogging Detection: A Challenging Benchmark and Large-Small Model Co-Adapter. Comput. Vis. – ECCV 2024, 15094, 366–382. [Google Scholar] [CrossRef]
  25. Pally, R.J.; Samadi, S. Application of image processing and convolutional neural networks for flood image classification and semantic segmentation. Environ. Model. Softw. 2022, 148, 105285. [Google Scholar] [CrossRef]
  26. Wagner, F.; Eltner, A.; Maas, H.-G. River water segmentation in surveillance camera images: A comparative study of offline and online augmentation using 32 CNNs. Int. J. Appl. Earth Obs. Geoinf. 2023, 119, 103305. [Google Scholar] [CrossRef]
  27. Khan, S.D.; Basalamah, S. Multi-Scale and Context-Aware Framework for Flood Segmentation in Post-Disaster High Resolution Aerial Images. Remote Sens. 2023, 15(8), 2208. [Google Scholar] [CrossRef]
  28. Ichim, L.; Popescu, D. Segmentation of Vegetation and Flood from Aerial Images Based on Decision Fusion of Neural Networks. Remote Sens. 2020, 12(15), 2490. [Google Scholar] [CrossRef]
  29. Wu, Z.; Dong, Z.; Yang, K.; Liu, Q.; Wang, W. Floodwater Extraction from UAV Orthoimagery Based on a Transformer Model. Remote Sens. 2024, 16(21), 4052. [Google Scholar] [CrossRef]
  30. Simantiris, G.; Bacharidis, K.; Panagiotakis, C. Closing the Domain Gap: Can Pseudo-Labels from Synthetic UAV Data Enable Real-World Flood Segmentation? Sensors 2025, 25(12), 3586. [Google Scholar] [CrossRef]
  31. Radford, A.; Kim, J.W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; et al. Learning Transferable Visual Models From Natural Language Supervision. Int. Conf. Mach. Learn. Proc. Mach. Learn. Res. 2021, 139, 8748–8763. Available online: https://proceedings.mlr.press/v139/radford21a.html (accessed on 26 November 2026).
  32. Lüddecke, T.; Ecker, A. Image Segmentation Using Text and Image Prompts. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR); pp. 7086–7096. Available online: https://openaccess.thecvf.com/content/CVPR2022/html/Luddecke_Image_Segmentation_Using_Text_and_Image_Prompts_CVPR_2022_paper.html (accessed on 26 November 2026).
  33. Ravi, N.; Gabeur, V.; Hu, Y.-T.; Hu, R.; Ryali, C.; Ma, T.; et al. SAM 2: Segment Anything in Images and Videos. International Conference on Learning Representations (ICLR); Available online: https://proceedings.iclr.cc/paper_files/paper/2025/hash/45c1f6a8cbf2da59ebf2c802b4f742cd-Abstract-Conference.html (accessed on 26 November 2026).
  34. Shi, G.; Tang, H.; Lu, B.; Sun, L.; Ye, T.; Wang, W. Region and Boundary Accuracy in Zero-Shot Shoreline Extraction: A Benchmark of Segmentation-Native Vision-Language Models and Prompted SAM Pipelines. Remote Sens. 2026, 18(18), 3228. [Google Scholar] [CrossRef]
  35. Zhang, R.; Jiang, Z.; Guo, Z.; Yan, S.; Pan, J.; Dong, H.; et al. Personalize Segment Anything Model with One Shot. International Conference on Learning Representations (ICLR) 2024. Available online: https://proceedings.iclr.cc/paper_files/paper/2024/hash/4f44e5c82dc7b0ba4472083e5dedb08e-Abstract-Conference.html (accessed on 26 November 2026).
  36. Chen, K.; Liu, C.; Chen, H.; Zhang, H.; Li, W.; Zou, Z.; et al. RSPrompter: Learning to Prompt for Remote Sensing Instance Segmentation Based on Visual Foundation Model. IEEE Trans. Geosci. Remote Sens. 2024, 62, 1–17. [Google Scholar] [CrossRef]
  37. Zhang, X.; Yu, Y.; Li, D.; Wang, Y. Progressive Self-Prompting Segment Anything Model for Salient Object Detection in Optical Remote Sensing Images. Remote Sens. 2025, 17(2), 342. [Google Scholar] [CrossRef]
  38. Li, H.; Zhou, W.; Wang, C.; Chen, E. PMA-SAM2: Prior-Memory Adapted Framework for Automatic Remote Sensing Water Body Extraction. Remote Sens. 2026, 18(22), 3880. [Google Scholar] [CrossRef]
  39. Yang, L.; Liu, P.; Zhang, G.; Zhao, H.; Zhao, C. Domain-Adaptive Segment Anything Model for Cross-Domain Water Body Segmentation in Satellite Imagery. J. Imaging 2025, 11(12), 437. [Google Scholar] [CrossRef]
  40. Hu, G.; Shao, M.; Li, K.; Zhou, X.; Xie, X. Optimizing Foundation Model to Enhance Surface Water Segmentation with Multi-Modal Remote Sensing Data. Water 2026, 18(3), 382. [Google Scholar] [CrossRef]
  41. Gherib, T.; Guettouche, M.S.; Souissi, B.; Rabehi, A.; Habib, M.; Riche, A.; et al. GL-FCR: A Global–Local Feature Context and Reconstruction Decoder for Transferable Foundation Model-Based Flood Mapping. Remote Sens. 2026, 18(21), 3674. [Google Scholar] [CrossRef]
  42. Shokati, H.; Seufferheld, K.D.; Fiener, P.; Scholten, T. Rapid flood mapping from aerial imagery using fine-tuned SAM and ResNet-backboned U-Net. Hydrol. Earth Syst. Sci. 2026, 30, 743–756. [Google Scholar] [CrossRef]
  43. Zhang, J. Research on Extraction Method of Typical Ground Objects Along Railway Based on SAM3. Railw. Stand. Des. advance online publication;(In Chinese) 2026. [Google Scholar] [CrossRef]
  44. Chen, J.; Wang, Q.; Zhu, R.; Pan, K.; Lu, X. A Two-Stage Iterative SAM3-Based Method for High-Precision Automatic Crack Detection. Computer Applications and Software. 2026. Available online: https://link.cnki.net/urlid/31.1260.tp.20261014.1151.004.
  45. Liu, Y.; Zheng, K.; Song, Y.; Lai, L.; Shen, M.; Dong, Y.; et al. SAMWater: a prompt-guided multimodal framework for transferable water mapping with the segment anything model. GISci. Remote Sens. 2026, 63(1), 2745243. [Google Scholar] [CrossRef]
  46. Yu, C.; Liu, T.; Li, A.; Qu, X.; Wu, C.; Liu, L.; et al. SAM-REF: Introducing Image-Prompt Synergy during Interaction for Detail Enhancement in the Segment Anything Model. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR) 2025, 19356–19365. Available online: https://openaccess.thecvf.com/content/CVPR2025/html/Yu_SAM-REF_Introducing_Image-Prompt_Synergy_during_Interaction_for_Detail_Enhancement_in_CVPR_2025_paper.html (accessed on 26 November 2026). [CrossRef]
  47. Wang, Y. Urban Flood Image Dataset; HydroShare, 2024. Available online: https://www.hydroshare.org/resource/24866122a6ee456c8f7c80aa87a9abcb/ (accessed on 20 November 2026).
  48. Hu, S.; Wang, Z.; Fan, X.; Zhang, C. Mitigating Site-Specific Data Dependency in Image-Based Water Level Estimation Using Vision Foundation Models. Water Resour. Res. 2026, 62(5), e2025WR042686. [Google Scholar] [CrossRef]
  49. Zhou, B.; Zhao, H.; Puig, X.; Fidler, S.; Barriuso, A.; Torralba, A. Scene Parsing Through ADE20K Dataset. IEEE Conference on Computer Vision and Pattern Recognition (CVPR); pp. 633–641. Available online: https://openaccess.thecvf.com/content_cvpr_2017/html/Zhou_Scene_Parsing_Through_CVPR_2017_paper.html (accessed on 26 November 2026).
  50. Reinke, A.; Tizabi, M.D.; Baumgartner, M.; Eisenmann, M.; Heckmann-Nötzel, D.; Kavur, A.E.; et al. Understanding metric-related pitfalls in image analysis validation. Nat. Methods 2024, 21(2), 182–194. [Google Scholar] [CrossRef]
  51. Simantiris, G.; Bacharidis, K.; Panagiotakis, C. Unsupervised Estimation of Post-Event Standing Urban Floodwater Depth Using Aerial Imagery and Digital Terrain Models. Remote Sens. 2026, 18(16), 2673. [Google Scholar] [CrossRef]
Figure 1. Overall framework of SSCR-SAM3. The water and flood water branches each perform text inference, automatic positive box generation, and joint text–box inference. Each branch takes the union of the initial text foreground and the spatial result. If no valid positive box is available, the branch retains its text mask. After the branches are merged, a nonempty result is output directly. An empty regular result triggers one water 0.1 text recovery step, whose mask becomes the final output directly. Model weights remain frozen throughout.
Figure 1. Overall framework of SSCR-SAM3. The water and flood water branches each perform text inference, automatic positive box generation, and joint text–box inference. Each branch takes the union of the initial text foreground and the spatial result. If no valid positive box is available, the branch retains its text mask. After the branches are merged, a nonempty result is output directly. An empty regular result triggers one water 0.1 text recovery step, whose mask becomes the final output directly. Model weights remain frozen throughout.
Preprints 247105 g001
Figure 2. Selected paired segmentation results for near-ground and aerial flood imagery. (a,b) Near-ground images; (c,d) aerial images. From left to right, the columns show RGB images with GT contours, predictions from the default SAM3 water 0.5 configuration, SSCR-SAM3 predictions, and the corresponding error maps. Per-image IoU values are annotated within the prediction panels. Blue indicates predicted water, and cyan contours indicate GT. Teal, orange, and red indicate TP, FP, and FN, respectively. The two zoomed views in (d) use identical coordinates and magnification to show local structures at road–vegetation boundaries.
Figure 2. Selected paired segmentation results for near-ground and aerial flood imagery. (a,b) Near-ground images; (c,d) aerial images. From left to right, the columns show RGB images with GT contours, predictions from the default SAM3 water 0.5 configuration, SSCR-SAM3 predictions, and the corresponding error maps. Per-image IoU values are annotated within the prediction panels. Blue indicates predicted water, and cyan contours indicate GT. Teal, orange, and red indicate TP, FP, and FN, respectively. The two zoomed views in (d) use identical coordinates and magnification to show local structures at road–vegetation boundaries.
Preprints 247105 g002
Figure 3. Paired IoU gains and confidence intervals for the 94 aerial images. (a) Per-image IoU gains of SSCR-SAM3 relative to the default water 0.5 configuration, sorted in descending order. Blue denotes the 32 images whose IoU changes from zero under the default configuration to a positive value; orange denotes the other 58 improved images. Light gray and dark gray denote the 2 unchanged and 2 decreased cases, respectively. (b) Mean paired IoU gains relative to the three text configurations and their 95% event-cluster bootstrap confidence intervals. Points indicate means, and horizontal lines indicate intervals. Gains are expressed in percentage points.
Figure 3. Paired IoU gains and confidence intervals for the 94 aerial images. (a) Per-image IoU gains of SSCR-SAM3 relative to the default water 0.5 configuration, sorted in descending order. Blue denotes the 32 images whose IoU changes from zero under the default configuration to a positive value; orange denotes the other 58 improved images. Light gray and dark gray denote the 2 unchanged and 2 decreased cases, respectively. (b) Mean paired IoU gains relative to the three text configurations and their 95% event-cluster bootstrap confidence intervals. Points indicate means, and horizontal lines indicate intervals. Gains are expressed in percentage points.
Preprints 247105 g003
Figure 4. Shared and exclusive contributions of the two fixed semantic prompts. (a) Composition of TP and FP pixels shared by the water and flood water text outputs or exclusive to either output, both obtained at an instance confidence threshold of 0.3. TP and FP compositions are each normalized to 100%, with total pixel counts indicated. (b) Proportion of images in which exclusive TP pixels account for at least a given percentage of the GT water area. The inset shows the 0–5% threshold range. At the 1% threshold, the exclusive contributions of the two prompts cover 29/94 and 56/94 images, respectively.
Figure 4. Shared and exclusive contributions of the two fixed semantic prompts. (a) Composition of TP and FP pixels shared by the water and flood water text outputs or exclusive to either output, both obtained at an instance confidence threshold of 0.3. TP and FP compositions are each normalized to 100%, with total pixel counts indicated. (b) Proportion of images in which exclusive TP pixels account for at least a given percentage of the GT water area. The inset shows the 0–5% threshold range. At the 1% threshold, the exclusive contributions of the two prompts cover 29/94 and 56/94 images, respectively.
Preprints 247105 g004
Figure 5. Intermediate results for spatial completion, initial foreground retention, and conditional recovery. (a) Spatial completion on aiflood_095: automatic positive boxes are derived from flood water candidates, and the last column shows regions added to the text union. (b) The water branch on aiflood_066: columns show the text mask, spatial result, foreground-retained result, and restored regions. In (a,b), the last column separates added or restored pixels into TP and FP. (c) Conditional recovery on aiflood_220: the regular merged output is empty, and recovery with water 0.1 yields an IoU of 82.84%; the last column shows the final TP/FP/FN error map. Colors have the same meanings as in Figure 2.
Figure 5. Intermediate results for spatial completion, initial foreground retention, and conditional recovery. (a) Spatial completion on aiflood_095: automatic positive boxes are derived from flood water candidates, and the last column shows regions added to the text union. (b) The water branch on aiflood_066: columns show the text mask, spatial result, foreground-retained result, and restored regions. In (a,b), the last column separates added or restored pixels into TP and FP. (c) Conditional recovery on aiflood_220: the regular merged output is empty, and recovery with water 0.1 yields an IoU of 82.84%; the last column shows the final TP/FP/FN error map. Colors have the same meanings as in Figure 2.
Preprints 247105 g005
Figure 6. Results grouped by scene metadata and water-area fraction. (a) Pooled water IoU grouped separately by scene environment and sky visibility. (b) Per-image IoU distributions grouped by GT water-area fraction, with each point representing an image. Boxes span the 25th to 75th percentiles, center lines indicate medians, whiskers indicate minima and maxima, and hollow diamonds indicate means. Both panels compare the default water 0.5 configuration with SSCR-SAM3.
Figure 6. Results grouped by scene metadata and water-area fraction. (a) Pooled water IoU grouped separately by scene environment and sky visibility. (b) Per-image IoU distributions grouped by GT water-area fraction, with each point representing an image. Boxes span the 25th to 75th percentiles, center lines indicate medians, whiskers indicate minima and maxima, and hollow diamonds indicate means. Both panels compare the default water 0.5 configuration with SSCR-SAM3.
Preprints 247105 g006
Figure 7. Distributions of per-image accuracy and component time for the fixed inference configurations. (a) Water IoU; (b) inference-component time. The configurations appear in the same order in both panels, and points represent the 94 aerial test images. Boxes span the 25th to 75th percentiles, lines within boxes indicate medians, and whiskers indicate minima and maxima. Dark filled diamonds and the values to their right indicate pooled water IoU. Hollow circles and the values to their right indicate mean component time. Timing was measured on an RTX 3090 with BF16. Component timing is defined in Section 4.4. Exact values are reported in Table 4 and Table S5, respectively.
Figure 7. Distributions of per-image accuracy and component time for the fixed inference configurations. (a) Water IoU; (b) inference-component time. The configurations appear in the same order in both panels, and points represent the 94 aerial test images. Boxes span the 25th to 75th percentiles, lines within boxes indicate medians, and whiskers indicate minima and maxima. Dark filled diamonds and the values to their right indicate pooled water IoU. Hollow circles and the values to their right indicate mean component time. Timing was measured on an RTX 3090 with BF16. Component timing is defined in Section 4.4. Exact values are reported in Table 4 and Table S5, respectively.
Preprints 247105 g007
Table 1. Inputs and prompt processing in related studies.
Table 1. Inputs and prompt processing in related studies.
Study/method Input and task adaptation Prompting Output processing
Ozdemir et al. [17] Aerial and satellite imagery; adapted CLIP-RSICD Region candidates generated automatically by SAM Candidate cropping and semantic classification
Shokati et al. [42] Aerial flood imagery; fine-tuned SAM decoder Points and boxes generated from GT Water segmentation guided by spatial prompts
PMA-SAM2 [38] RGB water imagery; trained adaptation modules Priors, prototype memory, and automatic dense prompts Water extraction guided by learned prompts
SAMWater [45] SAR and optical imagery; LoRA adaptation of the Water-IoU branch Multimodal priors and structured prompts Candidate ranking and water-mask fusion
SegEarth-OV3 [19] RGB remote sensing imagery; frozen SAM3 Class text prompts Fusion of instance and semantic outputs, weighted by presence scores
Du et al. [18] Drainage surveillance imagery; frozen SAM3 Fixed water text prompt Union of accepted instances; empty if none are accepted
Zhang [43] Railway corridor imagery; zero-shot SAM3 Hierarchical semantics and manual point/box interaction Interactive completion of local omissions
Chen et al. [44] Crack imagery; no additional task training Text prompts and boxes generated automatically from connected components Two-stage joint text–box inference
SSCR-SAM3
(this study)
Near-ground and aerial RGB imagery; frozen SAM3 Complementary text prompts and boxes generated automatically from candidates Initial foreground retention, union of two branches, and recovery of empty outputs
Note: GT denotes ground truth; LoRA denotes low-rank adaptation. Model training and prompting conditions are listed as described in the original studies.
Table 2. Data scope, label definitions, and experimental use.
Table 2. Data scope, label definitions, and experimental use.
Dataset/subset n Image size
(width × height, pixels)
Water foreground label Experimental use
Deepflood, full dataset 1040 512×384 1 (original 0/1 labels) Method development and evaluation on the full dataset
Deepflood prompt-analysis subset 120 512×384 1 (original 0/1 labels) Retrospective prompt analysis
AIFloodSense, official test set 94 1024×768 Flood = 255 Primary aerial analysis with fixed settings
AIFloodSense, official training portion 376 1024×768 Flood = 255 24 images for initial checks; supplementary descriptions of results for the training portion and full dataset
Note: The 120 Deepflood images used for retrospective prompt analysis are included in the full set of 1040, and the 24 AIFloodSense images used for initial checks are included in the 376-image training portion. Neither subset is counted twice. Ground truth contains water in every image in the primary near-ground and aerial analyses.
Table 3. Overall results on the 1040 Deepflood images.
Table 3. Overall results on the 1040 Deepflood images.
Method or configuration Pooled
IoU (%)
Mean per-image
IoU (%)
P (%) R (%) F1 (%) Empty predictions
(images)
Fixed SAM3 configurations
SAM3 water 0.5 83.91 82.75 94.77 87.98 91.25 62
water 0.3 86.22 85.29 94.38 90.89 92.60 30
flood water 0.3 86.13 85.20 94.41 90.76 92.55 39
Text OR 0.3 86.97 86.16 94.07 92.02 93.03 26
Two-stage Union 0.3 87.20 86.40 93.81 92.52 93.16 26
SSCR-SAM3 88.17 87.66 93.74 93.69 93.71 10
Low-threshold configurations applied to all images
water 0.1 84.31 84.02 89.11 94.00 91.49 10
flood water 0.1 87.13 86.47 93.41 92.84 93.12 21
Text OR 0.1 84.32 84.07 88.73 94.44 91.50 10
Direct transfer of publicly available pretrained weights
U-Net, direct transfer 45.79 45.38 60.80 64.97 62.81 0
DeepLabV3+, direct transfer 64.48 60.97 90.48 69.17 78.40 102
P, R, and F1 are calculated from pixel counts pooled over all images; mean IoU assigns equal weight to each image. U-Net and DeepLabV3+ directly use publicly available pretrained weights, whereas the other configurations use the same SAM3 checkpoint. Dataset usage is described in Section 4.1.
Table 4. Fixed-configuration results on the 94 official AIFloodSense test images.
Table 4. Fixed-configuration results on the 94 official AIFloodSense test images.
Method or configuration Pooled
IoU (%)
Mean per-image
IoU (%)
P (%) R (%) F1 (%) Empty predictions
(images)
SAM3 water 0.5 42.88 44.33 98.72 43.12 60.02 34
water 0.3 67.86 66.78 98.07 68.78 80.85 10
flood water 0.3 70.19 69.93 97.57 71.44 82.49 7
Text OR 0.3 71.73 71.10 97.34 73.17 83.54 6
Two-stage Union 0.3 75.28 74.80 95.58 77.99 85.90 6
SSCR-SAM3 78.13 77.25 95.49 81.12 87.72 2
All configurations use the same frozen SAM3 checkpoint. P, R, and F1 are pooled pixel-level metrics; mean IoU assigns equal weight to each image.
Table 5. Component gains with the same backbone on the official aerial test set.
Table 5. Component gains with the same backbone on the official aerial test set.
Component Comparison (before → after) Δ Pooled
IoU
(percentage points)
Δ Mean per-image
IoU
(percentage points)
Per-image IoU changes (images)
Improved Unchanged Decreased
Threshold water 0.5 → water 0.3 +24.98 +22.45 66 25 3
Semantics water 0.3 → Text OR +3.87 +4.32 85 7 2
Semantics flood water 0.3 → Text OR +1.54 +1.17 81 10 3
Spatial processing Text OR → Two-stage Union +3.55 +3.70 82 6 6
Initial foreground
retention
water branch:
Bq → Uq
+3.04 +2.67 82 10 2
Initial foreground
retention
flood water branch:
Bq → Uq
+2.38 +2.30 86 7 1
Conditional recovery Two-stage Union
→ SSCR-SAM3
+2.85 +2.45 4 90 0
All comparisons use the same 94 images. Gains are calculated as the second configuration minus the first using unrounded values. Bq and Uq denote the spatial re-prediction and the output after retaining the initial foreground for a single branch, respectively; their comparison isolates the contribution of initial foreground retention.
Table 6. Published reference results and the present results for the AIFloodSense binary Flood task.
Table 6. Published reference results and the present results for the AIFloodSense binary Flood task.
Method Training and evaluation conditions Result
source
IoU (%) P (%) R (%) F1 (%)
DeepLabV3 Target-domain supervised training;
512×384 input
Reference [5] 80.42 88.37 89.94 89.15
U-Net 84.14 92.61 90.19 91.39
Swin-T 84.29 91.59 91.37 91.48
SSCR-SAM3 Frozen-model inference;
evaluation on the original image grid
This study 78.13 95.49 81.12 87.72
Supervised results are taken from the corresponding rows in Table 7 of [5], which use ImageNet pretraining followed by target-domain training with 512×384 inputs. Results from this study are pooled water metrics evaluated on the original image grid.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.