DiNAT (Discrete Network Address Translation) and attention mechanism-based sand ridge line extraction method and device
By building a sand ridge extraction model based on the deep learning network U-Net based on DiNAT and attention mechanism, the problem of low sand ridge extraction accuracy of existing models in desert landform research is solved, and high-precision and high-efficiency sand ridge extraction is achieved.
Patent Information
- Application Number
- CN202510913701.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-12
AI Technical Summary
Existing edge detection models suffer from low edge extraction accuracy when extracting sand ridges in desert landform research. This is especially true in Landsat remote sensing images, where it is difficult to effectively capture the global relationship of the image due to the dense distribution of sand ridges and close proximity between adjacent ridges.
A sand ridge extraction method based on DiNAT and attention mechanism is adopted. The deep learning network U-Net is used to construct a sand ridge extraction model (SreUNAT). Through the hierarchical attention module DiNAT and the efficient feature fusion module EFFM, combined with the enhanced attention gate EAG, channel and spatial attention mechanism, efficient fusion of shallow and deep features is achieved, and the feature map size is restored through the upsampling convolution module EUCB.
The edge detection accuracy of sand ridge line extraction is improved, the problem of decreased edge extraction accuracy caused by insufficient global context information in the existing model is solved, and high-precision and high-efficiency sand ridge line extraction is achieved.
Smart Images

Figure CN120635672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a sand ridge extraction method and device based on DiNAT and attention mechanism. Background Art
[0002] Edge detection, a key task in computer vision and image processing, aims to extract fine-grained edge and contour information from images. Currently, mainstream edge detection models are mostly based on convolutional neural networks and multi-level supervision techniques, effectively identifying edge pixels in natural images. In desert landform research, sand ridge extraction from Landsat remote sensing imagery is a challenging and critical task. However, due to the dense distribution of sand ridges in Landsat remote sensing imagery of desert areas, adjacent ridges are relatively close. Existing edge detection models often use CNN networks, which lack the ability to model global contextual information in shallow-level features. Because the receptive field of a CNN's convolution operation gradually expands, shallow convolutions can only capture local intensity changes and struggle to effectively capture global relationships in the image. This limitation is particularly prominent in edge detection tasks, especially when processing complex scenes, where the model's lack of global contextual information can lead to reduced edge extraction accuracy.
[0003] In view of this, the present invention provides a sand ridge line extraction method and device based on DiNAT and attention mechanism to solve the technical problem of low edge extraction accuracy when sand ridge line extraction is performed using an edge detection model. Summary of the Invention
[0004] The present invention aims to provide a sand ridge extraction method and device based on DiNAT and attention mechanism to at least partially solve the above technical problems.
[0005] The present invention provides a sand ridge extraction method based on DiNAT and attention mechanism, characterized in that the method comprises: Inputting the target remote sensing image of the sand ridge line to be extracted into the pre-trained sand ridge line extraction model to obtain the sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model (SreUNAT) is obtained by training a pre-built deep learning network (U-Net) using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules (DiNAT) stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules (EFFMs) and upsampling convolution modules (EUCBs). The feature fusion modules are used to perform hot fusion and upsampling on the feature maps output by the encoder to obtain side output feature maps and fused feature maps. The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
[0006] In some embodiments, the hierarchical attention module includes alternately stacked neighborhood attention modules (NAs) and dilated neighborhood attention modules (DiNAs); The neighborhood attention module limits the attention range of each pixel in the input feature map to its nearest neighborhood and combines the information interaction between local pixels to capture fine-grained local features. The expanded neighborhood attention module introduces an expansion factor based on the neighborhood attention module to capture long-distance dependencies.
[0007] In some embodiments, the feature fusion module includes: Enhanced Attention Gate (EAG), which is used to achieve preliminary fusion of the shallow feature map generated by the encoder and the deep feature map generated by the decoder to obtain the side output feature map, and enhance the channel and spatial information of the side output feature map through the attention mechanism; The upsampling convolution module is used to upsample the deep feature map and match the dimension of the shallow feature map obtained after processing the image using the encoder, and restore the side output feature map output by each feature fusion module and the fused feature map obtained by the enhanced attention gate (EAG) to their original size.
[0008] In some embodiments, the feature fusion process of the enhanced attention gate includes: The input deep feature map and shallow feature map are respectively subjected to depth-separable convolution and processed through activation function to generate deep feature map and shallow feature map; The processed deep features and shallow features are fused element by element and processed through activation function to generate a fused feature map; Pass the fused feature map through the convolution layer to generate the attention weight map; The attention weight map is multiplied element-wise with the fusion feature map, and the skip connection in the U-Net architecture is introduced through the residual connection, combined with the original fusion features obtained by the spatial attention mechanism to generate a fusion feature map.
[0009] In some embodiments, the attention mechanism includes a parallel channel attention mechanism (EfficientChannelAttention, ECA) and a spatial attention mechanism (SpatialAttention, SA); Among them, the channel attention mechanism is used to capture the global correlation between channels in an adaptive manner to enhance the features of the input fused feature map; the spatial attention mechanism is used to enhance the features of the input fused feature map by capturing significant features in space.
[0010] In some embodiments, the channel attention mechanism performs feature enhancement on the input fusion feature map, specifically including: Perform global average pooling on the input fusion feature map in the spatial dimension to generate a channel description vector; The channel description vector is processed based on the adaptive convolution operation to learn the global dependency between channels. The convolution result is passed through the activation function to generate the channel attention weight. The input fusion feature map is multiplied by the channel attention weight channel by channel to obtain the channel-enhanced feature map.
[0011] In some embodiments, the spatial attention mechanism performs feature enhancement on the input fused feature map, specifically including: Extract average pooling features and maximum pooling features from the input fusion feature map; Splicing the average pooling feature and the maximum pooling feature channel dimension into a two-dimensional feature map; Processing the two-dimensional feature map through a convolutional layer to generate spatial attention weights; The input fused feature map is multiplied channel by channel by the spatial attention weight to obtain the spatially enhanced feature map.
[0012] In some embodiments, the upsampling convolution module uses bilinear interpolation to expand the basic resolution of the input fused feature map, refines local features through depthwise separable convolution, enhances cross-channel information interaction through a channel rearrangement mechanism, and completes feature dimension mapping through convolution.
[0013] The present invention also provides a sand ridge extraction device based on DiNAT and attention mechanism, the device comprising: An image acquisition unit, used for acquiring a target remote sensing image of a sand ridge line to be extracted; A result generating unit is used to input the target remote sensing image into a pre-trained sand ridge line extraction model to obtain a sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model (SreUNAT) is obtained by training a pre-built deep learning network (U-Net) using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules (DiNAT) stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules (EFFMs) and upsampling convolution modules (EUCBs). The feature fusion modules are used to perform hot fusion and upsampling on the feature maps output by the encoder to obtain side output feature maps and fused feature maps. The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the program.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-described methods when executed by a processor.
[0016] The sand ridge extraction method and device provided by this invention, based on DiNAT and an attention mechanism, inputs the target remote sensing image of sand ridges to be extracted into a pre-trained sand ridge extraction model to obtain the sand ridge extraction results. This sand ridge extraction model employs a deep learning network (U-Net) architecture, utilizes a hierarchical attention module (DiNAT) as the encoder, and incorporates an efficient feature fusion module (EFFM) and an efficient up-convolution block (EUCB) in the decoder, resulting in a high-performance end-to-end sand ridge extraction model. The EFFM, by introducing an enhanced attention gate (EAG) and channel and spatial attention mechanisms, achieves efficient fusion of shallow encoder features with deep decoder features. Furthermore, the EUCB efficiently performs upsampling, ensuring size matching during feature fusion and enhancing the expressiveness of the upsampled feature maps. This solves the technical issue of low edge extraction accuracy often encountered when using edge detection models for sand ridge extraction. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 Flowchart of the sand ridge extraction method provided by the present invention; Figure 2 This is a schematic diagram of the overall network structure of the SreUNAT model provided by the present invention; Figure 3 A schematic diagram of the network structure of DiNAT provided by the present invention; Figure 4 A schematic diagram of the network structure of the feature fusion module provided by the present invention; Figure 5 This is a schematic diagram of the network structure of the upsampling convolution module provided by the present invention; Figure 6 This is a structural block diagram of the sand ridge extraction device provided by the present invention; Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0020] Currently, the Transformer (attention mechanism) has demonstrated powerful feature extraction capabilities in visual tasks and has made significant progress in edge detection. In particular, the hierarchical DiNAT (Hierarchical Attention Module) encoder efficiently captures both global and local features by exponentially expanding its receptive field. Furthermore, the attention mechanism, with its flexible feature modeling capabilities, offers significant advantages in enhancing information interaction, suppressing irrelevant background, and improving the representation of target regions. Based on this, this paper proposes a sand ridge extraction model (SreUNAT) based on DiNAT and the attention mechanism, aiming to achieve high precision and efficiency in sand ridge extraction tasks.
[0021] Generally speaking, SreUNAT adopts a deep learning network (U-Net) structure, uses DiNAT as the encoder, and introduces an efficient feature fusion module (EFFM) and an efficient up-convolution block (EUCB) in the decoder, thus constructing a high-performance end-to-end sand ridge extraction model. Specifically, EFFM achieves efficient fusion of shallow encoder features with deep decoder features by introducing an enhanced attention gate (EAG) and channel and spatial attention mechanisms. Simultaneously, EUCB efficiently performs upsampling operations, ensuring size matching during feature fusion and enhancing the expressive power of the upsampled feature maps. Furthermore, SreUNAT employs a multi-level supervision strategy called HED for supervised learning of the network's four side output edge maps and the final fused edge map.
[0022] In a specific embodiment, Figure 1 As shown, the sand ridge extraction method based on DiNAT and attention mechanism provided by the present invention includes the following steps: S110: Acquire a target remote sensing image of the sand ridge line to be extracted; S120: Inputting the target remote sensing image of the sand ridge line to be extracted into a pre-trained sand ridge line extraction model to obtain a sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model (SreUNAT) is obtained by training a pre-built deep learning network (U-Net) using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules (DiNAT) stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules (EFFMs) and upsampling convolution modules (EUCBs). The feature fusion modules are used to perform hot fusion and upsampling on the feature maps output by the encoder to obtain side output feature maps and fused feature maps. The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
[0023] The remote sensing image samples used for model training can come from a pre-constructed dune ridge line dataset, which is constructed by processing remote sensing images of target areas (such as typical areas of the Tengger Desert, Badain Jaran Desert, Kubuqi Desert, Ulan Buh Desert, Kumtag Desert, Gurbantunggut Desert, Qaidam Basin Desert and Taklimakan Desert) to obtain high-quality data.
[0024] Specifically, Figure 2 The figure shows the overall network structure of the model SreUNAT proposed in this invention, including Figure 2 The encoder part on the left, the decoder part in the middle, and the side output processing structure on the right. In the traditional codec structure, the encoder is responsible for extracting features from the input image, while the decoder restores details of the feature map output by the encoder and gradually restores its channel dimension. Input image SreUNAT first performs preliminary feature extraction through two 3×3 convolutional layers with a stride of 2, while reducing the resolution to a quarter of the original while increasing the number of channels. Finally, a normalization layer optimizes the feature distribution. This process provides the subsequent encoder with high-quality input feature maps with sufficient channels, effectively improving the expressiveness and quality of the output feature maps.
[0025] like Figure 2As shown in the figure, SreUNAT's encoder is divided into four stages, each of which consists of a downsampling layer and multiple DiNATs stacked together. In addition to the initial downsampling layer mentioned above, each two stages are downsampled by a 3×3 convolutional layer with a stride of 2, reducing the spatial resolution to half of the original while doubling the number of channels. DiNAT is an improved hierarchical Transformer that combines neighborhood attention (NA) and dilated neighborhood attention (DiNA), which has shown significant performance improvements in various visual tasks. DiNAT can effectively maintain locality, maintain translation equivariance, exponentially expand the receptive field, and capture a wider range of long-distance dependencies.
[0026] SreUNAT's decoder primarily consists of multiple EFFMs and EUCBs, fusing features from bottom to top. EFFMs initially fuse deep and shallow feature maps using EAGs, further enhancing channel and spatial information through an attention mechanism. EUCBs not only upsample deep features to match the dimensions of shallow feature maps but also restore the four side-output feature maps and the final fused feature map to their original dimensions. Finally, SreUNAT's five outputs are mapped to five edge probability maps using a sigmoid activation function.
[0027] In some embodiments, the hierarchical attention module includes an alternating stack of a neighborhood attention module (NA) and a dilated neighborhood attention module (DiNA); wherein the neighborhood attention module limits the attention range of each pixel of the input feature map to its nearest neighborhood and combines the information interaction between local pixels to capture fine-grained local features; the dilated neighborhood attention module introduces an expansion factor on the basis of the neighborhood attention module to capture long-distance dependencies.
[0028] Specifically, Figure 3Schematic diagram of the network structure of DiNAT provided by the present invention. DiNAT adopts a hierarchical Transformer architecture and realizes efficient multi-scale feature modeling by alternately stacking NA and DiNA modules. The NA module focuses on the information interaction between local pixels by limiting the attention range of each pixel to its nearest neighborhood, thereby capturing fine-grained local features; and the DiNA module introduces an expansion factor on the basis of NA, so that each pixel can pay attention to pixels at a farther distance, thereby effectively capturing long-distance dependencies. Gradient propagation is optimized between different modules through LN and residual connections, and MLP is used to enhance nonlinear expression capabilities. This alternating design of local and sparse global attention enables DiNAT to achieve exponential expansion of the receptive field while maintaining linear computational complexity.
[0029] Next, we will use the formula derivation to introduce the self-attention mechanism DiNA in DiNAT in detail. DiNA is an extension of NA by introducing the expansion factor , so that its neighborhood sampling is sparse. Given an input feature map ,in is the number of tokens, is the embedding dimension of each token. token, assuming Indicates the The first token The index of the nearest neighbor token, then its expanded neighborhood attention weight matrix Defined as: ; in, It is token and The relative position offset between tokens, Represents the key vector participating in the current attention calculation, Represents the feature encoding from the key-value side, It means to transpose the key vector. Indicates the query vectors, Represents the transpose of the key vector corresponding to the index. The expanded neighborhood value matrix of tokens , which is defined as: ; in, yes The linear projection of Respectively represent The combination of value vectors related to the query, after specific index selection and transposition operation. The DiNA output of a token is obtained by multiplying the softmax-normalized dilated attention weights with the dilated neighborhood value matrix: ; in, Indicates the The attention output corresponding to the query, the value after integrating the associated information, is a scaling factor that helps stabilize the training process.
[0030] In some embodiments, the feature fusion module includes an enhanced attention gate (EAG) and an upsampling convolution module. The enhanced attention gate is used to achieve preliminary fusion of the deep feature map and the shallow feature map to obtain the side output feature map, and enhance the channel and spatial information through the attention mechanism; the upsampling convolution module is used to upsample the deep feature map and match it with the shallow feature map dimension, and restore the side output feature map and the fused feature map output by each feature fusion module to their original size.
[0031] Specifically, in order to better fuse the encoder output features from bottom to top, the present invention designs an efficient feature fusion module EFFM suitable for sand ridge extraction tasks, such as Figure 4 As shown in Figure 2, EFFM consists of two parts: EAG, a parallel channel attention mechanism (Efficient Channel Attention, ECA), and a spatial attention mechanism (SpatialAttention, SA). EAG can adaptively allocate attention weights to task-related areas, effectively highlighting key features and suppressing redundant information.
[0032] Based on the EFFM structure, the feature fusion process of the enhanced attention gate includes: The input deep feature map and shallow feature map are respectively subjected to depth-separable convolution and processed through activation function to generate deep feature map and shallow feature map; The processed deep features and shallow features are fused element by element and processed through activation function to generate a fused feature map; Pass the fused feature map through the convolution layer to generate the attention weight map; The attention weight map is multiplied element-wise with the fusion feature map, and the skip connection in the U-Net architecture is introduced through the residual connection, combined with the original fusion features obtained by the spatial attention mechanism to generate a fusion feature map.
[0033] Specifically, the above-mentioned EAG is as follows Figure 4As shown on the left side of the figure, it is an efficient module for fusing deep features and shallow features. Its design aims to highlight the important features of task-related areas and improve feature expression capabilities. First, deep features and shallow features After depth-wise separable convolution, batch normalization, and ReLU activation function processing, feature maps are generated. and : ; ; Then, the processed deep features and shallow features Perform element-by-element addition and fusion, and generate fusion features through ReLU activation function : ; Next, the fusion features The attention weight map is generated through a 1×1 convolution layer, and then the normalized attention weight map is obtained after batch normalization and Sigmoid activation function. : ; Finally, the fusion features and attention weight map Multiply element by element and introduce the original fusion features through residual connection to generate the final output features : ; Through this process, EAG can dynamically adjust the feature weights of different regions, highlight the feature expression of task-related regions, and retain the complete original information through residual connections, achieving lightweight and efficient feature fusion.
[0034] After EAG enhances and fuses the semantic features of two different levels to obtain EAG features, EFFM further uses parallel ECA and SA to extract channel and spatial feature information.
[0035] In some embodiments, the attention mechanism includes a parallel channel attention mechanism (EfficientChannel Attention, ECA) and a spatial attention mechanism (Spatial Attention, SA); wherein, the channel attention mechanism is used to capture the global correlation between channels in an adaptive manner to perform feature enhancement on the input fused feature map; the spatial attention mechanism is used to perform feature enhancement on the input fused feature map by capturing significant features in space.
[0036] The channel attention mechanism performs feature enhancement on the input fusion feature map, specifically including: Perform global average pooling on the input fusion feature map in the spatial dimension to generate a channel description vector; The channel description vector is processed based on the adaptive convolution operation to learn the global dependency between channels. The convolution result is passed through the activation function to generate the channel attention weight. The input fusion feature map is multiplied by the channel attention weight channel by channel to obtain the channel-enhanced feature map.
[0037] Specifically, the ECA module captures the global correlation between channels in an adaptive manner. First, the ECA module performs an adaptive operation on the input feature map. (i.e. the output feature map of the received EAG) performs global average pooling in the spatial dimension to generate a channel description vector : ; Among them, B represents the batch size and C represents the number of channels.
[0038] Then, based on an adaptive 1D convolution operation Processing, learning the global dependencies between channels. Convolution kernel size Adaptively adjusted by the following formula: ; in, and is a hyperparameter, It means rounding the result to the nearest odd number.
[0039] The convolution result is passed through the Sigmoid activation function to generate the channel attention weight : ; Finally, the input feature map The channel attention weights are multiplied channel by channel to obtain the enhanced feature map : ; In some embodiments, the spatial attention mechanism performs feature enhancement on the input fused feature map, specifically including: Extract average pooling features and maximum pooling features from the input fusion feature map; Splicing the average pooling feature and the maximum pooling feature channel dimension into a two-dimensional feature map; Processing the two-dimensional feature map through a convolutional layer to generate spatial attention weights; The input fused feature map is multiplied channel by channel by the spatial attention weight to obtain the spatially enhanced feature map.
[0040] Specifically, the SA module further enhances the feature map by capturing salient features in space. The calculation process is as follows: The SA module first takes the input feature map Extract average pooling features and max pooling features , are calculated along the channel dimension: ; Then and Splice along the channel dimension into a two-dimensional feature map : ; Splicing results After a convolution layer with a convolution kernel size of 3×3, the spatial attention weight is generated : ; Finally, the input feature map Multiply pixel by pixel with the spatial attention weight to obtain the enhanced feature map : ; Output feature maps of ECA and SA and It will be further integrated in subsequent modules, ultimately enhancing the representation ability of the feature map and improving the task performance of the network.
[0041] In some embodiments, the upsampling convolution module uses bilinear interpolation to expand the basic resolution of the input fused feature map, refines local features through depthwise separable convolution, enhances cross-channel information interaction through a channel rearrangement mechanism, and completes feature dimension mapping through convolution.
[0042] In order to better upsample deep features, the solution provided by the present invention introduces an efficient upsampling convolution module EUCB into the SreUNAT model, such as Figure 5 EUCB adopts a progressive feature enhancement strategy and achieves upsampling feature reconstruction through a three-stage process: first, bilinear interpolation is used to complete the basic resolution expansion, then local features are refined through depthwise separable convolution, and then the channel rearrangement mechanism is used to enhance cross-channel information interaction. Finally, 1×1 convolution is used to complete feature dimension mapping.
[0043] Specifically, the input feature map First, upsample to the target size through bilinear interpolation. This operation achieves smooth geometric transformation through linear weighting to avoid the checkerboard effect that may be introduced by deconvolution. The process can be expressed as: ; in, is the scaling factor, Represents the output feature map after upsampling operation. Then, 3×3 depth-separable convolution is used to Perform spatial feature enhancement. Depthwise separable convolution effectively reduces the number of parameters while maintaining the receptive field by separating intra-channel and cross-channel calculations. This process can be expressed as the following formula: ; in, represents the feature map after a specific transformation, Represents the size parameter of the convolution kernel in the depth-wise separable convolution, Indicates that the input feature map is The convolution kernel performs depth-separable convolution operation, splits channel convolution and point-by-point convolution, reduces the amount of calculation and extracts features at the same time.
[0044] Subsequently, in order to break the independence between channels in the depth convolution, the channel shuffling operation is used to First, The channels are divided into Groups, each containing channels. Next, the feature map is reshaped into , and restore the original shape after randomly permuting the group dimensions. This operation enhances the model's ability to fuse multi-scale features by forcing cross-group information interaction, ultimately forming , the process can be expressed as: ; Finally, cross-channel feature fusion and dimension alignment are achieved through 1×1 convolution to obtain the final output feature , the calculation formula of this process is: ; in, Output feature dimension.
[0045] In the above-mentioned specific embodiment, the sand ridge extraction method based on DiNAT and the attention mechanism provided by the present invention inputs the target remote sensing image of the sand ridges to be extracted into a pre-trained sand ridge extraction model, which then outputs the sand ridge extraction results. This sand ridge extraction model employs a deep learning network (U-Net) architecture, utilizes a hierarchical attention module (DiNAT) as the encoder, and incorporates an efficient feature fusion module (EFFM) and an efficient up-convolution block (EUCB) in the decoder, resulting in a high-performance end-to-end sand ridge extraction model. The EFFM, by introducing an enhanced attention gate (EAG) and channel and spatial attention mechanisms, achieves efficient fusion of shallow encoder features with deep decoder features. Furthermore, the EUCB efficiently performs upsampling, ensuring size matching during feature fusion and enhancing the expressiveness of the upsampled feature maps. This solves the technical issue of low edge extraction accuracy often encountered when using edge detection models for sand ridge extraction.
[0046] In order to facilitate understanding and demonstrate the technical effect of the sand ridge extraction method provided by the present invention, the model training process and comparative experimental results are demonstrated below.
[0047] For example, model training and comparative experiments were implemented using the open-source deep learning framework PyTorch and Python 3.8, relying on the mmsegmentation and NATTEN frameworks. The experiments were conducted using the CentOS 7.4 operating system. The server was equipped with an Intel Xeon Gold 6240 CPU, a Tesla V100 GPU with 16GB of video memory, 376GB of RAM, and CUDA version 11.3. Specific configuration information for the experimental environment is shown in Table 1.
[0048] Table 1. Experimental environment configuration ; The experiment used the AdamW optimizer to train the model and introduced a cosine decay learning rate scheduling strategy to optimize the training process. The experiment ran for 30,000 iterations, with a linear warm-up strategy used to gradually increase the learning rate for the first 1,500 iterations and a cosine decay scheduling strategy used to gradually decrease the learning rate for the remaining iterations. This strategy effectively balances stability in the early stages of training with convergence accuracy in the later stages. Thanks to the efficient design of the SreUNAT model, the entire training process took only 6.5 hours, further demonstrating its excellent training efficiency.
[0049] In the process of model training, the choice of loss function is crucial. It is used to measure the error between the predicted result and the true value, and to control the update of network parameters. The loss function used in this paper is CATS loss, which is composed of RCF loss , boundary tracking loss and texture suppression loss It consists of three parts. The specific expression is as follows: ; in, It represents the actual label and annotation result of the sample. It represents the output of the model for the sample, which is the predicted label calculated by the model based on the input image through forward propagation. The CATS loss contains three hyperparameters, which are the hyperparameters that control the weights of different loss terms in formula (21). and , and the hyperparameters for balancing positive and negative samples in RCF loss For the edge prediction graphs at different stages of SreUNAT, the specific hyperparameters of CATS loss are shown in Table 2.
[0050] Table 2. CATS loss hyperparameters ; Among them, EdgeMap1 to EdgeMap4 are the four side output edge maps of SreUNAT, and EdgeMap5 is the final generated edge map.
[0051] During the training process of the SreUNAT model, the setting of key hyperparameters has a decisive impact on model performance. To comprehensively evaluate the impact of hyperparameters on model performance, this paper systematically analyzes the following three core hyperparameters: learning rate, number of training iterations (iter), and batch size (bs). Among them, the learning rate directly affects the update amplitude of the model parameters and is a key factor in controlling the convergence speed and stability; iter determines the adequacy of model training and is closely related to the risk of overfitting; bs affects the directionality of gradient updates and memory usage efficiency, and has a significant impact on the model's convergence speed and generalization ability.
[0052] Next, this example will explore in depth the influence of these hyperparameters.
[0053] (1) Learning rate parameter analysis In the learning rate parameter analysis experiment, the warm-up initial learning rate for the first 1500 iterations is set to After 1500 iterations of warm-up training, the learning rate is gradually increased to the preset learning rate, and the remaining iterations are trained according to the cosine decay scheduling strategy. To explore the impact of the preset learning rate on the model performance, we fix the warm-up initial learning rate to , and As the center, set up five groups of comparative experiments: preset learning rate , and experiments were conducted on a pre-constructed sand ridge dataset. The experimental results were analyzed using the evaluation metrics of ODS, OIS, AP, and AC, as shown in Table 3.
[0054] Table 3. Impact of different preset learning rates on indicators ; As the preset learning rate gradually increases When , ODS and OIS reach 0.800 and 0.813 respectively, which are the highest values in all comparative experiments. This shows that under this learning rate, the edge detection performance of the SreUNAT model is the best. At the same time, the AP index is It reaches the highest value of 0.818. When , AP is 0.811, although slightly lower than The result is still better than the AP under other learning rates. When , AC reaches the highest value of 0.705. When AC is 0.702, slightly lower than The results were similar, but the differences were small. and The performance is the best in AP and AC indicators respectively, but The ODS and OIS indicators reached the highest value, while AP and AC were also close to the optimal level. Therefore, considering the overall performance and stability of the model, we chose As the preset learning rate of SreUNAT. This learning rate can not only maximize the edge detection performance (ODS and OIS) of the model, but also maintain a high level in AP and AC. In subsequent experiments, the training learning rate of SreUNAT is set to .
[0055] (2) Analysis of the number of iteration parameters After determining the optimal learning rate, iter also needs to be analyzed for parameters. iter refers to the total number of times the model parameters are updated during the training process. Appropriate iter can ensure that the model fully learns the characteristic distribution of the data, thereby improving performance. If iter is too small, the model may not be able to fully learn, resulting in underfitting; on the contrary, if iter is too much, the model may overfit the training data, thereby reducing the generalization ability on the test set. In order to verify that the number of iterations that is most suitable for the SreUNAT model is 30k, this embodiment sets up a total of 5 groups of comparative tests, namely 20k, 25k, 30k, 35k and 40k iterations, and conducts experiments on a pre-constructed sand ridge line dataset. The experimental results are analyzed using the evaluation indicators such as ODS, OIS, AP and AC, and the results are shown in Table 4.
[0056] Table 4. The impact of different training rounds on indicators ; As iter increases, the key indicators ODS and OIS generally show a trend of first increasing and then decreasing. When iter is 30k, ODS and OIS reach 0.800 and 0.813 respectively, the highest values in all experiments, and SreUNAT has the best sand ridge extraction performance. As iter further increases to 35k and 40k, ODS and OIS decrease slightly, indicating that the model begins to overfit. In addition, the AP indicator reaches 0.811 when iter is 30k, second only to 0.813 when iter is 20k. The difference is very small and significantly better than other iters. Finally, AC generally shows an increasing trend with the increase in the number of iterations. The model reaches the highest AC of 0.722 when iter is trained to 40k, but other indicators are all less than 20k. Overall, although the model performs best in AP and AC indicators when trained to 20k and 40k respectively, it reaches the highest in ODS and OIS at 30k, and is also close to the optimal level in AP and AC. In addition, 30k also achieves a good balance between computing resource consumption and training efficiency, avoiding excessively long training time.
[0057] Based on the above analysis, 30k is the optimal iter for SreUNAT training, which can maximize edge detection performance while maintaining high AP and AC indicators and taking into account training efficiency. Therefore, in subsequent experiments, the iter of SreUNAT is set to 30k.
[0058] (3) Batch size parameter analysis After obtaining the optimal learning rate and number of iterations for the SreUNAT model, the last step is to perform parameter analysis on bs. The choice of bs has an important impact on model training. Too high or too low will bring different problems. If bs is too small, the gradient will fluctuate greatly, the training will be unstable, and the convergence will be slow. If bs is too large, the generalization ability will be reduced and more video memory will be occupied. Therefore, a suitable bs can make training more stable and efficient, and maintain good generalization performance. In order to verify the bs that is most suitable for the SreUNAT model, this embodiment set up a total of 5 groups of comparative tests, setting bs to 1, 2, 4, 8 and 16 respectively, and conducting experiments on the sand ridge line dataset. The experimental results were analyzed using the evaluation indicators such as ODS, OIS, AP and AC, and the results are shown in Table 5.
[0059] Table 5. Impact of different batch sizes on indicators ; It is worth noting that due to the high number of parameters in the SreUNAT model (the final version has 153.19M parameters) and the limitations of experimental hardware conditions, the maximum value of bs was set to 24. As bs increases, the key indicators ODS and OIS generally show a trend of first increasing and then decreasing. When bs is 8, ODS and OIS reach 0.800 and 0.813, respectively, the highest values in all experiments, indicating that the SreUNAT model has the best sand ridge extraction performance under this configuration. However, as the batch size further increases to 24, ODS and OIS decrease slightly (ODS drops from 0.800 to 0.797, and OIS drops from 0.813 to 0.808). This phenomenon indicates that the model's generalization ability has decreased, resulting in a decrease in sand ridge extraction accuracy.
[0060] Furthermore, the AP index shows a monotonically decreasing trend with increasing bs, decreasing from 0.821 at bs = 1 to 0.776 at bs = 24, indicating that a larger bs weakens the model's ability to capture the detailed features of sand ridges. Finally, the AC index reaches its highest level at bs = 24, reaching 0.739.
[0061] Overall, although the model achieved the best performance in AP and AC indicators at bs=1 and bs=24, respectively, its ODS and OIS indicators were relatively low. This reflects that a bs that is too small cannot effectively capture global features, while a bs that is too large will lead to a decrease in generalization performance, thus affecting the overall effect of sand ridge extraction. In contrast, bs=8 not only achieves the best performance in ODS and OIS indicators, but its AP and AC indicators are also close to the optimal level, and are significantly better than the performance of bs=16. In addition, bs=8 achieves a good balance between computing resource consumption and training efficiency, effectively avoiding excessive training time. Therefore, in subsequent experiments, the bs of SreUNAT was set to 8.
[0062] In order to verify the effectiveness of the SreUNAT model proposed in the present invention in the sand ridge extraction task, this embodiment compares and analyzes it with the edge detection model in the prior art. The experiment compares classic edge detection models, including HED, RCF, TIN, FINED, PiDiNet, LDC, FF-CNSNP and EdgeNAT. In addition, based on the characteristics of the SreUNAT model, it is compared with the transformer-based edge detection model. Among them, FF-CNSNP proposes a transformer-based side output fusion module; EdgeNAT also uses DiNAT as its encoder, and proposes a SCAF-MLA decoder to enhance feature representation. Finally, all comparative experiments are carried out in the same experimental environment, and training and prediction are performed on the sand ridge dataset. The experimental results are comprehensively analyzed using the evaluation indicators such as ODS, OIS, AP and AC to evaluate the accuracy and clarity of each model respectively.
[0063] Table 6. Extraction results of different algorithms on the sand ridge dataset ; The sand ridge extraction results of different algorithms are shown in Table 6. The proposed SreUNAT model achieved optimal performance in terms of ODS, OIS, and AP, with values of 0.800, 0.813, and 0.811, respectively, representing significant improvements over other models. Specifically, compared to the top-performing classical edge detection model, LDC (ODS=0.786, AP=0.805), SreUNAT achieved accuracy improvements of 0.014 and 0.006, respectively. Among transformer-based models, SreUNAT achieved even greater improvements of 0.060 and 0.171 over FF-CNSNP (ODS=0.740, AP=0.640), fully demonstrating the effectiveness of its architectural design.
[0064] Compared to the transformer-based EdgeNAT model, SreUNAT demonstrates significant advantages in core performance metrics: ODS, OIS, and AP improve by 0.011, 0.013, and 0.102, respectively. This improvement fully demonstrates SreUNAT's superiority in sand ridge feature extraction and spatial reconstruction. In the sand ridge extraction task, ridge positioning accuracy significantly outweighs ridge clarity, making SreUNAT's comprehensive improvement in core metrics even more crucial.
[0065] As a result, SreUNAT achieves significant improvements in the accuracy and completeness of sand ridge extraction while maintaining high clarity, demonstrating enhanced robustness when dealing with complex dune types. Compared to Rid-HRNet and EdgeNAT, SreUNAT achieves a better balance between accuracy and detail preservation, providing a superior solution for sand ridge extraction.
[0066] In summary, this paper addresses the challenges of insufficient edge localization accuracy and loss of detail information in sand ridge extraction by proposing a SreUNAT model based on the DiNAT encoder. This model incorporates an efficient feature fusion module (EFFM) and an upsampling convolution module (EUCB) during the feature decoding phase. Combined with a multi-scale feature extraction mechanism, this model efficiently fuses global contextual information with local detail features, significantly improving the accuracy and stability of sand ridge extraction.
[0067] During the feature extraction phase, SreUNAT uses DiNAT as the encoder, leveraging its Neighbor Attention (NA) mechanism and Dilated Neighbor Attention (DiNA) to achieve multi-level feature extraction and dynamic receptive field adjustment. DiNAT not only accurately captures the local details of sand ridges while maintaining the integrity of the global structure, but also effectively reduces computational costs and provides richer feature representations for the decoders (EFFM and EUCB).
[0068] SreUNAT introduces the Enhanced Attention Gate (EAG) in the EFFM module, combining it with the parallel Channel Attention (ECA) and Spatial Attention (SA) mechanisms to achieve efficient feature interaction and enhance the model's ability to perceive detailed information. Furthermore, the EUCB module employs a progressive upsampling strategy to optimize the reconstruction of low-resolution features and improve the model's accuracy in capturing sand ridge structures.
[0069] To validate the effectiveness of SreUNAT, comparative experiments were conducted on a pre-constructed sand ridge dataset. The results demonstrate that SreUNAT achieves excellent performance on key metrics such as ODS, OIS, and AP. This fully demonstrates the collaborative optimization capabilities of the EFFM and EUCB modules, as well as the model's generalization and robustness across diverse datasets.
[0070] In addition to the above method, the present invention also provides a sand ridge extraction device based on DiNAT and attention mechanism, such as Figure 6 As shown, the device includes: An image acquisition unit 610 is used to acquire a target remote sensing image of the sand ridge line to be extracted; A result generating unit 620 is configured to input the target remote sensing image into a pre-trained sand ridge line extraction model to obtain a sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model (SreUNAT) is obtained by training a pre-built deep learning network (U-Net) using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules (DiNAT) stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules (EFFMs) and upsampling convolution modules (EUCBs). The feature fusion modules are used to perform hot fusion and upsampling on the feature maps output by the encoder to obtain side output feature maps and fused feature maps. The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
[0071] In some embodiments, the hierarchical attention module includes alternately stacked neighborhood attention modules (NAs) and dilated neighborhood attention modules (DiNAs); The neighborhood attention module limits the attention range of each pixel in the input feature map to its nearest neighborhood and combines the information interaction between local pixels to capture fine-grained local features. The expanded neighborhood attention module introduces an expansion factor based on the neighborhood attention module to capture long-distance dependencies.
[0072] In some embodiments, the feature fusion module includes: Enhanced Attention Gate (EAG), which is used to achieve preliminary fusion of deep feature maps and shallow feature maps, obtain side output feature maps, and enhance channel and spatial information through the attention mechanism; The upsampling convolution module is used to upsample the deep feature map and match it with the shallow feature map dimension, and restore the side output feature map and fused feature map output by each feature fusion module to their original size.
[0073] In some embodiments, the feature fusion process of the enhanced attention gate includes: The input deep feature map and shallow feature map are respectively subjected to depth-separable convolution and processed through activation function to generate deep feature map and shallow feature map; The processed deep features and shallow features are fused element by element and processed through activation function to generate a fused feature map; Pass the fused feature map through the convolution layer to generate the attention weight map; The attention weight map is multiplied element-wise with the fused feature map, and the original fused features are introduced through the residual connection to generate the fused feature map.
[0074] In some embodiments, the attention mechanism includes a parallel channel attention mechanism (EfficientChannelAttention, ECA) and a spatial attention mechanism (SpatialAttention, SA); Among them, the channel attention mechanism is used to capture the global correlation between channels in an adaptive manner to enhance the features of the input fused feature map; the spatial attention mechanism is used to enhance the features of the input fused feature map by capturing significant features in space.
[0075] In some embodiments, the channel attention mechanism performs feature enhancement on the input fusion feature map, specifically including: Perform global average pooling on the input fusion feature map in the spatial dimension to generate a channel description vector; The channel description vector is processed based on the adaptive convolution operation to learn the global dependency between channels. The convolution result is passed through the activation function to generate the channel attention weight. The input fusion feature map is multiplied by the channel attention weight channel by channel to obtain the channel-enhanced feature map.
[0076] In some embodiments, the spatial attention mechanism performs feature enhancement on the input fused feature map, specifically including: Extract average pooling features and maximum pooling features from the input fusion feature map; Splicing the average pooling feature and the maximum pooling feature channel dimension into a two-dimensional feature map; Processing the two-dimensional feature map through a convolutional layer to generate spatial attention weights; The input fused feature map is multiplied channel by channel by the spatial attention weight to obtain the spatially enhanced feature map.
[0077] In some embodiments, the upsampling convolution module uses bilinear interpolation to expand the basic resolution of the input fused feature map, refines local features through depthwise separable convolution, enhances cross-channel information interaction through a channel rearrangement mechanism, and completes feature dimension mapping through convolution.
[0078] In the above-mentioned specific embodiment, the sand ridge extraction device based on DiNAT and the attention mechanism provided by the present invention inputs the target remote sensing image of the sand ridges to be extracted into a pre-trained sand ridge extraction model, which then outputs the sand ridge extraction results. This sand ridge extraction model employs a deep learning network (U-Net) architecture, utilizes a hierarchical attention module (DiNAT) as the encoder, and incorporates an efficient feature fusion module (EFFM) and an efficient up-convolution block (EUCB) in the decoder, resulting in a high-performance end-to-end sand ridge extraction model. The EFFM, through the introduction of an enhanced attention gate (EAG) and channel and spatial attention mechanisms, achieves efficient fusion of shallow encoder features with deep decoder features. Furthermore, the EUCB efficiently performs upsampling, ensuring size matching during feature fusion and enhancing the expressiveness of the upsampled feature maps. This solves the technical issue of low edge extraction accuracy often encountered when using edge detection models for sand ridge extraction.
[0079] Figure 7 An example of a physical structure diagram of an electronic device is shown below. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the above method.
[0080] Furthermore, the logic instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0081] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the above method.
[0082] In yet another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is configured to execute the above method when executed by a processor.
[0083] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0084] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0085] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A sand ridge extraction method based on DiNAT and attention mechanism, characterized in that: The method comprises: Inputting the target remote sensing image of the sand ridge line to be extracted into the pre-trained sand ridge line extraction model to obtain the sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model is obtained by training a pre-built deep learning network using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules and upsampling convolution modules. The feature fusion module is used to perform hot fusion and upsampling on the feature map output by the encoder to obtain a side output feature map and a fused feature map; The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
2. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 1 is characterized in that: The hierarchical attention module includes alternately stacked neighborhood attention modules and dilated neighborhood attention modules; The neighborhood attention module limits the attention range of each pixel in the input feature map to its nearest neighborhood and combines the information interaction between local pixels to capture fine-grained local features. The expanded neighborhood attention module introduces an expansion factor based on the neighborhood attention module to capture long-distance dependencies.
3. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 1 is characterized in that: The feature fusion module includes: An enhanced attention gate is used to achieve a preliminary fusion of the shallow feature map generated by the encoder and the deep feature map generated by the decoder to obtain a side output feature map, and enhance the channel and spatial information of the side output feature map through the attention mechanism; An upsampling convolution module is used to upsample the deep feature map to match the dimension of the shallow feature map obtained after processing the image using a convolution encoder, and restore the side output feature map output by each feature fusion module and the fused feature map obtained by enhancing the attention gate output to the original size.
4. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 3 is characterized in that: The feature fusion process of the enhanced attention gate includes: The input deep feature map and shallow feature map are respectively subjected to depth-separable convolution and processed through activation function to generate deep feature map and shallow feature map; The processed deep features and shallow features are fused element by element and processed through activation function to generate a fused feature map; Pass the fused feature map through the convolution layer to generate the attention weight map; The attention weight map is multiplied element-wise with the fusion feature map, and a skip connection is introduced through the residual connection. The original fusion features obtained by the spatial attention mechanism are combined to generate a fusion feature map.
5. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 4 is characterized in that: The attention mechanism includes a parallel channel attention mechanism and a spatial attention mechanism; Among them, the channel attention mechanism is used to capture the global correlation between channels in an adaptive manner to enhance the features of the input fused feature map; the spatial attention mechanism is used to enhance the features of the input fused feature map by capturing significant features in space.
6. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 5 is characterized in that: The channel attention mechanism performs feature enhancement on the input fusion feature map, specifically including: Perform global average pooling on the input fusion feature map in the spatial dimension to generate a channel description vector; The channel description vector is processed based on the adaptive convolution operation to learn the global dependency between channels. The convolution result is passed through the activation function to generate the channel attention weight. The input fusion feature map is multiplied by the channel attention weight channel by channel to obtain the channel-enhanced feature map.
7. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 5 is characterized in that: The spatial attention mechanism performs feature enhancement on the input fusion feature map, specifically including: Extract average pooling features and maximum pooling features from the input fusion feature map; Splicing the average pooling feature and the maximum pooling feature channel dimension into a two-dimensional feature map; Processing the two-dimensional feature map through a convolutional layer to generate spatial attention weights; The input fused feature map is multiplied channel by channel by the spatial attention weight to obtain the spatially enhanced feature map.
8. The sand ridge extraction method based on DiNAT and attention mechanism according to claim 4 is characterized in that: The upsampling convolution module uses bilinear interpolation to expand the basic resolution of the input fusion feature map, refines local features through depth-wise separable convolution, enhances cross-channel information interaction through channel rearrangement mechanism, and completes feature dimension mapping through convolution.
9. A sand ridge extraction device based on DiNAT and attention mechanism, characterized in that: The device comprises: An image acquisition unit, used for acquiring a target remote sensing image of a sand ridge line to be extracted; A result generating unit is used to input the target remote sensing image into a pre-trained sand ridge line extraction model to obtain a sand ridge line extraction result output by the sand ridge line extraction model; The sand ridge extraction model is obtained by training a pre-built deep learning network using remote sensing image samples of the target area; The deep learning network includes an encoder, a decoder and a side output processing structure; The encoder includes multiple stage modules, each of which is composed of a downsampling layer and multiple hierarchical attention modules stacked together. Downsampling is performed between adjacent stage modules through a convolutional layer, and multi-level feature extraction is performed on the input feature map through multiple stage modules. The decoder is used to fuse the multi-level features output by the encoder step by step from bottom to top. The decoder includes multiple feature fusion modules and upsampling convolution modules. The feature fusion module is used to perform hot fusion and upsampling on the feature map output by the encoder to obtain a side output feature map and a fused feature map; The side output processing structure is used to map the side output feature map and the fusion feature map into edge probability maps respectively.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.