An implementation method of a remote sensing image road extraction task based on Swift-SegEdgeNet

By introducing a bi-branch convolutional module and an edge detection task into road extraction from remote sensing images, the network structure is optimized, solving the problems of high computational cost and inaccurate road direction feature extraction in existing methods, and achieving more efficient and accurate road extraction.

CN118736434BActive Publication Date: 2026-11-20BEIJING UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410747936.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2026-11-20
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Existing remote sensing image road extraction methods based on the Transformer series are computationally intensive, slow to train, and difficult to accurately extract the directional features of roads, resulting in low extraction accuracy, especially when extracting narrow, continuously distributed roads with a high error rate.

Method used

A dual-branch convolutional module is used to extract road direction features, and an edge detection task is added to the semantic segmentation task. The network structure is optimized through multi-task learning, and the road is extracted in combination with the Swift-SegEdgeNet model.

Benefits of technology

It improves the segmentation accuracy of road extraction from remote sensing images, reduces the amount of computation, and enhances the continuity and accuracy of road extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736434B_ABST
    Figure CN118736434B_ABST
Patent Text Reader

Abstract

The application discloses an implementation method of a remote sensing image road extraction task based on Swift-SegEdgeNet, and comprises the following steps: firstly, preprocessing Massachusetts road data set and DeepGlobe 2018 road data set and making edge labels; secondly, constructing a Swift-SegEdgeNet model; then, putting the Massachusetts road data set and the DeepGlobe 2018 road data set which are preprocessed and have the edge labels made into the Swift-SegEdgeNet for training; finally, using mIOU, mDC, Recall and F1-score to evaluate the road extraction result. The application optimizes the network structure by using the multi-task idea and proposes a double-branch convolution module to extract road direction features. In the remote sensing image road extraction task, the segmentation accuracy exceeds that of FCN, UNet, SegNet, ResUNet, AttUNet, DUNet, LinkNet34, DinkNet34, UNet++, UNet2++, TransUNet, Cswin, Segformer, Swin-ResUNet, Swin-ResUNet+ and other networks. This has great practical significance for automatic extraction of roads from remote sensing images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a road extraction method for remote sensing images based on Swift-SegEdgeNet, belonging to the field of computer vision. This invention has strong innovation and feasibility, and can be used to extract the directional features and complex edges of roads in remote sensing images, thereby improving the extraction accuracy of roads in remote sensing images. Background Technology

[0002] With the development of aerospace technology, researchers can easily collect and analyze large amounts of high-resolution remote sensing images. Learning from the knowledge contained in these images and effectively filtering information of interest is of great significance to fields such as earth science, environmental monitoring, urban planning, agricultural management, and disaster emergency response. Roads, as a vital component of daily transportation, are among the most important pieces of information in high-resolution remote sensing imagery. Road extraction has important applications in urban planning, traffic management, disaster emergency response, and environmental protection. Extracting roads from remote sensing images is a crucial yet challenging task.

[0003] In recent years, deep learning-based image algorithms have become a hot research topic in computer science. To improve the accuracy of road extraction in remote sensing images, many researchers have applied deep learning methods to road extraction, utilizing convolutional neural networks and Transformer networks. While convolutional neural network models can improve road extraction to some extent, convolutional operations excel at extracting local features but have limitations in capturing global feature representations. To better extract global features from remote sensing images, many studies have applied Transformer-based methods to road extraction. For example, Dosovitskiy et al. proposed VisionTransformer, the first application of Transformer to computer vision, laying the foundation for many subsequent studies. Zheng et al. proposed SETR, replacing the stacked convolutional layer-based encoder with a pure Transformer, gradually reducing spatial resolution to produce a new segmentation model. This non-convolutional Transformer encoder treats the input image as a sequence of image patches represented by learned patch embeddings and transforms this sequence using a global self-attention model for discriminative feature representation learning. Liu et al. proposed the Swin-Transformer architecture, which reduces computation by dividing the image into non-overlapping local windows and performing self-attention computation within each window, while also allowing cross-window connections after shifting. J. Chen et al. proposed TransUNet, which employs a hybrid CNN-Transformer structure, fully utilizing detailed high-resolution spatial information from CNN features and global contextual information from Transformer, but this method does not fully leverage the advantages of Transformer. Hu et al. proposed Swin-UNet, a U-shaped network built with pure Swin-Transformer modules, which learns local and global semantic features through skip connections by inputting patch sequences into an encoder-decoder structure based on Swin-Transformer modules. Xie et al. proposed SegFormer, which includes a novel hierarchical Transformer encoder that can output multi-scale features. This algorithm does not require positional encoding, avoiding the performance degradation caused by interpolating positional codes when the test resolution differs from the training resolution; furthermore, SegFormer avoids complex decoders, and the proposed MLP decoder aggregates information from different layers, thus combining local and global attention to present powerful representations. Dong et al. proposed CSWinTransformer, which introduces a self-attention mechanism for cross-shaped windows, calculating self-attention in the parallel horizontal and vertical strips that form the cross-shaped window.While Transformer-based segmentation methods can improve the accuracy of road extraction from remote sensing images to some extent, they generally suffer from the following problems: 1. Transformer-based segmentation methods generally involve high computational cost and slow training speed; 2. Current deep learning-based road extraction methods for remote sensing images utilize backbone networks to extract road information, rarely leveraging edge information to improve accuracy, resulting in poor road continuity and a high error rate; 3. Remote sensing images often contain roads that are long-spanning, narrow, continuously distributed, and oriented in different directions. These unique shapes pose challenges to road extraction. Current methods struggle to accurately extract the directional features of these roads, leading to a high error rate.

[0004] To address the aforementioned problems, this invention proposes a road extraction method for remote sensing images based on Swift-SegEdgeNet. First, a dual-branch convolutional module is proposed to extract the directional features of roads in remote sensing images. Second, an edge detection task is added to the semantic segmentation task to extract complex edge information, achieving better road extraction results from remote sensing images. Summary of the Invention

[0005] The purpose of this invention is to further improve the segmentation accuracy of road extraction in remote sensing images. An edge detection task is added to the semantic segmentation task, and the network structure is optimized using a multi-task learning approach, thereby improving the accuracy of road extraction from remote sensing images. Secondly, a bi-branch convolutional module capable of extracting road direction features is proposed, using strip convolutions in four different directions to extract road direction features, further improving the accuracy of road extraction from remote sensing images. To achieve the above objectives, this invention adopts the following technical solution:

[0006] An implementation method for road extraction from remote sensing images based on Swift-SegEdgeNet includes the following steps:

[0007] Step 1: Preprocess the Massachusetts road dataset and the DeepGlobe 2018 road dataset and generate edge labels.

[0008] Step 1.1: Split the dataset. Cropped the Massachusetts road dataset and the DeepGlobe 2018 road dataset into 512×512 images;

[0009] Step 1.2: Remove erroneous data. Analyze the cropped images, remove those with incorrect annotations, and divide the dataset into training, validation, and test sets;

[0010] Step 1.3: Create Edge Labels. First, convert the original segmentation labels to One-Hot encoding, generating a 3D array where each channel represents a category. Then, based on a specified radius parameter, calculate the distance from each pixel to its nearest category, and mark pixels within the radius as edges. This generates a binary edge map, revealing the road's edge information. Finally, convert the generated binary edge map into a PyTorch tensor for use in model training.

[0011] Step 2: Build the Swift-SegEdgeNet model.

[0012] Step 2.1: Feature Extraction. The input image first passes through an encoder containing a Patch Embedding layer, a SwiftFormer module, and a dual-branch convolutional module to extract features;

[0013] Step 2.1.1: Construct the Patch Embedding layer. The Patch Embedding layer contains two convolutional layers with a stride of 2 (including Batch Normalization and ReLU);

[0014] Step 2.1.2: Build the SwiftFormer module. The SwiftFormer module consists of two parts: the Conv Encoder module and the SwiftFormer Encoder module;

[0015] Step 2.1.3: Construct a dual-branch convolution module. The dual-branch convolution module includes a regular convolution branch and a strip convolution branch;

[0016] Step 2.2: Construct the semantic segmentation decoder. The semantic segmentation decoder first feeds the features extracted from the last layer of the encoder into the pyramid pooling module. Then, it gradually fuses high-level semantic information into the middle and lower layers through top-down branching and lateral connections. Finally, the obtained features are fused to obtain the final semantic segmentation map;

[0017] Step 2.3: Construct the edge detection decoder. The edge detection decoder aggregates the features obtained from each stage of the encoder according to two paths: from low to high and from high to low. The aggregated features are then concatenated to obtain the final edge map.

[0018] Step 2.4: Fusing semantic segmentation results and edge detection results. The semantic segmentation result obtained by the semantic segmentation decoder and the edge detection result obtained by the edge detection decoder are added together to obtain the final output result.

[0019] Step 3: Put the preprocessed Massachusetts road dataset and DeepGlobe2018 road dataset with edge labels into Swift-SegEdgeNet for training.

[0020] Step 4: Evaluate the road extraction results using mIOU, mDC, Recall, and F1-score.

[0021] Compared with existing technologies, this invention optimizes the network structure using a multi-task approach and proposes a dual-branch convolutional module to extract road direction features. In remote sensing image road extraction tasks, its segmentation accuracy surpasses that of networks such as FCN, UNet, SegNet, ResUNet, AttUNet, DUNet, LinkNet34, DinkNet34, UNet++, UNet2++, TransUNet, Cswin, Segformer, Swin-ResUNet, and Swin-ResUNet+. This has significant practical implications for the automated extraction of roads from remote sensing images. Attached Figure Description

[0022] Figure 1 Example image of Massachusetts road data after adding edge labels.

[0023] Figure 2 Example image of DeepGlobe 2018 road data after adding edge labels.

[0024] Figure 3 This is a network structure diagram of Swift-SegEdgeNet.

[0025] Figure 4 This is a structural diagram of the Conv Encoder module.

[0026] Figure 5 This is a structural diagram of the SwiftFormer Encoder module.

[0027] Figure 6 This is a structural diagram of an efficient additive attention module.

[0028] Figure 7 This is a structural diagram of a dual-branch convolutional module.

[0029] Figure 8 This is a diagram of the semantic segmentation decoder structure.

[0030] Figure 9 This is a diagram of the edge detection decoder structure.

[0031] Figure 10 This is a flowchart illustrating the implementation of the method of the present invention. Detailed Implementation

[0032] This invention relates to a road extraction method for remote sensing images based on Swift-SegEdgeNet. The invention will be explained and described below with reference to the accompanying drawings:

[0033] The Massachusetts road dataset and DeepGlobe 2018 road dataset used in this invention cover almost all types of roads. The Swift-SegEdgeNet structure includes an encoder, a semantic segmentation decoder, and an edge detection decoder. After the encoder obtains feature maps at four different scales, they are fed into the semantic segmentation decoder and the edge detection decoder, respectively. The semantic segmentation result obtained by the semantic segmentation decoder and the edge detection result obtained by the edge detection decoder are added together to obtain the final output result. The specific implementation scheme of this invention is as follows:

[0034] Step 1: Preprocess the Massachusetts road dataset and the DeepGlobe 2018 road dataset and generate edge labels.

[0035] Step 1.1: Split the dataset. Cropped the Massachusetts road dataset and the DeepGlobe 2018 road dataset into 512×512 images;

[0036] Step 1.2: Remove erroneous data. Analyze the cropped images, remove those with incorrect annotations, and divide the dataset into training, validation, and test sets;

[0037] Step 1.3: Create Edge Labels. First, convert the original segmentation labels to One-Hot encoding, generating a 3D array where each channel represents a category. Then, based on a specified radius parameter, calculate the distance from each pixel to its nearest category, and label pixels within the radius as edges. This generates a binary edge map, revealing the road's edge information. Finally, convert the generated binary edge map to a PyTorch tensor type for use in model training. Example images of the Massachusetts road dataset and DeepGlobe 2018 road dataset after adding edge labels are shown below. Figure 1 and Figure 2 As shown.

[0038] Step 2: Construct the Swift-SegEdgeNet model. The structure of the Swift-SegEdgeNet model is as follows: Figure 3 As shown.

[0039] Step 2.1: Feature Extraction. The input image first passes through an encoder containing a Patch Embedding layer, a SwiftFormer module, and a dual-branch convolutional module to extract features;

[0040] Step 2.1.1: Construct the Patch Embedding layer. The Patch Embedding layer contains two convolutional layers with a stride of 2 (including BN and ReLU), which transform the input image with a resolution of H×W×3 into a feature map of size H / 4×W / 4×C and use it as the input to the SwiftFormer module;

[0041] Step 2.1.2: Build the SwiftFormer module. The SwiftFormer module consists of two parts: the Conv Encoder module and the SwiftFormer Encoder module;

[0042] The Conv Encoder module structure is as follows: Figure 4 As shown, the feature map first passes through a depthwise convolutional layer and a batch normalization layer. Then, the resulting feature map passes through a pointwise convolutional layer, a GeLU activation layer, and another pointwise convolutional layer in sequence. Finally, the resulting feature map is added to the original feature map to obtain the output of the Conv Encoder module. The specific calculation process of the Conv Encoder module is shown in formulas (1) to (4):

[0043] x res =x (1)

[0044] x1=BN(DWConv(x)) (2)

[0045] x2=Conv(GeLU(Conv(x1))) (3)

[0046] x output =x2+x res (4)

[0047] The SwiftFormer Encoder module learns rich local-global information at each stage of the encoder. For example... Figure 5As shown, the SwiftFormer Encoder module contains a local representation module, an efficient additive attention module, and a linear layer. The local representation module consists of 3×3 depthwise convolutions and pointwise convolutions, which enables the module to learn spatial information and encode local information. Then, the obtained feature map is fed into the efficient additive attention module, which aims to learn the contextual information of the feature map. Finally, the output feature map is fed into the linear block, which consists of two 1×1 pointwise convolutional layers, a batch normalization layer, and a GeLU activation layer to generate non-linear features. The computation process of the SwiftFormer Encoder module is shown in equations (5) to (7):

[0048] x1=Conv(DWConv(x)) (5)

[0049] x2=Efficient Additive Attention(x1) (6)

[0050] x output =Linear(x2) (7)

[0051] Efficient Additive Attention refers to a highly efficient additive attention module. For example... Figure 6 As shown, two matrices W are used. q W k Transform the input matrix x into a Query matrix (Q) and a Key matrix (K), where Q and K ∈ R. n×d W q W k ∈R d×d Where n is the token length and d is the vector dimension. Next, each column of the Query matrix is ​​multiplied by the learnable parameter vector w. a ∈R d By learning attention weights, global attention weights a∈R are generated. n Then, the attention weights are multiplied by each column of the Query matrix and summed to produce a single global Query vector q∈R. d Then, q is multiplied by the Key matrix and passed through a linear layer to obtain the global context information. Finally, the normalized Query matrix is ​​added to the global context information and passed through a linear layer to obtain the final output result. The specific calculation process is shown in formulas (8) to (10):

[0052]

[0053]

[0054] x=Linear(Norm(Q)+Linear(K×q)) (10)

[0055] Step 2.1.3: Construct a dual-branch convolutional module. For example... Figure 7 As shown, the dual-branch convolution module includes a regular convolution branch and a strip convolution branch. The regular convolution branch is used to extract image features and downsample the feature map. The strip convolution branch first uses a 1×1 convolution to reduce the dimensionality of the input feature map, and then uses 9×3 strip convolutions in four different directions (horizontal, vertical, left diagonal, and right diagonal) to capture long-range contextual information. The output feature maps of the four strip convolutions are concatenated, and then downsampling and 1×1 convolution are performed to obtain the output of the strip convolution branch. Finally, the feature maps output by the regular convolution branch and the strip convolution branch are added together to obtain the final output of the dual-branch convolution module. The specific calculation process is shown in formulas (11) to (14):

[0056] x conv =ReLu(BN(Conv) 1×1 (x))) (11)

[0057] x i =D i (x conv ), i = 1, 2, 3, 4 (12)

[0058] x concat =Concat(x1,x2,x3,x4) (13)

[0059] x output =Linear(Norm(Q)+Linear(K×q)) (14)

[0060] Step 2.2: Construct the semantic segmentation decoder. As shown in Figure 8, the semantic segmentation decoder first feeds the features extracted from the last layer of the encoder into the pyramid pooling module. Then, through top-down branching and lateral connections, the high-level semantic information is gradually fused into the middle and low layers. Finally, the obtained features are fused to obtain the final semantic segmentation map. The specific calculation process is shown in formulas (15) to (19):

[0061] x1,x2,x3,x4=Encoder(x input (15)

[0062] y4=PPM(x4) (16)

[0063] y i =y i+1 +x i i = 1, 2, 3 (17)

[0064] x = Concat(y1, y2, y3, y4) (18)

[0065] x output =Conv(Conv(Conv(x)))# (19)

[0066] Where, x input The input is a remote sensing image. x1, x2, x3, x4 are feature maps obtained from the four stages of the encoder, and y1, y2, y3, y4 are feature maps obtained from the four stages of the semantic segmentation decoder. output This is the semantic segmentation result graph, where PPM is the pyramid pooling module.

[0067] Step 2.3: Construct the edge detection decoder. The edge detection decoder structure is as follows: Figure 9 As shown, the features obtained from each stage of the encoder are aggregated according to two paths: from low to high and from high to low. The aggregated features are then concatenated to obtain the final edge map. The specific calculation process is shown in formulas (20) to (27):

[0068] x1,x2,x3,x4=Encoder(x input (20)

[0069] x i =Conv 1×1 (Reshape(x i ),i=1,2,3,4 (21)

[0070] y i =Conv 3×3 (x i +x i+1 ), i = 1, 2, 3 (22)

[0071] y4=Conv 3×3 (x4) (23)

[0072] z i =Conv 3×3 (x i +x i-1 ), i = 2, 3, 4 (24)

[0073] z1 = Conv 3×3 (x1) (25)

[0074] x=Concat(y1,y2,y3,y4,z1,z2,z3,z4) (26)

[0075]

[0076] Where, xinput The input is a remote sensing image. x1, x2, x3, and x4 are feature maps obtained from the four stages of the encoder. y1, y2, y3, and y4 are feature maps obtained by aggregating features from high to low. z1, z2, z3, and z4 are feature maps obtained by aggregating features from low to high. σ represents three 3×3 convolutional layers (including BN and ReLU). This represents a 1×1 convolutional layer (containing BN and ReLU), and x_output is the final output edge detection result map.

[0077] Step 2.4: Fusing semantic segmentation results and edge detection results. The semantic segmentation result obtained by the semantic segmentation decoder and the edge detection result obtained by the edge detection decoder are added together to obtain the final output result.

[0078] Step 3: Put the preprocessed Massachusetts road dataset and DeepGlobe2018 road dataset with edge labels into Swift-SegEdgeNet for training.

[0079] Step 4: Evaluate the road extraction results using mIOU, mDC, Recall, and F1-score.

[0080] The implementation details of mIOU are shown in formula (28):

[0081]

[0082] Where k represents the number of categories to be classified in the semantic segmentation task, p ii p represents the number of pixels whose true class is i and whose predicted class is also i. ij p represents the number of pixels with true class i and predicted class j. ji This represents the number of pixels with true class j and predicted class i.

[0083] The details of the implementation of the average Dice coefficient are shown in formula (29):

[0084]

[0085] in This represents the segmentation result predicted by the model for the p-th image. represents the true label of the corresponding p-th image, and N represents the number of test samples.

[0086] The recall rate is calculated as shown in formula (30):

[0087]

[0088] Where TP is the number of samples that are actually positive and are predicted as positive, FN is the number of samples that are actually positive but are predicted as negative, and TN is the number of samples that are actually negative and are also predicted as negative.

[0089] The implementation details of F1-score are shown in formula (31):

[0090]

[0091] Among them, Recall refers to recall rate and Precision refers to precision rate.

[0092] Table 1 Results of different models on the Massachusetts road dataset

[0093]

[0094] Table 2 shows the results of different models on the DeepGlobe 2018 road dataset.

[0095]

[0096]

[0097] The examples above are for illustrative purposes only and are not intended to limit the technical solutions described herein. Therefore, all technical solutions and improvements thereof that do not depart from the spirit and scope of this invention should be covered within the scope of the claims of this invention.

Claims

1. A method for implementing road extraction in remote sensing images based on Swift-SegEdgeNet, characterized in that, Includes the following steps: Step 1: Preprocess the Massachusetts road dataset and the DeepGlobe 2018 road dataset and generate edge labels; Step 1.1: Split the dataset; crop the Massachusetts road dataset and the DeepGlobe 2018 road dataset into 512×512 images; Step 1.2: Remove erroneous data; Analyze the cropped images, remove images with incorrect annotations, and divide the dataset into training, validation, and test sets; Step 1.3: Create edge labels; First, convert the original segmentation labels into One-Hot encoding form to generate a three-dimensional array, where each channel represents a category; then, calculate the distance of each pixel to its nearest category according to the specified radius parameter, and mark pixels whose distance is within the radius as edges; in this way, a binary edge map is finally generated to obtain the edge information of the road; finally, convert the generated binary edge map into a PyTorch tensor type for training and use in the model; Step 2: Construct the Swift-SegEdgeNet model; Step 2.1: Extract features; The input image first passes through an encoder containing a Patch Embedding layer, a SwiftFormer module, and a dual-branch convolutional module to extract features; Step 2.1.1: Construct the Patch Embedding layer; the Patch Embedding layer contains two convolutional layers with a stride of 2, including Batch Normalization (BN) and ReLU; Step 2.1.2: Build the SwiftFormer module; the SwiftFormer module consists of two parts: the Conv Encoder module and the SwiftFormer Encoder module; Step 2.1.3: Construct a dual-branch convolution module; the dual-branch convolution module includes a regular convolution branch and a strip convolution branch; Step 2.2: Construct a semantic segmentation decoder; The semantic segmentation decoder first feeds the features extracted from the last layer of the encoder into the pyramid pooling module; then, through top-down branches and lateral connections, it gradually fuses high-level semantic information into the middle and low layers; the obtained features are then fused to obtain the final semantic segmentation map; Step 2.3: Construct the edge detection decoder; The edge detection decoder aggregates the features obtained from each stage of the encoder according to two paths, from low to high and from high to low, and then concatenates the aggregated features to obtain the final edge map; Step 2.4: Fuse semantic segmentation results and edge detection results; the semantic segmentation result obtained by the semantic segmentation decoder and the edge detection result obtained by the edge detection decoder are added together to obtain the final output result; Step 3: Input the preprocessed Massachusetts road dataset and DeepGlobe 2018 road dataset with edge labels into Swift-SegEdgeNet for training; Step 4: Evaluate the road extraction results using mIOU, mDC, Recall, and F1-score.

2. The method for implementing road extraction in remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, In the Conv Encoder module, the feature map first passes through a depthwise convolutional layer and a batch normalization layer; then, the obtained feature map passes through a pointwise convolutional layer, a GeLU activation layer, and another pointwise convolutional layer in sequence; finally, the obtained feature map and the original feature map are added together to obtain the output of the Conv Encoder module; the specific calculation process of the Conv Encoder module is shown in formulas (1) to (4): x res =x (1) x1=BN(DWConv(x)) (2) x2=Conv((GeLU(Conv(x1))) (3) x output =x2+x res (4)。 3. The method for implementing road extraction from remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, The SwiftFormer Encoder module learns rich local-global information at each stage of the encoder. It comprises a local representation module, an efficient additive attention module, and linear layers. The local representation module consists of 3×3 depthwise convolutions and pointwise convolutions, enabling it to learn spatial information and encode local information. The resulting feature map is then fed into the efficient additive attention module. Finally, the output feature map is fed into a linear block, which consists of two 1×1 pointwise convolutional layers, a batch normalization layer, and a GeLU activation layer to generate non-linear features. The calculation process of the SwiftFormer Encoder module is shown in formulas (5) to (7): x1=Conv(DWConv(x)) (5) x2=Efficient Additive Attention(x1) (6) x output =Linear(x2) (7) Here, Efficient Additive Attention refers to an efficient additive attention module; it uses two matrices Wq and Wk to transform the input matrix x into a Query matrix (Q) and a Key matrix (K), where Q and K ∈ R. n×d W q W k ∈R d×d n is the token length, d is the dimension of the vector; each column of the Query matrix is ​​multiplied by the learnable parameter vector w. a ∈R d By learning attention weights, global attention weights a∈R are generated. n ; Then, the attention weights are multiplied by each column of the Query matrix and summed to produce a single global Query vector q∈R. d Then, multiply q by the Key matrix and pass it through a linear layer to obtain the global context information; finally, add the normalized Query matrix to the global context information and pass it through a linear layer to obtain the final output result; the specific calculation process is shown in formulas (8) to (10): x=Linear(Norm(Q)+Linear(K×q)) (10).

4. The method for implementing road extraction from remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, The dual-branch convolution module includes a regular convolution branch and a strip convolution branch. The regular convolution branch is used to extract image features and downsample the feature map. The strip convolution branch first uses a 1×1 convolution to reduce the dimension of the input feature map, and then uses 9×3 strip convolutions in four different directions (horizontal, vertical, left diagonal, and right diagonal) to capture long-distance contextual information. The output feature maps of the four strip convolutions are concatenated, and then downsampling and 1×1 convolution are performed to obtain the output of the strip convolution branch. Finally, the feature maps output by the regular convolution branch and the strip convolution branch are added together to obtain the final output of the dual-branch convolution module. The specific calculation process is shown in formulas (11) to (14). x conv =ReLu(BN(Conv 1×1 (x))) (11) x i =D i (x conv ),i=1,2,3,4 (12) x concat =Concat(x1,x2,x3,x4) (13) x output =Linear(Norm(Q)+Linear(K×q)) (14)。 5. The method for implementing road extraction in remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, The semantic segmentation decoder first feeds the features extracted from the last layer of the encoder into the pyramid pooling module; then, through top-down branches and lateral connections, it gradually fuses the high-level semantic information into the middle and low layers; finally, it fuses the obtained features to obtain the final semantic segmentation map. The specific calculation process is shown in formulas (15) to (19): x1,x2,x3,x4=Encoder(x input ) (15) y4=PPM(x4) (16) and i / and i+1 +x i ,i=1,2,3 (17) x = Concat(y1, y2, y3, y4) (18) x outpu t=Conv(Conv(Conv(x))) (19) Where, x input The input is a remote sensing image. x1, x2, x3, x4 are feature maps obtained from the four stages of the encoder, and y1, y2, y3, y4 are feature maps obtained from the four stages of the semantic segmentation decoder. output This is the semantic segmentation result graph, where PPM is the pyramid pooling module.

6. The method for implementing road extraction in remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, The edge detection decoder structure aggregates the features obtained from each stage of the encoder according to two paths: from low to high and from high to low. The aggregated features are then concatenated to obtain the final edge map. The specific calculation process is shown in formulas (20) to (27). x1,x2,x3,x4=Encoder(x input ) (20) x i =Conv 1×1 (Reshape(x i )),i=1,2,3,4 (21) y i =Conv 3×3 (x i +x i+1 ),i=1,2,3 (22) y4=Conv 3×3 (x4) (23) z i =Conv 3×3 (x i +x i-1 ),i=2,3,4 (24) z1=Conv 3×3 (x1) (25) x=Concat(y1,y2,y3,y4,z1,z2,z3,z4) (26) Where, x input The input is a remote sensing image. x1, x2, x3, and x4 are feature maps obtained from the four stages of the encoder. y1, y2, y3, and y4 are feature maps obtained by aggregating features from high to low. z1, z2, z3, and z4 are feature maps obtained by aggregating features from low to high. σ represents three 3×3 convolutional layers, including BN and ReLU. This represents a 1×1 convolutional layer containing BN and ReLU; x_output is the final output edge detection result map.

7. The method for implementing road extraction from remote sensing images based on Swift-SegEdgeNet according to claim 1, characterized in that, The road extraction results were evaluated using mIOU, mDC, Recall, and F1-score. The implementation details of mIOU are shown in formula (28): Where k represents the number of categories to be classified in the semantic segmentation task, p ii p represents the number of pixels whose true class is i and whose predicted class is also i. ij p represents the number of pixels with true class i and predicted class j. ji This represents the number of pixels with true class j and predicted class i. The details of the implementation of the average Dice coefficient are shown in formula (29): in This represents the segmentation result predicted by the model for the p-th image. represents the true label of the corresponding p-th image, and N represents the number of test samples; The recall rate is calculated as shown in formula (30): Where TP is the number of samples that are actually positive and are predicted as positive, FN is the number of samples that are actually positive but are predicted as negative, and TN is the number of samples that are actually negative and are also predicted as negative. The implementation details of F1-score are shown in formula (31): Among them, Recall refers to recall rate and Precision refers to precision rate.

Citation Information

Patent Citations

  • Remote sensing image road segmentation method based on contextual information and multi-scale feature fusion

    CN113850825A

  • Single-body planar building detection method based on SegFormer

    CN116486276A