Coastline dynamic segmentation method based on Shoreline-SAM model
By introducing the ConvLSTM gating mechanism and the multimodal cueing mechanism, the Shoreline-SAM model solves the problems of illumination variation, wave reflection and temporal inconsistency in coastline segmentation, and achieves high-precision and robust dynamic coastline segmentation.
Patent Information
- Application Number
- CN202511478041.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-16
- Publication Date
- 2026-01-13
AI Technical Summary
Existing technologies for coastline segmentation suffer from problems such as high false detection rates due to changes in illumination, false boundary misjudgments caused by wave reflection interference, and state breaks caused by inconsistent timing. In particular, it is difficult to achieve high-precision and robust segmentation in dynamic environments.
By introducing ConvLSTM gating and multimodal prompting mechanisms, and combining Focal Loss, Dice Loss and Mask IoU Loss loss functions, the Shoreline-SAM model is used for dynamic coastline segmentation, which improves the model's ability to perceive dynamic environments and temporal continuity.
It significantly improves the accuracy and robustness of coastline segmentation, solves the problems of false boundary misjudgment and temporal jump in complex environments, and achieves highly reliable intelligent decision support.
Smart Images

Figure CN121329992A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of interdisciplinary technology of artificial intelligence and visible light image processing, and in particular to a dynamic coastline segmentation method based on the Shoreline-SAM model. Background Technology
[0002] For water segmentation in various images (including visible light images, drone aerial photography, and ground photography), traditional image segmentation mainly relies on pixel-level color analysis. Typical examples include threshold segmentation techniques, such as fixed threshold methods based on hue / brightness; edge detection algorithms, such as contour extraction methods like the Canny operator; and rule-based classification, which distinguishes water bodies using predefined color rules. However, while these methods may be effective in static and simple scenes, they suffer from fundamental flaws. For instance, when there are strong changes in lighting (such as midday glare or twilight shadows), the color threshold fails, leading to a high false detection rate. When faced with complex interference such as wave reflections and cloud reflections, a large number of false boundary misjudgments occur, making them completely unable to adapt to dynamic changes. Furthermore, parameters need to be manually adjusted repeatedly during tidal fluctuations.
[0003] To improve robustness, existing technologies have introduced shallow machine learning methods. Support Vector Machines (SVM) separate features through kernel function mapping, Random Forests classify through multi-decision tree ensemble, and clustering algorithms such as K-means unsupervised segmentation. These methods have made progress on specific datasets, but still have significant shortcomings: feature engineering relies on manual design (such as texture and gradient features), making it difficult to capture complex water body patterns.
[0004] In recent years, deep learning models such as U-Net, DeepLab, and SAM have significantly advanced the field of image segmentation. The U-Net encoder-decoder architecture fuses shallow details with deep semantics through skip connections, while the DeepLab series of models utilizes two core technologies: dilated convolution and spatial pyramid pooling (ASPP). However, these methods have limitations when used for coastline segmentation: convolutional kernels are limited by local receptive fields, making it difficult to distinguish similar textures (such as sand and shallow water); pooling operations lead to blurred boundaries and insufficient coastline localization accuracy. The SAM model represents a state-of-the-art general segmentation technique, utilizing the ViT encoder to capture global context and achieving zero-shot generalization through a cueing mechanism. However, it still faces challenges in dynamic coastline segmentation: the MLP adapter, as a feedforward structure, cannot filter out wave reflection interference; under strong light conditions, specular reflections may be misidentified as water boundaries; and temporal inconsistencies cause state breaks when processing consecutive frames, manifesting as jagged jumps in segmentation boundaries. The root structural problem lies in the adapter's use of a static MLP module instead of a recursive network, lacking a memory gating mechanism to preserve historical states. Summary of the Invention
[0005] To address the problems existing in the prior art, the purpose of this invention is to provide a dynamic coastline segmentation method based on the Shoreline-SAM model. Addressing the lack of robustness in traditional methods, the generalization limitations of machine learning models, and the temporal discontinuity issues in deep learning architectures (especially SAM), the Shoreline-SAM model improves the accuracy and robustness of coastline segmentation in dynamic environments through temporal enhancement techniques, achieving the following breakthroughs: First, overcome the accuracy bottleneck in dynamic environments: Traditional thresholding methods often suffer from false positive rates exceeding 40% when illumination changes, while models like SAM still exhibit a false positive rate of around 25% under wave reflection interference. The core objective of this invention is to introduce a ConvLSTM gating mechanism, which selectively memorizes tidal patterns and forgets transient interferences (such as pedestrian occlusion and specular reflection), thereby improving the model's segmentation performance in strong light and complex environments and effectively solving the problem of false boundary misjudgment in complex environments.
[0006] Second, it fundamentally solves the decision distortion caused by temporal jumps. In continuous frame processing, the static model causes the segmentation displacement and continuous tidal changes to be decoupled into discrete states due to the break in state transmission. However, the cross-frame collaborative mechanism built by the ConvLSTM adapter establishes a cross-frame state transmission channel by selectively remembering tidal gradual changes and forgetting instantaneous interference to ensure the coherent modeling of the tidal gradual change process, effectively suppressing the jump in segmentation results and ensuring the temporal consistency of erosion analysis.
[0007] Through the above innovations, the accuracy and temporal continuity of coastline segmentation have been simultaneously improved, promoting the transformation of coastal zone management from manual dependence to intelligent decision-making, and providing highly reliable technical support for scenarios such as disaster prevention and mitigation and habitat protection.
[0008] To achieve the above objectives, the present invention provides the following solution: A dynamic coastline segmentation method based on the Shoreline-SAM model includes: A visible light image is acquired and input into the Shoreline-SAM model to obtain a binary prediction image result for water body segmentation. The Shoreline-SAM model is trained using a training set, which includes: original visible light images at different resolutions and their corresponding ground truth labels. During training, the loss between the prediction result and the ground truth label is calculated to optimize the model. The image encoder in the Shoreline-SAM model adopts the ViT-B architecture and integrates a ConvLSTM temporal information fusion module for fusing temporal information.
[0009] Optionally, constructing the training set includes: Obtain raw visible light images at different resolutions, extract multi-region water body annotations from the raw visible light images, and obtain images of all regions containing water bodies; The image containing the water body is labeled using a labeling file, and then normalized and augmented to obtain the training set; the data augmentation includes random rotation, flipping, and brightness adjustment operations.
[0010] Optionally, the Shoreline-SAM model includes: The image encoder unit is used to adopt the ViT-B architecture and introduce a ConvLSTM temporal information fusion module in the adapter layer to fuse temporal information and obtain temporally enhanced image features. The cue encoder unit processes bounding box and point cue information to generate sparse and dense cue embeddings; The mask decoder unit is used to fuse the temporally enhanced image features and the cue embedding to output a high-precision segmentation mask unit, namely the binary prediction image result of water body segmentation.
[0011] Optionally, the image encoder unit includes: The image encoder subunit is used to process the visible light image into multiple Transformer encoder layers using the ViT-B architecture to obtain image features in the target dimension. The Transformer encoder layer includes a multi-head self-attention mechanism and a feedforward neural network. The image features are input into the adapter layer containing the ConvLSTM temporal information fusion module, and the image features are fused with historical temporal features to output a temporal enhanced feature map. The ConvLSTM temporal information fusion module includes an input gate, a forget gate, and an output gate, which are used to control the flow and forgetting of temporal information. The temporal enhancement feature map is subjected to position encoding and feature fusion to generate the temporal enhancement image features.
[0012] Optionally, the prompt encoder unit includes: The bounding box encoder subunit is used to process bounding box cues and generate sparse bounding box embeddings. The point encoder subunit is used to process point cues and generate sparse point embeddings. An embedding fusion subunit is used to fuse the bounding box embedding and the point embedding to generate a sparse cue embedding; The dense position encoder subunit is used to fuse the bounding box embedding and the point embedding to generate a dense position embedding, i.e. a dense cue embedding.
[0013] Optionally, the prompt encoder unit includes: The prompt encoder subunit is used to embed the temporally enhanced image features and the prompt into the first layer Transformer decoder, and fuse the image features and prompt information through a cross-attention mechanism to obtain the first fused feature; The first fused feature is input into a multi-layer Transformer decoder, where each layer of the multi-layer Transformer decoder includes a self-attention mechanism and a cross-attention mechanism to gradually refine the segmentation feature representation and generate a second fused feature. The second fused feature is input into the last layer of the Transformer decoder, and the second fused feature is mapped to the mask space through the linear projection layer to generate a low-resolution water body segmentation mask prediction, that is, the water body segmentation binary prediction image result.
[0014] Optionally, the loss optimization model for calculating the prediction result and the true label includes: The Focal Loss between the predicted result and the true label is calculated to handle the imbalance between positive and negative samples, and to focus on pixels that are difficult to classify. Calculate the Dice Loss between the predicted result and the real label to optimize the overall shape similarity of the segmentation mask; Calculate the Mask IoU Loss between the predicted result and the real label, and combine the IoU prediction value to optimize the boundary and region integrity of the segmentation mask; The Focal Loss, Dice Loss, and Mask IoU Loss are combined according to the target weights, and an optimizer is used to optimize the model.
[0015] The beneficial effects of this invention are as follows: This invention integrates a ConvLSTM temporal information fusion module into the SAM network model, which can significantly improve the model's ability to perceive dynamic water body changes. Instead of using the static image encoder in the classic SAM network, this invention improves it by introducing a temporal enhancement encoder that includes a ConvLSTM layer. A ConvLSTM temporal information fusion module is introduced into the adapter layer, and the flow and forgetting of temporal information are controlled through input gates, forget gates, and output gates. This improvement enables the model to fuse current image features with historical temporal features, enhancing the model's ability to perceive dynamic changes in water body boundaries, improving the model's robustness to changes in the morphology of water body regions in images, and significantly enhancing the model's accuracy in recognizing complex water body boundaries. This highlights the importance of temporal information for water body segmentation tasks and can effectively improve segmentation accuracy. This invention introduces a multimodal cueing mechanism (bounding box cueing and point cueing) and integrates it into the cueing encoder of the SAM network. This enables the network to more accurately locate and segment target water bodies, thus solving the problems of missegmentation and missed segmentation caused by the lack of precise cueing information in traditional segmentation methods. This invention proposes integrating the bounding box encoder and point encoder into the cueing encoder of the SAM network, allowing the model to simultaneously utilize the region information provided by the bounding box and the precise location information provided by the point cueing. This achieves a successful combination of coarse-grained region localization and fine-grained boundary refinement, eliminating background interference during feature extraction, reducing the impact of complex backgrounds on the model, and improving the network's ability to capture target region information. These characteristics improve the model's segmentation accuracy and robustness. This invention effectively addresses the class imbalance and boundary accuracy issues in water segmentation by employing a combined loss function of Focal Loss, Dice Loss, and Mask IoU Loss. Instead of using a single traditional loss function, this invention weightedly combines three loss functions: Focal Loss addresses the imbalance between positive and negative samples, focusing on hard-to-classify pixels; Dice Loss optimizes the overall shape similarity of the segmentation mask; and Mask IoU Loss optimizes the boundary accuracy and region integrity of the segmentation mask. This combined loss function design allows the model to simultaneously focus on global shape consistency and local boundary accuracy, significantly improving the model's accuracy in segmenting water boundaries, reducing noise and artifacts in the segmentation results, and enhancing the integrity and continuity of the segmentation results. This invention enables the model to adapt to image data from different sources and scenes by supporting multi-resolution input (such as 640×320 and 1280×640) and an adaptive data processing mechanism. The invention designs a DataLoader that supports multiple resolutions, automatically processing input images of different sizes. It ensures the quality of segmentation results through bilinear interpolation and morphological processing. This multi-resolution support mechanism allows the model to process various types of images, including visible light images, drone aerial photography, and ground-based images, improving the model's versatility and practicality, and providing a technical foundation for large-scale image processing in real-world applications. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1This is a flowchart of a dynamic coastline segmentation method based on the Shoreline-SAM model according to an embodiment of the present invention. Figure 2 This is a comparison diagram of this invention's embodiments with other prompt-driven segmentation models; Figure 3 This is a diagram showing the actual segmentation effect of an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] like Figure 1 As shown, this embodiment discloses a dynamic coastline segmentation method based on the Shoreline-SAM model, including: acquiring a visible light image; inputting the visible light image into the Shoreline-SAM model to obtain a binary prediction image result for water body segmentation; the Shoreline-SAM model is trained using a training set, which includes: original visible light images at different resolutions and their corresponding ground truth labels; during training, the loss between the prediction result and the ground truth label is calculated to optimize the model; the image encoder in the Shoreline-SAM model adopts the ViT-B architecture and integrates a ConvLSTM temporal information fusion module for fusing temporal information.
[0021] Specifically, this embodiment discloses a dynamic coastline segmentation method based on the Shoreline-SAM model, including: Step A, construct the Shoreline-SAM network model: The Segment Anything Model (SAM) based on Vision Transformer (ViT-B) is adopted as the backbone network, and a ConvLSTM temporal information fusion module is integrated into the image encoder. The model consists of three core components: an improved image encoder, a cue encoder, and a mask decoder. The improved image encoder adopts the ViT-B architecture and introduces a ConvLSTM layer in the adapter layer to fuse temporal information and enhance the model's ability to perceive dynamic water body changes. The cue encoder processes bounding boxes and point cue information to generate sparse and dense cue embeddings. The mask decoder fuses temporally enhanced image features and cue embeddings to output a high-precision segmentation mask. This architecture can effectively handle multi-scale and multi-morphological water body regions and improve the accuracy of dynamic water body boundary segmentation by utilizing temporal information. Step B: Obtain a multi-resolution water segmentation dataset and preprocess the water segmentation images to obtain data that meets the training and testing requirements. We collected visible light images, drone aerial photos, and ground-based images with resolutions of 640×320 and 1280×640, each image containing multiple independent water area annotations; we normalized the images, standardizing pixel values to the range of [0,1], and applied data augmentation techniques (including random rotation, flipping, brightness adjustment, etc.) to improve the model's generalization ability; we divided the dataset into training and testing sets to ensure that training images were used during training and testing images were used during testing. Step C: Create neural network training samples, construct the dataset, and divide it into training and test sets: From the images obtained in step B, extract multiple water areas from each image and generate corresponding binary mask annotations for each area; randomly divide the generated training samples into training and test sets in an 8:2 ratio to ensure the balance of data distribution; Step D: Train the Shoreline-SAM network using the training set and optimize and tune the parameters: The training set obtained in step C is input into the Shoreline-SAM model. Image features are extracted and temporal information is fused through an improved image encoder. Bounding boxes and point cue information are processed through a cue encoder. Segmentation predictions are generated through a mask decoder. A combination of Focal Loss, Dice Loss and Mask IoU Loss loss functions is used. The network parameters are optimized and adjusted using the AdamW optimizer. After multiple rounds of iterative training, a well-trained network model is obtained. Step E: Input the test set images that need to be segmented into the trained Shoreline-SAM network to obtain the binary prediction image results for water segmentation. The test image is input into the trained Shoreline-SAM model. The model automatically generates bounding box cueing or uses predefined point cueing to obtain a water segmentation mask through forward propagation. The low-resolution mask output is then upsampled using bilinear interpolation to restore it to the original image size, and thresholding is applied to obtain the final binary segmentation result.
[0022] Furthermore, constructing the training set includes: acquiring original visible light images at different resolutions, extracting multi-region water body annotations from the original visible light images, and obtaining all images containing water bodies; using the annotation file to annotate the images containing water bodies, and performing normalization and data augmentation to obtain the training set; data augmentation includes: random rotation, flipping, and brightness adjustment operations.
[0023] Specifically, step C includes the following steps: Step C1: In the images obtained in step B, perform multi-region water body annotation extraction on each image and retain all images containing water body regions; Step C2: Take the image obtained in step C1, retain the original resolution (640×320 or 1280×640), and use a JSON format annotation file to mark and label the water areas. Each image contains multiple independent water areas. Step C3: Perform data augmentation on the images obtained in step C2, including random rotation, flipping, brightness adjustment, etc., to obtain an enhanced training dataset. The dataset is randomly divided into a training set and a test set in an 8:2 ratio.
[0024] Furthermore, the Shoreline-SAM model includes: an image encoder unit, which adopts the ViT-B architecture and introduces a ConvLSTM temporal information fusion module in the adapter layer to fuse temporal information and obtain temporally enhanced image features; a cue encoder unit, which processes bounding box and point cue information to generate sparse and dense cue embeddings; and a mask decoder unit, which fuses the temporally enhanced image features and cue embeddings to output a high-precision segmentation mask unit, i.e., the binary prediction image result for water body segmentation.
[0025] Specifically, step D includes the following steps: Step D1: Input the training set obtained in step C3 into the feature extraction module of the Shoreline-SAM model, which consists of an improved ViT-B image encoder, to encode the input image into a high-dimensional feature representation; Step D2: Input the feature map obtained in step D1 into the cue encoder, and generate sparse and dense cue embeddings by processing the bounding box and point cue information; Step D3: Embed the temporally enhanced image features and cues into the mask decoder, process them through a multi-layer Transformer decoder to obtain the water body segmentation feature map, and evaluate the model performance through the validation set after each epoch of training. After several iterations of training, the trained network is obtained. Step D4: Calculate the loss between the predicted result and the true label. The loss function is a combination of Focal Loss, Dice Loss and Mask IoU Loss. The AdamW optimizer is used to optimize and adjust the network parameters to achieve the purpose of optimizing the model.
[0026] Furthermore, the image encoder unit includes: an image encoder subunit, which uses the ViT-B architecture to process visible light images into multiple Transformer encoder layers to obtain image features in the target dimension. The Transformer encoder layers include a multi-head self-attention mechanism and a feedforward neural network; an adapter layer that introduces image feature input into a ConvLSTM temporal information fusion module to fuse image features with historical temporal features and output a temporal enhanced feature map. The ConvLSTM temporal information fusion module includes an input gate, a forget gate, and an output gate to control the flow and forgetting of temporal information; and a position encoding and feature fusion of the temporal enhanced feature map to generate temporally enhanced image features.
[0027] Specifically, step D1 includes the following steps: Step D1-1: Input the image into the improved ViT-B image encoder. After processing through 16 Transformer encoder layers, each encoder layer contains a multi-head self-attention mechanism and a feedforward neural network, a 1024-dimensional image feature representation is obtained. Step D1-2: Introduce the ConvLSTM temporal information fusion module in the adapter_layer to fuse the current image features with historical temporal features. The ConvLSTM layer contains an input gate, a forget gate, and an output gate, which are used to control the flow and forgetting of temporal information. Steps D1-3: The temporal augmentation feature map output by the ConvLSTM module is subjected to position encoding and feature fusion to generate a temporal augmentation image embedding suitable for use by the mask decoder. This embedding contains the spatial features of the current image and historical temporal context information.
[0028] Furthermore, the cue encoder unit includes: a bounding box encoder subunit for processing bounding box cues and generating sparse bounding box embeddings; a point encoder subunit for processing point cues and generating sparse point embeddings; an embedding fusion subunit for fusing bounding box embeddings and point embeddings to generate sparse cue embeddings; and a dense position encoder subunit for fusing bounding box embeddings and point embeddings to generate dense position embeddings, i.e., dense cue embeddings.
[0029] Specifically, step D2 includes the following steps: Step D2-1: Process the input bounding box cueings through a bounding box encoder to generate sparse bounding box embeddings; Step D2-2: Process the input point cues using a point encoder to generate sparse point embeddings; Step D2-3: Merge the bounding box embedding and the point embedding to generate a unified sparse cue embedding; Step D2-4: Generate dense position embeddings through a dense position encoder to provide spatial position information for the mask decoder.
[0030] Furthermore, the cue encoder unit includes: a cue encoder subunit, used to embed temporally enhanced image features and cues into the first layer Transformer decoder, fuse image features and cue information through a cross-attention mechanism to obtain a first fused feature; input the first fused feature into a multi-layer Transformer decoder, where each layer of the multi-layer Transformer decoder contains a self-attention mechanism and a cross-attention mechanism to progressively refine the segmentation feature representation and generate a second fused feature; input the second fused feature into the last layer Transformer decoder, and map the second fused feature onto the mask space through a linear projection layer to generate a low-resolution water body segmentation mask prediction, i.e., a water body segmentation binary prediction image result.
[0031] Specifically, step D3 includes the following steps: Step D3-1: Embed the temporally enhanced image features and cues into the first layer of the mask decoder's Transformer decoder, and fuse the image features and cues through a cross-attention mechanism; Step D3-2: After processing by multiple layers of Transformer decoders, each layer includes self-attention and cross-attention mechanisms, the segmentation feature representation is gradually refined; Step D3-3: In the last decoder layer, the features are mapped to the mask space through a linear projection layer to generate a low-resolution water segmentation mask prediction. Steps D3-4: Simultaneously output the IoU prediction value to evaluate the segmentation quality, and calculate the IoU, Dice coefficient and other metrics through the validation set after each epoch of training to evaluate the model performance.
[0032] Furthermore, the loss optimization model between the predicted results and the true labels includes: calculating the Focal Loss between the predicted results and the true labels to handle the imbalance between positive and negative samples and focusing on hard-to-classify pixels; calculating the Dice Loss between the predicted results and the true labels to optimize the overall shape similarity of the segmentation mask; calculating the Mask IoU Loss between the predicted results and the true labels, and combining the IoU predicted values to optimize the boundary and region integrity of the segmentation mask; combining the Focal Loss, Dice Loss, and Mask IoU Loss according to the target weights, and using an optimizer to optimize the model.
[0033] Specifically, step D4 includes the following steps: Step D4-1: Calculate Focal Loss to handle the imbalance between positive and negative samples, focusing on hard-to-classify pixels and improving the model's sensitivity to boundary regions; Step D4-2: Calculate Dice Loss to optimize the overall shape similarity of the segmentation mask and ensure consistency between the predicted mask and the real mask in terms of region overlap. Step D4-3: Calculate Mask IoU Loss, and combine it with the IoU prediction value to optimize the boundary accuracy and region integrity of the segmentation mask; Step D4-4: Combine the three loss functions according to their weights, and use the AdamW optimizer to optimize and adjust the network parameters. Set the learning rate to 1e-4 and the weight decay to 0.01 to achieve the purpose of optimizing the model.
[0034] like Figure 2-3 As shown, Shoreline-SAM significantly outperforms traditional methods and other baseline models on datasets containing temporal variations, demonstrating substantial improvements in both accuracy and robustness. This method provides a novel solution for coastline segmentation and has broad application potential.
[0035] As shown in Table 1, Table 1 presents the comparison results of water surface segmentation performance and parameters with other baseline models.
[0036] Table 1 The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A dynamic coastline segmentation method based on the Shoreline-SAM model, characterized in that, include: Acquire a visible light image, input the visible light image into the Shoreline-SAM model, and obtain the binary prediction image result of water body segmentation; The Shoreline-SAM model is trained using a training set, which includes: original visible light images at different resolutions and their corresponding ground truth labels. During training, the loss between the predicted results and the true labels is calculated to optimize the model; The image encoder in the Shoreline-SAM model adopts the ViT-B architecture and integrates a ConvLSTM temporal information fusion module for fusing temporal information.
2. The dynamic coastline segmentation method based on the Shoreline-SAM model according to claim 1, characterized in that, Constructing the training set includes: Obtain raw visible light images at different resolutions, extract multi-region water body annotations from the raw visible light images, and obtain images of all regions containing water bodies; The image containing the water body is labeled using a labeling file, and then normalized and augmented to obtain the training set; the data augmentation includes random rotation, flipping, and brightness adjustment operations.
3. The method for dynamic coastline segmentation based on the Shoreline-SAM model according to claim 1, characterized in that, The Shoreline-SAM model includes: The image encoder unit is used to adopt the ViT-B architecture and introduce a ConvLSTM temporal information fusion module in the adapter layer to fuse temporal information and obtain temporally enhanced image features. The cue encoder unit processes bounding box and point cue information to generate sparse and dense cue embeddings; The mask decoder unit is used to fuse the temporally enhanced image features and the cue embedding to output a high-precision segmentation mask unit, namely the binary prediction image result of water body segmentation.
4. The dynamic coastline segmentation method based on the Shoreline-SAM model according to claim 3, characterized in that, The image encoder unit includes: The image encoder subunit is used to process the visible light image into multiple Transformer encoder layers using the ViT-B architecture to obtain image features in the target dimension. The Transformer encoder layer includes a multi-head self-attention mechanism and a feedforward neural network. The image features are input into the adapter layer containing the ConvLSTM temporal information fusion module, and the image features are fused with historical temporal features to output a temporal enhanced feature map. The ConvLSTM temporal information fusion module includes an input gate, a forget gate, and an output gate, which are used to control the flow and forgetting of temporal information. The temporal enhancement feature map is subjected to position encoding and feature fusion to generate the temporal enhancement image features.
5. The method for dynamic coastline segmentation based on the Shoreline-SAM model according to claim 3, characterized in that, The prompt encoder unit includes: The bounding box encoder subunit is used to process bounding box cues and generate sparse bounding box embeddings. The point encoder subunit is used to process point cues and generate sparse point embeddings. An embedding fusion subunit is used to fuse the bounding box embedding and the point embedding to generate a sparse cue embedding; The dense position encoder subunit is used to fuse the bounding box embedding and the point embedding to generate a dense position embedding, i.e. a dense cue embedding.
6. The dynamic coastline segmentation method based on the Shoreline-SAM model according to claim 3, characterized in that, The prompt encoder unit includes: The prompt encoder subunit is used to embed the temporally enhanced image features and the prompt into the first layer Transformer decoder, and fuse the image features and prompt information through a cross-attention mechanism to obtain the first fused feature; The first fused feature is input into a multi-layer Transformer decoder, where each layer of the multi-layer Transformer decoder includes a self-attention mechanism and a cross-attention mechanism to gradually refine the segmentation feature representation and generate a second fused feature. The second fused feature is input into the last layer of the Transformer decoder, and the second fused feature is mapped to the mask space through the linear projection layer to generate a low-resolution water body segmentation mask prediction, that is, the water body segmentation binary prediction image result.
7. The dynamic coastline segmentation method based on the Shoreline-SAM model according to claim 1, characterized in that, The loss optimization model for calculating the difference between the predicted result and the true label includes: The Focal Loss between the predicted result and the true label is calculated to handle the imbalance between positive and negative samples, and to focus on pixels that are difficult to classify. Calculate the Dice Loss between the predicted result and the real label to optimize the overall shape similarity of the segmentation mask; Calculate the Mask IoU Loss between the predicted result and the real label, and combine the IoU prediction value to optimize the boundary and region integrity of the segmentation mask; The Focal Loss, Dice Loss, and Mask IoU Loss are combined according to the target weights, and an optimizer is used to optimize the model.