A building target recognition method and system based on deep neural network and multi-task learning
By improving the U-Net deep neural network and multi-task learning, combined with the Xception convolution layer and the mean shift algorithm, the problem of insufficient accuracy in the two-category extraction of buildings is solved, the instance segmentation of buildings is achieved, the recognition accuracy is improved and the application value.
Patent Information
- Application Number
- CN201910636293.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-15
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-07-15
AI Technical Summary
The existing technology lacks accuracy in binary classification extraction of buildings and is difficult to achieve instance segmentation of buildings, which limits its application value in urban planning, road traffic, disaster assessment and other fields.
Using an improved U-Net deep neural network based on high-resolution images, combined with multi-task learning and mean shift algorithm, to achieve binary classification and instance segmentation of buildings, by replacing the second to sixth convolutional layers in the encoder For the Xception convolutional neural network model, and construct the discriminant loss function and total loss function, conduct deep network training and cluster analysis.
It improves the accuracy of building binary classification extraction to more than 95%, realizes instance segmentation of buildings, and enhances the information expression and application value of target recognition.
Smart Images

Figure CN112232102B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of target detection, and in particular relates to a building target recognition method and system based on deep neural network and multi-task learning. Background Art
[0002] With the improvement of deep learning theory and the development of its application in computer vision, the research on the application of deep neural networks in high-resolution remote sensing images is becoming more and more popular. In terms of the fusion of deep neural networks and high-resolution images, although certain results have been achieved in the research on binary classification extraction of buildings, there is still much room for improvement in terms of accuracy.
[0003] By adding auxiliary tasks, the accuracy of deep neural network building extraction can be further improved, but there are relatively few studies on related algorithms. While identifying the binary classification of buildings, performing instance segmentation of buildings can express more information about the target, which can not only improve the accuracy of building extraction, but also play a more practical and efficient application value in urban planning, road traffic, disaster assessment, disaster prevention and mitigation, etc. However, there is almost no research on the simultaneous realization of building extraction and instance segmentation based on high-resolution images, deep neural networks and auxiliary tasks. Summary of the invention
[0004] The purpose of the present invention is to achieve instance segmentation on the basis of building binary classification and improve the accuracy of building binary classification extraction.
[0005] The present invention realizes the simultaneous instance segmentation of building binary classification based on high-resolution images, improved U-Net deep neural network and multi-task learning, wherein multi-task learning refers to the combination of deep network learning and cluster analysis.
[0006] The present invention discloses a building target recognition method based on deep neural network and multi-task learning, comprising the following steps:
[0007] 1) Improve the U-Net deep neural network and replace the second to sixth convolutional layers in its encoder with the Xception convolutional neural network model;
[0008] 2) Obtain the binary classification results of buildings and the high-dimensional feature vector matrix of pixels in the image based on the improved U-Net deep neural network;
[0009] 3) Perform cluster analysis on the high-dimensional feature vectors of buildings in the high-dimensional feature vector matrix using the mean shift algorithm;
[0010] Step 4) Use the obtained clustering results to adjust the building binary classification results, and finally obtain the building instance segmentation structure, that is, determine the building individual.
[0011] Step 1) includes the following steps:
[0012] a. Build a U-Net deep neural network, which includes an encoder and a decoder, both of which are composed of continuous convolutional layers;
[0013] b. Use the Xception convolutional neural network model to replace the second to sixth convolutional layers in the encoder;
[0014] c. Construct the discriminant loss function L d :
[0015]
[0016] L d =αL var +βL dist +γL reg
[0017] Where, L var is the clustering degree of pixels of the same building, L dist is the distance between the cluster centers of different buildings, L reg is the weight regularization, x i is the high-dimensional vector of buildings, C is the number of buildings, c is the number of pixels, N c is the number of pixels of the building, A and B are different buildings, μ c is the cluster center of the building, δ v is the variance, μC A and μC B is the cluster center of different buildings, 2δ d is the minimum distance between the cluster centers of two buildings, and α, β, and γ are weights.
[0018] d. Construct the total loss function L t :
[0019] L t =L d +L b
[0020] Where L b It is the loss function of the improved U-Net deep neural network.
[0021] Step 2) includes the following steps:
[0022] a. Input the high-resolution image training set and validation set into the improved U-Net deep neural network, train the U-Net deep neural network, and obtain the trained U-Net network model;
[0023] b. Use the test set to test the trained U-Net network model. When the accuracy of the test set meets the requirements, the final improved U-Net network model is obtained. Otherwise, repeat step a in step 2) until the accuracy of the test set meets the requirements and the baseline improved U-Net network model is obtained.
[0024] c. Use the improved U-Net network model of the baseline to perform binary classification extraction of buildings in high-resolution images and obtain the loss function L of the improved U-Net network b , and generate a high-dimensional matrix of the features of each pixel, that is, a high-dimensional feature vector matrix of the pixel, that is, a high-dimensional feature space of the pixel. Among them, "binary classification extraction of buildings" means that in the image, if the pixel is a building, its value is 1; if the pixel is not a building, its value is 0.
[0025] Step 3) includes the following steps:
[0026] a. Filter the high-dimensional feature vector matrix of each pixel to filter out the high-dimensional feature vectors of non-buildings; for example, the where function in Python can be used for filtering. When the value of a pixel is 0, it is a non-building. Based on the binary classification results of buildings, the high-dimensional feature vectors of non-buildings are filtered out according to the where (mask! = 0) statement;
[0027] b. Based on the high-dimensional feature vector of the building, the mean shift algorithm is used for clustering to obtain the number of cluster centers. Different buildings have different cluster centers, and the pixels belonging to different cluster centers correspond to different buildings.
[0028] Step 4) comprises the following steps:
[0029] a. Calculate the discriminant loss function L according to the clustering result of step b in step 3) d ;
[0030] b. According to the loss function L of the improved U-Net network b And the discriminant loss function L d , calculate the total loss function L t ;
[0031] c. When the total loss function L t When convergence occurs, the instance segmentation result based on multi-task learning and building binary classification is obtained, and then the individual and number of buildings are determined; otherwise, step c in step 2), steps a and b in step 3), and steps a and b in step 4) are repeated until the total loss function L t convergence.
[0032] Based on the same inventive concept, the present invention also provides a building target recognition system based on deep neural network and multi-task learning, which includes:
[0033] The deep neural network building module is responsible for building an improved U-Net deep neural network, replacing the second to sixth convolutional layers in its encoder with the Xception convolutional neural network model;
[0034] The training and learning module is responsible for obtaining the binary classification results of the image and the high-dimensional feature vector matrix of the pixel points based on the improved U-Net deep neural network;
[0035] The clustering module is responsible for clustering the high-dimensional feature vectors of buildings in the high-dimensional feature vector matrix through the mean shift algorithm;
[0036] The building instance segmentation module is responsible for adjusting the building binary classification results using the obtained clustering results, and finally obtaining the building instance segmentation structure, that is, determining the individual buildings.
[0037] The beneficial effects of the present invention are:
[0038] The present invention proposes a new method for identifying buildings. Based on high-resolution remote sensing images and improved deep neural networks, the method uses multi-task learning (combining deep network learning and cluster analysis) to achieve binary classification extraction of buildings and instance segmentation of buildings. The present invention improves the accuracy of binary classification extraction of buildings, with an accuracy of more than 95%. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of the method of the present invention.
[0040] Figure 2 This is the improved U-Net deep neural network architecture diagram of the present invention.
[0041] Figure 3 It is a schematic diagram of the input high-resolution image.
[0042] Figure 4 It is a diagram showing the effect of identification by the method of the present invention.
[0043] Figure 5 It is a module structure diagram of the building target recognition system based on deep neural network and multi-task learning of the present invention. DETAILED DESCRIPTION
[0044] To make the above and / or other advantages of the present invention more clear, the present invention is described in detail below with reference to embodiments and drawings, but the present invention is not limited thereto.
[0045] like Figure 1As shown, in the above technical scheme, the target recognition method based on deep neural network and multi-task learning is to input high-resolution remote sensing images after improving the deep neural network and constructing the loss function, and obtain the baseline U-Net deep neural network by training the improved U-Net deep neural network, predict the binary classification results of the high-resolution image and generate a high-dimensional feature vector matrix of the pixel points, thereby forming two tasks (task 1 is binary classification, and task 2 is to generate high-dimensional feature vectors), filter out high-order feature vectors of non-buildings, perform cluster analysis on the high-dimensional feature vectors through the mean shift algorithm, train the baseline U-Net, adjust the binary classification results, and when the loss function converges, finally obtain the building instance segmentation structure, that is, determine the building individual.
[0046] like Figure 2 As shown in the figure, the improved U-Net deep neural network architecture diagram of the present invention, the design process is as follows:
[0047] The U-Net deep neural network consists of two parts: an encoder and a decoder, both of which are composed of continuous convolutional layers.
[0048] In the encoder, the first layer is the pre-covn full convolution layer, and the second layer is the downsampling layer. The present invention uses the Xception convolution layer ( Figure 2 The original full convolutional layer in the second layer is replaced by the Xception model, an existing neural network model, to obtain the feature map corresponding to this layer. The feature map of this layer has a lower resolution than that of the previous layer. The third to sixth layers are all downsampling layers. The original full convolutional layer is also replaced by the Xception convolutional layer to obtain feature maps of different scales. Feature maps of different scales are all saved.
[0049] The decoder mainly includes up-sampling layers (up-covn) and post-covn full convolution layers. Corresponding to the 5-level down-sampling layers in the encoder, there are 5-level up-sampling layers in the decoder. The feature maps of different scales in the encoder are passed to the corresponding up-sampling layers through skip connections. The last layer is the post-covn full convolution layer.
[0050] like Figure 3 Shown is the original image input to the U-Net network.
[0051] like Figure 4 As shown, Figure 3The image shown in the figure is extracted by the algorithm of the present invention to obtain a building instance segmentation map, in which different colors (or different grayscales) represent different buildings. Compared with the traditional U-Net network, the building binary classification extraction accuracy is improved by 1.9%.
[0052] Example:
[0053] This embodiment includes the following steps:
[0054] 1) Download the high-resolution remote sensing image dataset (Inria aerial image dataset), which has completed the preprocessing process such as radiation correction, atmospheric correction, and geometric correction. Crop the image to 416×416 and remove samples without buildings.
[0055] 2) Build the U-Net network architecture;
[0056] 3) Use the PyTorch deep learning framework to build an improved U-Net network. Figure 2 The convolutional layers have the same parameter settings, with a kernel stride of 1 and a kernel size of 3. The number of filters is (64, 64, 128, 128, 256, 256, 512 (encoder); 256, 128, 128, 64, 64, 2 (decoder)).
[0057] 4) Construct loss function:
[0058] 5) Construct the discriminant loss function:
[0059]
[0060] L d =αL var +βL dist +γL reg
[0061] Where, L var is the clustering degree of pixels of the same building, L dist is the distance between the cluster centers of different buildings, L reg is the weight regularization, x i is the high-dimensional vector of buildings, C is the number of buildings, c is the number of pixels, N c is the number of pixels of the building, A and B are different buildings, μ c is the cluster center of the building, δ v is the variance, μC A and μC B is the cluster center of different buildings, 2δ d is the minimum distance between the cluster centers of two buildings, and α, β, and γ are weights.
[0062] 6) Construct the total loss function L t :
[0063] L t =L d +L b
[0064] Where L b It is the loss function of the improved U-Net deep neural network.
[0065] 7) Data augmentation:
[0066] The training data set is horizontally flipped and mirror-flipped with p=0.5. At the same time, the training data is rotated by 90°, 180°, and 270° with uniform probability.
[0067] 8) Train the improved U-Net network:
[0068] The training samples, validation set, and test set are input into the U-Net network, and the graphics card is configured as NVIDIA TITANXp and the CPU is Intel i7-8700K. When the loss value converges, the training is stopped, and the baseline U-Net network is obtained, and the binary classification of the image and the high-dimensional feature vector of the generated pixel points are obtained.
[0069] 9) Write multi-task programs. The network structure still uses the baseline U-Net network. Write programs for clustering analysis, judgment of loss function, total function, etc.
[0070] 10) Input the image, run the multi-task program, train the baseline U-Net network, and stop training when the loss value converges to obtain the final network structure and the instance segmentation result of the building.
[0071] Based on the same inventive concept, another embodiment of the present invention provides a building target recognition system based on deep neural network and multi-task learning, such as Figure 5 As shown, it includes:
[0072] The deep neural network building module is responsible for building an improved U-Net deep neural network, replacing the second to sixth convolutional layers in its encoder with the Xception convolutional neural network model;
[0073] The training and learning module is responsible for obtaining the binary classification results of the image and the high-dimensional feature vector matrix of the pixel points based on the improved U-Net deep neural network;
[0074] The clustering module is responsible for clustering the high-dimensional feature vectors of buildings in the high-dimensional feature vector matrix through the mean shift algorithm;
[0075] The building instance segmentation module is responsible for adjusting the building binary classification results using the obtained clustering results, and finally obtaining the building instance segmentation structure, that is, determining the individual buildings.
[0076] Based on the same inventive concept, another embodiment of the present invention provides a computer / server, which includes a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing each step in the method of the present invention.
[0077] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, CD), wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the steps of the method of the present invention are implemented.
[0078] The network structure in the solution of the present invention can be adjusted according to actual applications, such as increasing or decreasing the number of network layers, using the Xception model to replace the convolutional layer of any layer, etc.
[0079] The present invention provides a method for target recognition based on deep neural network and multi-task learning, and there are many other embodiments. It is pointed out that for ordinary technicians in this technical field, several improvements and variations can be made without departing from the principles of the present invention, and these improvements and variations should also be considered as the protection scope of the present invention. All components not specified in this embodiment can be implemented using existing technologies.
Claims
1. A building target recognition method based on deep neural network and multi-task learning, characterized in that: The following steps are involved: 1) Improve the U-Net deep neural network and replace the second to sixth convolutional layers in its encoder with the Xception convolutional neural network model; 2) Obtain the binary classification results of the image and the high-dimensional feature vector matrix of the pixel points based on the improved U-Net deep neural network; 3) Perform cluster analysis on the high-dimensional feature vectors of buildings in the high-dimensional feature vector matrix using the mean shift algorithm; 4) Using the obtained clustering results to adjust the building binary classification results, finally obtaining the building instance segmentation structure, that is, determining the building individual; Step 1) includes: a. Build a U-Net deep neural network, which includes an encoder and a decoder, both of which are composed of continuous convolutional layers; b. Use the Xception convolutional neural network model to replace the second to sixth convolutional layers in the encoder; c. Construct the discriminant loss function L d : L d =αL var +βL dist +γL reg Where, L var is the clustering degree of pixels of the same building, L dist is the distance between the cluster centers of different buildings, L reg is the weight regularization, xi is the high-dimensional vector of buildings, C is the number of buildings, c is the number of pixels, N c is the number of pixels of the building, A and B are different buildings, μ c is the cluster center of the building, δ v is the variance, μC A and μC B is the cluster center of different buildings, 2δ d is the minimum distance between the cluster centers of two buildings, and α, β, and γ are weights; d. Construct the total loss function L t : L t =L d +L b Where L b The loss function of the improved U-Net deep neural network; Step 2) includes: a. Input the high-resolution image training set and validation set into the improved U-Net deep neural network, train the U-Net deep neural network, and obtain the trained U-Net network model; b. Use the test set to test the trained U-Net network model. When the accuracy of the test set meets the requirements, the final improved U-Net network model is obtained. Otherwise, repeat step a in step 2) until the accuracy of the test set meets the requirements, and the baseline improved U-Net network model is obtained. c. Use the improved U-Net network model of the baseline to perform binary classification extraction of buildings in high-resolution images, and obtain the loss function L of the improved U-Net network b , and generate a high-dimensional matrix of the features of each pixel, that is, a high-dimensional feature vector matrix of the pixel; Step 3) includes: a. Filter the high-dimensional feature vector matrix of each pixel to filter out the high-dimensional feature vectors of non-buildings; b. Based on the high-dimensional feature vector of the building, the mean shift algorithm is used for clustering to obtain the number of cluster centers. Different buildings have different cluster centers, and the pixels belonging to different cluster centers correspond to different buildings. Step 4) includes: a. Calculate the discriminant loss function L based on the clustering results d ; b. According to the loss function L of the improved U-Net network b And the discriminant loss function L d , calculate the total loss function L t ; c. When the total loss function L t When convergence occurs, the instance segmentation result based on multi-task learning and building binary classification is obtained, and then the individual and number of buildings are determined; otherwise, step c in step 2), steps a and b in step 3), and steps a and b in step 4) are repeated until the total loss function L t convergence; The improved U-Net deep neural network includes an encoder and a decoder, both of which are composed of consecutive convolutional layers; In the encoder, the first layer is a pre-covn full convolution layer, the second to sixth layers are downsampling layers, and the original full convolution layers from the second to sixth layers are replaced by Xception convolution layers to obtain feature maps of different scales; The decoder includes five levels of upsampling layers and a post-covn full convolution layer; the encoder transmits the feature map stored in the corresponding downsampling layer to the corresponding upsampling layer through a jump connection.
2. A building target recognition system based on deep neural network and multi-task learning, characterized in that: include: The deep neural network building module is responsible for building an improved U-Net deep neural network, replacing the second to sixth convolutional layers in its encoder with the Xception convolutional neural network model; The training and learning module is responsible for obtaining the binary classification results of the image and the high-dimensional feature vector matrix of the pixel points based on the improved U-Net deep neural network; The clustering module is responsible for clustering the high-dimensional feature vectors of buildings in the high-dimensional feature vector matrix through the mean shift algorithm; The building instance segmentation module is responsible for adjusting the building binary classification results using the obtained clustering results, and finally obtaining the building instance segmentation structure, that is, determining the building individuals; The total loss function L constructed by the deep neural network building module t for: L t =L d +L b Where, L b is the loss function of the improved U-Net deep neural network; L d To discriminate the loss function, the calculation formula is as follows: L d =αL vdr +βL dist +γL reg Where, L var is the clustering degree of pixels of the same building, L dist is the distance between the cluster centers of different buildings, L reg is the weight regularization, x i is the high-dimensional vector of buildings, C is the number of buildings, c is the number of pixels, N c is the number of pixels of the building, A and B are different buildings, μ c is the cluster center of the building, δ v is the variance, and is the cluster center of different buildings, 2δ d is the minimum distance between the cluster centers of two buildings, and α, β, and γ are weights; The training learning module performs the following operations: a. Input the high-resolution image training set and validation set into the improved U-Net deep neural network, train the U-Net deep neural network, and obtain the trained U-Net network model; b. Use the test set to test the trained U-Net network model. When the accuracy of the test set meets the requirements, the final improved U-Net network model is obtained. Otherwise, repeat operation a performed by the training learning module until the accuracy of the test set meets the requirements, and the baseline improved U-Net network model is obtained. c. Use the improved U-Net network model of the baseline to perform binary classification extraction of buildings in high-resolution images, and obtain the loss function L of the improved U-Net network b , and generate a high-dimensional matrix of the features of each pixel, that is, a high-dimensional feature vector matrix of the pixel; The clustering module performs the following operations: a. Filter the high-dimensional feature vector matrix of each pixel to filter out the high-dimensional feature vectors of non-buildings; b. Based on the high-dimensional feature vector of the building, the mean shift algorithm is used for clustering to obtain the number of cluster centers. Different buildings have different cluster centers, and the pixels belonging to different cluster centers correspond to different buildings. The building instance segmentation module performs the following operations: a. Calculate the discriminant loss function L based on the clustering results d ; b. According to the loss function L of the improved U-Net network b And the discriminant loss function L d , calculate the total loss function L t ; c. When the total loss function converges, the instance segmentation results based on multi-task learning and building binary classification results are obtained, and then the individual and number of buildings are determined; The improved U-Net deep neural network includes an encoder and a decoder, both of which are composed of consecutive convolutional layers; In the encoder, the first layer is a pre-covn full convolution layer, the second to sixth layers are downsampling layers, and the original full convolution layers from the second to sixth layers are replaced by Xception convolution layers to obtain feature maps of different scales; The decoder includes five levels of upsampling layers and a post-covn full convolution layer; the encoder transmits the feature map stored in the corresponding downsampling layer to the corresponding upsampling layer through a jump connection.
