Glacier image segmentation method and system based on hybrid self-cross attention and context aggregation
By combining self-crossing attention with contextual aggregation, the problem of cross-scale semantic mismatch and boundary detail loss in glacier segmentation is solved, achieving high-precision glacier image segmentation while reducing computational overhead.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAT SATELLITE METEOROLOGICAL CENT
- Filing Date
- 2026-04-22
- Publication Date
- 2026-07-03
Smart Images

Figure CN122336296A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a glacier image segmentation method and system based on hybrid self-cross attention and contextual aggregation, belonging to the field of glacier image segmentation technology. Background Technology
[0002] Glaciers, as important indicators of freshwater resources and climate change, are crucial for water resource assessment, disaster risk analysis, and climate change research, as information on their area changes, melting rates, and spatial distribution is essential. With the continuous acquisition of medium- and high-resolution multispectral remote sensing data, the automatic extraction and detailed mapping of glacier extents using remote sensing imagery has become a critical need.
[0003] Existing glacier extraction methods mainly include spectral index-based and threshold-based segmentation methods, traditional supervised classification, unsupervised classification methods, and semantic segmentation methods based on deep learning. Thresholding methods based on spectral indices such as the normalized differential snow index are simple to implement and have low computational cost, but they are sensitive to different regions, seasons, and imaging conditions. Furthermore, they are prone to misclassification and underreporting in complex backgrounds such as snow cover, shadow occlusion, cloud and fog effects, debris-covered glaciers, glacial lakes, and bare rocks. Traditional classification and object-oriented methods typically rely on manual feature design and parameter tuning, which limits their generalization ability and makes it difficult to work stably in large-scale, multi-source data and complex terrain scenarios.
[0004] In recent years, semantic segmentation models based on convolutional neural networks (such as encoder-decoder structures) have achieved good representation capabilities through end-to-end learning. However, the local receptive field characteristics of convolutional operations make them insufficient for modeling long-distance dependencies and large-scale contexts, easily leading to rough boundaries, breaks, and misclassification when the boundaries between glaciers and backgrounds are blurred, textures are similar, or targets have slender structures. To enhance global modeling capabilities, some existing technologies have introduced Transformer structures to obtain stronger global dependencies. However, the following problems still commonly exist in remote sensing segmentation tasks: First, multi-scale features differ in semantic hierarchy and spatial details, and direct fusion can easily cause cross-scale semantic mismatches, affecting localization and segmentation accuracy. Second, segmentation networks are prone to losing high-frequency boundary information during progressive downsampling and upsampling, resulting in unclear edges and missed detection of small targets. Third, high-resolution remote sensing images have large areas and dense pixels, and complex attention calculations and redundant feature fusions can lead to high parameter counts and computational overhead, making it difficult to achieve a balance between efficiency and accuracy.
[0005] Therefore, existing technologies still lack a technical solution that can achieve high-precision glacier segmentation under complex backgrounds and fuzzy boundary conditions, while also taking into account computational efficiency and effectively mitigating cross-scale semantic mismatch and boundary detail loss. Summary of the Invention
[0006] The technical problem to be solved by this invention is to provide a glacier image segmentation method and system based on hybrid self-cross attention and context aggregation, so as to improve cross-scale semantic alignment capability, enhance discriminative features and improve boundary refinement effect, while reducing redundant computational overhead.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A glacier image segmentation method based on hybrid self-cross attention and context aggregation includes the following steps: Step 1: Obtain the glacier remote sensing image to be segmented, and preprocess the glacier remote sensing image to obtain the input image for the glacier image segmentation network; Step 2: Input the glacier image segmentation network into the hierarchical encoder for feature extraction, obtaining multi-scale features at resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image resolution. ; Step 3: Utilize a hybrid self-crossing attention module for multi-scale features. and Perform hybrid attention computation, including self-attention and cross-attention computation, to obtain enhanced features aligned across scales. ;Utilizing a hybrid self-crossing attention module for multi-scale features Performing self-attention computation yields high-level semantic features that include the global context. ; Step 4, The input decoder performs bottom-up, step-by-step fusion decoding, including: upsampling the current scale features and fusing them with the previous scale features, iterating to a 1 / 4 resolution scale to obtain the fused features; Step 5: Perform lightweight context aggregation and channel recalibration on the fused features at the 1 / 4 resolution scale to obtain enhanced features; Step 6: The enhanced features obtained in Step 5 are refined to obtain boundary residual information. At the same time, the enhanced features obtained in Step 5 are initially segmented using a linear classification head to obtain an initial category response. The boundary residual information and the initial category response are fused to obtain a refined segmentation prediction. The refined segmentation prediction is upsampled to the input image resolution of the glacier image segmentation network to output the glacier segmentation result.
[0008] This invention also proposes a segmentation system based on the aforementioned glacier image segmentation method based on hybrid self-cross attention and context aggregation, the segmentation system comprising: The data acquisition and preprocessing module is used to acquire the glacier remote sensing images to be segmented and to preprocess the glacier remote sensing images to obtain the input images for the glacier image segmentation network. The encoder module is used to extract features from the input images of the glacier image segmentation network, obtaining multi-scale features at resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image resolution. ; Hybrid self-cross attention module for multi-scale features and Perform hybrid attention computation, including self-attention and cross-attention computation, to obtain enhanced features aligned across scales. It is also used for multi-scale features. Performing self-attention computation yields high-level semantic features that include the global context. ; Decoding and fusion module, used for... Perform bottom-up, step-by-step fusion decoding, including: upsampling the current scale features and fusing them with the previous scale features, iterating to a 1 / 4 resolution scale to obtain the fused features; The feature enhancement module is used to perform lightweight context aggregation and channel recalibration on the fused features at a 1 / 4 resolution scale to obtain enhanced features; The boundary refinement module is used to refine the boundaries of the enhanced features to obtain boundary residual information. At the same time, the linear classification head is used to perform preliminary segmentation of the enhanced features to obtain initial class responses. The boundary residual information and the initial class responses are fused to obtain refined segmentation predictions. The refined segmentation predictions are upsampled to the input image resolution of the glacier image segmentation network to output glacier segmentation results.
[0009] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects: 1. This invention introduces a hybrid self-cross attention module (HSC-AM) at a low-resolution high-level semantic scale, combining the global modeling capability of self-attention with the content-aware selective injection of cross-scale cross attention. This achieves cross-scale semantic alignment and improves discriminative feature expression in complex backgrounds, thereby alleviating the semantic mismatch problem caused by direct fusion of multiple scales.
[0010] 2. This invention introduces global scene priors into the 1 / 4 fused features through the Feature Enhancement Module (FEM), and recalibrates the channels using a fusion method of channel variance selection and efficient channel attention. This reduces redundant channels with lower additional computation, enhances key discrimination cues, and improves the separability and robustness of fragmented glaciers and easily confused backgrounds.
[0011] 3. This invention learns the edge correction amount and injects the initial response through the residual boundary refinement branch of the boundary refinement module (BSM), which effectively improves the contour quality of blurred boundaries, slender structures and small targets.
[0012] 4. The method of the present invention can achieve high segmentation accuracy on glacier remote sensing data while maintaining a low parameter scale, and is suitable for engineering applications in large-format, high-resolution remote sensing scenarios. Attached Figure Description
[0013] Figure 1 This is a network structure diagram of the method of the present invention; Figure 2 This is a structural diagram of the Hybrid Self-Crossing Attention Module (HSC-AM) proposed in this invention; Figure 3 This is a structural diagram of the Feature Enhancement Module (FEM) proposed in this invention, where (a) is a multi-scale pooling structure (PPM) and (b) is a variance-selective channel attention structure (Vsel-ECA). Detailed Implementation
[0014] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0015] like Figure 1 As shown, this invention proposes a glacier remote sensing segmentation method based on hybrid self-cross-attention and contextual aggregation, comprising: acquiring remote sensing images and preprocessing slices; hierarchical Transformer encoding to extract multi-scale features; performing hybrid self-cross-attention enhancement at a preset scale; progressively fusing at the decoding end to restore resolution; contextual aggregation and channel recalibration to enhance features; and refining boundary residuals and outputting the segmentation result. The method includes the following steps: Step 1: Acquire the remote sensing image to be segmented and preprocess it to obtain the network input image; preprocessing includes normalization, cropping, and data augmentation. This includes the following steps: Step 1-1, Slicing and Sample Construction. Normalized remote sensing images are cropped using a sliding window to obtain image slices of a preset size. A preset overlap rate is set to improve sample coverage in boundary areas, generating training samples. Steps 1-2: Calculate the normalized differential snow index based on multispectral bands. , The expression is: , in, Represents the visible light band. Represents the shortwave infrared band. The value range is [-1, 1]. Thresholding is used for segmentation. As a result, a binary map of the glacier is generated, which is used to construct an initial mask for the glacier region; Steps 1-3: Threshold adaptation and annotation map conversion. The OTSU algorithm is used for... The results adaptively select a threshold to complete the segmentation, and the obtained mask is converted into a single-channel category annotation map to meet the requirements of semantic segmentation training; Steps 1-4, Consistency Data Enhancement. Consistency enhancement is performed on the training samples and the single-channel category annotation map. Enhancement methods include at least one of random flipping, noise perturbation, blurring, and color perturbation; during enhancement, the images and labels undergo the same geometric transformations.
[0016] Step 2 involves inputting the network input image into a hierarchical Transformer encoder for feature extraction, obtaining multi-scale features at resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32. This includes the following steps: Step 2-1, Efficient Self-Attention Mechanism (ESA) for input token sequence By sequence reduction rate Change the sequence length from Shrink to Reduce the computational scale of attention to This can be represented as: , in, These represent the query matrix, key matrix, and value matrix, respectively. This represents the activation function. For the feature dimensions of a single attention head, This represents the corresponding linear mapping; the sequence reduction rate set for the efficient self-attention mechanism at each layer is as follows: ; Step 2-2 introduces a local convolutional prior using a position-free Mix-FFN. To avoid the accuracy loss caused by explicit positional encoding interpolation when the resolution changes, a 3×3 depthwise convolution is inserted between the pointwise linear transformations of the two layers of the feedforward network to inject spatial prior, which can be expressed as: , in, , These are the input and output features of the position-free encoded Mix-FFN, respectively. This represents the GELU activation function. This represents a 3×3 depth-separable convolution. , Both represent point-by-point linear transformations. The channel expansion ratio, The channel dimension of the current coding layer. For the real number field; Steps 2-3: Overlapping block embedding. The input image is encoded at four levels to obtain multi-scale features. It is preferable to use an overlapping convolutional embedding method to complete downsampling and block embedding (for example, the first layer is set to K=7, S=4, P=3, and the second to fourth layers are set to K=3, S=2, P=1, where K, S, and P represent the kernel size, stride, and padding size, respectively), so as to preserve the spatial continuity between blocks while downsampling and reduce the loss of boundary information.
[0017] Step 3: Perform hybrid attention computation on multi-scale features at a 1 / 16 resolution scale, including at least same-scale self-attention and adjacent-scale cross-attention, to obtain cross-scale aligned enhanced features; and perform self-attention on high-level semantic features at a 1 / 32 resolution scale to obtain high-level semantic features containing global context. For example... Figure 2 As shown, it includes the following steps: Step 3-1, for the given high-level features With low-level features The two are projected onto the common bottleneck width of the hybrid cross-attention module through a 1×1 convolution. And upsample the low-level features bilinearly to the same level as... At the same scale, the features are flattened into a sequence and normalized to obtain... ,in Its calculation expression is: , Step 3-2, followed by The two attention paths required to generate the graph through linear mapping Self-attention originates from higher levels. , and Computation captures nonlocal dependencies within the same layer, although cross-attention still prioritizes higher layers. For queries, but the index and load come from the lower-level projection and upsampled. and Then, standard multi-head scaled dot product attention is used to calculate weights and converge the outputs of each head to obtain two responses. and Its calculation expression is: , , Step 3-3: Next, concatenate the outputs of the two branches and fuse them back to the original number of high-level feature channels using a 1×1 convolution. Then, the original high-level features A pixel-level gated weight map is obtained by using 3×3 depthwise separable convolution with Sigmoid activation. Finally, the fused features are modulated and the residuals are back-injected. It's worth noting that when a 1 / 16 scale is used as the input for high-level features, a 1 / 32 scale is used as the input for low-level features; the output at this point... Simultaneous calculation of self-attention and cross-attention; however, when the 1 / 32 scale is used as high-level input, there are no low-level feature inputs, and the output at this time... Only self-attention is calculated. The expression for this process is: , in, For channel splicing, This is for element-wise multiplication.
[0018] Step 4: Input the high-level semantic features into the decoder for bottom-up, step-by-step fusion decoding; upsample the features at the current scale and fuse them with the features at the previous scale, iterating until a 1 / 4 resolution scale is obtained to obtain the fused features. For example... Figure 1 As shown, the specific method is as follows: right Use 1×1 convolutions to unify the number of channels. (b=128), obtained without changing the spatial dimensions. Next, starting at a scale of 1 / 32, a bottom-up bilinear upsampling process is performed. After fusing with the feature residuals from the previous layer, a 3×3 convolution is used to refine and eliminate upsampling artifacts. Finally, the fused features are output at a scale of 1 / 4. The calculation expression for this process is: , in, For sequence normalization and ReLU activation, For bilinear upsampling. When hour, .
[0019] Step 5: Perform light contextual aggregation and channel recalibration on the fused features at 1 / 4 resolution to obtain enhanced features; contextual aggregation includes at least one of pyramid pooling or multi-scale pooling. This includes the following steps: Step 5-1 introduces a global prior using a multi-scale pooling structure (PPM). For example... Figure 3 As shown in (a), the 1 / 4 fused feature output from the decoding end is first processed. Perform adaptive average pooling with a pooling grid size of . This process yields sub-region representations with different receptive fields. The output at each scale is then processed by a 1×1 convolution to compress the dimension, making the number of channels in each layer approximately 1 / M of the original feature (where M is the number of pooling grids at that scale). After upsampling to the original scale via bilinear interpolation, the feature is concatenated with the original feature along the channel dimension. Finally, a 1×1 convolution layer completes the fusion and alignment, forming a feature that simultaneously carries global scene priors and contextual information from multiple sub-regions. Its calculation expression is: , Step 5-2, as follows Figure 3 As shown in (b), it includes two branches: Variance selection branch: First, select the input features The variance of each channel in the spatial dimension is calculated as a "channel activity" indicator, amplifying channels with high variance (more discriminative) and suppressing channels with low variance (more redundant). Then, after standardization in the channel dimension, channel weights are obtained through a sigmoid mapping. , It is a 1 / 4 scale. Its calculation expression is: , in, Choose weights for variance; ECA High-Efficiency Channel Branch: Input Features Spatial feature compression is performed using Global Average Pooling (GAP) to obtain a 1×1×C feature map. Then, channel feature learning is performed on the compressed feature map, followed by cross-channel feature learning through 1×1 convolution, outputting another 1×1×C feature map. Finally, the 1×1×C feature map is combined with channel attention (element-wise multiplication of the original input feature map) to obtain output weights that emphasize the features of the relevant channels. Its calculation expression is: , in, For the nuclear length One-dimensional convolution, It is the Sigmoid activation function. This indicates that the channel is multiplied element by element; Finally, the two weights are multiplied element-wise along each channel to select and recalibrate important channels. The variance-selective channel attention structure (Vsel-ECA) adds almost no computational cost but significantly improves the separability and robustness of fragmented glaciers. The final output of this module is... The expression is: .
[0020] Step 6 involves inputting the enhanced features into the boundary refinement branch to obtain boundary residual information, and then fusing the boundary residual with the initial segmentation prediction to obtain a refined segmentation prediction; finally, the image is upsampled to the original image resolution to output the glacier segmentation result. For example... Figure 1 As shown, it includes the following steps: Step 6-1: Obtain the 1 / 4 scale features refined by FEM. Then, the initial class response is first obtained through a 1×1 convolution of a linear classification head. Subsequently, another branch will... First, a depthwise separable 3×3 convolution is used to extract local high-frequency details and then activated by ReLU. Then, a 1×1 convolution is used to map the high-frequency features to each class space, forming boundary residuals. ; Step 6-2, apply a small factor to the residual. Injecting the initial response yields a refined 1 / 4-scale prediction. Finally, The final segmentation probability map is obtained by upsampling to the original resolution by four times and then normalizing. Its calculation expression is: .
[0021] This invention also proposes a glacier segmentation system based on hybrid self-cross attention and context aggregation, comprising: Data acquisition and preprocessing module: used to acquire remote sensing images and generate samples and annotations; Encoder module: used to extract multi-scale features; Hybrid Self-Cross Attention Module (HSC-AM): Used for synergistic enhancement of self-attention and cross-scale cross attention at a preset scale; Decoding and fusion module: used for bottom-up progressive upsampling and residual fusion to output 1 / 4 scale features; Feature Enhancement Module (FEM): Used for global prior injection in PPM and channel recalibration in VSe1-ECA; Boundary Refinement Module (BSM): Used to learn boundary residuals and output refined segmentation results.
[0022] Based on the same inventive concept, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the aforementioned glacier image segmentation method based on hybrid self-cross attention and context aggregation.
[0023] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned glacier image segmentation method based on hybrid self-cross attention and context aggregation.
[0024] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0025] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0026] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0027] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0028] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A method for glacier image segmentation based on hybrid self-cross attention and context aggregation, characterized in that, Includes the following steps: Step 1: Obtain the glacier remote sensing image to be segmented, and preprocess the glacier remote sensing image to obtain the input image for the glacier image segmentation network; Step 2, input the image of the glacier image segmentation network into the hierarchical encoder for feature extraction, to obtain multi-scale features with resolutions of 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the input image resolution ; Step 3: Utilize a hybrid self-crossing attention module for multi-scale features. and Perform hybrid attention computation, including self-attention and cross-attention computation, to obtain enhanced features aligned across scales. ;Utilizing a hybrid self-crossing attention module for multi-scale features Performing self-attention computation yields high-level semantic features that include the global context. ; Step 4, The input decoder performs bottom-up, step-by-step fusion decoding, including: upsampling the current scale features and fusing them with the previous scale features, iterating to a 1 / 4 resolution scale to obtain the fused features; Step 5: Perform lightweight context aggregation and channel recalibration on the fused features at the 1 / 4 resolution scale to obtain enhanced features; Step 6: The enhanced features obtained in Step 5 are refined to obtain boundary residual information. At the same time, the enhanced features obtained in Step 5 are initially segmented using a linear classification head to obtain an initial category response. The boundary residual information and the initial category response are fused to obtain a refined segmentation prediction. The refined segmentation prediction is upsampled to the input image resolution of the glacier image segmentation network to output the glacier segmentation result.
2. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 1, the preprocessing of the glacier remote sensing image includes normalization, cropping, and data augmentation. Normalized glacier remote sensing images are cropped using a sliding window, and image slices are generated based on preset size and preset overlap rate as image samples. Normalized differential snow index calculated based on multispectral bands : , in, Represents the visible light band. Represents the shortwave infrared band. The value range is [-1, 1]; threshold segmentation is used. As a result, a binary map of the glacier was generated, which was used to construct an initial mask for the glacier region and served as the basis for subsequent OTSU algorithm adaptive threshold segmentation and single-channel category labeling map generation. Adaptive selection of threshold pairs based on the OTSU algorithm The results are segmented, and the resulting labeled mask is converted into a single-channel category labeled map; Consistent data augmentation is performed on the image samples and the single-channel category annotation map to obtain the input image of the glacier image segmentation network. The data augmentation includes at least one of random flipping, noise perturbation, and blurring and color perturbation.
3. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 2, the hierarchical encoder comprises four layers, each layer including a highly efficient self-attention mechanism, a position-free coding Mix-FFN, and overlapping block embedding connected sequentially; wherein... Efficient self-attention mechanisms utilize sequence reduction rate The sequence length of the input features of each layer is changed from... Shrink to The compressed representation is obtained through linear transformation and reshaping. The input features of each layer are the output features of the previous layer. The input features of the first layer are the input images of the glacier image segmentation network. The calculation expression for this process is: , in, These represent the query matrix, key matrix, and value matrix, respectively. This represents the activation function. For the feature dimensions of a single attention head, This represents the corresponding linear mapping; the sequence reduction rate set for the efficient self-attention mechanism at each layer is as follows: ; The calculation expression for position-free Mix-FFN is: , in, , These are the input and output features of the position-free encoded Mix-FFN, respectively. This represents the GELU activation function. This represents a 3×3 depth-separable convolution. , Both represent point-by-point linear transformations. The channel expansion ratio, For the channel dimension of the position-free encoded Mix-FFN layer, For the real number field; The output of the position-free encoding Mix-FFN is embedded through overlapping blocks to obtain the output of each layer. The kernel size of the overlapping block embedding convolution in the first layer is set to K=7, stride to S=4, and padding size to P=3. The kernel sizes of the second to fourth layers are all set to K=3, S=2, and P=1. That is, after four layers of encoding, the input image of the glacier image segmentation network obtains multi-scale features with resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image resolution. .
4. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 3, a hybrid self-crossing attention module is used to process multi-scale features. and The specific process of performing hybrid attention computation is as follows: Will As a high-level characteristic , As low-level features The two are projected onto the common bottleneck channel number of the hybrid self-cross attention module through 1×1 convolution. And the low-level features after 1×1 convolution are bilinearly upsampled to the same level as... At the same scale, flatten the sequence again and normalize it to obtain features. The calculation expression is: , in, Presentation layer normalization operation, Indicates the flattening operation. For batch size, The number of common bottleneck channels for the hybrid cross-attention module. Representing features respectively Spatial height and spatial width, Represents a 1×1 convolution. Indicates bilinear upsampling; The query required for self-attention computation is generated through linear mapping. ,key Sum , The query required for cross-attention computation is generated through linear mapping. , The keys required for cross-attention computation are generated through linear mapping. Sum The self-attention calculation output is obtained by using multi-head scaled dot product attention to calculate weights and aggregating the outputs of each head. Output of cross-attention calculation The calculation expression is: , , in, This represents the activation function. The feature dimension of a single attention head; High-level characteristics A pixel-level gated weight map is obtained by using 3×3 depthwise separable convolution with Sigmoid activation. , and After concatenation, high-level features are fused back using a 1×1 convolution. Number of channels , and then with Element-wise multiplication yields the fused feature, which is then modulated and back-injected with residuals to obtain... The calculation expression is: , in, This represents the Sigmoid activation function. This represents a 3×3 depth-separable convolution. For channel splicing, This is for element-wise multiplication.
5. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 4, for Use 1×1 convolutions to unify the number of channels. To obtain features without changing the spatial dimensions ; Starting at a scale of 1 / 32, a bottom-up bilinear upsampling process is performed, which is then fused with the feature residuals from the previous layer. A 3×3 convolution is then used to refine the fused features and eliminate upsampling artifacts. Finally, the fused features are output at a scale of 1 / 4. The calculation expression is: , in, For sequence normalization and ReLU activation, Represents a 1×1 convolution. This represents a 3×3 convolution. This indicates bilinear upsampling.
6. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 5, the fusion features at a 1 / 4 resolution scale output by the decoder are... Perform adaptive average pooling, with pooling grid sizes of respectively This yields sub-region representations with different receptive fields; subsequently, pooling results with different grid sizes are fed into a 1×1 convolution for dimensionality compression, and then upsampled using bilinear interpolation to the corresponding data. After reaching the same spatial scale, and with The data is stitched together along the channel dimension, and finally fused and aligned using a 1×1 convolutional layer to form features that simultaneously carry global scene priors and contextual information from multiple sub-regions. The calculation expression is: , in, Represents a 1×1 convolution. Indicates channel-dimensional splicing. Indicates the pooling mesh size as Average pooling, This indicates that the pooling mesh size is... The pooling results are then subjected to bilinear interpolation upsampling; Features The variance is calculated for each channel in the spatial dimension. After standardizing the variance in the channel dimension, the channel weights are obtained through a Sigmoid mapping. The calculation expression is: , in, This is the variance statistic. Features The Each channel feature map For the first The spatial location of each channel eigenvalues at that location Features The space height and width, It is the Sigmoid activation function. Represents a standardized function; Features Global average pooling is used to compress spatial features, resulting in a compressed feature map. Channel features are then learned from this compressed feature map, followed by cross-channel feature learning via 1×1 convolution. The resulting learned feature map is then compared with... The channels are multiplied element-wise to obtain the weights of the output that reflect the features of the channels of interest. The calculation expression is: , in, For the nuclear length One-dimensional convolution, This represents the Sigmoid activation function. For element-wise multiplication, Indicates global average pooling; Weights of both paths and Element-wise multiplication by channel yields the enhanced features. The expression is: 。 7. The glacier image segmentation method based on hybrid self-cross attention and contextual aggregation according to claim 1, characterized in that, In step 6, the initial class response is first obtained by performing a 1×1 convolution on the enhancement features using a linear classification head; then, the enhancement features are extracted using a 3×3 depthwise separable convolution. The local high-frequency details are extracted and activated by ReLU, and then a 1×1 convolution is used to map the high-frequency features to each class space to form the boundary residual. The residual is expressed as a coefficient Injecting the initial class response yields a refined 1 / 4 scale prediction. Finally The image was upsampled four times to the resolution of the input image for the glacier image segmentation network and then normalized to obtain the final segmentation probability map. The calculation expression is: , in, Represents a 1×1 convolution. Represents the ReLU activation function. This represents a 3×3 depth-separable convolution. This represents the activation function. This indicates a fourfold upsampling.
8. A segmentation system based on the glacier image segmentation method based on hybrid self-cross attention and context aggregation as described in claim 1, characterized in that, The segmentation system includes: The data acquisition and preprocessing module is used to acquire the glacier remote sensing images to be segmented and to preprocess the glacier remote sensing images to obtain the input images for the glacier image segmentation network. The encoder module is used to extract features from the input images of the glacier image segmentation network, obtaining multi-scale features at resolutions of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the input image resolution. ; Hybrid self-cross attention module for multi-scale features and Perform hybrid attention computation, including self-attention and cross-attention computation, to obtain enhanced features aligned across scales. It is also used for multi-scale features. Performing self-attention computation yields high-level semantic features that include the global context. ; Decoding and fusion module, used for... Perform bottom-up, step-by-step fusion decoding, including: upsampling the current scale features and fusing them with the previous scale features, iterating to a 1 / 4 resolution scale to obtain the fused features; The feature enhancement module is used to perform lightweight context aggregation and channel recalibration on the fused features at a 1 / 4 resolution scale to obtain enhanced features; The boundary refinement module is used to refine the boundaries of the enhanced features to obtain boundary residual information. At the same time, the linear classification head is used to perform preliminary segmentation of the enhanced features to obtain initial class responses. The boundary residual information and the initial class responses are fused to obtain refined segmentation predictions. The refined segmentation predictions are upsampled to the input image resolution of the glacier image segmentation network to output glacier segmentation results.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the glacier image segmentation method based on hybrid self-cross attention and context aggregation as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the glacier image segmentation method based on hybrid self-cross attention and context aggregation as described in any one of claims 1 to 7.