A remote sensing image segmentation method, system, device and storage medium
By integrating the spatial channel Mamba module and the information-guided cross-fusion module into the remote sensing image segmentation model, the problem of insufficient extraction of global information and local details in remote sensing image segmentation is solved, achieving efficient remote sensing image segmentation and improving the accuracy and computational efficiency of remote sensing image segmentation.
Patent Information
- Application Number
- CN202511011186.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-22
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2045-07-22
AI Technical Summary
Existing Mamba-based visual models for remote sensing image segmentation suffer from insufficient extraction of specific global information in spatial and channel dimensions, as well as inadequate perception of local detail features. Furthermore, they are computationally complex and difficult to apply in practice.
The design integrates the Mamba module for spatial channels with the information-guided cross-fusion module. Combining the state-space modeling capabilities and attention mechanism of the Mamba model, features are extracted at the encoder and decoder stages through parallel global and local branches, enhancing the perception of global context and local details while maintaining linear computational complexity.
It significantly improves the ability to extract global contextual information and perceive local details in remote sensing images, enhances the segmentation accuracy of remote sensing images, while maintaining low computational complexity and exhibiting superior robustness and generalization ability.
Smart Images

Figure CN120747752B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of remote sensing image processing and computer vision technology, and in particular to a remote sensing image segmentation method, system, device and storage medium. Background Technology
[0002] Semantic segmentation of remote sensing images aims to accurately classify each pixel in a remote sensing image to automatically identify and extract land cover types such as buildings, farmland, and water bodies. This technology is a key support for applications such as urban planning, resource management, and environmental monitoring. However, high-resolution remote sensing images contain rich information about ground features, diverse target types, and significant spatial scale differences, while also needing to consider complex spatial relationships and contextual information, which poses a significant challenge to achieving accurate semantic segmentation. Traditional methods such as Support Vector Machines (SVM) and Random Forests require significant manual intervention and have limited effectiveness. Deep learning methods based on Convolutional Neural Networks (CNNs) (such as U-Net and its variants) perform well in local feature extraction but have limitations in modeling long-range dependencies in images. Transformer-based methods can effectively capture long-range contextual information through self-attention mechanisms, but their computational complexity increases quadratically with the length of the input sequence, resulting in huge computational and memory overhead when processing high-resolution remote sensing images, making them difficult to apply in practice.
[0003] Recently, the Mamba model, as a state-space model, has demonstrated efficient long sequence modeling capabilities and linear computational complexity in the field of natural language processing, and its visual variants (such as Vision Mamba) have begun to be introduced into computer vision tasks. However, existing Mamba-based visual models still have shortcomings in remote sensing image segmentation: on the one hand, they are not sufficiently capable of extracting specific global information in spatial and channel dimensions; on the other hand, their ability to perceive local detail features needs improvement. Therefore, how to design a lightweight semantic segmentation method that can efficiently capture multi-dimensional global contextual information while maintaining sensitivity to local details is a key problem that urgently needs to be solved. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a remote sensing image segmentation method, system, device, and storage medium. This method, by designing a fusion spatial channel Mamba module and an information-guided cross-fusion module, effectively combines the state-space modeling capabilities and attention mechanism of the Mamba model. While maintaining linear computational complexity, it significantly improves the ability to extract global contextual information (including spatial and channel dimensions) from remote sensing images and the perception of local details, thereby achieving pixel-level accurate classification of land cover categories (such as buildings, roads, vegetation, and water bodies). This method has significant implications for urban planning, land resource management, environmental monitoring, and other fields.
[0005] On the one hand, a remote sensing image segmentation method is provided, including: Acquire the remote sensing image to be segmented; The remote sensing image to be segmented is input into a trained remote sensing image segmentation model to obtain the segmentation result. The trained remote sensing image segmentation model includes an encoder, a decoder, and a segmentation head. The encoder uses parallel global and local branches to extract features in stages, obtaining encoded features. The decoder performs feature decoding processing on the encoded features in stages, obtaining decoded features. The decoded features from each stage are fused with the encoded features from the corresponding stage to obtain fused features. The segmentation head maps the fused features to obtain the segmentation result of the remote sensing image.
[0006] On the other hand, a remote sensing image segmentation system is provided, including: The acquisition module is configured to acquire the remote sensing image to be segmented; The segmentation module is configured to: input the remote sensing image to be segmented into a trained remote sensing image segmentation model to obtain the segmentation result of the remote sensing image; wherein, the trained remote sensing image segmentation model includes: an encoder, a decoder, and a segmentation head; the encoder performs feature extraction in stages using parallel global branches and local branches to obtain encoded features; the decoder performs feature decoding processing on the encoded features in stages to obtain decoded features; the decoded features of each stage are fused with the encoded features of the corresponding stage to obtain fused features; the segmentation head maps the fused features to obtain the segmentation result of the remote sensing image.
[0007] Furthermore, an electronic device is also provided, including: Memory, used for non-transitory storage of computer-readable instructions; and Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.
[0008] In another aspect, a storage medium is also provided for non-transitory storage of computer-readable instructions, wherein when the non-transitory computer-readable instructions are executed by a computer, the method described in the first aspect is performed.
[0009] The above technical solution has the following advantages or beneficial effects: This invention employs the classic encoder-decoder architecture used in semantic segmentation tasks and designs a spatial channel Mamba module. This module combines Mamba's state-space model with spatial and channel attention mechanisms, applying them simultaneously in both the encoding and decoding stages. In the encoding stage, it efficiently captures global feature representations across spatial and channel dimensions, enhancing the model's ability to focus on specific dimensions. Simultaneously, in the decoding stage, it fuses encoded information with information from the previous layer, effectively compensating for the semantic differences between the encoder's skip connection features and the decoder's upsampled features while preserving fine-grained details. This method significantly improves the accuracy of semantic segmentation of remote sensing images while maintaining low computational complexity, exhibiting superior robustness and generalization ability, and showing broad application prospects in fields such as urban planning and resource surveys. Attached Figure Description
[0010] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0011] Figure 1 This is a flowchart of the method in Example 1. Detailed Implementation
[0012] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0013] Example 1 This embodiment provides a remote sensing image segmentation method; like Figure 1 As shown, a remote sensing image segmentation method includes: S101: Obtain the remote sensing image to be segmented; S102: The remote sensing image to be segmented is input into the trained remote sensing image segmentation model to obtain the segmentation result of the remote sensing image; wherein, the trained remote sensing image segmentation model includes: an encoder, a decoder, and a segmentation head; the encoder uses parallel global branches and local branches to extract features in stages to obtain encoded features; the decoder performs feature decoding processing on the encoded features in stages to obtain decoded features; the decoded features of each stage are fused with the encoded features of the corresponding stage to obtain fused features; the segmentation head maps the fused features to obtain the segmentation result of the remote sensing image.
[0014] Furthermore, the training process of the trained remote sensing image segmentation model includes: Construct a training set, which consists of remote sensing images with known image segmentation results; The training set is input into the remote sensing image segmentation model to train the model. Training is stopped when the total loss function value of the model no longer decreases, and the trained remote sensing image segmentation model is obtained.
[0015] Furthermore, the input end of the encoder is used to input the remote sensing image to be segmented, the output end of the encoder is connected to the input end of the decoder, the output end of the decoder is connected to the input end of the segmentation head, and the output end of the segmentation head outputs the segmentation result of the remote sensing image.
[0016] Furthermore, the global branch includes: a block layer Embedding, a first spatial channel Mamba module, a first adder, a second spatial channel Mamba module, a first convolutional layer, a second adder, a third spatial channel Mamba module, a second convolutional layer, a third adder, a fourth spatial channel Mamba module, a third convolutional layer, and a fourth adder connected in sequence; wherein, the input end of the block layer Embedding is used to input the remote sensing image to be segmented; the output end of the fourth adder is the output end of the encoder, and the output end of the fourth adder is connected to the input end of the decoder.
[0017] Furthermore, the block layer Embedding and the first spatial channel Mamba module constitute the first stage of the global branch, the second spatial channel Mamba module and the first convolutional layer constitute the second stage of the global branch, the third spatial channel Mamba module and the second convolutional layer constitute the third stage of the global branch, and the fourth spatial channel Mamba module and the third convolutional layer constitute the fourth stage of the global branch.
[0018] The working process formula for each stage of the global branch, excluding the first stage, is expressed as follows:
[0019] in, Indicates the first branch in the global branch The output of the stage Indicates the local branch number 1 The output of the stage Indicates the first A spatial channel Mamba module, Indicates the global branch number Intermediate results of the stage, Indicates the first Convolutional layer Indicates the first branch in the global branch The output of the stage.
[0020] The first stage of the global branch differs slightly from the second to fourth stages. The first stage consists of a block layer Embedding and a first spatial channel Mamba module. The working process of the first stage can be expressed as follows:
[0021] in, This represents the remote sensing image to be segmented. This represents the preliminary features extracted from the remote sensing image. This indicates the first spatial channel Mamba module. This represents the output of the first stage in the global branch. This indicates a block-level embedding.
[0022] The first stage, Embedding, divides the input remote sensing image into non-overlapping image patches and generates preliminary features. Specifically, the image is divided into non-overlapping 4×4 image patches, and the feature dimensions are mapped to C. This operation can be achieved using a single convolutional layer with a kernel size of 4×4 and a stride of 4. This processing reduces the spatial resolution to one-quarter of the original size, so the feature dimensions output by the first stage are H / 4×W / 4×C.
[0023] The subsequent second to fourth stages are processed sequentially by the spatial channel Mamba module, ultimately generating a global feature representation with a hierarchical structure. To ensure that the feature sizes in each stage of the global branch are consistent with those in the local branches, a convolutional layer (3×3 kernel size, stride 2) is followed by the spatial channel Mamba module in the second to fourth stages. The final feature dimensions for the second to fourth stages are H / 8×W / 8, H / 16×W / 16, and H / 32×W / 32, respectively.
[0024] The beneficial effects of the above technical solution are: global branches can efficiently capture global long-range dependencies in spatial and channel dimensions, simultaneously capture cross-channel dependencies and long-range spatial context, significantly improve the model's ability to model global contextual information of remote sensing images, while maintaining linear computational complexity and overcoming the quadratic computational complexity of traditional Transformers. )question.
[0025] Furthermore, the local branch includes: a first residual module, a second residual module, a third residual module, and a fourth residual module connected in sequence; the input end of the first residual module is used to input the remote sensing image to be segmented, and the output end of the fourth residual module is connected to the input end of the fourth adder.
[0026] The working process of the residual module can be formally expressed as follows:
[0027] in, Indicates the first The output of each residual module Indicates the first Each residual module, Indicates the first The output of each residual module. Each residual module consists of a different number of residual blocks, where the first residual module consists of three residual blocks, the second residual module consists of four residual blocks, the third residual module consists of six residual blocks, and the fourth residual module consists of three residual blocks. The first residual block of each residual module is a residual block with downsampling, and the non-first residual blocks of each residual module are residual blocks without downsampling.
[0028] The working process of the residual block with downsampling is expressed as follows:
[0029] in, This represents the input to the residual block with downsampling. This indicates the output of the residual block with downsampling. This represents a convolutional layer with kernel size m and stride n. express Activation function This represents the intermediate results of the residual block with downsampling.
[0030] The working process of the residual block without downsampling is expressed as follows:
[0031] in This represents the input of the residual block without downsampling. This represents the output of the residual block without downsampling. This represents a convolutional layer with kernel size m and stride n. express Activation function This represents the intermediate results of the residual block without downsampling.
[0032] Furthermore, the output of the first residual module is connected to the input of the first adder, the output of the second residual module is connected to the input of the second adder, the output of the third residual module is connected to the input of the third adder, and the output of the fourth residual module is connected to the input of the fourth adder.
[0033] It should be understood that the input remote sensing image is... Where H, W, and C represent the height, width, and number of channels of the image, respectively. The first residual module, the second residual module, the third residual module, and the fourth residual module generate feature maps with spatial resolutions of H / 4×W / 4, H / 8×W / 8, H / 16×W / 16, and H / 32×W / 32, respectively.
[0034] The beneficial effects of the above technical solution are: local branches efficiently capture pixel-level detailed features through residual networks, and form a multi-scale feature pyramid with downsampling. The residual structure helps to retain more local feature information, providing more detailed local feature information at multiple levels for subsequent decoders.
[0035] Furthermore, the decoder includes: a fifth spatial channel Mamba module, a first upsampling layer, a sixth spatial channel Mamba module, a second upsampling layer, a seventh spatial channel Mamba module, a third upsampling layer, an eighth spatial channel Mamba module, and a fourth upsampling layer connected in sequence; the input of the fifth spatial channel Mamba module is the input of the decoder, and the fourth upsampling layer is the output of the decoder.
[0036] Furthermore, the fifth spatial channel Mamba module and the first upsampling layer constitute the fourth stage of the decoder; the sixth spatial channel Mamba module and the second upsampling layer constitute the third stage of the decoder; the seventh spatial channel Mamba module and the third upsampling layer constitute the second stage of the decoder; and the eighth spatial channel Mamba module and the fourth upsampling layer constitute the first stage of the decoder.
[0037] The decoder, the first The phase will encode the features of the corresponding level. Compared with the previous stage of decoding feature upsampling results Both inputs are processed together using the spatial channel Mamba module for feature interaction and enhancement. Specifically, before being input into the spatial channel Mamba module, the two inputs are initially fused by adding corresponding elements, and then input into the spatial channel Mamba module. This process can be formalized as follows:
[0038] in, Indicates the encoder's first... The output of the stage Indicates the decoder's first The output of the stage Indicates the decoder's first The space channel Mamba module of the phase, This indicates an upsampling operation.
[0039] It should be noted that the spatial channel Mamba module in the fourth stage of the decoder only has one encoded feature as input, so there is no feature addition operation.
[0040] The beneficial effects of the above technical solution are: by efficiently integrating multi-level features, the decoder dynamically fuses encoder jump connection features and upsampled features during the decoding process, which not only preserves high-resolution spatial details, but also corrects semantic deviations through global contextual information.
[0041] Furthermore, the input of the eighth spatial channel Mamba module is connected to the output of the first adder, the input of the seventh spatial channel Mamba module is connected to the output of the second adder, the input of the sixth spatial channel Mamba module is connected to the output of the third adder, and the input of the fifth spatial channel Mamba module is connected to the output of the fourth adder.
[0042] Furthermore, the block layer Embedding is used to divide the input remote sensing image into non-overlapping image blocks and generate preliminary features.
[0043] Furthermore, the internal structures of the first, second, third, fourth, fifth, sixth, seventh, and eighth spatial channel Mamba modules are identical; the first spatial channel Mamba module includes: The module is connected in sequence as follows: first layer normalization module, first visual state space module, fifth adder, second layer normalization module, channel attention module, sixth adder, third layer normalization module, second visual state space module, seventh adder, fourth layer normalization module, spatial attention module, and eighth adder.
[0044] Furthermore, the operating processes of the first, second, third, fourth, fifth, sixth, seventh, and eighth spatial channel Mamba modules are consistent; the operating process of the first spatial channel Mamba module is expressed by the following formula: ; ; ; ; in, Indicates the first Input to the spatial channel Mamba module, Indicates the first The output of the spatial channel Mamba module, This represents the first-level normalization module. This indicates the second-level normalization module. This indicates the third-layer normalization module. This indicates the fourth-level normalization module. This represents the first visual state space module. This represents the second visual state space module. This indicates the channel attention module. This indicates a spatial attention module. This indicates the first intermediate result. Indicates the second intermediate result. This indicates a third intermediate result.
[0045] Furthermore, the internal working processes of the first visual state space module and the second visual state space module are consistent. The working process of the first visual state space module is expressed by the following formula: The feature sequence after layer normalization As the input to the first visual state space module, let the state vector Indicates time The hidden state at a given location has the following state transition and update formulas:
[0046] in, and For network learnable weights, For activation function, It was the hidden state from a previous moment. Indicates the first Features of each time step (or sequence position).
[0047] It should be understood that the visual state space module is a novel sequence modeling method based on the State Space Model (SSM), aiming to solve the secondary computational complexity caused by the self-attention mechanism in the traditional Transformer architecture. )question.
[0048] Furthermore, the channel attention module includes: a global average pooling layer, a fully connected layer, a first activation function layer, and a first multiplier connected in sequence; the input of the global average pooling layer is the input of the channel attention module; the output of the first multiplier is the output of the channel attention module; wherein, the input of the multiplier is also connected to the input of the global average pooling layer.
[0049] Furthermore, the channel attention module includes: Let the input be F First, global average pooling is used to extract representative elements of the features in each channel. The channel attention weights are then obtained through a fully connected layer and a sigmoid function. W Then use the weight vector W Mapping with the original feature Element-wise multiplication dynamically adjusts the contribution of each channel; the above steps can be formalized as follows: ; ; ; in, This represents the global average pooling operation. Represents a fully connected operation. Represents the Sigmoid function. This indicates a feature that enhances attention after passing through a channel.
[0050] Furthermore, the spatial attention module includes: a max pooling layer, a fourth convolutional layer, a second activation function layer, and a second multiplier connected in sequence; the input of the max pooling layer is the input of the spatial attention module, and the input of the spatial attention module is also connected to the input of the fourth convolutional layer through an average pooling layer; the input of the spatial attention module is also connected to the input of the second multiplier, and the output of the second multiplier is the output of the spatial attention module.
[0051] Furthermore, the spatial attention module includes: Let the input be F First, average pooling and max pooling are performed along the channel dimension to obtain the spatial representation of the feature map. as well as For the spliced as well as Perform convolution operations, and through The function yields a normalized spatial attention matrix. Utilizing spatial attention Input features Pixel-by-pixel multiplication is performed to obtain the weighted features. The above steps can be formalized as follows: ; ; ; ; in, This represents the channel average pooling operation. This represents the channel max pooling operation. Represents the convolution operation. Represents the Sigmoid function. This indicates features enhanced by spatial attention.
[0052] Furthermore, the first-layer normalization module, the second-layer normalization module, the third-layer normalization module, and the fourth-layer normalization module are used to accelerate training convergence and improve model stability and generalization ability.
[0053] Furthermore, the first residual module includes: a first residual unit with downsampling, a first residual unit without downsampling, and a second residual unit without downsampling, connected in sequence.
[0054] Furthermore, the second residual module includes: a second residual unit with downsampling, a third residual unit without downsampling, a fourth residual unit without downsampling, and a fifth residual unit without downsampling.
[0055] Furthermore, the third residual module includes: a third residual unit with downsampling, a sixth residual unit with downsampling, a seventh residual unit without downsampling, an eighth residual unit without downsampling, a ninth residual unit without downsampling, and a tenth residual unit without downsampling.
[0056] Furthermore, the fourth residual module includes: a fourth residual unit with downsampling, an eleventh residual unit with downsampling, and a twelfth residual unit without downsampling.
[0057] Furthermore, the internal structures of the first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, and twelfth residual units without downsampling are identical. The first residual unit without downsampling includes: The fifth convolutional layer, the sixth convolutional layer, and the ninth adder are connected in sequence; the input of the fifth convolutional layer is the input of the first residual unit with downsampling, the output of the ninth adder is the output of the first residual unit with downsampling, and the input of the ninth adder is also connected to the input of the fifth convolutional layer. Furthermore, the internal structures of the first, second, third, and fourth residual units with downsampling are identical. The first residual unit with downsampling includes: The seventh convolutional layer, the eighth convolutional layer, and the tenth adder are connected sequentially. The input of the seventh convolutional layer is the input of the first residual unit without downsampling, and the output of the tenth adder is the output of the first residual unit without downsampling. The input of the seventh convolutional layer is also connected to the input of the tenth adder through the ninth convolutional layer. The downsampling operation is implemented through the ninth convolutional layer.
[0058] The beneficial effects of the above technical solution are: through the residual structure, the residual network can efficiently capture pixel-level detailed features, and in conjunction with downsampling, form a multi-scale feature pyramid. The residual structure helps to retain more local feature information, providing more detailed local feature information at multiple levels for the subsequent decoder.
[0059] In summary, at each layer of the encoder, multi-level features are extracted in parallel using a global branch containing the spatial channel Mamba module and a local branch containing the residual module. At each layer of the decoder, the encoded features of the corresponding layer are input together with the upsampled results of the decoded features from the previous layer into the spatial channel Mamba module for feature interaction and enhancement. The fused features are then upsampled to generate multi-scale features that restore resolution. Finally, the features output from the decoding layer are upsampled and mapped to the category space through a segmentation head (convolutional layer) to generate pixel-level semantic segmentation results.
[0060] In the decoder, the encoded features of the corresponding level are input together with the upsampling results of the decoded features of the previous layer into the spatial channel Mamba module for feature interaction and enhancement, and the fused features are upsampled to generate multi-scale features that restore resolution.
[0061] Decoder The phase will encode the features of the corresponding level. Compared with the previous stage of decoding feature upsampling results Both inputs are processed together using the spatial channel Mamba module for feature interaction and enhancement. Specifically, before being input into the spatial channel Mamba module, the two inputs are initially fused by adding corresponding elements, and then input into the spatial channel Mamba module. This process can be formalized as follows:
[0062] in, Indicates the encoder's first... i Stage output, Indicates the decoder's first i Stage output, Indicates the decoder's firsti The space channel Mamba module of the phase, This indicates an upsampling operation.
[0063] It should be noted that the spatial channel Mamba module in the fourth stage of the decoder only has one encoded feature as input, so there is no feature addition operation.
[0064] By encoding and decoding features, this method can effectively capture global contextual information in remote sensing images. Whether it is small-area details or large-scale global features in the image, this invention can effectively model and learn them, providing more robust feature support for the subsequent generation of semantic segmentation results.
[0065] After decoding and upsampling at each stage of the decoder, the output features of the first stage of the decoder are... The spatial resolution is restored to 1 / 4 (H / 4×W / 4) of the image. In order to obtain a segmentation result with the same resolution (H×W) as the input image, final upsampling and classification are required.
[0066] Furthermore, the segmentation head upsamples the final features output by the decoding layer and maps them to the category space through the segmentation head (convolutional layer) to generate pixel-level semantic segmentation results.
[0067] Features The spatial resolution is upsampled by a factor of 4 using an upsampling layer to restore the original input image size H×W, resulting in the feature map. Where D is the number of feature channels. The upsampling layer is implemented using bilinear interpolation. Obtain feature map Then, the classification head (implemented through a convolutional layer) is used to map it to the channel of the number of semantic categories, generating the semantic segmentation result; let the number of semantic categories be... The classification head uses 1×1 convolutions to process the final features. Perform channel mapping to obtain features , ; in, Represents a 1×1 convolution; Mapped features Normalization is performed using the Softmax function to obtain the predicted probability for each category: ; Among the features The dimension is , and Indicates taking feature map middle The position, the colon indicates the position. All values of each channel, The function normalizes the classification result of each pixel into a probability distribution, ensuring that the sum is 1. Represents pixels The probability of belonging to each category; For each pixel, the category with the highest probability is selected as its predicted semantic label, ultimately generating a pixel-level semantic segmentation result image for the entire image. The above algorithm can be formalized as follows:
[0068] in, The function represents taking the category corresponding to the highest probability. This represents the predicted semantic category of each pixel.
[0069] Predict the semantic category of all pixels The semantic segmentation results are combined according to their positions to form a complete semantic segmentation result image. Each pixel value represents the label of its corresponding land cover category.
[0070] This invention innovatively combines the Mamba state-space model with spatial and channel attention mechanisms by designing a spatial channel Mamba module. During the encoding stage, it efficiently captures global long-range dependencies in both spatial and channel dimensions, significantly improving the model's ability to model global contextual information of remote sensing images while maintaining linear computational complexity, overcoming the quadratic complexity bottleneck of traditional Transformers. In the decoding stage, the spatial channel Mamba module effectively fuses features from different sources (encoder skip features, decoder upsampled features) and with different properties (local details, global context). While preserving the fine structural information of the image, it significantly bridges the semantic gap between features, improving the recognition accuracy for complex scenes and small targets. This method significantly improves the semantic segmentation accuracy of remote sensing images while possessing high computational efficiency, providing reliable technical support for applications such as land cover classification, urban planning, and disaster assessment.
[0071] Example 2 This embodiment provides a remote sensing image segmentation system, including: The acquisition module is configured to acquire the remote sensing image to be segmented; The segmentation module is configured to: input the remote sensing image to be segmented into a trained remote sensing image segmentation model to obtain the segmentation result of the remote sensing image; wherein, the trained remote sensing image segmentation model includes: an encoder, a decoder, and a segmentation head; the encoder performs feature extraction in stages using parallel global branches and local branches to obtain encoded features; the decoder performs feature decoding processing on the encoded features in stages to obtain decoded features; the decoded features of each stage are fused with the encoded features of the corresponding stage to obtain fused features; the segmentation head maps the fused features to obtain the segmentation result of the remote sensing image.
[0072] It should be noted that the acquisition module and segmentation module described above correspond to steps S101 to S102 in Embodiment 1. The examples and application scenarios implemented by the modules and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the modules described above, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.
[0073] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0074] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.
[0075] Example 3 This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1.
[0076] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0077] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0078] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.
[0079] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0080] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.
[0081] Example 4 This embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the method described in Embodiment 1.
[0082] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for segmenting a remote sensing image, characterized in that, include: Acquire the remote sensing image to be segmented; The remote sensing image to be segmented is input into a trained remote sensing image segmentation model to obtain the segmentation result. The trained remote sensing image segmentation model includes an encoder, a decoder, and a segmentation head. The encoder uses parallel global and local branches to extract features in stages, obtaining encoded features. The decoder performs feature decoding processing on the encoded features in stages, obtaining decoded features. The decoded features from each stage are fused with the encoded features from the corresponding stage to obtain fused features. The segmentation head maps the fused features to obtain the segmentation result of the remote sensing image. The global branch includes: a block layer Embedding, a first spatial channel Mamba module, a first adder, a second spatial channel Mamba module, a first convolutional layer, a second adder, a third spatial channel Mamba module, a second convolutional layer, a third adder, a fourth spatial channel Mamba module, a third convolutional layer, and a fourth adder, connected in sequence; wherein, the input end of the block layer Embedding is used to input the remote sensing image to be segmented; the output end of the fourth adder is the output end of the encoder, and the output end of the fourth adder is connected to the input end of the decoder; The block layer Embedding and the first spatial channel Mamba module form the first stage of the global branch; the second spatial channel Mamba module and the first convolutional layer form the second stage of the global branch; the third spatial channel Mamba module and the second convolutional layer form the third stage of the global branch; and the fourth spatial channel Mamba module and the third convolutional layer form the fourth stage of the global branch. The local branch includes: a first residual module, a second residual module, a third residual module, and a fourth residual module connected in sequence; the input end of the first residual module is used to input the remote sensing image to be segmented, and the output end of the fourth residual module is connected to the input end of the fourth adder; The output of the first residual module is connected to the input of the first adder, the output of the second residual module is connected to the input of the second adder, the output of the third residual module is connected to the input of the third adder, and the output of the fourth residual module is connected to the input of the fourth adder. The first spatial channel Mamba module includes: The first layer normalization module, the first visual state space module, the fifth adder, the second layer normalization module, the channel attention module, the sixth adder, the third layer normalization module, the second visual state space module, the seventh adder, the fourth layer normalization module, the spatial attention module, and the eighth adder are connected in sequence. The working process of the first spatial channel Mamba module is expressed by the following formula: ; ; ; ; in, Indicates the first Input to the spatial channel Mamba module, Indicates the first The output of the spatial channel Mamba module, This represents the first-level normalization module. This indicates the second-level normalization module. This indicates the third-level normalization module. This indicates the fourth-level normalization module. This represents the first visual state space module. This represents the second visual state space module. This indicates the channel attention module. This indicates a spatial attention module. This indicates the first intermediate result. This indicates the second intermediate result. This indicates a third intermediate result.
2. The remote sensing image segmentation method as described in claim 1, characterized in that, The decoder includes: a fifth spatial channel Mamba module, a first upsampling layer, a sixth spatial channel Mamba module, a second upsampling layer, a seventh spatial channel Mamba module, a third upsampling layer, an eighth spatial channel Mamba module, and a fourth upsampling layer connected in sequence; the input of the fifth spatial channel Mamba module is the input of the decoder, and the fourth upsampling layer is the output of the decoder. The fifth spatial channel Mamba module and the first upsampling layer constitute the fourth stage of the decoder; the sixth spatial channel Mamba module and the second upsampling layer constitute the third stage of the decoder; the seventh spatial channel Mamba module and the third upsampling layer constitute the second stage of the decoder; and the eighth spatial channel Mamba module and the fourth upsampling layer constitute the first stage of the decoder. The input of the Mamba module in the eighth spatial channel is connected to the output of the first adder; the input of the Mamba module in the seventh spatial channel is connected to the output of the second adder; the input of the Mamba module in the sixth spatial channel is connected to the output of the third adder; and the input of the Mamba module in the fifth spatial channel is connected to the output of the fourth adder.
3. The remote sensing image segmentation method as described in claim 1, characterized in that, The working process of the first visual state space module can be expressed by the following formula: The feature sequence after level normalization As the input to the first visual state space module, let the state vector Indicates time t The hidden state at a given location has the following state transition and update formulas: ; in, and For network learnable weights, For activation function, It was the hidden state from a previous moment. This represents the feature at time step t.
4. The remote sensing image segmentation method as described in claim 1, characterized in that, The channel attention module includes: a global average pooling layer, a fully connected layer, a first activation function layer, and a first multiplier connected in sequence; the input of the global average pooling layer is the input of the channel attention module; the output of the first multiplier is the output of the channel attention module; wherein, the input of the multiplier is also connected to the input of the global average pooling layer; The spatial attention module includes: a max pooling layer, a fourth convolutional layer, a second activation function layer, and a second multiplier connected in sequence; the input of the max pooling layer is the input of the spatial attention module, and the input of the spatial attention module is also connected to the input of the fourth convolutional layer through an average pooling layer; the input of the spatial attention module is also connected to the input of the second multiplier, and the output of the second multiplier is the output of the spatial attention module.
5. A remote sensing image segmentation system, characterized in that, The remote sensing image segmentation method described in claims 1-4 includes: The acquisition module is configured to acquire the remote sensing image to be segmented; The segmentation module is configured to: input the remote sensing image to be segmented into a trained remote sensing image segmentation model to obtain the segmentation result of the remote sensing image; wherein, the trained remote sensing image segmentation model includes: an encoder, a decoder, and a segmentation head; the encoder performs feature extraction in stages using parallel global branches and local branches to obtain encoded features; the decoder performs feature decoding processing on the encoded features in stages to obtain decoded features; the decoded features of each stage are fused with the encoded features of the corresponding stage to obtain fused features; the segmentation head maps the fused features to obtain the segmentation result of the remote sensing image; the global segmentation head... The support includes: a segmentation layer Embedding, a first spatial channel Mamba module, a first adder, a second spatial channel Mamba module, a first convolutional layer, a second adder, a third spatial channel Mamba module, a second convolutional layer, a third adder, a fourth spatial channel Mamba module, a third convolutional layer, and a fourth adder, connected sequentially; wherein, the input of the segmentation layer Embedding is used to input the remote sensing image to be segmented; the output of the fourth adder is the output of the encoder, and the output of the fourth adder is connected to the input of the decoder; the segmentation layer Embedding and the first spatial channel Mamba module... The global branch is structured as follows: the first stage comprises a second spatial channel Mamba module and a first convolutional layer; the third stage comprises a third spatial channel Mamba module and a second convolutional layer; and the fourth stage comprises a fourth spatial channel Mamba module and a third convolutional layer. The local branch comprises: a first residual module, a second residual module, a third residual module, and a fourth residual module connected sequentially; the input of the first residual module is used to input the remote sensing image to be segmented; the output of the fourth residual module is connected to the input of a fourth adder; and the output of the first residual module is connected to the input of the first adder. The output of the second residual module is connected to the input of the second adder, the output of the third residual module is connected to the input of the third adder, and the output of the fourth residual module is connected to the input of the fourth adder; the first spatial channel Mamba module includes: a first-layer normalization module, a first visual state space module, a fifth adder, a second-layer normalization module, a channel attention module, a sixth adder, a third-layer normalization module, a second visual state space module, a seventh adder, a fourth-layer normalization module, a spatial attention module, and an eighth adder connected in sequence; the working process formula of the first spatial channel Mamba module is expressed as: ; ; ; ; in, Indicates the first Input to the spatial channel Mamba module, Indicates the first The output of the spatial channel Mamba module, This represents the first-level normalization module. This indicates the second-level normalization module. This indicates the third-level normalization module. This indicates the fourth-level normalization module. This represents the first visual state space module. This represents the second visual state space module. This indicates the channel attention module. This indicates a spatial attention module. This indicates the first intermediate result. This indicates the second intermediate result. This indicates a third intermediate result.
6. An electronic device, characterized in that, Memory, used for non-transitory storage of computer-readable instructions; and Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in any one of claims 1-4.
7. A storage medium, characterized in that, Non-transitory storage of computer-readable instructions, wherein when the non-transitory computer-readable instructions are executed by a computer, the method of any one of claims 1-4 is performed.
Citation Information
Patent Citations
Remote sensing image segmentation method and system based on improved SwinTransform
CN117095168A
