A road extraction method for remote sensing images based on dual-channel deep neural network
By combining the dual-channel deep neural network with the convolution and transformation neural network, and using the feature fusion module that fuses channels and spatial attention, the problem of connectivity and similar spectral feature distinction in road extraction in remote sensing images is solved, and the extraction effect is improved. .
Patent Information
- Application Number
- CN202410853815.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-28
AI Technical Summary
Existing technologies have deficiencies in the connectivity, accuracy and distinction of features with similar spectral characteristics in road extraction in remote sensing images. It is especially difficult to effectively extract road information in complex backgrounds and densely built areas.
A method based on dual-channel deep neural networks is used to extract road feature information and building feature information in parallel through the convolutional neural network CNN and the convolutional-transformation neural network CNN-Transformer, and an attention module based on fused channels and spatial attention is used CBAM and the feature fusion module of the mutually exclusive strategy perform feature fusion to improve the accuracy and differentiation ability of road extraction.
The accuracy and connectivity of road extraction in complex backgrounds are improved, and road and building features with similar spectral characteristics can be effectively distinguished to meet the needs of road extraction in complex backgrounds.
Smart Images

Figure CN118397462B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of road extraction from remote sensing images, and in particular to a method for extracting roads from remote sensing images based on a dual-channel deep neural network. Background Art
[0002] Road information is important information in remote sensing images, and road extraction is an important part of remote sensing image information extraction. It has been widely used in automatic navigation, map updating, urban planning, and smart city construction. Therefore, it is of great significance to accurately and efficiently extract roads from remote sensing images. Traditional road extraction methods require artificially designed features, which are inefficient and not suitable for large-scale extraction, and cannot meet the needs of road extraction in complex backgrounds. Therefore, how to accurately extract roads from remote sensing images, solve the connectivity problem of road extraction, and distinguish objects with similar spectral characteristics is of great research significance.
[0003] Road extraction methods include four categories: color-based, shape-based, texture-based, and deep learning-based methods. Color-based methods mainly use the color difference between the road and the background to extract the road. This type of method is suitable for situations where the color difference between the road and the background is large. When the color difference is not large or the background is complex, it is difficult to solve the problem of road occlusion and background interference. Shape-based extraction methods mainly use the thin and long features of the road and combine other methods to extract the road in the remote sensing image. This type of method has a good effect on the extraction of the road when the road shape is single, but it is difficult to solve the problem of road extraction under complex road shapes, and it requires more manual parameters to be set, and the degree of automation is low. Texture-based methods mainly use the texture similarity of the road to extract the road. The method of extracting the road using texture features has a good extraction effect when the background is simple, but this method is difficult to distinguish between objects with similar spectral characteristics. Deep learning-based methods mainly use the powerful nonlinear expression and semantic information extraction capabilities of neural networks to extract roads. Convolutional neural networks CNN and transform neural networks Transformer are commonly used methods for semantic segmentation. They do not require manual feature design, can process large amounts of data, and can automatically extract features based on trained models. However, most methods based on convolutional neural networks (CNNs) and transform neural networks (Transformers) still have deficiencies in terms of accuracy, connectivity, and differentiation of objects with similar spectral characteristics in road extraction. Therefore, how to effectively use convolutional neural networks (CNNs) and transform neural networks (Transformers) to solve the existing problems of connectivity, accuracy, and differentiation of objects with similar spectral characteristics in road extraction is an important research issue.
[0004] The invention patent application with publication number CN117854027A discloses a dual convolutional network road extraction method based on hypergraph and multi-level feature fusion. The invention provides a dual convolutional network road extraction method consisting of a hypergraph construction module, a hypergraph feature extraction module, a multi-scale feature extraction module and a dual-modal fusion module, which effectively solves the problem that road features are not utilized in data-driven methods, and at the same time improves the accuracy of road extraction; but it still has deficiencies in terms of connectivity and accuracy of road extraction. The invention patent application with publication number CN117830990A discloses a remote sensing image road extraction method based on multi-scale channel attention improvement. The invention method introduces multi-scale channel attention in the jump connection part of the road extraction network, effectively aggregates local and global context information, and improves the accuracy and robustness of road extraction, but there are still problems with road connectivity and the accuracy of road extraction in areas with dense buildings. The invention patent with publication number CN113850825A discloses a remote sensing image road segmentation method based on context information and multi-scale feature fusion. The invention method fuses context information and multi-scale features, effectively improving the accuracy of road extraction, but the method is still insufficient in distinguishing objects with similar spectral characteristics. The invention patent application with publication number CN117649600A discloses a multi-category road automatic extraction method and system combining direction and semantic features. The invention provides a method for extracting railways, highways, paths and bridges from remote sensing images, effectively improving the accuracy of road extraction, but the method is still insufficient in distinguishing objects with similar spectral characteristics. The invention patent application with publication number CN117789028A discloses a remote sensing image road extraction method, system, device and medium based on large kernel convolution and directional strip convolution. The invention provides a remote sensing image road extraction method based on large kernel convolution and directional strip convolution, but the method is difficult to distinguish objects with similar spectral characteristics. The invention patent application with publication number CN117765395A discloses a road extraction method and system for generalized application of semantic segmentation algorithm. The invention provides a road extraction method that improves the accuracy of object recognition by dividing remote sensing images into grid units, but the method still has difficulty in solving the problem of accuracy of road extraction in densely built areas. The invention patent application with publication number CN117746051A discloses a SAR image road extraction method based on a semantic segmentation model. The invention provides a method for post-processing the road extraction results output by the model, which improves the connectivity and accuracy of the extracted roads, but the method still has difficulty in distinguishing objects with similar spectral characteristics. Summary of the invention
[0005] The purpose of the present invention is to provide a remote sensing image road extraction method based on a dual-channel deep neural network, which can simultaneously learn road feature information and building feature information, distinguish roads and building information with similar spectral characteristics, and make the road extraction result more accurate.
[0006] To achieve the above object, the technical solution adopted by the present invention is:
[0007] A remote sensing image road extraction method based on a dual-channel deep neural network comprises the following steps:
[0008] S1: constructing a road extraction model, wherein the road extraction model is a dual-channel deep neural network that can simultaneously extract road feature information and building feature information; the dual-channel deep neural network includes a road feature information extraction branch, a building feature information extraction branch, a feature fusion branch, a feature decoding module, a segmentation branch, and a connectivity branch;
[0009] The road feature information extraction branch is a convolutional neural network (CNN), which is used to extract road feature information;
[0010] The building feature information extraction branch is a convolutional-transformation neural network CNN-Transformer, which is used to extract building feature information;
[0011] The feature fusion branch is an attention module CBAM based on fusion channel and spatial attention and a feature fusion module of a repulsive strategy, which is used to realize the fusion of features output by the road feature information extraction branch and the building feature information extraction branch;
[0012] The feature decoding module includes two decoding parts, namely a road feature decoding part and a building feature decoding part, which are used to decode feature information, restore the resolution of the feature map, and obtain a decoded road prediction feature map and a decoded building prediction feature map;
[0013] The segmentation branch and the connected branch are connected in parallel behind the road feature decoding part, the segmentation branch is used to calculate the loss function of the segmentation branch and output the road segmentation prediction feature map of the segmentation branch, and the connected branch is used to calculate the loss function of the connected branch and output the connected prediction feature map of the connected branch; the road segmentation prediction feature map output by the segmentation branch and the connected prediction feature map output by the connected branch are spliced according to element-by-element addition to obtain the final road prediction feature map;
[0014] S2: using the public dataset to be cropped as the training set and test set of the road extraction model;
[0015] S3: training the road extraction model using the training set and the test set, performing loss calculation on the connected prediction feature map and the road segmentation prediction feature map output by the connected branch and the segmentation branch respectively with the real connected label and the real road label to obtain the road loss, performing loss calculation on the building prediction feature map output by the building feature decoding part with the real building label to obtain the building loss, and adding the road loss and the building loss to obtain the total loss of the network, and finally back-propagating the total loss to optimize the parameters of the model to complete the model training;
[0016] S4: Extract roads from remote sensing images using the trained road extraction model.
[0017] Furthermore, the convolutional neural network CNN includes five stages, namely the first stage, the second stage, the third stage, the fourth stage and the fifth stage, all of which are convolutional module layers; the convolutional module layer of the first stage includes a convolutional layer, a batch normalization layer BN, an activation function ReLU and a maximum pooling layer; the convolutional module layers of the second stage, the third stage, the fourth stage and the fifth stage are all composed of residual modules, and the residual module includes a convolutional layer, a batch normalization layer BN, an activation function ReLU, a convolutional layer, a batch normalization layer BN, an activation function ReLU, a convolutional layer, a batch normalization layer BN and an activation function ReLU connected in sequence. The second stage, the third stage, the fourth stage and the fifth stage stack 3 layers, 4 layers, 23 layers and 3 layers of the residual module itself respectively.
[0018] Furthermore, the convolution-transformation neural network CNN-Transformer includes five stages, the first stage is the convolution module layer, the second stage, the third stage, and the fourth stage are all pre-activated bottleneck module layers, and the fifth stage is the transformation module layer; the convolution module layer of the first stage includes sequentially connected convolution layers, group normalization GN, and activation functions ReLU; the pre-activated bottleneck module layer includes three groups of convolution layers, group normalization GN, and activation functions ReLU that alternate in sequence, wherein the input of the pre-activated bottleneck module layer and the output of the third group normalization GN are concatenated according to element-by-element addition and then subjected to the third activation function ReLU to obtain the output of the pre-activated bottleneck module layer; the transformation module layer consists of an embedding module layer and 12 sequentially stacked Transformer layers.
[0019] Furthermore, the embedding module layer includes a convolution layer, a dimensionality reduction function, a transposition function and a regularization, wherein the input of the embedding module layer and the output of the transposition function are concatenated according to element-by-element addition and then regularized as the output of the embedding module layer, and the Transformer layer includes a first layer normalization mechanism, a multi-head self-attention mechanism MSA, a second layer normalization mechanism and a multi-layer perceptron MLP connected in sequence, wherein the input of each Transformer layer and the output of its own multi-head self-attention mechanism MSA are concatenated according to element-by-element addition and then input into the second layer normalization mechanism, and are concatenated with the output of the multi-layer perceptron MLP according to element-by-element addition as the output of the Transformer layer, the output of the embedding module layer is used as the input of the first Transformer layer, the output of the first Transformer layer is used as the input of the second Transformer layer, and after 12 consecutive times, the output of the twelfth Transformer layer is obtained as the output of the final transformation module layer.
[0020] Furthermore, the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsion strategy include 1 convolution layer and 1 CBAM module, the convolution layer is a convolution layer with a convolution kernel size of 1×1, the CBAM module includes 7 channel attention modules and 7 spatial attention modules, the channel attention module includes a maximum pooling layer, an average pooling layer, a multilayer perceptron MLP and a sigmoid function, the multilayer perceptron MLP includes a convolution layer, an activation function ReLU, and a convolution layer; the spatial attention module includes a maximum pooling layer, an average pooling layer, a convolution layer and a sigmoid function.
[0021] Furthermore, the calculation formula of the fused feature map according to the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy is as follows:
[0022] ;
[0023] ;
[0024] ;
[0025] ;
[0026] ;
[0027] in, is the channel attention module, is the sigmoid function, is a multi-layer perceptron, is the average pooling layer, is the maximum pooling layer, is the hidden layer of the multi-layer perceptron MLP, is the activation function of the multi-layer perceptron MLP, is the input feature, is the average pooling feature, is the maximum pooling feature, is the channel attention module feature, is the element-by-element multiplication method, is the spatial attention module, is the convolutional layer, is the spatial attention module feature, To fusion features, is the road feature that has passed through the channel attention module and the spatial attention module, Building features after the channel attention module and the spatial attention module.
[0028] Furthermore, the road feature decoding part is composed of a decoding module layer I, which includes a decoding module layer I1, a decoding module layer I2, a decoding module layer I3, and a decoding module layer I4. The decoding module layer I1 is composed of a first strip convolution module layer and a first convolution module layer I 11 The decoding module layer I2 is composed of a second strip convolution module layer and a second convolution module layer I 21 The decoding module layer I3 is composed of the third strip convolution module layer and the third convolution module layer I 31The decoding module layer I4 is composed of a fourth strip convolution module layer and an upsampling; the first strip convolution module layer, the second strip convolution module layer, the third strip convolution module layer and the fourth strip convolution module layer first perform feature extraction, batch normalization operation and nonlinear transformation on the feature map through the convolution layer, the batch normalization layer BN, and the activation function ReLU, and then extract information from the feature map from the horizontal, vertical, left diagonal and right diagonal lines through two convolution layers with different convolution kernel sizes and padding, the horizontal transformation module, and the vertical transformation module, wherein the two convolution layers with different convolution kernel sizes and padding are respectively used for upsampling in the horizontal direction to extract feature information in the vertical direction, and for upsampling in the vertical direction to extract feature information in the horizontal direction, and the horizontal transformation module is a horizontal transformation operation A convolution layer and a horizontal transformation operation are sequentially connected after the vertical transformation operation, which are used to upsample in the vertical direction and transform the input feature map in the horizontal direction to extract the feature information of the left diagonal line. The vertical transformation module is a vertical transformation operation, and a convolution layer and a vertical transformation operation are sequentially connected after the vertical transformation operation, which are used to upsample in the horizontal direction and transform the input feature map in the vertical direction to extract the feature information of the right diagonal line. The feature maps obtained by two different convolution layers, horizontal transformation modules, and vertical transformation modules are spliced along the channel direction, and then batch normalization operations and nonlinear transformations are performed through a batch normalization layer BN and an activation function ReLU. Finally, feature extraction, batch normalization operations, and nonlinear transformations are performed through a convolution layer, a batch normalization layer BN, and an activation function ReLU to obtain an output feature map; the first convolution module layer I 11 , the second convolutional module layer I 21 And the third convolutional module layer I 31 They all contain convolutional layers, batch normalization layers BN, and activation functions ReLU. The road feature decoding part extracts information from the feature map from the horizontal, vertical, left diagonal, and right diagonal lines through the strip convolutional module layer in the decoding module layer I, and splices the information extracted in the four directions along the channel, performs normalization and nonlinear transformation, and then modifies the number of channels of the feature map through the convolutional layer, performs normalization and nonlinear transformation, and at the same time uses the convolutional module layer in the decoding module layer I to modify the number of channels of the feature map, performs normalization and nonlinear transformation, and uses upsampling to modify the size of the feature map.
[0029] Furthermore, the building feature decoding part is composed of a decoding module layer II and an upsampling, the decoding module layer II includes a convolution module layer II1, a convolution module layer II2, and a convolution module layer II3, the convolution module layer II1 includes a convolution layer, an activation function ReLU, an upsampling, a convolution layer, and an activation function ReLU, the convolution module layer II2 includes an upsampling, a convolution layer, and an activation function ReLU, and the convolution module layer II3 includes an upsampling, a convolution layer, and an activation function ReLU. The convolution module layer in the building feature decoding part uses a convolution operation to extract features, changes the number of channels of the feature map, uses an upsampling operation to change the size of the feature map, performs a nonlinear transformation through the activation function ReLU, and uses an upsampling layer after three convolution module layers to restore the feature map to the size of the input image.
[0030] Furthermore, a dilated spatial convolution pooling pyramid ASPP is provided between the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsion strategy and the road feature decoding part, so as to increase the receptive field of feature points; the dilated spatial convolution pooling pyramid ASPP includes a Conv 1×1 convolution layer, a Conv 3×3 convolution layer with a dilation rate of 6, a Conv 3×3 convolution layer with a dilation rate of 12, a Conv 3×3 convolution layer with a dilation rate of 18, and an adaptive average pooling; the adaptive average pooling is followed by a convolution layer, a batch normalization layer BN, an activation function ReLU and an interpolation operation; the outputs of the convolution layers and the interpolation operation with four different dilation rates are spliced along the channel and then subjected to feature extraction and batch normalization operations through the convolution layer and the batch normalization layer BN; then, nonlinear transformation is performed through the activation function ReLU and regularization to prevent overfitting, and finally the output of the dilated spatial convolution pooling pyramid ASPP is obtained.
[0031] Furthermore, the segmentation branch is a convolution module layer composed of a convolution layer, a ReLU activation function and a convolution layer, and the segmentation branch is used to calculate the loss function of the segmentation branch and output a road segmentation prediction feature map corresponding to the segmentation branch.
[0032] Furthermore, the connected branch is composed of 2 connected convolutional layers and 2 compression and excitation networks SE; the first connected convolutional layer in the connected branch is composed of a convolutional layer, a ReLU activation function and a convolutional layer, the second connected convolutional layer is composed of a convolutional layer, a ReLU activation function and a convolutional layer with an expansion rate of 3, and the compression and excitation networks SE are both composed of an average pooling layer, a fully connected layer, a ReLU activation function, a fully connected layer and a sigmoid function; the connected branch is used to calculate the loss function of the connected branch and output the connected prediction feature map corresponding to the connected branch.
[0033] Furthermore, when using the public data set for cropping as the training set and test set of the road extraction model, it is also necessary to perform random rotation, horizontal flipping, Gaussian blur and normalization operations on the images in the training set to generate new image sets and label sets, and at the same time perform normalization operations on the images in the test set.
[0034] The beneficial technical effects of the present invention are:
[0035] (1) The present invention constructs a remote sensing image road extraction method based on a dual-channel deep neural network, which can simultaneously extract road feature information and building feature information. The convolutional neural network (CNN) and the convolution-transformation neural network (CNN-Transformer) are used to extract road feature information and building feature information in parallel, and the attention module (CBAM) based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy are used to perform feature fusion, which effectively fuses the road feature information and building feature information extracted by the dual-channel deep neural network;
[0036] (2) In order to distinguish road features and building features with similar spectral characteristics, the road features and building features learned from high-resolution remote sensing images are extracted and utilized through an attention module CBAM based on fusion channels and spatial attention and a feature fusion module based on a repulsive strategy to obtain more semantic information, thereby obtaining road features constrained by building features. This improves the performance of the model in distinguishing road features and building features with similar spectral characteristics. The road extraction strategy of the present invention obtains better extraction results in terms of road extraction and can meet the needs of road extraction under complex backgrounds. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Flow chart of a method for extracting roads from remote sensing images based on a dual-channel deep neural network in an embodiment of the present invention;
[0038] Figure 2 It is a schematic diagram of the structure of a dual-channel deep neural network in an embodiment of the present invention;
[0039] Figure 3 It is a structural schematic diagram of the pre-activation bottleneck module layer in an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of the structure of the embedded module layer in an embodiment of the present invention;
[0041] Figure 5 Schematic diagram of the structure of the Transformer layer in an embodiment of the present invention;
[0042] Figure 6 It is a structural schematic diagram of an attention module CBAM based on fusion channel and spatial attention and a feature fusion module based on a repulsive strategy in an embodiment of the present invention;
[0043] Figure 7 This is a schematic diagram of the structure of a CBAM module in an embodiment of the present invention;
[0044] Figure 8 Schematic diagram of the structure of the atrous spatial convolutional pooling pyramid ASPP in an embodiment of the present invention;
[0045] Fig. 9 Schematic diagram of the structure of the strip convolution module layer in an embodiment of the present invention;
[0046] Fig.10 This is a schematic diagram of the structure of the connected branches in an embodiment of the present invention;
[0047] Fig.11 Schematic diagram of road extraction results according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. In the following description, a lot of specific details are set forth to facilitate a full understanding of the present invention, but the present invention can also be implemented in other ways different from those described herein, and therefore, the present invention is not limited to the limitation of the specific embodiments disclosed below. Unless otherwise defined, the technical terms or scientific terms used herein should be the usual meanings understood by people with ordinary skills in the field described in the application.
[0049] like Figure 1 As shown, the remote sensing image road extraction method based on a dual-channel deep neural network in this embodiment includes the following steps:
[0050] S1: construct a road extraction model, which is a dual-channel deep neural network that can simultaneously extract road feature information and building feature information; Figure 2 As shown, the dual-channel deep neural network includes a road feature information extraction branch, a building feature information extraction branch, a feature fusion branch, a feature decoding module, a segmentation branch and a connectivity branch.
[0051] The road feature information extraction branch is a convolutional neural network CNN, which is used to extract road feature information. In an embodiment of the present invention, the convolutional neural network CNN includes five stages, the first stage, the second stage, the third stage, the fourth stage and the fifth stage, and all five stages are convolution module layers; the convolution module layer of the first stage includes a convolution layer, a batch normalization layer BN, an activation function ReLU and a maximum pooling layer; the convolution module layers of the second stage, the third stage, the fourth stage and the fifth stage are all composed of residual modules, and the residual module includes a convolution layer, a batch normalization layer BN, an activation function ReLU, a convolution layer, a batch normalization layer BN, an activation function ReLU, a convolution layer, a batch normalization layer BN and an activation function ReLU connected in sequence. The second stage, the third stage, the fourth stage and the fifth stage stack 3 layers, 4 layers, 23 layers and 3 layers on the residual module itself, respectively. The fourth stage and the fifth stage use convolution layers with expansion rates of 2 and 4, respectively, to perform convolution operations to improve the receptive field of the feature map. The size of the feature map output by each stage is respectively and ,in, , and are the length, width and number of channels of the image input into the network respectively. The feature maps output by the first stage, the second stage, the third stage, the fourth stage and the fifth stage are road feature map x, road feature map e1, road feature map e2, road feature map e3 and road feature map e4 respectively.
[0052] The building feature information extraction branch is a convolution-transformation neural network CNN-Transformer, which is used to extract building feature information. In an embodiment of the present invention, the convolution-transformation neural network CNN-Transformer includes five stages, the first stage is a convolution module layer, the second stage, the third stage, and the fourth stage are all pre-activation bottleneck module layers, i.e., PreActBottleneck layers, and the fifth stage is a transformation module layer; the convolution module layer of the first stage includes a convolution layer, a group normalization GN, and an activation function ReLU connected in sequence; Figure 3 As shown, the pre-activated bottleneck module layer includes three groups of convolutional layers, group normalization GN and activation function ReLU that are alternated in sequence, wherein the input of the pre-activated bottleneck module layer and the output of the third group normalization GN are concatenated according to element-by-element addition and then the output of the pre-activated bottleneck module layer is obtained by the third activation function ReLU; the transformation module layer is composed of an embedding module layer and 12 sequentially stacked Transformer layers, as shown Figure 4 As shown, the embedding module layer includes a convolution layer, a dimensionality reduction function, a transposition function and regularization, i.e., dropout, wherein the input of the embedding module layer and the output of the transposition function are concatenated according to element-by-element addition and then regularized as the output of the embedding module layer; Figure 5 As shown, the Transformer layer includes a first layer normalization mechanism, a multi-head self-attention mechanism MSA, a second layer normalization mechanism and a multi-layer perceptron MLP connected in sequence, wherein the input of each Transformer layer is concatenated with the output of its own multi-head self-attention mechanism MSA according to element-by-element addition and then input into the second layer normalization mechanism behind it, and concatenated with the output of the multi-layer perceptron MLP according to element-by-element addition as the output of the Transformer layer, the output of the embedding module layer is used as the input of the first Transformer layer, the output of the first Transformer layer is used as the input of the second Transformer layer, and after 12 consecutive times, the output of the twelfth Transformer layer is obtained as the output of the final transformation module layer. The sizes of the feature maps output by the first stage, the second stage, the third stage, and the fourth stage are respectively and ,in, , and is the length, width and number of channels of the image input to the network. The feature maps output by the first, second, third and fourth stages are building feature map f1, building feature map f2, building feature map f3 and feature map f4 for extracting global context information for feature fusion. The embedding module layer in the transformation module layer of the fifth stage is used to serialize the feature map f4 and add position information. The 12 Transformer layers encode the tokenized image blocks into an input sequence for extracting global context. The output of the fifth stage is a feature map f5 containing a feature sequence. The size of feature map f5 is (1024, 768).
[0053] The feature fusion branch is an attention module CBAM based on fusion channel and spatial attention and a feature fusion module of an exclusive strategy, which is used to realize the fusion of features output by the road feature information extraction branch and the building feature information extraction branch. In an embodiment of the present invention, the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of an exclusive strategy include 1 convolution layer and 1 CBAM module, the convolution layer is a convolution layer with a convolution kernel size of 1×1, the CBAM module includes 7 channel attention modules and 7 spatial attention modules, the channel attention module includes a maximum pooling layer (i.e. GAP), an average pooling layer (i.e. GMP), a multilayer perceptron MLP and a sigmoid function, the multilayer perceptron MLP includes a convolution layer, an activation function ReLU, and a convolution layer; the spatial attention module includes a maximum pooling layer (i.e. GAP), an average pooling layer (i.e. GMP), a convolution layer and a sigmoid function.
[0054] like Figure 6 As shown, the road feature maps e1, e2, e3, and e4 outputted from the second, third, fourth, and fifth stages of the convolutional neural network CNN (i.e., the road feature information extraction branch), and the building feature maps f1, f2, and f3 outputted from the first, second, and third stages of the building feature information extraction branch (i.e., the convolution-transformation neural network CNN-Transformer) are inputted into the CBAM module, as shown in FIG. Figure 7 As shown in the figure, each input feature map passes through the channel attention module and the spatial attention module of the corresponding channel number size in sequence. The road feature map e1, road feature map e2, road feature map e3, road feature map e4 and the building feature map f1, building feature map f2, and building feature map f3 respectively pass through the average pooling layer (GMP) and the maximum pooling layer (GAP) based on the width W and length H of the image in the channel attention module to aggregate the spatial information of the feature map; each input feature map passes through the average pooling layer (GMP) and the maximum pooling layer (GAP) to obtain two sub-feature maps, and the obtained two sub-feature maps are respectively passed through the convolution layer, activation function ReLU and convolution layer in the multi-layer perceptron MLP to compress the spatial dimension of the input feature map, and the corresponding two sub-feature maps output by the multi-layer perceptron MLP are merged according to element-by-element addition to obtain a channel feature map, and then the channel attention feature map is obtained through the sigmoid function; the obtained channel attention feature map is fused with the corresponding feature map input to the channel attention module according to element-by-element multiplication to obtain the fused feature map corresponding to each input feature map. The fused feature maps output by the channel attention module are input into the corresponding spatial attention module in sequence. Each fused feature map is processed based on the number of channels. C After the average pooling layer and the maximum pooling layer, two fused sub-feature maps are obtained. The two fused sub-feature maps are spliced along the channel to obtain a spatial feature map. After a convolution layer, the number of channels of the spatial feature map is modified to 1. Then, the spatial attention feature map is obtained through the sigmoid function. The obtained spatial attention feature map is fused with the corresponding fused feature map input into the spatial attention module according to element-by-element multiplication to obtain feature-enhanced building feature maps f1', building feature maps f2', building feature maps f3', and feature-enhanced road feature maps e1', road feature maps e2', road feature maps e3' and road feature maps e4'. The calculation formula for enhancing the feature map based on the attention module CBAM based on fusion channels and spatial attention and the feature fusion module based on the repulsive strategy is as follows:
[0055] ;
[0056] ;
[0057] ;
[0058] ;
[0059] in, is the channel attention module, is the sigmoid function, is a multi-layer perceptron, is the average pooling layer, is the maximum pooling layer, is the hidden layer of the multi-layer perceptron MLP, is the activation function of the multi-layer perceptron MLP, is the input feature, is the average pooling feature, is the maximum pooling feature, is the channel attention module feature, is the element-by-element multiplication method, is the spatial attention module, is the convolutional layer, It is the feature of the spatial attention module. In the attention module CBAM based on the fusion channel and spatial attention and the feature fusion module of the repulsive strategy, the features of different channels of the feature map are amplified through the channel attention module and the spatial attention module, and key information is extracted from different spaces to better extract the road.
[0060] In an embodiment of the present invention, the road feature maps e1, e2, e3 and e4 outputted in the second, third, fourth and fifth stages of the convolutional neural network CNN and the building feature maps f1, f2 and f3 outputted in the first, second and third stages of the convolutional-transformation neural network CNN-Transformer are subjected to the attention module CBAM based on the fusion channel and the spatial attention and the feature fusion module based on the repulsion strategy to obtain the feature-enhanced building feature maps f1', f2' and f3'. Figure f2', building feature map f3', road feature map e1', road feature map e2', road feature map e3' and road feature map e4', and the road feature map e1', road feature map e2', road feature map e3' are input into the road feature decoding part corresponding to the road feature information extraction branch for decoding, the building feature map f1', building feature map f2', building feature map f3' are input into the building feature decoding part corresponding to the building feature information extraction branch for decoding, and the road feature map e4' is used for feature fusion with the output of the building feature information extraction branch.
[0061] The feature decoding module includes two decoding parts, namely a road feature decoding part and a building feature decoding part. The road feature decoding part acts on the feature map output by the road feature information extraction branch, and the building feature decoding part acts on the feature map output by the building feature information extraction branch, and is used to decode the feature information, restore the resolution of the feature map, and obtain the decoded road prediction feature map and the decoded building prediction feature map.
[0062] In the embodiment of the present invention, the road feature decoding part corresponding to the road feature information extraction branch is composed of a decoding module layer I, and the decoding module layer I includes a decoding module layer I1, a decoding module layer I2, a decoding module layer I3, and a decoding module layer I4. The decoding module layer I1 is composed of a first strip convolution module layer (a first strip conv layer) and a first convolution module layer I 11 The decoding module layer I2 is composed of a second strip convolution module layer (second strip conv layer) and a second convolution module layer I 21 The decoding module layer I3 is composed of a third strip convolution module layer (third strip conv layer) and a third convolution module layer I 31 The decoding module layer I4 is composed of a fourth strip convolution module layer (fourth strip conv layer) and an upsampling; Fig. 9As shown, the first strip convolution module layer, the second strip convolution module layer, the third strip convolution module layer and the fourth strip convolution module layer first perform feature extraction, batch normalization operation and nonlinear transformation on the feature map through the convolution layer, the batch normalization layer BN and the activation function ReLU, and then extract the information in the feature map from the horizontal, vertical, left diagonal and right diagonal respectively through two convolution layers with different convolution kernel sizes and padding, the horizontal transformation module and the vertical transformation module, wherein the two convolution layers with different convolution kernel sizes and padding are respectively used for upsampling in the horizontal direction to extract the feature information in the vertical direction, and for upsampling in the vertical direction to extract the feature information in the horizontal direction, and the horizontal transformation module is a horizontal transformation operation followed by a convolution layer and a horizontal transformation module. The horizontal transformation operation is used to upsample in the vertical direction and transform the input feature map in the horizontal direction to extract the feature information of the left diagonal line. The vertical transformation module is a vertical transformation operation followed by a convolution layer and a vertical transformation operation, which are used to upsample in the horizontal direction and transform the input feature map in the vertical direction to extract the feature information of the right diagonal line. The feature maps obtained by two different convolution layers, horizontal transformation modules, and vertical transformation modules are spliced along the channel direction, and then batch normalization operations and nonlinear transformations are performed through a batch normalization layer BN and an activation function ReLU. Finally, feature extraction, batch normalization operations, and nonlinear transformations are performed through a convolution layer, a batch normalization layer BN, and an activation function ReLU to obtain an output feature map. The first convolution module layer I 11 , the second convolutional module layer I 21 And the third convolutional module layer I 31 They all contain convolutional layers, batch normalization layers BN, and activation functions ReLU.
[0063] The building feature decoding part corresponding to the building feature information extraction branch is composed of a decoding module layer II and an upsampling. The decoding module layer II includes a convolution module layer II1, a convolution module layer II2, and a convolution module layer II3. The convolution module layer II1 includes a convolution layer, an activation function ReLU, an upsampling, a convolution layer, and an activation function ReLU. The convolution module layer II2 includes an upsampling, a convolution layer, and an activation function ReLU. The convolution module layer II3 includes an upsampling, a convolution layer, and an activation function ReLU.
[0064] like Figure 2 As shown in FIG, a hollow spatial convolutional pooling pyramid ASPP is provided between the attention module CBAM based on the fusion channel and spatial attention and the feature fusion module based on the repulsive strategy and the road feature decoding part. Figure 8As shown in the figure, the atrous spatial convolution pooling pyramid ASPP includes a Conv 1×1 convolution layer, a Conv 3×3 convolution layer with a dilation rate of 6, a Conv 3×3 convolution layer with a dilation rate of 12, a Conv 3×3 convolution layer with a dilation rate of 18, and adaptive average pooling. The adaptive average pooling is followed by a convolution layer, a batch normalization layer BN, an activation function ReLU, and an interpolation operation. The outputs of the four convolution layers with different dilation rates and the interpolation operation are spliced along the channel and then subjected to feature extraction and batch normalization operations through the convolution layer and the batch normalization layer BN. Then, nonlinear transformation is performed through the activation function ReLU and regularization to prevent overfitting, and finally the output of the atrous spatial convolution pooling pyramid ASPP is obtained.
[0065] like Figure 2 As shown in FIG, a segmentation branch and a connected branch are connected in parallel after the road feature decoding part. The segmentation branch is a convolutional module layer composed of a convolutional layer, a ReLU activation function and a convolutional layer, which is used to calculate the loss function of the segmentation branch and output the road segmentation prediction feature map of the segmentation branch. Fig.10 As shown, the connected branch is composed of 2 connected convolutional layers and 2 compression and excitation networks SE; the first connected convolutional layer in the connected branch is composed of a convolutional layer, a ReLU activation function and a convolutional layer, and the second connected convolutional layer is composed of a convolutional layer, a ReLU activation function and a convolutional layer with an expansion rate of 3. The compression and excitation networks SE are composed of an average pooling layer, a fully connected layer, a ReLU activation function, a fully connected layer and a sigmoid function, which are used to calculate the loss function of the connected branch and output the connected prediction feature map of the connected branch. The road prediction feature map output by the road feature decoding part passes through the first connected convolutional layer and the first compression and excitation network SE to obtain a connected prediction feature map with an interval of 1 with adjacent pixels, and the road prediction feature map output by the road feature decoding part passes through the second connected convolutional layer and the second compression and excitation network SE to obtain a connected prediction feature map with an interval of 3 with adjacent pixels. The road segmentation prediction feature map output by the segmentation branch and the connected prediction feature map output by the connected branch are spliced according to element-by-element addition to obtain the final road prediction feature map.
[0066] like Figure 2As shown, the feature-enhanced building feature map f1', building feature map f2', building feature map f3' output by the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy and the feature map f5 output by the convolution-transformation neural network CNN-Transformer are input to the building feature decoding part for decoding. The feature map f5 is input to the convolution module layer Ⅱ1 and reshaped through a 3×3 convolution layer and a ReLU activation function. The feature map f5 is then modified to the same shape as the building feature map f3' in size and number of channels through upsampling and convolution layers, and a nonlinear transformation is performed using the ReLU activation function. The feature map f5 that has passed through the convolution module layer Ⅱ1 is concatenated with the building feature map f3' along the channel direction to obtain the concatenated feature map f6'. The concatenated feature map f6' is input to the convolution module layer Ⅱ2. The feature map f6' is modified to the same shape as the building feature map f2' in size and number of channels through upsampling and convolution layers, and a nonlinear transformation is performed using the ReLU activation function. The feature map f6' of the convolution module layer Ⅱ2 is concatenated with the building feature map f2' along the channel direction to obtain the concatenated feature map f7', which is input into the convolution module layer Ⅱ3. After upsampling and convolution layer, the feature map f7' is modified to the same shape as the building feature map f1' in size and number of channels, and the ReLU activation function is used for nonlinear transformation. The feature map f7' passing through the convolution module layer Ⅱ3 is concatenated with the building feature map f1' along the channel direction to obtain the concatenated feature map f8'. The spliced feature map f8' is upsampled to obtain the building prediction feature map, and the loss is calculated with the real building label for model optimization.
[0067] At the same time, the spliced feature map f6' is input into the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy. The number of channels is adjusted through the convolution layer with a convolution kernel size of 1×1 (Conv 1×1 convolution layer) to make the number of channels of the feature map f6' consistent with the size and number of channels of the road feature map e4' to be fused; then the feature-enhanced road feature map e4' and the feature map f6' after the convolution layer with a convolution kernel size of 1×1 (Conv 1×1 convolution layer) are fused according to the repulsive strategy (i.e., element-by-element subtraction method) to obtain the fused road feature map e4''. The calculation formula for fusion of feature maps based on the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy is as follows:
[0068] ;
[0069] in, To fusion features, is the road feature that has passed through the channel attention module and the spatial attention module, Building features after the channel attention module and the spatial attention module.
[0070] Then the fused road feature map e4'' is input into the atrous spatial convolution pooling pyramid ASPP to increase the receptive field of the feature points. The input fused road feature map e4'' is processed by a parallel Conv 1×1 convolution layer, a Conv 3×3 convolution layer with a dilation rate of 6, a Conv 3×3 convolution layer with a dilation rate of 12, and a Conv 1×1 convolution layer with a dilation rate of 18. 3×3 convolutional layers and adaptive average pooling are used to obtain feature maps t1'', t2'', t3'', t4'', and t5''. The feature map t5'' is sequentially passed through a convolutional layer, a batch normalization layer BN, and an activation function ReLU to obtain a feature map t6''. The feature map t6'' is then interpolated to obtain t7''. The feature maps t1'', t2'', t3'', t4'', and t7'' are concatenated along the channel direction to obtain a feature map t8''. The concatenated feature map t8'' is passed through a convolutional layer, a batch normalization layer BN, an activation function ReLU, and regularization to obtain a road feature map e4''' for input into the road feature decoding part.
[0071] Then the road feature map e4''' is input into the decoding module layer Ⅰ1 of the road feature decoding part, and the road feature map e3' is input into the first convolution module layer Ⅰ of the road feature decoding part. 11 In the example, the size and number of channels of the road feature map e4''' and the road feature map e3' are the same, and then the road feature map e4''' and the road feature map e3' are concatenated along the channel direction, i.e., Concat operation, to obtain the concatenated feature map e5'. The concatenated feature map e5' is then input into the decoding module layer I2, and the road feature map e2' is input into the second convolution module layer I 21 In the example, the size and number of channels of the spliced feature map e5' and the road feature map e2' are the same, and the spliced feature map e5' and the road feature map e2' are subjected to feature splicing operation along the channel direction, i.e., Concat operation, to obtain the spliced feature map e6'. Then the spliced feature map e6' is input into the decoding module layer I3, and the road feature map e1' is input into the third convolution module layer I 31In the example, the size and number of channels of the spliced feature map e6' and the road feature map e1' are the same, and then the spliced feature map e6' and the road feature map e1' are subjected to feature splicing operation along the channel direction, i.e., Concat operation, to obtain the spliced feature map e7'. The spliced feature map e7' is input to the fourth decoding module layer Ⅰ4 for decoding to obtain the feature map e8'. The obtained feature map e8' is upsampled and input to the segmentation branch and the connectivity branch to obtain the road segmentation prediction feature map and the connectivity prediction feature map. The road segmentation prediction feature map and the connectivity prediction feature map are spliced according to element-by-element addition to obtain the final road prediction feature map.
[0072] The input image containing R, G, and B channel information is respectively subjected to feature extraction by the road feature information extraction branch and the building feature information extraction branch. The road feature information extraction branch extracts five road feature maps x, e1, e2, e3, and e4. The building feature information extraction branch extracts three building feature maps f1, f2, f3, and a feature map f4 for global context information extraction to facilitate feature fusion. The feature map f4 used for feature fusion is then serialized through the transformation module layer, and the position information is added. The feature map f5 is obtained after 12 Transformer layers. The three building feature maps f1, f2 and f3 extracted by the building feature information extraction branch and the four road feature maps e1, e2, e3 and e4 extracted by the road feature information extraction branch are input into the feature fusion branch (i.e., the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy) to obtain the feature enhanced building feature map f1', building feature map f2', building feature map f3', road feature map e1', road feature map e2', road feature map e3' and road feature map e4'. The building feature map f3' and feature map f5 are input into the building feature decoding part for decoding to obtain the feature map f6'. The feature map f6' is input into the feature fusion branch and fused with the feature enhanced road feature map e4' according to the repulsive strategy to obtain the fused road feature map e4''. Then, the fused road feature map e4'' is input into the atrous spatial convolution pooling pyramid ASPP to obtain the road feature map e4''', and the feature-enhanced road feature maps e1', e2', e3' and e4''' are input into the road feature decoding part, the connected branch and the segmentation branch to obtain the road segmentation prediction feature map and the connected prediction feature map of the segmentation branch, and the road loss calculated by comparing the road segmentation prediction feature map and the connected prediction feature map of the segmentation branch with the true road label and the true connected label respectively. At the same time, the feature-enhanced building feature map f1' and building feature map f2' are input into the building feature decoding part, and decoded with the feature map f6' to obtain the building prediction feature map, and the building loss is calculated by the building prediction feature map and the real building label. Finally, the road loss and building damage Sum to get the total loss , and then the total loss Perform back propagation to optimize the model parameters of the entire network.
[0073] S2: Use the images and labels of both roads and buildings in the public dataset Massachusetts data set to crop as the training set and test set of the dual-channel deep neural network. The embodiment of the present invention uses python software to split the image data and the corresponding labels into images with a length × width of 512 × 512, randomly rotate, horizontally flip, Gaussian blur and normalize the images in the training set to generate a new image set and label set, normalize the images in the test set, and use the image data and the corresponding labels in a ratio of 11:1 as the training set and test set of the road extraction model.
[0074] S3: Use the training set and the test set to train the road extraction model constructed in step S1, calculate the loss based on the road segmentation prediction feature map output by the segmentation branch and the real road label, and at the same time, calculate the loss based on the connection prediction feature map output by the connection branch and the real connection label to obtain the road loss; calculate the loss based on the building prediction feature map output by the building feature decoding part and the real building label to obtain the building loss, and add the road loss and the building loss to obtain the total loss of the network, and finally back-propagate the total loss to optimize the model parameters and complete the model training.
[0075] The road feature decoding part corresponding to the road feature information extraction branch extracts information from the feature map from the horizontal, vertical, left diagonal and right diagonal lines through the strip convolution module layer in the decoding module layer I (including decoding module layer I1, decoding module layer I2, decoding module layer I3, and decoding module layer I4), and splices the information extracted in the four directions along the channel, performs normalization and nonlinear transformation, and then modifies the number of channels of the feature map through the convolution layer, performs normalization and nonlinear transformation, and at the same time uses the convolution module layer in the decoding module layer I to modify the number of channels of the feature map, performs normalization and nonlinear transformation, and then uses the upsampling in the decoding module layer I4 to modify the size of the feature map. Then, the connected branch and the segmentation branch connected after the road feature decoding part are used to extract and calculate the information of the decoded road prediction feature map, judge the connectivity of the road, and obtain the predicted binary map after segmentation, so as to obtain the connected prediction feature map and the road segmentation prediction feature map. Finally, the road segmentation prediction feature map output by the segmentation branch and the real road label, as well as the connected feature map output by the connected branch and the real connected label are used to calculate the loss to obtain the road loss. , road loss Including connectivity loss and segmentation loss .
[0076] The building feature decoding part corresponding to the building feature information extraction branch uses the convolution operation in the decoding module layer II to change the number of feature map channels and extract features, uses the upsampling operation to change the size of the feature map, performs nonlinear transformation through the activation function ReLU, and uses upsampling after three convolution module layers to restore the feature map to the size of the input image, obtains the building prediction feature map and performs loss calculation with the real building label to obtain the building loss. , and the road loss and building damage Add up to get the total loss of the network , and finally the total loss Perform back propagation, optimize the model parameters, and complete model training. Total loss The calculation formula is as follows:
[0077] ;
[0078] ;
[0079] ;
[0080] ;
[0081] ;
[0082] ;
[0083] ;
[0084] ;
[0085] ;
[0086] in, For the The loss function of the connected branch when the interval between pixels and adjacent pixels is 1, is the loss function of the connected branch when the interval between a given pixel and its adjacent pixels is 3, For the The ground truth labels for pixels, For the The network prediction result of pixels, For the The number of neighboring pixels of a pixel, For the The distance between a pixel and its adjacent pixels, is the length of the image, is the width of the image, For the The pixels and the spacing are The true value of the connectivity at the neighboring pixels of Indicates The pixels and the spacing are The predicted value of connectivity at the neighboring pixels of is a logarithmic function, is the binary cross entropy loss, for Dice Coefficient loss function.
[0087] S4: Use the trained road extraction model to extract roads from remote sensing images. The final road prediction feature map is obtained by concatenating the road segmentation prediction feature map output by the segmentation branch and the connected prediction feature map output by the connected branch according to element-by-element addition.
[0088] The embodiment of the present invention uses the trained road extraction model and the test set obtained in step S2 to perform a road extraction test, and the test results and the real labels are compared for accuracy evaluation. The evaluation index formula is as follows:
[0089] ;
[0090] ;
[0091] ;
[0092] ;
[0093] ;
[0094] in, is the overall accuracy, is the average accuracy, is the average recall rate, is the average F1 score, is the average intersection-union ratio; Indicates categories; Indicates the total number of categories; Represents the correctly predicted road pixels; Indicates that the background is mistakenly predicted as a pixel of the road; Represents the correctly predicted background pixels; Indicates pixels where the road is incorrectly predicted as background.
[0095] Five existing convolutional neural networks, including the pyramid scene parsing network PSPNet50, the transformer combined with U-shaped structure network TransUNet, the deep dense image labeling network DeepLabV3, the network based on Linknet and void convolution D-linkNet, and the connectivity attention network CoANet, are selected to transform the neural network and compared with the remote sensing image road extraction method based on the dual-channel deep neural network described in the embodiment of the present invention. A comparative test is carried out using the public dataset Massachusetts. The obtained road extraction results are shown in Table 1.
[0096] Table 1 Statistics of extraction results of five existing methods and the method of the embodiment of the present invention
[0097]
[0098] The model road extraction accuracy results in Table 1 show that the method described in the embodiment of the present invention achieves the highest accuracy in road extraction except for the average accuracy index. Fig.11 The comparison of the model road extraction results in shows that the method described in the embodiment of the present invention has been significantly improved in distinguishing roads and buildings with similar spectral characteristics, the connectivity of road extraction, and the integrity of road extraction, and can meet the needs of road extraction in complex backgrounds.
[0099] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A road extraction method for remote sensing images based on dual-channel deep neural network, It is characterized in that The steps include: S1: constructing a road extraction model, wherein the road extraction model is a dual-channel deep neural network that can simultaneously extract road feature information and building feature information; the dual-channel deep neural network includes a road feature information extraction branch, a building feature information extraction branch, a feature fusion branch, a feature decoding module, a segmentation branch, and a connectivity branch; The road feature information extraction branch is a convolutional neural network, which is used to extract road feature information; The building feature information extraction branch is a convolution-transformation neural network, which is used to extract building feature information; The feature fusion branch is an attention module CBAM based on fusion channel and spatial attention and a feature fusion module of a repulsive strategy, which is used to realize the fusion of features output by the road feature information extraction branch and the building feature information extraction branch; The feature decoding module includes two decoding parts, namely a road feature decoding part and a building feature decoding part, which are used to decode feature information, restore the resolution of the feature map, and obtain a decoded road prediction feature map and a decoded building prediction feature map; The segmentation branch and the connected branch are connected in parallel behind the road feature decoding part, the segmentation branch is used to calculate the loss function of the segmentation branch and output the road segmentation prediction feature map of the segmentation branch, and the connected branch is used to calculate the loss function of the connected branch and output the connected prediction feature map of the connected branch; the road segmentation prediction feature map output by the segmentation branch and the connected prediction feature map output by the connected branch are spliced according to element-by-element addition to obtain the final road prediction feature map; S2: using the public dataset to be cropped as the training set and test set of the road extraction model; S3: training the road extraction model using the training set and the test set, performing loss calculation on the connected prediction feature map and the road segmentation prediction feature map output by the connected branch and the segmentation branch respectively with the real connected label and the real road label to obtain the road loss, performing loss calculation on the building prediction feature map output by the building feature decoding part with the real building label to obtain the building loss, and adding the road loss and the building loss to obtain the total loss of the network, and finally back-propagating the total loss to optimize the parameters of the model to complete the model training; S4: Extract roads from remote sensing images using the trained road extraction model.
2. According to the remote sensing image road extraction method based on dual-channel deep neural network according to claim 1, It is characterized in that The convolutional neural network includes five stages, namely the first stage, the second stage, the third stage, the fourth stage and the fifth stage, and all the five stages are convolution module layers; the convolution module layer of the first stage includes a convolution layer, a batch normalization layer BN, an activation function ReLU and a maximum pooling layer; the convolution module layers of the second stage, the third stage, the fourth stage and the fifth stage are all composed of residual modules, and the residual module includes a convolution layer, a batch normalization layer BN, an activation function ReLU, a convolution layer, a batch normalization layer BN, an activation function ReLU, a convolution layer, a batch normalization layer BN and an activation function ReLU connected in sequence; the second stage, the third stage, the fourth stage and the fifth stage stack 3 layers, 4 layers, 23 layers and 3 layers of the residual module itself respectively.
3. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that The convolution-transformation neural network includes five stages, the first stage is the convolution module layer, the second stage, the third stage and the fourth stage are all pre-activated bottleneck module layers, and the fifth stage is the transformation module layer; the convolution module layer of the first stage includes sequentially connected convolution layers, group normalization GN and activation functions ReLU; the pre-activated bottleneck module layer includes three groups of convolution layers, group normalization GN and activation functions ReLU that are alternated in sequence, wherein the input of the pre-activated bottleneck module layer and the output of the third group normalization GN are concatenated according to element-by-element addition and then the output of the pre-activated bottleneck module layer is obtained by the third activation function ReLU; the transformation module layer consists of an embedding module layer and 12 sequentially stacked Transformer layers.
4. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 3, It is characterized in that The embedding module layer includes a convolution layer, a dimensionality reduction function, a transposition function and a regularization function, wherein the input of the embedding module layer and the output of the transposition function are spliced according to element-by-element addition and then regularized as the output of the embedding module layer; the Transformer layer includes a first layer normalization mechanism, a multi-head self-attention mechanism MSA, a second layer normalization mechanism and a multi-layer perceptron MLP connected in sequence, wherein the input of each Transformer layer and the output of its own multi-head self-attention mechanism MSA are spliced according to element-by-element addition and then input into the second layer normalization mechanism, and are spliced with the output of the multi-layer perceptron MLP according to element-by-element addition as the output of the Transformer layer, the output of the embedding module layer is used as the input of the first Transformer layer, the output of the first Transformer layer is used as the input of the second Transformer layer, and after 12 consecutive times, the output of the twelfth Transformer layer is obtained as the output of the final transformation module layer.
5. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that The attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsion strategy include 1 convolution layer and 1 CBAM module, the CBAM module includes 7 channel attention modules and 7 spatial attention modules, the channel attention module includes a maximum pooling layer, an average pooling layer, a multilayer perceptron MLP and a sigmoid function, the multilayer perceptron MLP includes a convolution layer, an activation function ReLU, and a convolution layer; the spatial attention module includes a maximum pooling layer, an average pooling layer, a convolution layer and a sigmoid function.
6. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 5, It is characterized in that The calculation formula of the fused feature map based on the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsive strategy is as follows: ; ; ; ; ; in, is the channel attention module, is the sigmoid function, is a multi-layer perceptron, is the average pooling layer, is the maximum pooling layer, is the hidden layer of the multi-layer perceptron MLP, is the activation function of the multi-layer perceptron MLP, is the input feature, is the average pooling feature, is the maximum pooling feature, is the channel attention module feature, is the element-by-element multiplication method, is the spatial attention module, is the convolutional layer, is the spatial attention module feature, To fusion features, is the road feature that has passed through the channel attention module and the spatial attention module, Building features after the channel attention module and the spatial attention module.
7. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that The road feature decoding part is composed of a decoding module layer I, and the decoding module layer I includes a decoding module layer I 1 , Decoding module layer I 2 , Decoding module layer I 3 , Decoding module layer I 4 , the decoding module layer I 1 The first strip convolution module layer and the first convolution module layer I 11 The decoding module layer I 2 The second strip convolution module layer and the second convolution module layer I 21 The decoding module layer I 3 The third strip convolution module layer and the third convolution module layer I 31 The decoding module layer I 4 It is composed of a fourth strip convolution module layer and an upsampling; the first strip convolution module layer, the second strip convolution module layer, the third strip convolution module layer and the fourth strip convolution module layer first perform feature extraction, batch normalization operation and nonlinear transformation on the feature map through the convolution layer, the batch normalization layer BN and the activation function ReLU, and then extract information from the feature map from the horizontal, vertical, left diagonal and right diagonal lines through two convolution layers with different convolution kernel sizes and padding, the horizontal transformation module and the vertical transformation module, respectively, splice the feature maps obtained by the two different convolution layers, the horizontal transformation modules and the vertical transformation modules along the channel direction, and then perform batch normalization operation and nonlinear transformation through the batch normalization layer BN and the activation function ReLU, and finally perform feature extraction, batch normalization operation and nonlinear transformation through the convolution layer, the batch normalization layer BN and the activation function ReLU to obtain the output feature map; the first convolution module layerⅠ 11 , the second convolutional module layer I 21 And the third convolutional module layer I 31 They all contain convolutional layers, batch normalization layers BN, and activation functions ReLU.
8. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that The building feature decoding part is composed of a decoding module layer II and an upsampling module layer II, wherein the decoding module layer II includes a convolution module layer II. 1 , convolutional module layer II 2 , convolutional module layer II 3 , the convolutional module layer II 1 Including convolution layer, activation function ReLU, upsampling, convolution layer and activation function ReLU, the convolution module layer II 2 Including upsampling, convolution layer and activation function ReLU, the convolution module layer II 3 Including upsampling, convolution layer and activation function ReLU.
9. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that A dilated spatial convolution pooling pyramid ASPP is also provided between the attention module CBAM based on fusion channel and spatial attention and the feature fusion module of the repulsion strategy and the road feature decoding part, which is used to increase the receptive field of feature points; the dilated spatial convolution pooling pyramid ASPP includes a Conv 1×1 convolution layer, a Conv 3×3 convolution layer with a dilation rate of 6, a Conv 3×3 convolution layer with a dilation rate of 12, a Conv 3×3 convolution layer with a dilation rate of 18, and adaptive average pooling. The adaptive average pooling is followed by a convolution layer, a batch normalization layer BN, an activation function ReLU and an interpolation operation. The outputs of the convolution layers and the interpolation operation with four different dilation rates are spliced along the channel and then subjected to feature extraction and batch normalization operations through the convolution layer and the batch normalization layer BN. Then, nonlinear transformation is performed through the activation function ReLU and regularization to prevent overfitting, and finally the output of the dilated spatial convolution pooling pyramid ASPP is obtained.
10. The method for extracting roads from remote sensing images based on a dual-channel deep neural network according to claim 1, It is characterized in that The segmentation branch is a convolution module layer composed of a convolution layer, a ReLU activation function and a convolution layer. The segmentation branch is used to calculate the loss function of the segmentation branch and output the road segmentation prediction feature map corresponding to the segmentation branch; the connected branch is composed of 2 connected convolution layers and 2 compression and excitation networks SE; the first connected convolution layer in the connected branch is composed of a convolution layer, a ReLU activation function and a convolution layer, and the second connected convolution layer is composed of a convolution layer, a ReLU activation function and a convolution layer with an expansion rate of 3. The compression and excitation network SE are both composed of an average pooling layer, a fully connected layer, a ReLU activation function, a fully connected layer and a sigmoid function; the connected branch is used to calculate the loss function of the connected branch and output the connected prediction feature map corresponding to the connected branch.
