A land-sea segmentation method based on dual attention mechanism
By constructing a land-sea segmentation method based on a dual attention mechanism and utilizing the Transformer Block and adaptive feature fusion modules, the accuracy problem of land-sea boundaries in remote sensing images is solved, achieving a more accurate land-sea segmentation effect.
Patent Information
- Application Number
- CN202510062720.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-01-15
AI Technical Summary
Existing land-sea segmentation methods for remote sensing images suffer from insufficient accuracy when dealing with complex land-sea boundaries and small-scale targets. This is especially true when faced with interference factors such as fuzzy information in coastal areas, artificial structures, and narrow waterways, making it difficult to clearly delineate land-sea boundaries.
A land-sea segmentation method based on a dual attention mechanism is adopted to construct an encoder and decoder. The encoder consists of four Transformer Blocks, combined with a convolutional attention module and an efficient multi-head attention mechanism. The decoder adopts a pyramid pooling module and an adaptive feature fusion module to improve segmentation accuracy through multi-scale information fusion.
It improves the accuracy and detail capture of land and sea segmentation, can more accurately depict coastlines in complex scenes, enhances the ability to capture key areas and edge details, and provides more accurate land and sea segmentation results.
Smart Images

Figure CN120107779B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image processing, and in particular to a land-sea segmentation method based on a dual attention mechanism. Background Art
[0002] The coastline is defined as "the line dividing land and sea at the average high tide level over many years." In the field of land-sea segmentation in remote sensing imagery, this is called the instantaneous coastline, the boundary between land and sea at a specific time and tidal conditions. It not only boasts abundant natural resources but also hosts one of the most active areas of human activity. However, the combined influence of natural and human factors, including sea level rise, land subsidence, river sediment transport, land reclamation, and port construction, makes the coastline one of the most dynamic natural boundaries on Earth's surface.
[0003] Traditional coastline measurement methods primarily rely on manual field surveys. However, these surveys are time-consuming, labor-intensive, and susceptible to subjective influences from surveyors, resulting in low efficiency and accuracy errors, making it difficult to monitor the dynamic changes of coastlines. In contrast, remote sensing technology uses detection equipment to acquire information about the Earth's surface from a distance. It offers advantages such as wide coverage, multi-temporal monitoring, and high resolution. It is widely used in fields such as land resource surveys, agricultural development, and marine monitoring, becoming a primary means of monitoring coastline dynamics. Currently, the main methods for automatically extracting coastlines from remote sensing images include threshold segmentation, edge detection operators, and object-oriented methods. However, these methods have the following drawbacks: 1) While simple, threshold segmentation methods require manual threshold setting, which can affect coastline extraction accuracy if the threshold is not set appropriately; 2) Edge detection operators are significantly affected by noise, resulting in a lack of continuity between the land and sea edges detected, and subsequent processing is often required after coastline extraction; 3) Object-oriented methods struggle to process high-resolution remote sensing images containing large amounts of data and fail to fully utilize the useful information within them. Consequently, these methods have limitations when dealing with multi-scale, complex land and sea scenes and coastline morphologies.
[0004] In recent years, deep learning technology has developed rapidly. Leveraging its powerful feature extraction capabilities, it has achieved remarkable success in various downstream computer vision tasks, such as image classification, object detection, and semantic segmentation. Deep learning technology has also made significant progress in the field of land-sea segmentation in remote sensing imagery. However, it is worth noting that in this task, deep learning models struggle to clearly and smoothly delineate land-sea boundaries when faced with ambiguous information such as the presence of aquaculture areas, biomes, and plankton in coastal areas. Relying solely on local feature extraction, these models face challenges in processing edge details due to the presence of small-scale information such as artificial structures like ports and docks, as well as narrow waterways. This makes existing land-sea segmentation models inaccurate. Therefore, it is crucial to develop a land-sea segmentation method that can accommodate complex land-sea boundaries and interference factors such as small-scale objects. Summary of the Invention
[0005] In response to the above-mentioned prior art, the present invention provides a land-sea segmentation method based on a dual attention mechanism, which mainly solves the technical problems existing in the above-mentioned background technology.
[0006] To achieve the above-mentioned purpose, the technical solution of the embodiment of the present invention is implemented as follows:
[0007] A land-sea segmentation method based on a dual attention mechanism includes the following steps:
[0008] S1, obtaining a remote sensing image, and preprocessing the remote sensing image to obtain a coastline remote sensing image to be segmented;
[0009] S2. Constructing a land-sea segmentation model with a dual attention mechanism:
[0010] S2.1. Constructing an encoder with dual attention mechanism;
[0011] The encoder includes four Transformer Blocks, each of which includes a patch embedding layer, a Transformer layer, a convolutional attention module, and an Overlap Patch Merging layer;
[0012] The Transformer layer includes an efficient multi-head attention mechanism and a hybrid feedforward network;
[0013] The expression of the efficient multi-head attention mechanism is:
[0014]
[0015]
[0016]
[0017]
[0018]
[0019] in, Represents the input features, Q, K, and V represent query, key, and value matrices respectively. 、 and is the corresponding weight matrix; is the dimension of the key vector, is the number of heads, is the output linear transformation matrix; is the feature after downsampling, represents a two-dimensional convolution operation, is the convolution kernel size, is the step length, is the spatial downsampling ratio; It refers to the operation of linear transformation followed by random feature inactivation, while Dropout is a regularization operation applied to the residual connection branch. It is a multi-head attention mechanism, and OutPut is the output;
[0020] S2.2, build an adaptive feature fusion module;
[0021] S2.3. Constructing a multi-scale information fusion decoder based on the adaptive feature fusion module;
[0022] S3. Training the land-sea segmentation model to obtain a trained land-sea segmentation model; inputting the coastline remote sensing image to be segmented into the trained land-sea segmentation model to obtain a land-sea segmentation result map of the remote sensing image.
[0023] Optionally, the encoder includes four Transformer Blocks, namely Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4;
[0024] The Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4 are connected in sequence.
[0025] Optionally, the hybrid feedforward network includes a 1×1 convolutional layer, a 3×3 convolutional layer, an activation function and a Dropout layer;
[0026] The number of Transformer layers in the Transformer Block1 is three, the number of Transformer layers in the Transformer Block2 is four, the number of Transformer layers in the Transformer Block3 is six, and the number of Transformer layers in the Transformer Block4 is three.
[0027] Optionally, the expression of the convolutional attention module is:
[0028]
[0029]
[0030]
[0031]
[0032] in, are input features, is the channel attention weight, is the output after the channel attention module, σ represents the Sigmoid activation function, is the spatial attention weight, is the final output after the spatial attention module.
[0033] Optionally, the decoder includes a pyramid pooling module, two residual convolution blocks, an adaptive feature fusion module, a 1×1 convolution layer, and an upsampling layer; the connection between the two residual convolution blocks is a residual connection;
[0034] The input of the pyramid pooling module is connected to the output of the Transformer Block4, and the pyramid pooling module is used to extract multi-scale context information from the feature map output by the Transformer Block4;
[0035] The two residual convolution blocks are used to extract local features from the feature map output by the pyramid pooling module;
[0036] The adaptive feature fusion module is used to upsample the feature maps output by the two residual convolution blocks and fuse the features of the encoder;
[0037] The 1×1 convolutional layer is used to map the feature map output by the adaptive feature fusion module into a binary land-sea segmentation result map;
[0038] The upsampling layer is used to align the land-sea segmentation result image with the original input image in terms of spatial resolution.
[0039] Optionally, the adaptive feature fusion module includes dynamic snake convolution, 1×1 convolution, a channel attention mechanism based on global average pooling, a channel attention mechanism based on global maximum pooling, and a reverse residual block;
[0040] The expression of the adaptive feature fusion module is:
[0041]
[0042]
[0043] Among them, DSC stands for dynamic snake convolution, Concat stands for channel-level splicing operation, GAP and GMP stand for global average pooling and global maximum pooling respectively, and MLP stands for multi-layer perceptron. is the Sigmoid activation function, It is the feature map after IRB processing.
[0044] Optionally, the number of the adaptive feature fusion modules is three, namely a first adaptive feature fusion module, a second adaptive feature fusion module and a third adaptive feature fusion module;
[0045] The first adaptive feature fusion module is jump-connected to the Transformer Block1;
[0046] The second adaptive feature fusion module is jump-connected to the Transformer Block2;
[0047] The third adaptive feature fusion module is jump-connected to the Transformer Block3, and the outputs of the two residual convolution blocks are connected to the third adaptive feature fusion module;
[0048] The third adaptive feature fusion module, the second adaptive feature fusion module, and the first adaptive feature fusion module are connected in sequence.
[0049] Optionally, both of the two residual convolution blocks include Conv3×3, batch normalization and ReLU activation functions;
[0050] The expressions of the two residual convolution blocks are:
[0051]
[0052] Where X is the input feature map, and F(X) is the output after several layers of convolution, activation, normalization, etc.
[0053] The beneficial effects of the present invention are as follows: a trained land-sea segmentation model is obtained by training a coastline image through constructing a land-sea segmentation model, and the coastline image to be segmented is input into the trained land-sea segmentation model to obtain a land-sea segmentation result; wherein, in the encoding stage, the land-sea segmentation model introduces a convolutional block attention module and an efficient multi-head attention mechanism to form a dual-attention encoder for fully combining global context with local information to enhance the ability to capture key areas and edge details; in the decoding stage, a pyramid pooling module, a residual convolution block and an adaptive feature fusion module are introduced to form a decoder with multi-scale information fusion capability, which can effectively retain low-level edge information, while gradually integrating semantic features from high levels, enhancing the association between features of different resolutions, and ultimately depicting more accurate coastline details, and finally obtaining accurate land-sea segmentation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic flow chart of a land-sea segmentation method based on a dual attention mechanism provided in an embodiment of the present invention;
[0055] Figure 2 This is an overall block diagram of a land-sea segmentation method based on a dual attention mechanism provided in an embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a convolutional attention module provided in an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of a Transformer Block provided in an embodiment of the present invention;
[0058] Figure 5 Schematic diagram of an adaptive feature fusion module provided in an embodiment of the present invention;
[0059] Figure 6 The segmentation result diagram of the test image based on the GF-HNCD dataset;
[0060] Figure 7 This is the segmentation result diagram based on the test image in the BSD dataset;
[0061] Figure 8 This is the result diagram of the ablation experiment. DETAILED DESCRIPTION
[0062] The technical solution of the present invention is further elaborated in detail below in conjunction with the drawings and specific embodiments of the specification. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. In the following description, reference is made to "some embodiments", which describes a subset of all possible embodiments, but it should be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0063] In the following description, numerous specific details are provided to provide a more thorough understanding of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced without one or more of these details. In other instances, certain technical features well known in the art are not described to avoid confusion with the present invention.
[0064] It should be understood that the present invention can be implemented in different forms and should not be interpreted as being limited to the embodiments proposed herein. On the contrary, providing these embodiments will make the disclosure thorough and complete, and will fully convey the scope of the present invention to those skilled in the art. And the purpose of the terms used herein is only to describe specific embodiments and is not intended to limit the present invention. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates another way. It should also be understood that the terms "comprising" and / or "comprising" when used in this specification determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0065] It should also be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "inner," "outer," "left," "right," and similar expressions used herein are for illustrative purposes only and do not represent the only implementation methods.
[0066] In order to fully understand the present invention, a detailed structure will be provided in the following description to illustrate the technical solution proposed by the present invention. Optional embodiments of the present invention are described in detail below. However, in addition to these detailed descriptions, the present invention may also have other implementations.
[0067] Example
[0068] Please refer to the attached Figure 1 and attached Figure 2 , this application provides a land-sea segmentation method based on a dual attention mechanism, comprising the following steps:
[0069] S1, obtaining a remote sensing image, and preprocessing the remote sensing image to obtain a coastline remote sensing image to be segmented;
[0070] Specifically, images containing land and sea areas are acquired from satellites, drones, or other remote sensing platforms, and preprocessed, such as denoising, correction, and contrast enhancement, to improve image quality. Through preprocessing, clearer coastline images are obtained.
[0071] S2. Constructing a land-sea segmentation model with a dual attention mechanism:
[0072] S2.1. Constructing an encoder with dual attention mechanism;
[0073] The encoder includes four Transformer Blocks, each of which includes a patch embedding layer, a Transformer layer, a convolutional attention module, and an Overlap Patch Merging layer;
[0074] The Transformer layer includes an efficient multi-head attention mechanism and a hybrid feedforward network;
[0075] The expression of the efficient multi-head attention mechanism is:
[0076]
[0077]
[0078]
[0079]
[0080]
[0081] in, Represents the input features, Q, K, and V represent query, key, and value matrices respectively. 、 and is the corresponding weight matrix; is the dimension of the key vector, is the number of heads, is the output linear transformation matrix; is the feature after downsampling, represents a two-dimensional convolution operation, is the convolution kernel size, is the step length, is the spatial downsampling ratio; It refers to the operation of linear transformation followed by random feature inactivation, while Dropout is a regularization operation applied to the residual connection branch. It is a multi-head attention mechanism, and OutPut is the output;
[0082] S2.2, build an adaptive feature fusion module;
[0083] S2.3. Constructing a multi-scale information fusion decoder based on the adaptive feature fusion module;
[0084] S3. Training the land-sea segmentation model to obtain a trained land-sea segmentation model; inputting the coastline remote sensing image to be segmented into the trained land-sea segmentation model to obtain a land-sea segmentation result map of the remote sensing image.
[0085] Specifically, a land-sea segmentation model (DA-MiTUNet) including an encoder and a decoder with a dual attention mechanism is constructed, wherein the encoder is used to extract features from coastline images to obtain features with multiple resolutions; the decoder is used to fuse the multiple features with different resolutions; the remote sensing image is preprocessed to obtain a coastline image, which is then input into the land-sea segmentation model for training. After the trained land-sea segmentation model is obtained, the remote sensing image to be segmented is input into the trained land-sea segmentation model to obtain a segmentation result map of the remote sensing image.
[0086] As an optional implementation, the encoder includes four Transformer Blocks, namely Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4;
[0087] The Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4 are connected in sequence;
[0088] It should be noted that the Vision Transformer (ViT) differs from traditional image processing models in that it divides the input image into fixed-size patches and converts them into sequence data for processing, leveraging the Transformer's powerful representation capabilities and self-attention mechanism to learn and process image data. However, ViT uses fixed-size patches and static position encoding, lacks a hierarchical structure, and fails to effectively utilize multi-scale features, resulting in limited feature representation capabilities when processing complex images and high computational complexity. The Mix Transformer (MiT) addresses these issues by employing a hierarchical Transformer encoder that can generate multi-level and multi-scale features from the input image, including high-resolution shallow features and low-resolution deep features, thereby improving the accuracy of semantic segmentation. Unlike ViT, MiT adopts a position-free encoding design and uses 3×3 convolutions to represent position information. This approach better understands the spatial relationship between pixels, further improving efficiency, accuracy, and robustness. Therefore, the land-sea segmentation model in this invention constructs an encoder based on MiT.
[0089] For details, please refer to the attached Figure 4, the preprocessed coastline image is input to the encoder. First, the preprocessed coastline image is downsampled through Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4 in sequence. In the Transformer layers of Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4, different "patch_sizes" (7, 3, 3, 3) and "strides" (4, 2, 2, 2) are used respectively to obtain feature maps with 1 / 4, 1 / 8, 1 / 16 and 1 / 32 resolutions respectively; in each Transformer Block, the image is first divided into small blocks and flattened into vectors through the patch embedding layer, and then processed through the Transformer layer. The feature map after processing by the Transformer layer will enter the Overlap Patch Merging The layer merges overlapping small blocks. This layer introduces overlapping areas between small blocks of the feature map, performs downsampling and merging, so as to effectively preserve the continuity of local features, generate richer and spatially consistent features, and provide better input for the next encoding stage. Based on this, the encoder can gradually extract and fuse multi-scale features of the image, providing rich feature information for downstream decoders and classification tasks.
[0090] The hybrid feedforward network includes a 1×1 convolutional layer, a 3×3 convolutional layer, an activation function and a Dropout layer;
[0091] The number of Transformer layers in Transformer Block 1 is three, the number of Transformer layers in Transformer Block 2 is four, the number of Transformer layers in Transformer Block 3 is six, and the number of Transformer layers in Transformer Block 4 is three;
[0092] Specifically, each Transformer layer includes an efficient multihead attention mechanism (Efficient Multihead Attention) and a mixed feedforward network (MixFFN), which are used to capture long-range dependencies between features and perform nonlinear transformations, respectively. The Efficient Multihead Attention mechanism introduces a spatial downsampling ratio (sr_ratio). This reduces computational complexity by using an "sr_ratio × sr_ratio" convolutional layer to reduce the input dimensionality before processing the query and key-value pairs. When calculating attention, it adaptively adjusts the spatial resolution of the input features to ensure effective extraction of long-range dependencies at different scales, capturing the interrelationships between features globally. The MixFFN combines 1×1 convolutions with 3×3 depthwise convolutions to expand the feature dimensionality and enhance spatial feature extraction while maintaining computational efficiency. Nonlinear transformations are then performed using an activation function (GELU) and dropout.
[0093] As an optional implementation, please refer to the attached Figure 3 , the expression of the convolutional attention module is:
[0094]
[0095]
[0096]
[0097]
[0098] in, are input features, is the channel attention weight, is the output after the channel attention module, σ represents the Sigmoid activation function, is the spatial attention weight, is the final output after the spatial attention module;
[0099] The convolutional block attention module combines channel attention and spatial attention sequentially to refine input features in two stages. It performs weighted optimization of channel and spatial information in a local range, allowing the model to first focus on "which channels are important" and then "which spatial locations are important." By inferring attention along these two dimensions, it achieves the goal of adaptively optimizing image features, thereby more comprehensively capturing key information in the features.
[0100] Specifically, the convolutional block attention module is integrated into the end of the Transformer layer, enabling it to retain global context while further improving its perception of details and boundaries. By combining the convolutional block attention module with an efficient multi-head attention mechanism to form a dual-attention encoder, the feature maps processed by multiple Transformer encoder layers undergo channel-wise and spatial attention adjustments, enhancing the model's focus on important features while suppressing interference from unimportant information to a certain extent, resulting in more discriminative feature output.
[0101] As an optional implementation, the decoder includes a pyramid pooling module, two residual convolution blocks, an adaptive feature fusion module, a 1×1 convolution layer, and an upsampling layer; the connection between the two residual convolution blocks is a residual connection;
[0102] The input of the pyramid pooling module is connected to the output of the Transformer Block4, and the pyramid pooling module is used to extract multi-scale context information from the feature map output by the Transformer Block4;
[0103] The two residual convolution blocks are used to extract local features from the feature map output by the pyramid pooling module;
[0104] The adaptive feature fusion module is used to upsample the feature maps output by the two residual convolution blocks and fuse the features of the encoder;
[0105] The 1×1 convolutional layer is used to map the feature map output by the adaptive feature fusion module into a binary land-sea segmentation result map;
[0106] The upsampling layer is used to align the land-sea segmentation result image with the original input image in terms of spatial resolution;
[0107] Specifically, after feature extraction by the encoder's four Transformer blocks, contextual information at different scales is obtained, namely features at 1 / 4, 1 / 8, 1 / 16, and 1 / 32 resolutions, including high-resolution shallow features and low-resolution deep features. Shallow features typically have higher spatial resolution, so they retain rich details such as low-level visual features like edges, texture, and color, which are crucial for locating the boundaries of segmented objects. Low-resolution deep features, derived from the latter layers of the backbone network, have a larger receptive field, provide broader global contextual information, and possess a strong ability to abstract objects, helping the land and sea segmentation model understand the complex content of remote sensing images and make global semantic judgments. A hierarchical decoder is designed based on a multi-scale fusion strategy, consisting of a pyramid pooling module, two consecutive residual convolutional blocks, an adaptive feature fusion module, a 1×1 convolutional layer, and an upsampling layer. This allows the model to preserve fine boundary information while ensuring overall semantic consistency.
[0108] As an optional implementation, please refer to the attached Figure 5 The adaptive feature fusion module includes dynamic snake convolution, 1×1 convolution, channel attention mechanism based on global average pooling, channel attention mechanism based on global maximum pooling, and reverse residual block;
[0109] The expression of the adaptive feature fusion module is:
[0110]
[0111]
[0112] Among them, DSC stands for dynamic snake convolution, Concat stands for channel-level splicing operation, GAP and GMP stand for global average pooling and global maximum pooling respectively, and MLP stands for multi-layer perceptron. is the Sigmoid activation function, is the feature map after IRB processing;
[0113] Specifically, the Adaptive Feature Fusion Module (AFFM) first introduces dynamic snake convolution to enhance the spatial adaptability of shallow features (S_low), better capturing irregularly deformed regions and overcoming the limitations of a fixed receptive field. Subsequently, the upsampled deep features are concatenated with shallow feature maps enhanced by dynamic snake convolution, and 1×1 convolution is used to reduce redundancy in the channel dimension to form the fused feature map S1. This fused feature map contains rich semantic information and fine spatial details, addressing the shortcomings of single features. The Adaptive Feature Fusion Module (AFFM) then introduces a channel-wise attention mechanism based on global average pooling (GAP) and global max pooling (GMP). This mechanism generates attention weights to dynamically adjust the importance of different feature channels, promoting information flow between different feature layers. Finally, an inverted residual block (IRB) is applied to feature map S1 and element-wise multiplied with the previous attention weights to produce the final output, effectively fusing multi-scale features.
[0114] The number of the adaptive feature fusion modules is three, namely a first adaptive feature fusion module, a second adaptive feature fusion module and a third adaptive feature fusion module;
[0115] The first adaptive feature fusion module is jump-connected to the Transformer Block1;
[0116] The second adaptive feature fusion module is jump-connected to the Transformer Block2;
[0117] The third adaptive feature fusion module is jump-connected to the Transformer Block3, and the outputs of the two residual convolution blocks are connected to the third adaptive feature fusion module;
[0118] The third adaptive feature fusion module, the second adaptive feature fusion module, and the first adaptive feature fusion module are connected in sequence;
[0119] Specifically, during the decoding process of the decoder, the features output by the two residual convolution blocks are sent to the third adaptive feature fusion module, and then fused with the shallower high-resolution features (1 / 16 resolution features) obtained by inputting into Transformer Block3. The fused features are then sent to the second adaptive feature fusion module, where they are fused with the shallower high-resolution features (1 / 8 resolution features) obtained by inputting into Transformer Block2. The fused features are then sent to the first adaptive feature fusion module, where they are fused with the shallower high-resolution features (1 / 4 resolution features) obtained by inputting into Transformer Block1. Through the above process, upsampling and feature fusion are performed layer by layer. Finally, a 1x1 convolution layer is used to compress the number of channels to the number of categories, and the segmentation result is generated. At the same time, the result is upsampled through the upsampling layer (upSample) to ensure that the output has the same spatial size as the input (i.e., 512×512) to obtain the final result.
[0120] As an optional implementation, both of the two residual convolution blocks include Conv3×3, batch normalization, and ReLU activation functions;
[0121] The expressions of the two residual convolution blocks are:
[0122]
[0123] Where X is the input feature map, and F(X) is the output after several layers of convolution, activation, normalization, etc.
[0124] Specifically, in the decoder, a pyramid pooling module first extracts multi-scale contextual information from the deepest 1 / 32 resolution features, further expanding the model's receptive field and enhancing its understanding of global information. The features processed by the pyramid pooling module are then fed into two consecutive residual convolutional blocks for further processing. These residual convolutional blocks incorporate Conv3×3, batch normalization, and ReLU activation functions. These convolutional blocks extract local features while preserving global information, thereby enhancing the representation of high-level semantic features. The residual connection design also alleviates the vanishing gradient problem during network training and ensures smoother information flow. Subsequently, the decoder progressively upsamples the feature maps through three adaptive feature fusion modules (AFFMs) and fuses shallower, higher-resolution features from the encoder, ensuring that important details are not lost while reconstructing the spatial resolution of the features. Finally, a 1×1 convolutional layer maps the feature maps into a binary land-sea segmentation result. A final upsampling layer ensures that the segmentation result is fully aligned with the original input image in terms of spatial resolution.
[0125] In this paper, four Transformer blocks are used as the encoder to enhance the model's ability to extract multi-scale features. The decoder, consisting of two consecutive residual convolution blocks and three Adaptive Feature Fusion Modules (AFFMs), is then combined with a pyramid pooling module and dynamic snake convolution. These two modules further enhance the model's receptive field, its ability to capture spatial dependencies, and its ability to refine feature representations. During the encoding process, multi-scale features are extracted layer by layer by generating feature maps at 1 / 4, 1 / 8, 1 / 16, and 1 / 32 resolutions, ensuring rich contextual information is captured. We also integrate a convolutional attention module at the end of each Transformer layer, enabling it to preserve global context while further enhancing the perception of details and boundaries. During decoding, higher-resolution features from shallower encoder layers (1 / 4, 1 / 8, and 1 / 16 resolution features) are directly passed to the Adaptive Feature Fusion Module (AFFM) via skip connections for feature fusion, helping to recover detailed edge information. Features from the deepest layer (1 / 32 resolution) are first aggregated through a Pyramid Pooling Module (PPM) for multi-scale context, enhancing the global receptive field of the features. These features are then fed into two convolutional blocks (Conv Block 1 and Conv Block 2) with residual connections for further refinement. The residual connections mitigate the vanishing gradient problem. Subsequently, upsampling and feature fusion are performed layer by layer, culminating in a 1x1 convolutional layer to reduce the number of channels to the number of categories and generate the segmentation result. This result is then upsampled by an upsampling layer to ensure the output has the same spatial size as the input (i.e., 512×512), resulting in the final segmentation result.
[0126] In order to verify the segmentation effect of the land-sea segmentation method based on the dual attention mechanism provided in the present invention, the hardware configuration includes an Intel Core i7-13700KF CPU, an NVDIA GeForce RTX 4080-16GB GPU, 32GB RAM and a Windows 10 operating system. The software versions include PyTorch 1.10.0 and Python 3.8.18. During the training process, AdamW is used as the optimizer, the batch size is set to 6, the initial learning rate is 5e-4, and 200 epochs are trained. The cross-entropy loss function is also used.
[0127] Take the following dataset:
[0128] a) GF-HNCD
[0129] The GF-HNCD dataset, acquired by the GF-1 WFV satellite at a distance of 16 meters, contains eight raw remote sensing images (RSIs), each with a resolution of 12,000 × 13,400 pixels. For ease of processing and analysis, the original images and their labels were cropped to 512 × 512 pixels, totaling 5,010 images. The images include red, green, and blue bands (corresponding to a 4-3-2 band combination), with clear annotations for ocean and land categories.
[0130] b) Benchmark land-sea dataset
[0131] The Benchmark Sea-Land Dataset (BSD) is a high-quality dataset of coastlines along China's coastal waters, constructed from Landsat-8 OLI images through preprocessing steps such as cropping, denoising, and enhancement, as well as manual semantic annotation. The dataset includes 1,950 training images of 512 × 512 pixels and 1,411 validation and test images of the same size. Rivers and lakes in the images are considered land, resulting in two categories: land and sea. For the experiments, images with the red-green-blue (4, 3, 2) bands were selected.
[0132] Since the land-sea segmentation model of this invention is primarily used for land-sea segmentation in remote sensing images, a subtask of semantic segmentation, we use common semantic segmentation evaluation metrics such as MIoU and mean F1 score (mF1-Score) as quantitative evaluation metrics to assess the model's segmentation performance. Furthermore, to objectively and comprehensively evaluate the model's effectiveness, we also incorporate visual interpretation methods to qualitatively assess the model's ability to extract small-scale features of the land-sea boundary.
[0133] To better understand the model performance, we use the confusion matrix to calculate the model's MIoU and mean F1 score (mF1-Score). The evaluation index calculation formula is as follows:
[0134]
[0135]
[0136]
[0137]
[0138] Among them, TP, FP, FN and TN are true positive, false positive, false negative and true negative respectively.
[0139] The specific experiments are as follows:
[0140] Based on the two datasets (a) and (b), experiments and comparisons were conducted using U-Net, PSPNet, UPerNet, SwinUnet, SegFormer, and TCUnet, along with the land-sea segmentation model provided by the present invention. U-Net and PSPNet are classic CNN-based segmentation models, while UPerNet is a multi-task learning framework designed based on CNN, Feature Pyramid Network (FPN), and Pyramid Pooling Module (PPM). SegFormer and SwinUnet are pure Transformer-based models, while TCUnet is a hybrid model combining CNN and Transformer. U-Net uses a vanilla fully convolutional network without a specific pre-trained backbone, while PSPNet and UPerNet use ResNet50 as their backbone networks. SegFormer uses MiT-B0 as its backbone network, and SwinUnet's backbone network consists of multiple Swin Transformer blocks. TCUnet's CNN branch and Transformer branch use ResNet and PVT V2 as their backbone networks, respectively.
[0141] The experimental environment for the above models was kept consistent, and the results of each model were evaluated using two different datasets to increase dataset diversity. Furthermore, to ensure experimental fairness, these models were not pre-trained. Through experimental comparison, we can more comprehensively evaluate the performance of the land-sea segmentation model provided by this invention in the land-sea segmentation task of remote sensing imagery. The segmentation results are shown in Table 1:
[0142] Table 1 Comparison of performance and segmentation effects of different models
[0143]
[0144] The data in Table 1 shows the quantitative evaluation indicators of different models on the GF-HNCD and BSD datasets. The results show that the land-sea segmentation model provided by the present invention outperforms other comparison models in two key indicators, mF1 and MIoU. In the above two datasets, mF1 reached 97.46% and 97.36%, respectively, while MIoU reached 96.96% and 96.77%, respectively. From the analysis of the data in the table, it can be seen that the hybrid model TCUnet that combines CNN and Transformer performs better than SegFormer and SwinUnet based on pure Transformer, and SegFormer shows higher classification accuracy than CNN-based methods. Although SwinUnet combines the excellent global modeling capabilities of the Swin Transformer block, the model ignores fine-grained spatial position information during the stacking process, resulting in insufficient precise alignment of spatial information, resulting in loss of edge information. This makes SwinUnet's performance on the BSD dataset inferior to PSPNet and UPerNet, and only better than U-Net. On the GF-HNCD dataset, PSPNet achieved the highest segmentation accuracy among CNN-based methods, outperforming U-Net and UPerNet, and only slightly falling behind UPerNet on the BSD dataset. This is due to its introduction of the Pyramid Pooling Module (PPM), which captures multi-scale contextual information through pooling operations at different scales, thereby enhancing the model's perception of objects of varying scales. UPerNet, while combining the Feature Pyramid Network (FPN) and the Pyramid Pooling Module (PPM) to form a multi-task learning framework, achieved similar performance to PSPNet on the single semantic segmentation task.
[0145] We also introduce two metrics, parameters and floating-point operations (FLOPs), to measure the complexity and computational efficiency of each model. Parameters refer to the total number of parameters required to train a model, typically expressed in units of "millions (M)" or "billions (B)." Floating-point operations (FLOPs) are a measure of the model's computational complexity, representing the number of floating-point operations required during a single forward pass, typically expressed in "G" (i.e., one billion floating-point operations). As shown in Table 1, the UPerNet model has the highest number of parameters and floating-point operations, reaching 64.12M and 238G respectively. In comparison, the land-sea segmentation model provided by this invention strikes a balance between these two aspects. While SegFormer based on MiT-B0 and TCUNet based on ResNet and PVT V2 both have fewer parameters and FLOPs, making them more portable, experimental results demonstrate that the land-sea segmentation model provided by this invention surpasses all compared models in segmentation accuracy while maintaining low computational overhead.
[0146] Please refer to the attached Figure 6 and Figure 7 , Figure 6 The segmentation results of all comparison methods on the test images based on the GF-HNCD dataset are shown. Figure 7 The segmentation results of all comparison methods on the test image based on the BSD dataset are shown; among them, (a) Unet, (b) PSPNet, (c) UPerNet, (d) SwinUnet, (e) SegFormer, (f) TCUNet, and (g) DA-MiTUNet. It can be seen that the land-sea segmentation model provided by the present invention achieves better segmentation results than the other six comparison models, especially in the area marked by the orange rectangle. Based on the differences in land-sea characteristics and segmentation results of remote sensing images, we further focus on the impact of the following five typical situations on extreme sea level event prediction and coastal risk assessment:
[0147] (1) Aquaculture areas, biomes and plankton
[0148] like Figure 7 As shown, Figure 7 The first and second images show a significant amount of ambiguous information (organisms or suspended matter) in coastal areas. In remote sensing imagery, because the color and texture of organisms or suspended matter are similar to those of adjacent land, ignoring overall texture information and classifying based solely on pixel features can easily lead to the model failing to effectively distinguish between water and land. During semantic segmentation, the model may over-rely on local features and fail to fully integrate global contextual information, making it difficult to discern the environmental relevance and spatial distribution characteristics of these areas, leading to ambiguous land-sea boundary segmentation. Visual inspection shows that our model effectively avoids misclassification of these ambiguous features as land, preserving boundary detail and maintaining segmentation integrity better than other models. Comparison results show that only Models f and g avoid misclassifying organisms or suspended matter as land; the other comparison models all exhibit varying degrees of misclassification. While Model f avoids these errors, it suffers from under-detection of islands in the ocean, resulting in some islands being misclassified as land, demonstrating its limitations in recognizing complex boundaries. The land-sea segmentation model provided by the present invention effectively reduces these misjudgments and also demonstrates higher recognition in processing fuzzy areas, thereby generating a clearer land-sea segmentation boundary.
[0149] like Figure 7 As shown, Figure 7The third image shows a typical aquaculture area, which often has clearly defined boundaries. Comparing the results in the figure, models a, c, and e failed to correctly identify the aquaculture area. Models d and f misclassified or omitted certain boundaries, resulting in a lack of clarity and a broken outline where the aquaculture area meets the land. While model b correctly segmented the land-sea boundary, our model went a step further and identified small patches of land within the water, demonstrating excellent boundary differentiation and small-scale object recognition capabilities, highlighting its superiority in recognizing complex backgrounds and details.
[0150] (2) Complex mixed coastline
[0151] like Figure 6 As shown, Figure 6 The first image depicts a coastline type with aquaculture areas mixed with silt, which is classified as land in the label. From the segmentation results, it can be seen that all models except model C can segment the land-sea boundary relatively completely. However, our model further demonstrates its strong adaptability and processing effect in the waterway in the yellow box in this area. Figure 7 As shown, Figure 7 The fourth picture shows a mixed coastline composed of a variety of complex geographical features such as aquaculture areas, biological communities and bedrock coastlines. It can be seen that when the land-sea segmentation model provided by the present invention processes fine structures such as aquaculture areas, the details of the land-sea edge remain clearer and more consistent with the shape of the label image. In contrast, other models such as a, b, c and e divide the coastal aquaculture areas and the land into a whole, resulting in a significant extension of the land-sea boundary to the sea. The land-sea edge of d and f both show a jagged edge effect, presenting an irregular and rough boundary. This jagged effect is usually due to the fact that the model does not refine the features finely enough during the decoding stage, resulting in a lack of accuracy in the classification of edge areas. Overall, the land-sea segmentation model provided by the present invention can better capture the terrain contours and retain the details of tiny ridges and depressions, which is crucial for the accurate identification of mixed coastlines.
[0152] (3) Narrow waterways, artificial structures and small harbors
[0153] like Figure 6 As shown, Figure 6 The second and third pictures Figure 7The fifth and sixth figures show the advantages of our model in identifying narrow waterways. As small-scale features in remote sensing images, narrow waterways are usually difficult to extract accurately due to their limited spatial range and slender, curved shapes, which poses a challenge to fine coastline segmentation. However, from the comparison of various segmentation results, it can be seen that the land-sea segmentation model provided by the present invention can more finely capture the complete shape and clear boundaries of these narrow waterways, showing stronger recognition capabilities. In addition, Figure 6 Figures 4 through 6 show artificial coastlines constructed with materials such as concrete and masonry, including breakwaters, docks, and ports. Comparing the segmentation results of various models, our model accurately extracts the outlines and boundaries of these artificial structures even against complex backgrounds and in areas with unclear color transitions, preserving the integrity of the artificial coastline. It can also accurately distinguish between different types of man-made structures, resulting in a more realistic rendering of the spatial layout and morphology of these structures. These results further demonstrate our model's strengths in handling small-scale features and complex terrain.
[0154] Figure 6 and Figure 7 The yellow frame in the seventh picture shows a semi-enclosed water area with a tortuous and complex coastline, belonging to a small harbor water area. Figure 6 In the data, models a and b showed some ability in processing small harbor areas, but failed to fully identify the waters within the harbor, with some misclassification. Model c performed the worst. Models d to g were able to basically identify the morphological characteristics of the harbor, but our model performed the best. Figure 7 All models correctly identified harbor waters, but with varying degrees of completeness. Models a, b, c, and e all misclassified green vegetation near harbors as ocean to varying degrees, demonstrating a lack of ability to eliminate internal errors.
[0155] From the segmentation tasks mentioned above, ranging from narrow waterways and small harbors to artificial coastlines, it can be seen that our model shows obvious advantages in small-scale feature extraction. It can accurately identify and preserve the complete form of the target in complex backgrounds and subtle boundaries, effectively avoid misclassification, and demonstrate strong adaptability and detail capture capabilities for a variety of complex landforms.
[0156] (4) Misjudgment of ships and green vegetation (internal error)
[0157] Figure 7 The eighth to tenth figures show a case where green vegetation and ships were misclassified. The three remote sensing images in this case all showed high clarity, but in the coastline extraction task, green vegetation within the land area was misclassified as ocean, and a cargo ship sailing in the sea was classified as land. Figure 7In the eighth and ninth figures, the vegetation areas were misidentified as oceans by other models (such as a, b, c, and e) to varying degrees. Our model successfully avoided such misjudgments through more refined feature extraction and effective use of contextual information, accurately restoring green vegetation-covered areas to land. Figure 7 The yellow box in the tenth figure shows a cargo ship sailing in the ocean. Only models b and g fail to classify it as land. This type of misclassification likely stems from a lack of contextual information and confusion caused by the ship's small size. The comparison results show that the land-sea segmentation model provided by the present invention is superior in eliminating internal errors.
[0158] (5) Impact of remote sensing image resolution
[0159] Figure 6 The eighth and ninth images show a case study of low resolution remote sensing images. In this case, we can see that these two remote sensing images have limited ability to identify features due to low resolution, blurred details, uneven illumination, significant noise interference, and insufficient contrast, making it difficult to meet the needs of high-precision remote sensing analysis. Figure 6 In the eighth image, the yellow frame of model a exhibits a distinct grid-like pattern and localized discontinuities. This phenomenon is often caused by the model's inability to effectively capture subtle boundary and continuity features in low-resolution and noisy inputs, resulting in a coarse and lacking edge description, resulting in noticeable unevenness. Models b and f both suffer from insufficient image resolution, misclassifying highly reflective areas with uneven lighting and inconsistent reflectance as land. Model c completely fails to effectively distinguish between land and ocean. Figure 6 In the ninth image, all models exhibit varying degrees of misclassification due to interference from factors such as cloud cover and atmospheric scattering. Only models e and g are able to fully restore the land and sea areas. This comparison demonstrates that our model benefits from its ability to fuse multi-scale features and represent deep features. Its feature extraction module effectively enhances feature contrast while addressing noise and low-resolution image quality, effectively mitigating the adverse effects of these low-quality images. Therefore, the land and sea segmentation model provided by this invention exhibits superior noise immunity, effectively avoiding severe misclassifications caused by insufficient resolution, and thus possesses greater reliability in practical remote sensing applications.
[0160] In the context of extreme sea level events, accurate land-sea segmentation is crucial for monitoring and analyzing coastal changes. First, areas such as aquaculture areas, biomes, and plankton, similar to the surrounding land, are prone to segmentation errors, posing challenges to the accurate monitoring and assessment of phenomena such as seawater erosion and intrusion. Our model, through refined segmentation methods, accurately identifies these complex areas, providing a reliable data foundation for coastal environmental change. Furthermore, artificial structures such as breakwaters and harbors significantly influence coastal flow patterns and coastal erosion during extreme sea level events, such as heavy rainfall, tides, or storm surges. Accurately identifying the complete outlines of these artificial structures helps assess their effectiveness in flood control and coastal erosion mitigation. Our model, by accurately extracting these artificial structures, helps predict their protective effects under extreme climatic conditions, providing important support for coastal protection systems, such as assessing their effectiveness in controlling water flow and maintaining coastal stability during heavy rainfall and storm surges. Furthermore, narrow waterways and small harbors are often sensitive areas where water converges, which can lead to dramatic water level fluctuations and widespread flooding during extreme sea level events. Our model demonstrates strong adaptability in identifying these small-scale features, enabling accurate assessments of flooding risks that may occur during extreme events, and providing reliable reference information for flood prevention planning and response measures in coastal areas. Regarding the misidentification of green vegetation, traditional semantic segmentation models are often prone to misclassification, while the lack of features and noise interference in low-resolution images further affect classification accuracy. In the context of extreme sea level events, accurate identification of green vegetation is crucial for assessing ecosystem health and marine socioeconomic impacts. Our model significantly reduces misjudgments and overcomes the adverse effects of low resolution by fully utilizing contextual information and fusing multi-scale features. These advantages effectively support emergency response and assessment of coastal ecosystem health.
[0161] In summary, through high-precision land-sea segmentation, our model can play an important role in disaster prediction, risk assessment, and vulnerability analysis in coastal areas. It can not only provide strong data support for the effectiveness evaluation of coastal protection facilities, but also provide stable and reliable basic information for the long-term dynamic monitoring of the coastal environment, thereby providing a more solid guarantee for risk response and prevention of extreme sea level events.
[0162] Ablation experiment:
[0163] Ablation experiments were conducted on the BSD dataset to verify the effectiveness of the proposed land-sea segmentation model and its various modules. The performance of each module was evaluated using the metrics MIoU, mF1, and Accuracy. We used UNet as the base convolutional neural network, then replaced its encoder with MiT and gradually added CBAM, (RCB + AFFM), and PPM modules. The (RCB + AFFM) decoder consists of two consecutive residual convolutional blocks (RCB) and three adaptive feature fusion modules (AFFM). Details of the ablation experiment design are shown in Table 2.
[0164] Table 2 Overview of BSD-based ablation experiments
[0165]
[0166] Please refer to the attached Figure 8 , Figure 8 Among them, (a) CNN; (b) MiT (Mix Transformer); (c) MiT + CBAM; (d) MiT + CBAM + (RCB + AFFM) and (e) MiT + CBAM + (RCB + AFFM) + PPM; Table 2 shows the evaluation indicators of the ablation experiment. It can be seen that the MIoU, mF1 and Accuracy of the basic convolutional neural network are 93.27, 95.07 and 95.14% respectively, and from Figure 8 It can be seen that UNet presents the worst classification results, reflecting its shortcomings in edge area processing and global accuracy. Then, after replacing the backbone network of UNet with MiT, the various indicators and segmentation accuracy of the model have been improved, indicating that the efficient multi-head attention mechanism of MiT encoder enhances feature extraction, enabling the model to better capture the complex information in remote sensing images in multi-scale scenarios. After further adding the CBAM module, the various evaluation indicators of the model increased by 1.25%, 0.66% and 0.54% respectively. By comparison Figure 8(b) and (c) show that the misclassification in (c) is further reduced, and the model renders edge details more meticulously. This is because the CBAM module, by modeling channel and spatial attention, enables the model to more effectively focus on important areas. Subsequently, we replaced the decoder with a new decoder consisting of a residual convolutional block (RCB) and an adaptive feature fusion module (AFFM). The segmentation results in Figure 8 (d) show that the model exhibits higher smoothness and consistency in edge transition regions, and the segmentation accuracy of narrow waterways is further improved. Internal errors such as ship misclassification are completely eliminated. This demonstrates that the decoder consisting of RCB and AFFM can effectively fuse and enhance the details of features at different scales during the resolution restoration process, resulting in more accurate segmentation results. Finally, the addition of a pyramid pooling module (PPM) further utilizes multi-scale contextual information to enhance the model's global perception capabilities. Ultimately, the model is more precise and smoother in processing edge details, with improvements of MIoU, mF1, and Accuracy of 3.5%, 2.29%, and 2.14%, respectively, compared to the basic convolutional neural network. This verifies the effectiveness of each module in the task of land and sea segmentation in remote sensing images.
[0167] This paper presents a novel land-sea segmentation model (DA-MiTUNet) that improves existing models' ability to handle complex scenes and capture detailed information by integrating multi-scale feature extraction and multiple attention mechanisms. Specifically, DA-MiTUNet uses the Mix Transformer (MiT) as an encoder, integrating a convolutional block attention module (CBAM) and an efficient multi-head attention mechanism to form a dual-attention encoder. This encoder effectively combines global context with local information to enhance the capture of key areas and edge details. During the decoding phase, residual convolutional blocks and an adaptive feature fusion module (AFFM) are introduced to form a decoder with multi-scale information fusion capabilities. This decoder effectively preserves low-level edge information while gradually integrating higher-level semantic features, enhancing the correlation between features at different resolutions and ultimately depicting more accurate coastline details. Furthermore, a pyramid pooling module (PPM) is integrated to expand the model's global receptive field, enabling it to better capture multi-scale contextual information. Finally, a series of classic semantic segmentation models were compared and evaluated on the GF-HNCD and BSD datasets. The experimental results demonstrated that the land-sea segmentation model proposed in this paper achieved superior segmentation results, highlighting its effectiveness. In summary, the DA-MiTUNet model can provide a more reliable scientific basis for the accurate extraction and dynamic monitoring of coastlines, assisting with ecological protection and resource management in coastal areas. It also possesses greater application value in risk assessment, disaster prediction, and environmental change monitoring related to extreme sea level events.
[0168] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. The scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A land-sea segmentation method based on a dual attention mechanism, characterized in that: The following steps are involved: S1, obtaining a remote sensing image, and preprocessing the remote sensing image to obtain a coastline remote sensing image to be segmented; S2. Constructing a land-sea segmentation model with a dual attention mechanism: S2.
1. Constructing an encoder with dual attention mechanism; The encoder includes four Transformer Blocks, each of which includes a patch embedding layer, a Transformer layer, a convolutional attention module, and an Overlap Patch Merging layer; The Transformer layer includes an efficient multi-head attention mechanism and a hybrid feedforward network; The expression of the efficient multi-head attention mechanism is: in, Represents the input features, Q, K, and V represent query, key, and value matrices respectively. 、 and is the corresponding weight matrix; is the dimension of the key vector, is the number of heads, is the output linear transformation matrix; is the feature after downsampling, represents a two-dimensional convolution operation, is the convolution kernel size, is the step length, is the spatial downsampling ratio; It refers to the operation of linear transformation followed by random feature inactivation, while Dropout is a regularization operation applied to the residual connection branch. It is a multi-head attention mechanism, and OutPut is the output; S2.2, build an adaptive feature fusion module; S2.
3. Constructing a multi-scale information fusion decoder based on the adaptive feature fusion module; S3. Training the land-sea segmentation model to obtain a trained land-sea segmentation model; inputting the coastline remote sensing image to be segmented into the trained land-sea segmentation model to obtain a land-sea segmentation result map of the remote sensing image.
2. The land-sea segmentation method based on the dual attention mechanism according to claim 1 is characterized in that: The encoder includes four Transformer Blocks, namely Transformer Block1, Transformer Block2, Transformer Block3 and Transformer Block4; The Transformer Block1, Transformer Block2, Transformer Block3 and TransformerBlock4 are connected in sequence.
3. The land-sea segmentation method based on the dual attention mechanism according to claim 2 is characterized in that: The hybrid feedforward network includes a 1×1 convolutional layer, a 3×3 convolutional layer, an activation function and a Dropout layer; The number of Transformer layers in the Transformer Block1 is three, the number of Transformer layers in the Transformer Block2 is four, the number of Transformer layers in the Transformer Block3 is six, and the number of Transformer layers in the Transformer Block4 is three.
4. The land-sea segmentation method based on the dual attention mechanism according to claim 1, characterized in that: The expression of the convolutional attention module is: in, are input features, is the channel attention weight, is the output after the channel attention module, σ represents the Sigmoid activation function, is the spatial attention weight, is the final output after the spatial attention module.
5. The land-sea segmentation method based on the dual attention mechanism according to claim 2 is characterized in that: The decoder includes a pyramid pooling module, two residual convolution blocks, an adaptive feature fusion module, a 1×1 convolution layer and an upsampling layer; the connection between the two residual convolution blocks is a residual connection; The input of the pyramid pooling module is connected to the output of the Transformer Block4, and the pyramid pooling module is used to extract multi-scale context information from the feature map output by the Transformer Block4; The two residual convolution blocks are used to extract local features from the feature map output by the pyramid pooling module; The adaptive feature fusion module is used to upsample the feature maps output by the two residual convolution blocks and fuse the features of the encoder; The 1×1 convolutional layer is used to map the feature map output by the adaptive feature fusion module into a binary land-sea segmentation result map; The upsampling layer is used to align the land-sea segmentation result image with the original input image in terms of spatial resolution.
6. The land-sea segmentation method based on the dual attention mechanism according to claim 5 is characterized in that: The adaptive feature fusion module includes dynamic snake convolution, 1×1 convolution, channel attention mechanism based on global average pooling, channel attention mechanism based on global maximum pooling, and reverse residual block; The expression of the adaptive feature fusion module is: Among them, DSC stands for dynamic snake convolution, Concat stands for channel-level splicing operation, GAP and GMP stand for global average pooling and global maximum pooling respectively, and MLP stands for multi-layer perceptron. is the Sigmoid activation function, It is the feature map after IRB processing.
7. The land-sea segmentation method based on the dual attention mechanism according to claim 6, characterized in that: The number of the adaptive feature fusion modules is three, namely a first adaptive feature fusion module, a second adaptive feature fusion module and a third adaptive feature fusion module; The first adaptive feature fusion module is jump-connected to the Transformer Block1; The second adaptive feature fusion module is jump-connected to the Transformer Block2; The third adaptive feature fusion module is jump-connected to the Transformer Block3, and the outputs of the two residual convolution blocks are connected to the third adaptive feature fusion module; The third adaptive feature fusion module, the second adaptive feature fusion module, and the first adaptive feature fusion module are connected in sequence.
8. The land-sea segmentation method based on the dual attention mechanism according to claim 5, characterized in that: Both residual convolution blocks include Conv3×3, batch normalization and ReLU activation functions; The expressions of the two residual convolution blocks are: Where X is the input feature map, and F(X) is the output after several layers of convolution, activation, normalization, etc.
Citation Information
Patent Citations
Remote sensing image semantic segmentation method based on double-branch feature fusion
CN115797931A
Lightweight remote sensing image urban water area identification method based on Segform and related device
CN118397456A
Cited By
Medical image segmentation method based on reverse residual attention and multi-scale context
CN122336272A