Remote sensing image semantic segmentation method and system based on dynamic attention mechanism

By constructing a dynamic processing flow of multi-scale feature maps and fused feature maps, and a multi-task joint optimization strategy, the problem of inaccurate extraction of ground object boundaries in remote sensing image segmentation is solved, achieving high-precision segmentation and classification of remote sensing images in complex scenes, and improving the overall effect of remote sensing image analysis.

CN120953996APending Publication Date: 2025-11-14ECONOMIC TECH RES INST OF STATE GRID ANHUI ELECTRIC POWER
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202511131696.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing remote sensing image segmentation and classification technologies struggle to accurately extract ground feature boundaries in complex scenes, impacting the accuracy of classification and analysis.

Method used

A remote sensing image semantic segmentation method based on dynamic attention mechanism is adopted. By constructing a dynamic processing flow of multi-scale feature maps and fused feature maps, a dual-stream decoder network and a multi-task joint optimization strategy are introduced to achieve accurate segmentation and classification of ground objects in complex scenes.

Benefits of technology

It improves the accuracy and performance of image segmentation, enhances the overall effect of remote sensing image analysis and processing, and strengthens the model's adaptability to complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953996A_ABST
    Figure CN120953996A_ABST
Patent Text Reader

Abstract

The invention discloses a remote sensing image semantic segmentation method and system based on a dynamic attention mechanism, and relates to the technical field of remote sensing image processing, and the method comprises the following steps: carrying out the labeling and enhancement processing of a multi-scene remote sensing image, and generating a standardized data set; processing the data set through an encoder, and extracting a multi-scale high-dimensional feature map; decoding the multi-scale high-dimensional feature map, and fusing a decoding result with scale features to generate an optimized feature map; based on the optimized feature map, adopting a joint loss function to synchronously optimize segmentation, detection and classification tasks; performing dynamic up-sampling and boundary refinement on the optimized feature map, and outputting a structured analysis result; according to the method, the boundary information of the ground objects in the remote sensing image is accurately extracted through a dynamic processing flow and introduction of a double-flow decoder network and a multi-task joint optimization strategy, accurate segmentation and classification of the ground objects in a complex scene are achieved, and the overall effect of analysis and processing of the remote sensing image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of remote sensing image processing technology, and more specifically, to a method and system for semantic segmentation of remote sensing images based on a dynamic attention mechanism. Background Technology

[0002] Remote sensing images are image data of the ground or surface objects acquired through remote sensing technology. They are widely used in fields such as geographic information science, environmental monitoring, and resource management. Remote sensing technology uses sensors launched from platforms such as aircraft, satellites, and drones to detect information about the Earth's surface or atmosphere and convert this information into image data. Depending on the type of remote sensing sensor, remote sensing images can contain information in different spectral bands, such as visible light, infrared, and microwaves. These images help us understand the various properties and changes of the Earth's surface and atmosphere.

[0003] However, existing remote sensing image segmentation and classification techniques still have shortcomings in terms of detection and classification efficiency and accuracy. In complex scenes, traditional segmentation methods often struggle to accurately extract ground feature boundaries, thus affecting the accuracy of classification and analysis.

[0004] To address the above problems, this invention proposes a solution. Summary of the Invention

[0005] To overcome the aforementioned shortcomings of existing technologies, embodiments of the present invention provide a remote sensing image semantic segmentation method and system based on a dynamic attention mechanism. By constructing a dynamic processing flow of multi-scale feature maps and fused feature maps, the method accurately extracts the boundary information of ground features in remote sensing images, achieving precise segmentation and classification of ground features in complex scenes. By introducing a dual-stream decoder network and a multi-task joint optimization strategy, the system effectively improves the accuracy of image segmentation, especially in complex environments, fully exploring image details, optimizing image segmentation performance, and thus improving the overall effect of remote sensing image analysis and processing.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A semantic segmentation method for remote sensing images based on a dynamic attention mechanism includes the following steps: annotating and enhancing remote sensing images of multiple scenes to generate a standardized dataset; processing the dataset through an encoder to extract multi-scale high-dimensional feature maps; decoding the multi-scale high-dimensional feature maps and fusing the decoding results with scale features to generate optimized feature maps; simultaneously optimizing segmentation, detection, and classification tasks based on the optimized feature maps using a joint loss function; and performing dynamic upsampling and boundary refinement on the optimized feature maps to output structured analytical results.

[0007] In a preferred embodiment, the step of annotating and enhancing multi-scene remote sensing images to generate a standardized dataset specifically involves: annotating remote sensing image data using a pre-trained object detection model; performing data enhancement processing on the annotated remote sensing image data through image affine transformation; and performing normalization processing and channel mean removal on the enhanced images to generate a standardized dataset.

[0008] In a preferred embodiment, the step of processing the dataset through the encoder to extract multi-scale high-dimensional feature maps specifically involves: constructing an encoder containing hybrid Transformer blocks based on the SegFormer architecture and loading pre-trained model parameters; inputting the standardized dataset into the encoder and generating preliminary feature maps through multi-layer convolution operations; performing pooling operations on the preliminary feature maps to obtain dimensionality-reduced feature maps; and cascading the dimensionality-reduced feature maps to generate several levels of feature maps, thus forming multi-scale high-dimensional feature maps.

[0009] In a preferred embodiment, the convolution and pooling operations are specifically as follows: a 3×3 convolution kernel is used to perform position-preserving convolution on the standardized image, and a preliminary feature map that retains spatial position information is generated by calculating through a sliding window; a 2×2 pooling window is used to sample the preliminary feature map with a stride of 2, so as to compress the spatial resolution to 1 / 2 of the original image while retaining key features, and output a dimensionality-reduced feature map.

[0010] In a preferred embodiment, the decoding of the multi-scale high-dimensional feature map specifically involves: embedding features into the multi-scale high-dimensional feature map and adding positional encoding; inputting the position-encoded feature embedding vector into the spatial decoding stream and the channel decoding stream for several layers of iterative decoding to obtain spatial features and channel features; concatenating the spatial features and channel features element-wise to obtain a joint feature vector; calculating the difference between the spatial features and the channel features to generate a dynamic weight vector; and performing weighted fusion based on the dynamic weight vector and the joint feature vector to generate an initial fused feature map.

[0011] In a preferred embodiment, the step of fusing the decoding result with scale features to generate an optimized feature map specifically involves: performing global max pooling on the channel features and generating channel attention weights through convolution; cross-multiplying the spatial features with the channel attention weights to obtain spatially weighted features; cross-multiplying the channel features with the spatial attention weights to obtain channel-weighted features; fusing the spatially weighted features and the channel-weighted features through addition to obtain spatial-channel fused features; performing scale alignment on the feature map of the i-th layer of the encoder; and fusing the primary fused features and the aligned features through weighted concatenation to output the optimized feature map.

[0012] In a preferred embodiment, the step of simultaneously optimizing segmentation, detection, and classification tasks based on optimized feature maps and using a joint loss function specifically involves: calculating independent loss values ​​for semantic segmentation, object detection, and boundary regression tasks in parallel based on optimized feature maps; constructing a dynamic correlation matrix representing the correlation between tasks; adaptively weighting and fusing the independent loss values ​​according to the correlation matrix to generate a global optimized loss; and simultaneously optimizing all task parameters through backpropagation of the global loss.

[0013] In a preferred embodiment, the step of performing dynamic upsampling and boundary refinement on the optimized feature map and outputting structured parsing results specifically involves: generating a high-resolution feature map through content-aware upsampling, extracting boundary information from the feature map to generate a boundary probability map; fusing the boundary probability map with the feature map to generate boundary enhancement features; performing multi-scale context extraction on the boundary enhancement features to output refined features; and generating semantic segmentation masks and target detection results in parallel based on the refined features.

[0014] A remote sensing image semantic segmentation system based on a dynamic attention mechanism includes: a data acquisition and preprocessing module for annotating and enhancing remote sensing images of multiple scenes to generate a standardized dataset; a feature encoding module for processing the dataset through an encoder to extract multi-scale high-dimensional feature maps; a feature decoding and fusion module for decoding the multi-scale high-dimensional feature maps and fusing the decoding results with scale features to generate optimized feature maps; a comprehensive optimization module for simultaneously optimizing segmentation, detection, and classification tasks based on the optimized feature maps using a joint loss function; and a result generation and output module for performing dynamic upsampling and boundary refinement on the optimized feature maps and outputting structured analytical results.

[0015] The technical effects and advantages of the remote sensing image semantic segmentation method and system based on dynamic attention mechanism of the present invention are as follows: 1. This invention constructs a multi-scale dynamic feature processing workflow to extract and fuse high-dimensional features from remote sensing images in a hierarchical manner, forming a fusion feature system capable of accurately mining ground feature information. This design overcomes the limitations of traditional single feature processing, achieving deep integration and efficient utilization of multi-dimensional features, providing a high-quality feature foundation for subsequent semantic segmentation and object detection. This fusion feature system can flexibly capture ground feature details and boundary information based on image content, greatly improving the system's segmentation accuracy and feature response capability.

[0016] 2. This invention comprehensively optimizes model performance by introducing a dual-stream decoding and multi-task joint optimization strategy, combined with multi-task loss functions (such as semantic segmentation accuracy, target localization accuracy, and classification confidence). Through spatial and channel separation processing of feature decoding and dynamic weight allocation of multi-task losses, and with the help of feature fusion and joint training mechanisms, the system can efficiently generate segmentation and detection results that meet the needs of multiple tasks. This mechanism not only enhances the model's adaptability to complex scenes but also provides strong support for improving the overall effect of remote sensing image processing. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a remote sensing image semantic segmentation method based on a dynamic attention mechanism according to the present invention.

[0018] Figure 2 This is a schematic diagram of the structure of a remote sensing image semantic segmentation system based on a dynamic attention mechanism according to the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0020] Example 1, Figure 1 This invention presents a remote sensing image semantic segmentation method based on a dynamic attention mechanism, comprising: S1, annotates and enhances remote sensing images from multiple scenes to generate a standardized dataset; In this embodiment, remote sensing images from multiple scenes are labeled and enhanced to generate a standardized dataset, as detailed below: Remote sensing image data covering cities, farmland, forests, and water areas was collected using commercial remote sensing satellites, drones, and publicly available remote sensing image datasets. To accurately segment semantics, the original remote sensing images needed to be labeled. YOLO was used for automatic labeling of the acquired images, and an object detection model was employed to identify different land cover categories in the images, generating corresponding category labels and bounding boxes. After automatic labeling, manual verification and correction were performed to ensure the accuracy of the labels, especially for complex land cover types, where manual correction significantly improved the accuracy of the data labeling. After labeling, each image contained the land cover category (e.g., city, farmland, forest, water area) and corresponding pixel-level annotation information.

[0021] To enhance the model's generalization ability and reduce overfitting, various data augmentation methods were applied to the labeled remote sensing image data while ensuring image quality. These methods included image rotation, flipping, scaling, color transformation, noise addition, and affine transformation, which maximized the expansion of the training dataset and increased the model's adaptability in complex scenes.

[0022] The enhanced remote sensing image data is standardized by size normalization, pixel value normalization, and channel mean removal to obtain a standardized dataset. Specifically, all enhanced remote sensing images are uniformly adjusted to the same size to ensure the shape consistency of the input data and avoid the impact of size differences on the model's training effect. For each pixel, its value is divided by 255 to normalize the pixel value range of the image from [0,255] to [0,1], avoiding training instability caused by differences in pixel value ranges between different images. By calculating the mean of each channel in the training dataset and subtracting the mean of the corresponding channel from each pixel, the influence of image illumination variations is removed, ensuring that the model can focus on the features of the ground objects themselves.

[0023] S2, the encoder processes the dataset to extract multi-scale high-dimensional feature maps; In this embodiment, the dataset is processed by an encoder to extract multi-scale high-dimensional feature maps, specifically as follows: An encoder based on the SegFormer architecture was chosen. To improve the network's convergence speed and feature representation capability, pre-trained model parameters were loaded to leverage knowledge gained from training on large-scale datasets, thereby accelerating the training process and improving model accuracy. The encoder contains multiple hybrid Transformer blocks, each composed of a self-attention mechanism and convolutional layers. A normalized dataset of size [size missing] is input to the encoder. ,in, For batch size, Image height, Image width, This represents the number of image channels.

[0024] The encoder first feeds the standardized input dataset into a multi-layer convolutional network for processing. Each convolutional layer uses a 3×3 kernel for sliding window computation, extracting local features such as edges and textures while preserving spatial location information. The convolution operation uses a stride of 1 and employs same padding to generate a preliminary feature map with a size of [size missing]. ,in, The height of the convolved image. The width of the convolved image. The number of channels in the convolutional image.

[0025] After the convolution operation, a pooling operation is performed on the initial feature map using a 2×2 pooling window and a stride of 2. This reduces the spatial resolution of the initial feature map to half its original value, resulting in a dimensionality-reduced feature map with a size of [size missing]. ,in, The height of the pooled image. The width of the pooled image. This represents the number of image channels after pooling.

[0026] The encoder generates feature maps at each layer by repeatedly performing convolution and pooling operations. Each convolution operation extracts deeper feature information, while pooling further reduces the spatial dimension of the feature maps. By continuously generating feature maps at different levels through convolution and pooling, it provides multi-scale feature representations from local to global. Each convolution operation uses a different number of convolution kernels to progressively enhance the semantic information of the features. The output feature map of each layer is concatenated with the feature map of the previous layer, ultimately generating several layers of feature maps. These feature maps represent semantic information at different scales in the image. Specifically: after the first stage of processing, the output feature map has a resolution of 1 / 4 of the input image and 256 channels; after the second stage of processing, the output feature map has a resolution of 1 / 8 of the input image and 512 channels; after the third stage of processing, the output feature map has a resolution of 1 / 16 of the input image and 1024 channels; after the fourth stage of processing, the output feature map has a resolution of 1 / 32 of the input image and 2048 channels. Concatenating these four feature maps at different scales yields a multi-scale high-dimensional feature map with a size of [size missing]. ,in, The image height is the multi-scale high-dimensional feature map. The image width is the multi-scale high-dimensional feature map. The number of image channels for multi-scale high-dimensional feature maps.

[0027] S3 decodes multi-scale high-dimensional feature maps and fuses the decoding results with scale features to generate optimized feature maps; In this embodiment, the multi-scale high-dimensional feature map is decoded, specifically as follows: The feature vector of each pixel will be transformed through mapping. The embedding vectors of dimension 1 yield an embedding feature map of size 2. To provide spatial location information, each embedding vector will have a location encoding added, with the encoding dimension of each embedding vector's location being [dimension number missing]. Position codes are typically calculated using sine and cosine functions, specifically:

[0028]

[0029] in, For the position index of the sequence, The dimension encoded for the current position. This represents the encoding dimension of the embedding vector position. By adding the position encoding element-wise to the embedding vector, we obtain an embedding feature map with added position-aware information.

[0030] The feature embedding vector with added positional encoding is input into a dual-stream decoder network, which includes a spatial decoding stream and a channel decoding stream. In the dual-stream decoder network, the input feature embedding vector undergoes a multi-layer iterative decoding process. In each layer of decoding, the spatial decoding stream gradually recovers the spatial details of the image through multi-layer convolution and deconvolution operations to generate spatial features, while the channel decoding stream recovers the channel information of the image through hierarchical operations to recover the semantic features of different objects or backgrounds and generate channel features.

[0031] Spatial features and channel features are concatenated element-wise along the feature dimension to generate a size of [size missing]. The joint eigenvectors, and These represent the number of output channels for the spatial decoding and channel decoding branches, respectively.

[0032] Activation function via Softmax Calculate the difference between the spliced ​​spatial and channel features to generate a dynamic weight vector. ,in, For input feature number The degree of difference of each element This represents the location of all possible categories or features. Weighted fusion is achieved by element-wise multiplying the dynamic weight vector with the joint feature map, generating a weighted fused feature map. The weighted fused feature map is then further processed by a convolutional layer to obtain the initial fused feature map.

[0033] In this embodiment, the decoding result is fused with scale features to generate an optimized feature map, specifically as follows: After multiple convolutional and pooling operations, the obtained spatial features contain local information of each pixel in the image. Different spatial locations contribute differently to the semantic segmentation task. Therefore, we use global average pooling to reduce the dimensionality of the entire feature map, obtaining a global semantic representation. ,in, Spatial location eigenvalues ​​at that location These are the spatial features after global average pooling. For channel features, global max pooling is used to extract the channel feature value with the largest response, generating a global channel feature representation. , The spatial attention weights are generated by convolving the channel features after global max pooling and the spatial features after global average pooling through a 1×1 convolution. and channel attention weights :

[0034]

[0035] Spatial features are cross-multiplied with channel attention weights to obtain spatial weighted features. Channel features are cross-multiplied with spatial attention weights to obtain channel weighted features. Spatial weighted features and channel weighted features are fused by addition to obtain spatial-channel fusion features. The i-th layer feature map output by the encoder is upsampled by bilinear interpolation to restore the spatial resolution of the image and aligned with the scale of the spatial-channel fusion features. The aligned i-th layer feature map and the spatial-channel fusion features are then weighted by 1×1 convolution and concatenated along the channel dimensions to obtain the optimized feature map.

[0036] S4, based on optimized feature maps, uses a joint loss function to simultaneously optimize segmentation, detection, and classification tasks; In this embodiment, based on the optimized feature map, a joint loss function is used to simultaneously optimize the segmentation, detection, and classification tasks, specifically as follows: Based on optimized feature maps, semantic segmentation, object localization, classification, and bounding box regression tasks are performed. Loss functions are constructed for each task, including semantic segmentation, object localization, classification, and bounding box regression. For semantic segmentation, the classification error for each pixel is calculated. The loss function for semantic segmentation is the cross-entropy loss, and the formula for calculating the loss value is as follows:

[0037] in, Loss value for semantic segmentation task Indicates the true label, Predicting probabilities Indicates the number of pixels.

[0038] The target localization task measures the positional error of a target in an image. The target localization loss function uses smoothed L1 loss, and the formula for calculating the loss value of the target localization task is:

[0039] in, To determine the task loss value for the target, It is the actual target location. It is the predicted target location. The target quantity.

[0040] The classification task calculates the classification error for each target category using a combination of cross-entropy loss and soft max activation. The formula for calculating the loss value in the classification task is as follows:

[0041] in, For the classification task loss value, For the real category, For the predicted class probability, This represents the number of categories.

[0042] The bounding box regression task is used to calculate the regression error of the target bounding box position. CIoU loss is used to evaluate the regression accuracy. The formula for calculating the loss value of the bounding box regression task is:

[0043] in, This represents the loss value for the bounding box regression task. To predict the intersection-union ratio (IU / U) between the bounding box and the ground truth bounding box, For the prediction box, For the true frame, Let be the Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box. The diagonal length of the minimum bounding box. The aspect ratio is used to balance the importance of different objectives. The difference in aspect ratio.

[0044] The loss values ​​from semantic segmentation, object localization, classification, and bounding box regression tasks are combined into a single loss vector. Based on the loss vector, the Pearson correlation coefficient is used to assess the degree of correlation between tasks. ,in, It is the loss value and covariance, and They are and standard deviation The correlation coefficient is used. The Pearson correlation coefficient for each pair of tasks has been pre-calculated using task loss, resulting in a dynamic correlation matrix. The larger V is, the stronger the relationship between the two tasks. This is based on the dynamic association matrix. The loss values ​​of each task are weighted and combined to obtain the total loss. ,in, It is the transpose of the loss vector. It is the loss vector.

[0045] Based on the calculated total loss The network parameters are optimized using the backpropagation algorithm. The optimization process involves calculating the gradient of the loss function with respect to the network parameters and updating the network parameters using gradient descent. ,in, and These are the updated parameters and the current parameters, respectively. It's the learning rate. It is the loss function with respect to the parameters The gradient is calculated. Through multiple backpropagation iterations, the loss of each task in the network is gradually minimized, thereby improving the multi-task learning performance of the model.

[0046] S5 performs dynamic upsampling and boundary refinement on the optimized feature map, and outputs structured analytical results; In this embodiment, dynamic upsampling and boundary refinement are performed on the optimized feature map, and structured analysis results are output, specifically as follows: After obtaining the optimized feature map, a deformable convolutional layer is first introduced. Traditional convolutions have fixed sampling positions, making it difficult to adapt to the irregular shapes and complex structures of targets in remote sensing images. The deformable convolutional layer, however, learns additional offsets, enabling it to dynamically adjust the sampling positions of the convolutional kernel. Specifically, for the input fused feature map, the deformable convolutional layer predicts a set of offsets of the same size as the convolutional kernel. These offsets act on the standard convolutional sampling grid, deforming it to form a dynamic sampling grid.

[0047] The optimized feature map is upsampled using a dynamically generated sampling grid. During upsampling, corresponding feature values ​​are extracted from the optimized feature map based on the position of the dynamic sampling grid. Then, bilinear interpolation or other suitable interpolation methods are used to upsample the feature map to the required high resolution, resulting in a high-resolution feature map. This content-aware upsampling method adaptively adjusts the sampling position according to the importance and feature distribution of the image content. For example, in remote sensing images, for features with clear outlines and structures such as buildings and roads, the dynamic sampling grid can more accurately capture the features at their edges and corners, allowing the upsampled high-resolution feature map to clearly reflect the details of these features, avoiding the edge blurring and detail loss problems that may occur with traditional upsampling methods.

[0048] After obtaining the high-resolution feature map, the Sobel edge detection operator is used to process it. The Sobel operator effectively detects edge information in the image by calculating the gradients in the horizontal and vertical directions. For each pixel in the high-resolution feature map, the Sobel operator calculates the gradient magnitudes in the horizontal and vertical directions, using the following formula: ,in, It is the gradient magnitude of a pixel. This represents the gradient value of a pixel in the high-resolution feature map in the horizontal direction. This represents the gradient value of the same pixel in the vertical direction in the high-resolution feature map. By applying the Sobel operator to the entire high-resolution feature map, a grayscale image containing image edge information is obtained. Then, the grayscale image is normalized and thresholded to convert it into a boundary probability map. Each pixel value in the boundary probability map represents the probability that the location belongs to an image boundary; the closer the value is to 1, the more likely the location is to be a boundary, and vice versa. In remote sensing images, Sobel edge detection can clearly detect the boundaries between different land features, such as the boundary between farmland and forest, or the boundary between river and land, providing a foundation for subsequent boundary enhancement.

[0049] The boundary probability map is multiplied channel-by-channel with the high-resolution feature map. In this process, the boundary probability map acts as a weight map, weighting each channel of the high-resolution feature map. Specifically, for each pixel value in each channel of the high-resolution feature map, it is multiplied by the corresponding pixel value in the boundary probability map. Thus, in regions with higher probability values ​​in the boundary probability map (i.e., the image boundary regions), the corresponding pixel values ​​in the high-resolution feature map are enhanced, while in regions with lower probability values ​​in the boundary probability map (i.e., the image non-boundary regions), the corresponding pixel values ​​in the high-resolution feature map remain relatively unchanged or are weakened.

[0050] A 3×3 dilated convolution is performed on the boundary enhancement feature map to output a refined feature map. Specifically, to further refine the boundary information, a 3×3 dilated convolution operation is performed on the boundary enhancement feature map. Dilated convolution can expand the receptive field of the convolution kernel without increasing the number of parameters or computational cost, thereby obtaining richer contextual information. For 3×3 dilated convolution, the dilation rate determines the spacing between sampling points in the convolution kernel. For example, when the dilation rate is 2, the spacing between sampling points in the original 3×3 convolution kernel is 1 pixel, which is equivalent to sampling within a 5×5 area. By performing a 3×3 dilated convolution on the boundary enhancement feature map, the features of the boundary region can be further integrated and optimized, removing some noise and false boundaries while retaining the true boundary information, resulting in a refined feature map.

[0051] A 1×1 convolution operation is performed on the refined feature map. The purpose of the 1×1 convolution is to adjust the number of channels in the feature map, converting it to the same number of channels as the number of semantic categories. For example, if a remote sensing image needs to be segmented into 10 categories such as buildings, roads, vegetation, and water bodies, then after the 1×1 convolution, the number of channels in the feature map will become 10. At this point, each channel represents the feature response of the corresponding category. Then, the resulting multi-channel feature map is processed by the softmax activation function, converting the feature value of each channel into a probability value belonging to the corresponding category, resulting in a category probability map. In the category probability map, the value of each pixel in each channel represents the probability that the pixel belongs to the corresponding category. Finally, through the argmax operation, for each pixel, the category with the highest probability value among all category channels is selected as the predicted category of the pixel, thereby generating a semantic segmentation mask.

[0052] Simultaneously, RoI Align is used to process the refined feature map and extract Regions of Interest (RoI) features. RoI Align can accurately extract the feature regions corresponding to the target detection boxes on the feature map, and align and sample the features through methods such as bilinear interpolation, avoiding the accuracy loss caused by quantization operations in traditional RoI Pooling methods. For each RoI, RoI Align outputs a fixed-size feature map. Then, the extracted RoI feature map is flattened and input into a fully connected layer. The fully connected layer further processes and classifies the RoI features through a series of linear transformations and activation functions. At the output of the fully connected layer, the target classification result and the detection box coordinates are output in parallel. The target classification result represents the probability that the target within the RoI belongs to a certain predefined category, while the detection box coordinates are used to determine the position and size of the target in the original remote sensing image. In this way, the classification and localization of targets in remote sensing images are realized, providing results for the target detection task in remote sensing images.

[0053] Example 2, Figure 2 This invention presents a remote sensing image semantic segmentation system based on a dynamic attention mechanism, comprising: The data acquisition and preprocessing module annotates and enhances remote sensing images from multiple scenes to generate standardized datasets. The feature encoding module processes the dataset through the encoder and extracts multi-scale high-dimensional feature maps; The feature decoding and fusion module decodes multi-scale high-dimensional feature maps and fuses the decoding results with scale features to generate optimized feature maps. The comprehensive optimization module, based on the optimized feature map, uses a joint loss function to simultaneously optimize segmentation, detection, and classification tasks; The results generation and output module performs dynamic upsampling and boundary refinement on the optimized feature map and outputs structured analytical results.

[0054] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.

[0055] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, in the form of a computer program product.

[0056] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein 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 application.

[0057] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.

[0058] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0059] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A semantic segmentation method for remote sensing images based on a dynamic attention mechanism, characterized in that, Includes the following steps: Annotate and enhance remote sensing images from multiple scenes to generate standardized datasets; The dataset is processed by an encoder to extract multi-scale high-dimensional feature maps; Decode multi-scale high-dimensional feature maps and fuse the decoding results with scale features to generate optimized feature maps; Based on optimized feature maps, a joint loss function is used to simultaneously optimize segmentation, detection, and classification tasks. Dynamic upsampling and boundary refinement are performed on the optimized feature map, and structured analytical results are output.

2. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 1, characterized in that, The process of annotating and enhancing multi-scene remote sensing images to generate a standardized dataset specifically involves: Annotate remote sensing image data using a pre-trained object detection model; The labeled remote sensing image data is augmented using affine transformation. The enhanced image is normalized and the channel mean is removed to generate a standardized dataset.

3. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 2, characterized in that, The process of processing the dataset through the encoder to extract multi-scale high-dimensional feature maps specifically involves: An encoder containing hybrid Transformer blocks is built based on the SegFormer architecture, and pre-trained model parameters are loaded. The standardized dataset is input into the encoder, and preliminary feature maps are generated through multi-layer convolution operations. The initial feature map is pooled to obtain a dimensionally reduced feature map. The dimensionality-reduced feature maps are cascaded to generate feature maps of several levels, forming a multi-scale high-dimensional feature map.

4. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 3, characterized in that, The convolution and pooling operations are specifically as follows: A 3×3 convolution kernel is used to perform position-preserving convolution on the standardized image, and a preliminary feature map that retains spatial location information is generated by calculating through a sliding window. A 2×2 pooling window with a stride of 2 is used to sample the initial feature map, which compresses the spatial resolution to half of the original image while preserving key features, and outputs a dimensionality-reduced feature map.

5. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 4, characterized in that, The decoding of multi-scale high-dimensional feature maps specifically involves: Feature embedding with positional encoding is performed on multi-scale high-dimensional feature maps; The feature embedding vector with added positional encoding is input into the spatial decoding stream and the channel decoding stream for several layers of iterative decoding to obtain spatial features and channel features. The spatial features and channel features are concatenated element by element to obtain a joint feature vector; Calculate the difference between spatial features and channel features to generate a dynamic weight vector; An initial fused feature map is generated by weighted fusion of dynamic weight vector and joint feature vector.

6. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 5, characterized in that, The process of fusing the decoding results with scale features to generate an optimized feature map specifically involves: Global max pooling is performed on the channel features, and channel attention weights are generated through convolution. Spatial features are cross-multiplied with channel attention weights to obtain spatial weighted features; The channel features are cross-multiplied with the spatial attention weights to obtain the channel-weighted features; Spatial weighted features and channel weighted features are fused by addition to obtain spatial channel fused features; Scale alignment is performed on the feature map of the i-th layer of the encoder; The optimized feature map is output by weighted splicing and fusing the primary fusion features and the alignment features.

7. A remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 6, characterized in that, The method of simultaneously optimizing segmentation, detection, and classification tasks based on optimized feature maps and using a joint loss function is as follows: Independent loss values ​​for semantic segmentation, object detection, and boundary regression tasks are computed in parallel based on optimized feature maps. Construct a dynamic correlation matrix representing the correlation between tasks; The independent loss values ​​are adaptively weighted and fused based on the correlation matrix to generate a globally optimized loss. All task parameters are optimized synchronously through backpropagation of global loss.

8. The remote sensing image semantic segmentation method based on dynamic attention mechanism according to claim 7, characterized in that, The process of performing dynamic upsampling and boundary refinement on the optimized feature map and outputting structured analytical results is as follows: High-resolution feature maps are generated through content-aware upsampling, and boundary information of the feature maps is extracted to generate boundary probability maps. The boundary probability map and feature map are fused to generate boundary enhancement features; Multi-scale context extraction is performed on the boundary enhancement features to output refined features; Semantic segmentation masks and object detection results are generated in parallel based on refined features.

9. A remote sensing image semantic segmentation system using the dynamic attention mechanism as described in any one of claims 1-8, characterized in that, include: The data acquisition and preprocessing module annotates and enhances remote sensing images from multiple scenes to generate standardized datasets. The feature encoding module processes the dataset through the encoder and extracts multi-scale high-dimensional feature maps; The feature decoding and fusion module decodes multi-scale high-dimensional feature maps and fuses the decoding results with scale features to generate optimized feature maps. The comprehensive optimization module, based on the optimized feature map, uses a joint loss function to simultaneously optimize segmentation, detection, and classification tasks; The results generation and output module performs dynamic upsampling and boundary refinement on the optimized feature map and outputs structured analytical results.

Citation Information

Cited By

  • Remote sensing image recognition method and system based on semi-automatic labeling and semantic segmentation

    CN122049683A

  • Remote sensing image recognition method and system based on semi-automatic labeling and semantic segmentation

    CN122049683B

  • Deep learning-based forest remote sensing image semantic segmentation processing method and system

    CN122115843A

  • Magnetic resonance imaging automatic classification and lesion detection method based on deep learning

    CN122135100A