A remote sensing extraction network based on a dynamic state space and a local attention mechanism, and a construction method and an extraction method thereof
By introducing remote sensing extraction networks with MASS-SSM, DBWA, and D-MDSM modules, the problems of easy breakage of long-distance topological dependencies and insufficient boundary fineness in mangrove remote sensing extraction were solved, achieving efficient and accurate remote sensing monitoring and carbon storage assessment of mangroves.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGXI ACAD OF SCI
- Filing Date
- 2026-05-15
- Publication Date
- 2026-07-14
AI Technical Summary
Existing remote sensing methods for mangrove forest extraction suffer from drawbacks such as easy breakage of long-distance topological dependencies, insufficient boundary fineness, weak multi-scale adaptability, and difficulty in balancing efficiency and accuracy, making it difficult to achieve high-precision and efficient remote sensing monitoring.
A remote sensing extraction network based on dynamic state space and local attention mechanism is adopted. Through the multi-scale adaptive snake scan state space module (MASS-SSM), dynamic deformation and boundary enhancement window attention module (DBWA), and decoupled multi-dimensional dynamic selection mechanism module (D-MDSM), global context modeling, fine edge perception and multi-scale fusion are achieved, thereby improving the completeness and robustness of extraction.
It significantly improves the cross-union ratio, boundary segmentation accuracy, and multi-scale adaptability of mangrove remote sensing extraction, and achieves efficient high-resolution remote sensing image processing. The number of parameters is reduced by 62%, the amount of computation is reduced by 60%, and the inference speed is increased by 132%. The accuracy and efficiency are superior to existing methods.
Smart Images

Figure CN122391884A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical fields of remote sensing image processing and deep learning, and in particular to a remote sensing extraction network based on dynamic state space and local attention mechanism, as well as its construction method and extraction method. Background Technology
[0002] Mangroves, as an important "blue carbon" ecosystem, possess extremely high carbon sequestration efficiency and carbon burial capacity. Accurately obtaining their spatial distribution and area is fundamental for achieving carbon sink assessment and scientific protection. However, mangroves are mostly distributed in the intertidal zone, with patches that are irregularly connected over long distances, having tortuous and fragmented boundaries, and suffering from severe spectral confusion with similar ground features such as water bodies and Spartina alterniflora, posing a significant challenge to large-scale, high-precision remote sensing monitoring. Existing extraction methods mainly include traditional machine learning methods relying on manually designed features, convolutional neural network semantic segmentation methods represented by U-Net and DeepLab, Transformer methods based on self-attention, and emerging state-space model methods. When applied to mangrove extraction, these methods suffer from drawbacks such as poor feature universality, limited local receptive fields making it difficult to capture long-distance dependencies, computational complexity increasing quadratically with image resolution, and insufficient context learning due to fixed scanning paths and limited local modeling capabilities.
[0003] In-depth analysis reveals that the aforementioned shortcomings will lead to four main technical problems in complex mangrove scenarios. First, existing state-space models generally employ fixed-direction bidirectional scanning, forcibly flattening two-dimensional images into a one-dimensional sequence. This disrupts the natural curvature and bifurcation of mangrove topology along tidal channels and coastlines, making it difficult for the model to learn long-distance dependencies that conform to the true geometry of ground features. This results in large-scale continuous patches being prone to fragmentation. Second, local attention mechanisms use fixed square windows to aggregate neighborhood features. For mangroves with irregular edge heights, fixed windows inevitably introduce background noise or truncate key edge structures, diluting the focus on boundary details and causing severe confusion between mangroves and surrounding ground features in transition zones. Third, existing multi-scale feature fusion strategies are mostly limited to weighted selection of the channel dimension. This ignores the spatial differences in receptive field size between the core and edge areas and fails to provide a sufficiently rich combination of scales to match the dramatic scale changes from single trees to large-scale communities. Fourth, while the Transformer method can model global dependencies, its computational overhead is too high. Existing lightweight solutions often sacrifice accuracy, making it difficult to achieve topology-adaptive global modeling, fine-grained deformation edge perception, and multi-dimensional dynamic scale selection while maintaining linear complexity.
[0004] In summary, existing technologies have not effectively addressed the problems of easily broken long-distance topological dependencies, insufficient boundary fineness, weak multi-scale adaptability, and the difficulty in balancing efficiency and accuracy in mangrove remote sensing extraction. Therefore, there is an urgent need to develop new remote sensing extraction technologies that can adaptively match irregular connected structures, dynamically fit curved edges, and decouple multi-dimensional receptive fields. This would systematically improve the integrity, boundary clarity, and multi-scale robustness of mangrove remote sensing extraction while maintaining linear computational complexity. Summary of the Invention
[0005] The purpose of this invention is to provide a remote sensing extraction network based on dynamic state space and local attention mechanism, as well as its construction method and extraction method, which solves at least one of the technical problems of existing mangrove remote sensing extraction schemes, such as easy breakage of long-distance topological dependence, insufficient boundary fineness, weak multi-scale adaptability, and difficulty in balancing efficiency and accuracy.
[0006] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: In a first aspect, the present invention provides a remote sensing extraction network based on dynamic state space and local attention mechanism, including an encoder, a decoder and a jump connection set between the two, and also includes a global-local joint enhancement module and a decoupled multidimensional dynamic selection mechanism module; In each level of the encoder, the global-local joint enhancement module replaces the original standard convolution to output globally enhanced and edge-refined features; The decoupled multidimensional dynamic selection mechanism module is set in each skip connection except the deepest layer of the encoder. It is used to generate dynamic weights in the spatial dimension, channel dimension and scale dimension respectively, and to perform weighted fusion on the multi-scale features obtained by parallel processing of multi-scale depth separable convolution to obtain enhanced skip connection features. In each layer of the decoder, the global-local joint enhancement module replaces the original standard convolution to upsample the deepest features output by the encoder layer by layer and fuse them with the corresponding skip connection features layer by layer to maintain a wide range of connectivity and enhance edge details, and finally outputs a target feature segmentation probability map.
[0007] Furthermore, the global-local joint enhancement module includes: The multi-scale adaptive serpentine scanning state space module is used to selectively model the state space of the input feature map through dynamically generated multi-scale serpentine scanning paths in order to capture long-distance spatial dependencies. The dynamic deformation and boundary enhancement window attention module is set in parallel with the multi-scale adaptive serpentine scanning state space module, and is used to enhance edge details through explicit modeling of deformable windows and boundary probabilities.
[0008] Furthermore, the multi-scale adaptive serpentine scan state space module includes: The path bias field generation unit is used to process the input feature map through a convolutional layer to generate a path bias field with offsets in the height and width directions. A multi-scale serpentine scanning path generation unit is used to generate a path generation network with multiple different scale factors. Based on the path bias field and the previous position, the next position is dynamically determined to generate multiple serpentine scanning paths covering different receptive field ranges. The path continuity and non-repetition are ensured by a regularization function. The state-space model recursion unit is used to expand the input feature map into a sequence along each of the serpentine scanning paths, input it into the selective state-space model for recursive processing, and fold the recursed output sequence back into a two-dimensional feature map along the original path; wherein, the step size parameter of the selective state-space model is dynamically generated by the input to achieve selective information processing; The multi-scale feature fusion unit is used to weight and fuse the two-dimensional feature maps corresponding to each path through an attention mechanism to output a globally enhanced feature map.
[0009] Furthermore, the dynamic deformation and boundary enhancement window attention module includes: The deformation window partitioning unit is used to uniformly lay out the window center point grid on the input feature map and predict the offset for each center point to form a deformation window, so that the window dynamically fits the edge of the target feature. The boundary probability map estimation unit is used to process the input feature map through the boundary detection branch to generate a boundary probability map; The boundary enhancement self-attention calculation unit is used to calculate a boundary enhancement matrix for each deformation window based on the boundary probability map, integrate the matrix into the self-attention calculation of pixels within the window to enhance the feature contribution of edge pixels, and output the enhanced features through multi-head self-attention and feedforward network.
[0010] Furthermore, the decoupled multidimensional dynamic selection mechanism module includes: The multi-scale feature generation unit is used to process the input feature map in parallel through depthwise separable convolutions of various different scales to obtain multi-scale feature maps. A multidimensional routing weight calculation unit is used to generate spatial selection matrix, channel selection matrix and scale selection vector in parallel through a multidimensional routing network; The fusion output unit is used to broadcast and add the spatial selection matrix, channel selection matrix, and scale selection vector, and after mapping by the activation function, multiply and sum them element-wise with the multi-scale feature map to obtain enhanced skip connection features.
[0011] Furthermore, the spatial selection matrix is obtained by Softmax normalization along the channel dimension after convolution; the channel selection matrix is obtained by global average pooling, two fully connected layers, and Softmax normalization along the channel dimension; the scale selection vector is obtained by Softmax normalization of learnable parameters.
[0012] Furthermore, the overall loss function of the extraction network is a weighted sum of Dice loss, cross-entropy loss, and boundary loss; wherein, the boundary loss is obtained by first extracting the edge map of the true label and then calculating the weighted cross-entropy of the predicted probability map in the edge region, so as to enhance the model's sensitivity to edges.
[0013] Secondly, this invention also provides a method for constructing a remote sensing extraction network based on dynamic state space and local attention mechanism, comprising the following steps: Build a U-Net infrastructure that includes encoders, decoders, and jump connections; A global-local joint enhancement module is set at each level of the encoder's feature extraction path to output globally enhanced and edge-refined features. A decoupled multidimensional dynamic selection mechanism module is set on each skip connection outside the deepest layer of the encoder. Through this module, dynamic weights are generated in three dimensions: space, channel, and scale. The multi-scale features output by the multi-scale depth separable convolution are weighted and fused to obtain enhanced skip connection features. Global-local joint enhancement modules are set in each layer of the feature fusion path of the decoder. The deepest output features are upsampled layer by layer and fused with the corresponding skip connection features layer by layer to maintain large-scale connectivity and enhance edge details. Finally, the target land cover segmentation probability map is output to complete the extraction network construction. The constructed extraction network is trained end-to-end using a joint loss function to obtain an optimized extraction network.
[0014] Furthermore, the global-local joint enhancement module is composed of a multi-scale adaptive snake scan state space module and a dynamic deformation and boundary enhancement window attention module in parallel; The multi-scale adaptive snake scan state space module is used to perform long-distance spatial dependency modeling on the input feature map, and the dynamic deformation and boundary enhancement window attention module is used to enhance the edge details of the feature map.
[0015] Thirdly, the present invention also provides an extraction method based on the extraction network described in any of the above claims, comprising the following steps: S1. Acquire the remote sensing image to be processed; S2. Input the remote sensing image into the extraction network, and extract multi-scale feature maps through the encoder; S3. The feature maps of each level of the encoder extraction path are processed by the corresponding global-local joint enhancement module to obtain globally enhanced and edge-refined features. S4. The features output by the encoder, except for the deepest layer, are processed by the decoupled multidimensional dynamic selection mechanism module in their respective skip connections to obtain enhanced skip connection features. S5. The decoder upsamples the deepest features of the output layer by layer through the global-local joint enhancement module and fuses them with the corresponding skip connection features layer by layer to maintain a wide range of connectivity and enhance edge details, and finally outputs the target ground object segmentation probability map.
[0016] This invention addresses the urgent need for high-precision monitoring and carbon sequestration assessment of mangrove ecosystems by proposing an intelligent remote sensing image extraction method that integrates a multi-scale adaptive snake scan state space module (MASS-SSM), a dynamic deformation and boundary enhancement window attention module (DBWA), and a decoupled multidimensional dynamic selection mechanism (D-MDSM). Compared with existing technologies, it has the following significant advantages: 1. Topology-adaptive global context modeling significantly improves the completeness of extracting long-distance connected regions. Existing state-space model-based methods employ fixed horizontal and vertical bidirectional scanning, disrupting the natural topological structure of mangroves distributed along tidal channels and coastlines (e.g., curvature, bifurcation, and network patterns). This invention proposes a MASS-SSM module that dynamically predicts scan path offsets through a lightweight path generation network, generating multi-scale adaptive serpentine scan paths that continuously and smoothly cover irregular areas of mangroves. This design enables the state-space model to learn long-distance contextual dependencies that conform to the actual geometry of mangroves, fundamentally avoiding segmentation breaks or misjudgments caused by improper scan paths. Experiments show that on elongated and curved mangrove patches, the intersection-over-union (IoU) ratio of this invention is 8-12 percentage points higher than traditional bidirectional scanning, and the integrity of large-scale continuous mangrove extraction reaches over 96%.
[0017] 2. Fine-grained deformation edge detection significantly improves boundary segmentation accuracy and anti-aliasing capabilities. Existing local attention mechanisms use fixed square windows, which are prone to introducing background noise or truncating edge structures. This invention's proposed DBWA module innovatively integrates deformable windows with explicit boundary probability modeling: on one hand, it learns an offset for each window center point, allowing the window to dynamically conform to the curved and fragmented edge direction of mangroves; on the other hand, it generates a boundary probability map through a boundary detection branch and enhances the contribution of boundary pixels in the attention calculation. This mechanism effectively solves the problem of mangroves being easily confused with similar features such as water bodies, mudflats, and Spartina alterniflora at the edges. Quantitative evaluation shows that in edge segmentation accuracy metrics (such as boundary intersection-union ratio, Boundary IoU), this invention improves by more than 15% compared to fixed-window attention, and the overall boundary F1 score reaches 0.92, significantly outperforming existing methods.
[0018] 3. Dynamic multi-scale fusion with multi-dimensional decoupling enhances the model's robustness to targets with drastic scale changes. Existing multi-scale dynamic selection mechanisms (SKNet) only perform weighted fusion from the channel dimension, ignoring the diversity of spatial location and different scale combinations. The proposed D-MDSM module generates dynamic weights simultaneously across spatial, channel, and scale dimensions through a lightweight routing network, selecting the most suitable features from a set of multi-scale convolutional kernels (3×3, 5×5, 7×7, dilated convolutions) for each spatial location and channel. This mechanism enables the model to adaptively adjust the receptive field based on the actual scale of the mangrove target (from a single tree to a large-scale community) and its spatial location (core or periphery). On a test set containing mangroves of various scales, the proposed method achieves an average intersection-over-union (mIoU) of 88.7%, a 6.4 percentage point improvement over the original SKNet, with a particularly significant increase in recall for small patches (+12%).
[0019] 4. Linear computational complexity and lightweight design enable efficient, large-scale remote sensing monitoring. All three new modules in this invention maintain linear computational complexity: MASS-SSM is implemented through serpentine scanning and SSM recursion. The complexity of DBWA's deformation window attention is... For window size, usually The multi-scale convolutions in D-MDSM are all depthwise separable convolutions. The overall network parameter count is only 18.7M, the floating-point operation cost (FLOPs) is 112.4G, and the inference speed reaches 42.5 FPS (on an RTX 4090). Compared with Swin-UNet (49.2M parameters, 285.6G FLOPs, 18.3 FPS), this invention reduces the parameter count by 62%, the computational cost by 60%, and improves the inference speed by 132%, achieving an excellent balance between accuracy and efficiency, and can efficiently process full-scene high-resolution remote sensing imagery.
[0020] 5. Systematic experimental verification and application in carbon storage estimation This invention was systematically validated in typical mangrove distribution areas such as Qinzhou, Beihai, and Fangchenggang in Guangxi. A dataset containing 15,000 samples was constructed using multi-source data from Gaofen-2, Sentinel-2, and UAV aerial photography. Comparison with mainstream methods such as U-Net, DeepLab V3+, and Swin-UNet shows that this invention achieves optimal performance in overall accuracy, Kappa coefficient, mIoU, and F1 score, significantly outperforming existing methods. Ablation experiments further confirm that the model performance continuously improves after gradually introducing the MASS-SSM, DBWA, and D-MDSM modules, validating the effectiveness of each module. Based on the extracted results coupled with a carbon storage estimation model, this invention successfully achieved accurate assessment of carbon storage in the Guangxi mangrove ecosystem, with a total carbon storage density of approximately 249.88 Mg / ha (50cm depth) and a total carbon storage of approximately 2.625 million tons. The extracted results show a high degree of agreement with field survey data. This verified the reliability and practical value of the method.
[0021] 6. Good generalization and scalability The modular design proposed in this invention does not rely on a specific encoder backbone network and can be flexibly embedded into various semantic segmentation architectures (such as U-Net, DeepLab, FPN, etc.). Furthermore, this method is not only applicable to mangrove extraction but can also be extended to other remote sensing land cover recognition tasks with similar challenges (long-distance irregular connectivity, blurred edges, and varying scales), such as coastline extraction, river network extraction, and farmland segmentation, demonstrating broad application prospects.
[0022] In summary, this invention, through the synergistic effect of three innovative modules—MASS-SSM, DBWA, and D-MDSM—significantly improves the global continuity, boundary refinement, and multi-scale adaptability of mangrove remote sensing extraction while maintaining linear computational complexity. Its overall performance surpasses existing methods, providing efficient and accurate technical support for coastal ecological monitoring and carbon sequestration assessment. Attached Figure Description
[0023] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a diagram of the overall architecture of the D-Unet network provided in this embodiment; Figure 2 This is a structural diagram of the MSDM module provided in this embodiment; Figure 3 The D provided in this embodiment MDSM module structure diagram; Figure 4 This is a map of the mangrove dataset provided in this embodiment; Figure 5 The image shows the test results of the model provided in this embodiment; Figure 6 This is a stitched image of the two images provided in this embodiment; Figure 7 This is the result of the remote sensing image stitching provided in this embodiment. The red area represents the extracted mangrove forest area. Figure 8 This is a remote sensing intelligent extraction result image of Guangxi mangroves provided in this embodiment. The red area represents the extracted mangrove area. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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, 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.
[0026] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0027] I. Examples This embodiment provides a remote sensing extraction network based on dynamic state space and local attention mechanism. Please refer to... Figure 1-3As shown, an innovative remote sensing extraction network based on the U-Net architecture is proposed to address challenges such as blurred boundaries and poor multi-scale adaptability in the extraction of targets like mangroves. The core of the solution is the introduction of dedicated modules at two key locations in the network: First, a "global-local joint enhancement module" is set at each layer of the encoder and decoder, replacing the standard convolutions at each layer of the original U-Net. At each encoder layer, MSDM performs two types of operations on the feature map at that scale: MASS-SSM captures the long-distance irregular connectivity of mangroves along a multi-directional serpentine path with linear complexity, while DBWA enhances the focus on edge details through deformable windows and boundary probabilities. This ensures that the features output by the encoder layer by layer possess both scale-optimized global context and retain fine-grained boundary responses. Second, a "decoupled multi-dimensional dynamic selection mechanism module" is embedded in all skip connections except the deepest layer. This module significantly enhances the feature quality transmitted by skip connections by dynamically generating weights and fusing multi-scale features in three dimensions: space, channel, and scale. Finally, the decoder not only upsamples the enhanced deep features layer by layer, but also, at each level of the decoder, MSDM fuses the upsampled deep features with the shallow features of skip connections: MASS SSM maintains a broad connectivity prior to avoid fragmentation within large patches, while DBWA further enhances edge localization and detail to distinguish mangroves from similar backgrounds (water bodies, mudflats, etc.). By replacing the original convolution in parallel, the decoder can simultaneously perform global semantic integration and local boundary refinement in each resolution restoration, ultimately outputting a mangrove segmentation result that combines overall coherence and sharp edges. This technical solution, through modular design, systematically enhances the network's comprehensive perception of global context and local details, achieving high-precision and robust extraction of complex remote sensing targets.
[0028] This embodiment also provides a method for constructing a remote sensing extraction network based on dynamic state space and local attention mechanism. Please refer to [link / reference]. Figure 1-3As shown, a method for constructing the aforementioned high-precision remote sensing extraction network is specifically provided. Its core lies in how to systematically integrate three innovative modules to build a complete, trainable model. This construction method follows clear steps: First, a U-Net infrastructure containing encoder and decoder paths is built; then, a "global-local joint enhancement module" is implanted in all feature extraction and fusion layers of the encoder and decoder, enabling global and edge enhancement processing of features at each layer; next, a "decoupled multidimensional dynamic selection mechanism module" is embedded in all skip connections except the deepest layer to achieve dynamic multidimensional enhancement of the transmitted features; then, the processed features are fused according to a specific process, which requires the upsampled features from the decoder to be concatenated and fused with the skip connection features, ultimately outputting a segmentation map, thus completing the network construction; finally, a joint loss function composed of multiple loss functions is used to perform end-to-end training and optimization of the network. The technical solution generated by this construction method deeply integrates global modeling, edge awareness, and multi-dimensional dynamic scale selection capabilities into the standard U-Net structure. This results in a model that has significant advantages in solving problems such as long-distance dependencies and edge confusion, and ultimately obtains a performance-optimized model through training.
[0029] This embodiment also provides an extraction method based on the above-described extraction network. Please refer to [link / reference]. Figure 1-3 As shown, the extraction method works as follows: First, the remote sensing image to be processed is acquired and input. Then, the encoder part of the network performs multi-scale feature extraction on the image. Next, all feature maps extracted at each level, including the deepest features, are processed by the "global-local joint enhancement module" at their respective levels to enhance global and edge information. Shallow feature maps, except for the deepest layer, are processed by the "decoupled multi-dimensional dynamic selection mechanism module" in their respective skip connections to obtain enhanced skip features. Finally, the decoder upsamples the deepest feature map that has completed global and edge enhancement layer by layer and fuses it with the enhanced skip connection features at the corresponding scale layer by layer, ultimately directly outputting the segmentation probability map of the target ground features. This method has a clear process, a high degree of automation, and can complete the entire process from the original remote sensing image to a high-precision ground feature extraction mask from end to end. It effectively overcomes the problems of low efficiency and rough boundaries of traditional methods and is suitable for remote sensing monitoring tasks in large-scale and complex environments.
[0030] II. Specific Implementation (a) Task Definition This invention addresses the semantic segmentation task of remote sensing images of mangrove forests. Given an input remote sensing image... (H, W represent the image height and width, and 3 represents the number of RGB channels). The goal is to predict the class label for each pixel. The scalar model is defined as follows: 1 represents the mangrove area, and 0 represents the background. The core challenge of this task is that the coastal environment is complex (water bodies, mudflats, and other vegetation disturbances), and the mangrove patches are irregular in shape, connected over long distances, with blurred boundaries and dramatic scale variations.
[0031] (II) Overall Network Structure To address the aforementioned issues, this invention proposes a target feature (such as mangrove) extraction network that integrates dynamic state space and local attention mechanisms, named D-Unet. Based on the classic U-Net architecture, this network comprises three main parts: an encoder path, a decoder path, and skip connections. As shown in Figure 1, the encoder extracts multi-scale features layer by layer through convolution and pooling; the decoder gradually restores spatial resolution through upsampling and skip connections, achieving accurate localization.
[0032] To address the specific challenges of extracting target features such as mangroves, this invention introduces three core modules at key locations within the U-Net architecture: 1. Multi-scale Adaptive Serpentine Scan State Space Module (MASS-SSM): By dynamically generating multi-scale serpentine scan paths, it adaptively matches the irregular connected topology of mangroves, efficiently modeling long-distance spatial dependencies with linear computational complexity, and avoiding segmentation and breakage.
[0033] 2. Dynamic Deformation and Boundary Enhancement Window Attention Module (DBWA): Parallel to MASS-SSM, it uses a deformable window to fit the curved edges of mangroves and explicitly models the boundary probability, enhancing the perception of edge details and solving the boundary blurring problem.
[0034] 3. Decoupled Multidimensional Dynamic Selection Mechanism (D-MDSM): By decoupling and dynamically selecting the receptive field in three dimensions—space, channel, and scale—more refined multi-scale feature adaptive fusion is achieved, improving the model's robustness to multi-scale targets.
[0035] The overall process is as follows: 1. Feature extraction: The input remote sensing image is processed by an encoder (such as ResNet-34) to extract feature maps F1, F2, F3, and F4 at four scales, with 64, 128, 256, and 512 channels, respectively.
[0036] 2. Global Context Modeling and Edge Enhancement: The deepest feature map F4 is input into the MSDM module composed of MASS-SSM and DBWA (e.g., Figure 2 As shown), the output features are globally enhanced and have refined edges. .
[0037] 3. Skip Connection Enhancement: Embed D-MDSM modules (such as...) in each layer of skip connections. Figure 3 As shown, multi-dimensional dynamic scale selection is performed on the shallow features F1, F2, and F3 output by the encoder to output enhanced jump features. .
[0038] 4. Decoding and Output: [This section likely refers to a process involving decoding and output.] After upsampling and The data is concatenated, upsampled layer by layer and fused with the corresponding jump features, and finally output as a mangrove segmentation probability map after 1×1 convolution and sigmoid activation function.
[0039] The entire network is trained end-to-end by jointly optimizing the Dice loss, cross-entropy loss, and boundary loss:
[0040] in , .
[0041] (III) Detailed Design of Each Module 3.1 Multi-scale Adaptive Snake Scan State Space Module (MASS-SSM) (1) Module principle Mangroves are irregularly connected along tidal channels and coastlines (e.g., winding, branching, network-like). Existing fixed-direction (horizontal + vertical) scanning disrupts their natural topology. To address this, this invention proposes a multi-scale adaptive serpentine scanning strategy. A lightweight path generation network dynamically predicts the offset of the scanning path, enabling the scanning path to continuously and smoothly cover the irregular areas of the mangroves. Simultaneously, multi-scale scanning is employed to capture the global dependencies of fine textures, medium-width connected regions, and large patches.
[0042] (2) Specific implementation steps Step 1: Path bias field generation Input feature map Through two Convolutional layer generation path bias field :
[0043] in The two channels represent the offsets in the height and width directions, respectively.
[0044] Step 2: Generation of multi-scale serpentine scanning path Path generation networks at three different scales (corresponding to scale factors) Generate three scanning paths . By scale For example, starting from the starting point (0,0), according to the bias field... The next position is dynamically determined by the previous position:
[0045] in It is a regularization function that maps the predicted offset to the 8-neighbor directions, ensuring that the path is continuous and does not repeat.
[0046] Step 3: State-Space Model (SSM) Scanning and Recursion feature map By path Expand into a sequence The state is recursively derived from the input SSM. The discrete form of the SSM is:
[0047]
[0048]
[0049] in: : The first on the scan path The feature vector at each position.
[0050] : No. The hidden state of the step, For the state dimension (as designed in this invention) ).
[0051] : Fixed state transition matrix.
[0052] , : Projection matrix.
[0053] Step size parameter, determined by input Dynamic generation enables "selective" information processing:
[0054] : No. The output feature vector of the step.
[0055] Output sequence Follow the original path Refolded into a two-dimensional feature map .
[0056] Step 4: Multi-scale feature fusion The feature maps obtained from the three paths Fusion through attention mechanisms:
[0057]
[0058] in For the fusion function (by (Convolution implementation), outputting a 3-channel weight map; For spatial location normalization weights; This indicates element-wise multiplication.
[0059] 3.2 Dynamic Deformation and Boundary Enhancement Window Attention Module (DBWA) (1) Module principle The edges of mangrove forests are irregular, fragmented, and curved, and a fixed square window would introduce background noise or truncate the edge structure. To address this, this invention proposes a dynamically deformable window that learns an offset for each window's center point, allowing the window to conform to the edge direction; simultaneously, it explicitly models the boundary probabilities.
[0060] (2) Specific implementation steps Step 1: Deformable window partitioning enhances the contribution of boundary pixels in attention calculation.
[0061] A grid of window center points is evenly distributed on the feature map. ,in Step length
[0062] ( For window size, this invention takes Predict the offset for each center point:
[0063] by Centered on, divide into sizes of Deformation window .
[0064] Step 2: Boundary Probability Graphical Estimation Input feature map \(F\) generates boundary probability map through boundary detection branch. :
[0065] in The closer the value is to 1, the more likely the pixel is to be the edge of a mangrove forest.
[0066] Step 3: Enhance self-attention at the inner boundary of the window For each deformation window Extract the features of all pixels within the window and obtain the query result through linear transformation. ,key ,value matrix Calculate the boundary enhancement matrix. Its elements ,in For the first in the window The coordinates of each pixel. Then the boundary-enhancing self-attention is:
[0067] in The scaling factor is learnable (initialized to 0.1). Finally, the enhanced features are output through multi-head attention (8 heads) and a feedforward network (2048 dimensions).
[0068] 3.3 Decoupled Multidimensional Dynamic Selection Mechanism (D-MDSM) (1) Module principle Existing multi-scale feature fusion methods only weight features from the channel dimension, ignoring differences in spatial location and scale. This invention proposes a decoupled multi-dimensional dynamic selection mechanism that generates dynamic weights simultaneously in the spatial, channel, and scale dimensions through a lightweight routing network. This mechanism selects the most suitable features from a set of multi-scale convolutional kernels for each spatial location and each channel.
[0069] (2) Specific implementation steps Step 1: Multi-scale feature generation use Parallel processing of input features using depthwise separable convolutions at different scales. (This invention takes) The convolution kernels are respectively The expansion rate is 2 :
[0070] Obtain multi-scale feature maps .
[0071] Step 2: Multidimensional route weight calculation Spatial selection matrix :pass Softmax of the convolutional back channel dimension:
[0072] Channel selection matrix : Through global average pooling + two fully connected layers + Softmax:
[0073] Scale selection vector : Through learnable parameters And Softmax:
[0074] Step 3: Combine weights and output The weights of the three dimensions are broadcast and summed to obtain the final fused weight tensor. :
[0075] After applying a Sigmoid mapping to the weights, the multi-scale features are weighted and summed:
[0076] in For the first Weighted slices at each scale, This involves element-wise multiplication. The final output is... As an enhanced skip connection feature, it is concatenated with the decoder upsampled feature.
[0077] 3.4 Training and Optimization Strategies (1) Loss function The overall loss function is:
[0078] in For boundary loss, a weighted cross-entropy based on the boundary probability graph is used to enhance the model's sensitivity to edges.
[0079] (2) Data Augmentation Online data augmentation strategies: random horizontal / vertical flipping, random rotation (90°, 180°, 270°), brightness and contrast adjustment (±20%), Gaussian noise injection. .
[0080] (3) Training hyperparameters
[0081] (4) Training process 1. Load the encoder weights pre-trained on ImageNet.
[0082] 2. Forward Propagation: Input image X → Encoder extracts multi-scale features → D-MDSM enhances skip connections → MASS-SSM + DBWA processes deep features → Decoder upsamples and fuses → Outputs segmentation probability map.
[0083] 3. Calculate the total loss. Then, backpropagate to update the parameters.
[0084] 4. Evaluate on the validation set every 5 rounds and save the optimal model.
[0085] 5. Employ an early stopping mechanism to prevent overfitting.
[0086] Through the above technical solutions, this invention achieves topology-adaptive global dependency modeling, fine perception of deformation edges, and multi-dimensional dynamic multi-scale fusion with linear computational complexity, significantly improving the accuracy, continuity, and robustness of mangrove remote sensing extraction.
[0087] III. Specific Examples This embodiment discloses a remote sensing intelligent extraction and carbon storage estimation method for mangroves based on dynamic state space and local attention mechanism, including the following steps.
[0088] Step 1: Experimental Environment and Dataset Construction Step 101: Hardware and Software Environment Configuration This example was run on a server equipped with four NVIDIA RTX 4090 GPUs (each with 24GB of VRAM). The operating system was Ubuntu 22.04, the deep learning framework was PyTorch 2.3.0, and CUDA version 12.1.
[0089] Step 102: Study Area and Data Acquisition The study area covers the coastal mangrove distribution area of Guangxi Zhuang Autonomous Region, including Qinzhou (Maoweihai, Qishierjing, Dafengjiang), Beihai (Hepu County, Haicheng District, Yinhai District, Tieshangang District), and Fangchenggang (Gangkou District, Fangcheng District, Dongxing City). Multi-source high-resolution remote sensing imagery was used, including Gaofen-2 (0.8m spatial resolution), Sentinel-2 (10m fusion product), and UAV aerial imagery.
[0090] Step 103: Dataset Creation A semi-automated annotation process of "multi-scale optimized segmentation + manual correction" is adopted: 1. Generate initial mangrove region vectors based on a multi-scale optimization segmentation algorithm.
[0091] 2. Manually refine and correct the annotation boundaries, focusing on correcting curved and broken edge areas.
[0092] 3. The vector-raster conversion and framing are performed to create 512×512 pixel sample blocks with an overlap rate of 25%.
[0093] 4. Data augmentation: random horizontal / vertical flip, random rotation (90°, 180°, 270°), brightness and contrast adjustment (±20%), Gaussian noise injection (σ=0.01).
[0094] 5. Sample cleaning: Remove samples with no background (mangrove pixels accounting for <1%) and those severely obscured by clouds.
[0095] 6. Finally, a dataset containing 15,000 samples is constructed, which is divided into a training set (10,500 images), a validation set (3,000 images), and a test set (1,500 images) in a 7:2:1 ratio.
[0096] Step 2: Construct the D-Unet intelligent extraction network model As shown in Figure 1, the D-Unet network constructed in this embodiment includes an encoder, a MASS-SSM module, a DBWA module, a D-MDSM enhanced skip connection, a decoder, and an output layer.
[0097] Step 201, Encoder Configuration ResNet-34 was used as the encoder backbone network, and feature maps at four scales were extracted through multiple convolution and pooling operations, with 64, 128, 256, and 512 channels respectively. The encoder was loaded with ImageNet pre-trained weights.
[0098] Step 202: Configuration of Multi-Scale Adaptive Snake Scan State Space Module (MASS-SSM) The MASS-SSM module is located at the top of the encoder and is used to input feature maps. The specific configuration is as follows: Path generation networks: two The convolutional layer has 128 channels in the intermediate layers and 2 channels in the output layer.
[0099] Multiscale scanning: Set 3 scale factors These correspond to three scanning paths.
[0100] State-space model: Hidden state dimension Projection matrix and step length All are dynamically generated from the input (through linear layers Linear_Δ, Linear_B, and Linear_C, with output dimensions of 1, 512, and 512 respectively). State transition matrix. It is fixed as a diagonal matrix, and the initial value is initialized according to the HiPPO matrix.
[0101] Discretization: Zero-order preservation method is used, the formula is as follows , .
[0102] Output fusion: The output feature maps of the three paths are processed by 1×1 convolution (3×512 channels for input, 512 channels for output) to generate spatial weights, and then weighted summation is performed to obtain the final output.
[0103] Step 203: Configure the Dynamic Deformation and Boundary Enhancement Window Attention Module (DBWA) The DBWA module runs in parallel with the MASS-SSM branch, maintaining the same input feature map size. The specific configuration is as follows: Window size Step length That is, a window overlap rate of 50%.
[0104] Deformable offset generation Convolution, 512 input channels, 2 output channels, with offset limited by Tanh activation. Within the pixel range.
[0105] Boundary detection branch: Convolution + BatchNorm + Sigmoid, 512 input channels, 1 output channel.
[0106] Multi-head self-attention: 8 heads, key dimension Boundary enhancement scaling factor Initialized to 0.1, it is ready for learning.
[0107] Feedforward network: 2048 dimensions, using GELU activation.
[0108] Two layers of DBWA modules are stacked, with each layer using residual connections and LayerNorm.
[0109] Step 204: Configuration of Decoupled Multidimensional Dynamic Selection Mechanism (D-MDSM) In each layer of the encoder A D-MDSM module is embedded at the jump connection. The specific configuration is as follows: Multi-scale convolution kernels: , respectively Depthwise separable convolution Depthwise separable convolution Depthwise separable convolution with dilation of 2 Depthwise separable convolutions. All convolutions have a stride of 1, and padding maintains the same size.
[0110] Spatial selection matrix: 1×1 convolution (input) Channel, Output (channel), followed by Softmax.
[0111] Channel selection matrix: Global average pooling → Fully connected layer ( → ReLU → Fully Connected Layer → Remodel into → Softmax along the channel dimension.
[0112] Scale selection vector: learnable parameters Softmax normalization.
[0113] Output: The three weighted broadcasts are summed and then passed through a Sigmoid function. The sum is then weighted and summed with the multi-scale features.
[0114] Step 205, Decoder Configuration Decoder upsampling layer by layer (using bilinear interpolation+) Each layer is convolutional, and each layer is concatenated with the corresponding skip connection features enhanced by D-MDSM, then processed through two... Convolution (channel count halved layer by layer). Finally, a mangrove segmentation probability map is output via a 1×1 convolution and sigmoid activation (size restored to...). ).
[0115] Step 3: Model Training Step 301: Loss Function Configuration The overall loss function is:
[0116] in: , To predict the probability map, This is a real label.
[0117] This is the standard binary cross-entropy loss.
[0118] For boundary loss: First, extract the edge map of the true labels using the Sobel operator. Then calculate the weighted cross-entropy of the predicted probability map in the edge region, using the formula: .
[0119] Step 302: Configure training hyperparameters A two-stage training strategy is adopted: pre-training + fine-tuning.
[0120]
[0121] Step 303, Training Process 1. Load the ImageNet pre-trained ResNet-34 encoder weights. The decoder and new modules (MASS-SSM, DBWA, D-MDSM) are initialized using Kaiming normality.
[0122] 2. Forward propagation: Input image → Encoder Extraction → Input MASS-SSM to get → Input DBWA to get → Decoder upsampling, while simultaneously The enhanced skip features are obtained by inputting D-MDSM respectively. → Layer-by-layer fusion → Output probability map .
[0123] 3. Calculation Backpropagation is performed to update the parameters. The gradient clipping threshold is 1.0.
[0124] 4. Every 5 rounds, evaluate the overall accuracy, mIoU and other metrics on the validation set, and save the model with the highest mIoU on the validation set.
[0125] 5. If the verification loss does not decrease after 20 consecutive rounds (pre-training) or 10 rounds (fine-tuning), stop training.
[0126] Step 4: Experimental Results and Application Verification Step 401, Quantitative Assessment The results are as follows, compared with mainstream methods on the test set (1,500 independent samples):
[0127] This invention significantly outperforms existing methods in all metrics, with a particularly noticeable improvement in boundary IoU (+9.3% relative improvement).
[0128] Step 402, Ablation Experiment The effectiveness of each module was verified step by step (all under the same training settings):
[0129] The results show that MASS-SSM improves mIoU and boundary IoU by 0.7% and 1.6% respectively compared to the original DSSM; DBWA further brings a significant improvement in boundary accuracy (+7.3% boundary IoU); and D-MDSM improves overall accuracy in multi-scale scenarios.
[0130] Step 403, Efficiency Comparison
[0131] This invention has significant advantages in terms of parameter quantity, computational load, and inference speed, and can efficiently process large-scale remote sensing images.
[0132] Step 404: Large-area application and carbon storage estimation The trained model was used to perform sliding window prediction on whole-view Gaofen-2 images of Qinzhou, Beihai, and Fangchenggang in Guangxi (window size 512×512, stride 384, overlapping areas were averaged and fused), outputting a binary mask map of mangrove distribution. The extraction results were validated with field survey quadrat data, and the overall consistency was good. .
[0133] Based on the extracted mangrove distribution vector and combined with ground quadrat survey data (vegetation parameters, soil organic carbon, etc.), and according to the allometric growth equation and carbon storage calculation formula, the total carbon storage density of the Guangxi mangrove ecosystem is estimated to be approximately 249.88 Mg / ha (50 cm depth), and the total carbon storage is estimated to be approximately 2.625 million tons. Specific regional results are as follows:
[0134] Step 405, Generalization Test The method of this invention was transferred to the Zhanjiang Mangrove Nature Reserve in Guangdong (Sentinel-2 image, 10m resolution). Using only the Guangxi training model for direct prediction, the overall accuracy reached 91.5% and the mIoU was 81.3%. After fine-tuning with a small number of local samples (500 images), the accuracy improved to 94.8% and 86.2%, respectively, indicating that the invention has good cross-regional generalization ability.
[0135] Through the above specific implementation methods, those skilled in the art can reproduce this invention without creative effort. This invention, by proposing and introducing a multi-scale adaptive snake-scan state space module (MASS-SSM), a dynamic deformation and boundary enhancement window attention module (DBWA), and a decoupled multidimensional dynamic selection mechanism (D-MDSM), significantly improves the accuracy, continuity, and boundary clarity of mangrove remote sensing extraction based on the existing U-Net framework, while maintaining low computational cost and high inference speed, providing reliable technical support for coastal ecological monitoring and carbon sink assessment.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A remote sensing extraction network based on dynamic state space and local attention mechanism, comprising an encoder, a decoder, and skip connections between them, characterized in that, It also includes a global-local joint enhancement module and a decoupled multi-dimensional dynamic selection mechanism module; In each level of the encoder, the global-local joint enhancement module replaces the original standard convolution to output globally enhanced and edge-refined features; The decoupled multidimensional dynamic selection mechanism module is set in each skip connection except the deepest layer of the encoder. It is used to generate dynamic weights in the spatial dimension, channel dimension and scale dimension respectively, and to perform weighted fusion on the multi-scale features obtained by parallel processing of multi-scale depth separable convolution to obtain enhanced skip connection features. In each layer of the decoder, the global-local joint enhancement module replaces the original standard convolution to upsample the deepest features output by the encoder layer by layer and fuse them with the corresponding skip connection features layer by layer to maintain a wide range of connectivity and enhance edge details, and finally outputs a target feature segmentation probability map.
2. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 1, characterized in that, The global-local joint enhancement module includes: The multi-scale adaptive serpentine scanning state space module is used to selectively model the state space of the input feature map through dynamically generated multi-scale serpentine scanning paths in order to capture long-distance spatial dependencies. The dynamic deformation and boundary enhancement window attention module is set in parallel with the multi-scale adaptive serpentine scanning state space module, and is used to enhance edge details through explicit modeling of deformable windows and boundary probabilities.
3. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 2, characterized in that, The multi-scale adaptive snake-like scanning state space module includes: The path bias field generation unit is used to process the input feature map through a convolutional layer to generate a path bias field with offsets in the height and width directions. A multi-scale serpentine scanning path generation unit is used to generate a path generation network with multiple different scale factors. Based on the path bias field and the previous position, the next position is dynamically determined to generate multiple serpentine scanning paths covering different receptive field ranges. The path continuity and non-repetition are ensured by a regularization function. The state-space model recursion unit is used to expand the input feature map into a sequence along each of the serpentine scanning paths, input it into the selective state-space model for recursive processing, and fold the recursed output sequence back into a two-dimensional feature map along the original path; wherein, the step size parameter of the selective state-space model is dynamically generated by the input to achieve selective information processing; The multi-scale feature fusion unit is used to weight and fuse the two-dimensional feature maps corresponding to each path through an attention mechanism to output a globally enhanced feature map.
4. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 2, characterized in that, The dynamic deformation and boundary enhancement window attention module includes: The deformation window partitioning unit is used to uniformly lay out the window center point grid on the input feature map and predict the offset for each center point to form a deformation window, so that the window dynamically fits the edge of the target feature. The boundary probability map estimation unit is used to process the input feature map through the boundary detection branch to generate a boundary probability map; The boundary enhancement self-attention calculation unit is used to calculate a boundary enhancement matrix for each deformation window based on the boundary probability map, integrate the matrix into the self-attention calculation of pixels within the window to enhance the feature contribution of edge pixels, and output the enhanced features through multi-head self-attention and feedforward network.
5. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 1, characterized in that, The decoupled multidimensional dynamic selection mechanism module includes: The multi-scale feature generation unit is used to process the input feature map in parallel through depthwise separable convolutions of various different scales to obtain multi-scale feature maps. A multidimensional routing weight calculation unit is used to generate spatial selection matrix, channel selection matrix and scale selection vector in parallel through a multidimensional routing network; The fusion output unit is used to broadcast and add the spatial selection matrix, channel selection matrix, and scale selection vector, and after mapping by the activation function, multiply and sum them element-wise with the multi-scale feature map to obtain enhanced skip connection features.
6. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 5, characterized in that, The spatial selection matrix is obtained by performing Softmax normalization along the channel dimension after convolution; the channel selection matrix is obtained by global average pooling, two fully connected layers, and Softmax normalization along the channel dimension. The scale selection vector is obtained by normalizing the learnable parameters using Softmax.
7. The remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 1, characterized in that, The overall loss function of the extraction network is a weighted sum of Dice loss, cross-entropy loss and boundary loss; wherein, the boundary loss is obtained by first extracting the edge map of the true label and then calculating the weighted cross-entropy of the predicted probability map in the edge region, so as to enhance the model's sensitivity to edges.
8. A method for constructing a remote sensing extraction network based on dynamic state space and local attention mechanism, characterized in that, Includes the following steps: Build a U-Net infrastructure that includes encoders, decoders, and jump connections; A global-local joint enhancement module is set at each level of the encoder's feature extraction path to output globally enhanced and edge-refined features. A decoupled multidimensional dynamic selection mechanism module is set on each skip connection outside the deepest layer of the encoder. Through this module, dynamic weights are generated in three dimensions: space, channel, and scale. The multi-scale features output by the multi-scale depth separable convolution are weighted and fused to obtain enhanced skip connection features. Global-local joint enhancement modules are set in each layer of the feature fusion path of the decoder. The deepest output features are upsampled layer by layer and fused with the corresponding skip connection features layer by layer to maintain large-scale connectivity and enhance edge details. Finally, the target land cover segmentation probability map is output to complete the extraction network construction. S5. The constructed extraction network is trained end-to-end using a joint loss function to obtain the optimized extraction network.
9. The method for constructing a remote sensing extraction network based on dynamic state space and local attention mechanism according to claim 8, characterized in that, The global-local joint enhancement module is composed of a multi-scale adaptive snake scan state space module and a dynamic deformation and boundary enhancement window attention module in parallel. The multi-scale adaptive snake scan state space module is used to perform long-distance spatial dependency modeling on the input feature map, and the dynamic deformation and boundary enhancement window attention module is used to enhance the edge details of the feature map.
10. An extraction method based on the extraction network according to any one of claims 1 to 7, characterized in that, Includes the following steps: S1. Acquire the remote sensing image to be processed; S2. Input the remote sensing image into the extraction network, and extract multi-scale feature maps through the encoder; S3. The feature maps of each level of the encoder extraction path are processed by the corresponding global-local joint enhancement module to obtain globally enhanced and edge-refined features. S4. The features output by the encoder, except for the deepest layer, are processed by the decoupled multidimensional dynamic selection mechanism module in their respective skip connections to obtain enhanced skip connection features. S5. The decoder upsamples the deepest features of the output layer by layer through the global-local joint enhancement module and fuses them with the corresponding skip connection features layer by layer to maintain a wide range of connectivity and enhance edge details, and finally outputs the target ground object segmentation probability map.