Deep learning line feature extraction method fused with nDSM
By integrating the normalized digital surface model and deep learning method, combined with the VGG-UNet network, the problem of redundancy and accuracy deviation in line feature extraction in UAV images is solved, and high-precision and high-integrity line feature extraction is achieved, which is suitable for Line feature recognition for outdoor buildings.
Patent Information
- Application Number
- CN202410712136.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-04
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology has problems such as redundancy, disconnection, accuracy deviation and weak generalization ability in extracting line features from UAV images in outdoor scenes. In particular, the classification and extraction capabilities of building line features are insufficient, making it difficult to meet the needs of high-resolution images. need.
Using the fusion of normalized digital surface model (nDSM) and deep learning methods, by constructing a four-channel image and manually annotated training sample data set, combined with the VGG-UNet deep neural network, the loss function of the distance field and angle field is used to perform line features. extraction, enhancing the robustness and accuracy of the model.
It achieves high-precision and high-integrity line feature extraction in outdoor drone images, and can effectively identify building outlines, roof lines and transition lines, improving its application capabilities in outdoor scenes.
Smart Images

Figure CN118628760A
Abstract
Description
Technical Field
[0001] The invention relates to a deep learning line feature extraction method integrating a normalized digital surface model (nDSM), and belongs to the fields of artificial intelligence, remote sensing science and technology, and surveying and mapping engineering technology. Background Art
[0002] With the rapid development of drone technology, drone photogrammetry is becoming more and more popular due to its low price. In urban scenes, there are a large number of line features distributed in the images taken by drones, which is of great significance for urban mapping and reconstruction of building three-dimensional models. A large number of studies have realized line feature extraction based on image gradients. The common LSD line segment detector performs region growth on the pixels in the linear feature area, and uses the obtained rectangular area pixels to calculate the line segment parameters. Some scholars have made improvements based on the LSD algorithm, including multi-scale line feature extraction methods MLSD and ELSED algorithm, which improve the accuracy of line segment detection and algorithm efficiency. However, since the ability of gradient features to describe image features is limited and they belong to low-level features, the line features extracted by these methods usually have problems such as redundancy, discontinuous line breaks and precision deviation.
[0003] When there is noise in the image or the shooting lighting conditions are poor, the pixel set detected based on the same gradient direction lacks robustness and is difficult to take into account the global knowledge in the scene. It may extract non-interesting corners or line segments, or the extracted line segments contain noise. The development of deep neural networks provides new possibilities for solving these problems. Huang et al. (2018) first proposed a method for detecting corners and line primitives based on deep learning, and realized the extraction of structural lines in indoor scenes. Since then, many scholars have proposed different deep neural networks to realize line segment parameter extraction, which has been significantly improved in terms of robustness and extraction accuracy. However, since they are mainly aimed at indoor scenes and are limited by the lack of training samples, these methods have weak generalization capabilities, which limits their application in outdoor scenes. Since the resolution of remote sensing images is lower than that of indoor images, the superposition of different types of objects will produce mixed pixels. At this time, the feature description ability of gradient information is weak, and it is impossible to effectively extract the line features of outdoor images. Therefore, stronger feature expression capabilities are required. In addition, the line features of buildings are not a simple type. They can be divided into contour lines, ridge lines, and transition lines. It is necessary to have stronger classification and extraction capabilities for the extracted line features. Traditional methods are based on image gradient calculation and have weak description capabilities for image features. Line feature extraction methods based on deep learning have high robustness and geometric extraction accuracy. However, existing research mainly focuses on indoor scenes, lacks research on geometric primitive extraction and training sample datasets applied to outdoor scenes, and it is difficult to meet the requirements of generalization.
[0004] To solve the above problems, the present invention proposes a deep learning line feature extraction method integrated with nDSM, which can better realize the line feature extraction in the images acquired by UAV, and is of great significance for construction engineering surveying and mapping and reconstruction of building three-dimensional models. Summary of the invention
[0005] In view of the problems existing in the above-mentioned prior art, the present invention provides a deep learning line feature extraction method integrated with nDSM, so as to solve the above-mentioned technical problems.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is: a deep learning line feature extraction method integrating nDSM, comprising the following steps:
[0007] Step S1: using the survey area images obtained by UAV photogrammetry, a digital orthophoto (DOM), a digital surface model (DSM) and a 3D point cloud are constructed using a photogrammetric 3D reconstruction method;
[0008] Step S2: Generate a digital elevation model (DEM). First, use the Cloth Simulation Filter (CSF) algorithm to extract ground points from the scene point cloud and downsample them. Then use the inverse distance weighted method to interpolate and generate the DEM.
[0009] Step S3: Generate a normalized digital surface model (nDSM), use raster map algebra to subtract the DSM from the DEM, obtain the maximum elevation value of the region, and map the nDSM elevation value to a 0-255 grayscale value;
[0010] Step S4: Prepare a deep learning training sample data set, use DOM and nDSM to construct a four-channel image, and combine the manually drawn line features to prepare a training sample data set;
[0011] Step S5: Use the deep neural network for training and model verification, and incrementally construct a sample data set for line feature extraction; use the trained deep learning network model to realize UAV photogrammetry line feature extraction.
[0012] Preferably, the specific implementation steps of preparing the deep learning training sample data set in step S4 are:
[0013] Step S41: First, wireframe drawing is performed based on the RGB three-channel digital and digital surface model.
[0014] Step S42: Divide the DOM and nDSM images into blocks, keep the names of the divided images consistent, and store them in the train and ndsm folders respectively;
[0015] Step S42: Convert the manually marked line feature vertex coordinates into pixel coordinates, generate angle-field straight-line distance field, and mark training samples.
[0016] Preferably, the specific implementation steps of the deep neural network structure and network training in step S5 are:
[0017] S51: Construct a deep neural network for line feature extraction. The network structure includes a backbone network and two branch networks. VGG-UNet is used as the backbone network. Downsampling and upsampling are achieved through multi-layer convolution blocks to form a symmetrical U-shaped network structure. Because the feature extraction part of UNet (corresponding to the left half of the network) is similar to the structure of VGG16, UNet is implemented by upsampling of VGG16, so it is named VGG-UNet. The kernel function dimension of each level of the network is reduced by half to reduce the amount of calculation of the model and use boundary filling. Downsampling is used to extract image features layer by layer, and upsampling is used to gradually restore the detailed information and position information of the image, and finally obtain an output feature map reflecting the image features. Since the VGG-UNet structure contains five convolutional layers, the number of convolutional kernels of the five convolutional layers is set to 64, 128, 256, 512 and 1024 respectively, the size of each convolutional kernel of the upsampling layer is 3×3, and the activation function is the ReLu function. The feature is then downsampled to 8 times by three consecutive average pooling operations, and then upscaled back to the original resolution by another series of convolutional layers and bilinear interpolation.
[0018] In order to extract and estimate the distance field and angle field, the deep features are divided into two branches, each branch contains 3 convolutional layers. The first two convolutional layers perform ReLU activation and batch normalization after convolution. The last convolutional layer of one branch network outputs the distance field through the ReLU function after convolution, and the other branch network outputs the angle field using the Sigmoid function. The distance field is a method of representing discrete lines in an image using a continuous two-dimensional vector field. The branch network can effectively take into account both global and local features.
[0019] For each pixel in the image, the distance field D gives the distance from the current pixel to the point on the nearest line segment, and the line angle field A returns the direction of the nearest line segment. These two quantities can be obtained by pointing to the two-dimensional offset field (x, y ∈ R H ×W ×R H×W where (H,W) is the size of the image:
[0020]
[0021] The objective function of the constructed deep neural network is defined as the total loss of the distance field and the angle field:
[0022] L=LD +L A
[0023] Among them, L D is the L1 loss between the normalized distance fields, L A It is the L2 angle loss taking the angular circularity into account.
[0024]
[0025] By predicting the value The normalized background value For comparison, only the pixel area with a distance less than r is selected to participate in the calculation. r is in pixels, then D n ∈R + For the predicted angle value The angle loss is calculated by comparing with the background angle field A∈[0,π]. The learning rate used in network training is e -3 , each time the validation loss reaches a plateau, the learning rate is reduced to 1 / 10. A The training ends when it is narrowed to a given threshold range, and the optimal neural network model for line feature extraction is obtained.
[0026] In the image line feature extraction stage, the trained neural network model is used to extract line features from the processed image, and finally a high-precision line feature extraction result is obtained. The distance field D is calculated by linear attenuation in the area defined by the distance r, that is:
[0027]
[0028] Traditional methods mainly rely on the gradient information near the line segment. The present invention selects the area with a distance of less than r pixels from the line segment for supervised learning. Smaller r values may result in most image areas being unsupervised, including false true values failing to detect real lines, such as lines with low contrast. Forcing these lines to be in the background, i.e., high distance field, during training will provide harmful training signals and reduce the recall rate of prediction. On the contrary, if the selected r value is too large, low-contrast lines will not be penalized during training, and the trained model will be able to detect them, thereby providing more complete predictions than background values.
[0029] The beneficial effects of the present invention are as follows: the present invention discloses a deep learning line feature extraction method integrating nDSM, constructs a line feature extraction neural network for outdoor UAV images, can effectively extract line features in high-precision UAV images (image resolution 0.1m), and has the advantages of high precision and high integrity; at the same time, a deep learning training sample data set for extracting building contours, ridge lines and transition lines is constructed, which can meet the training of a line feature extraction neural network model based on UAV images. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a technical flow chart of the present invention;
[0031] Figure 2 Digital orthophoto of a city area;
[0032] Figure 3 Digital surface model of a certain urban area;
[0033] Figure 4 Constructed deep neural network training samples;
[0034] Figure 5 Schematic diagram of the deep image feature extraction network structure;
[0035] Figure 6 Line features are extracted using a trained deep neural network. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention more clear, the present invention is further described in detail below through the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the scope of the present invention.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present invention belongs. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0038] like Figure 1 As shown, a deep learning line feature extraction method integrating nDSM includes the following steps:
[0039] Step S1: using the survey area images obtained by UAV photogrammetry, a digital orthophoto (DOM), a digital surface model (DSM) and a 3D point cloud are constructed using a photogrammetric 3D reconstruction method;
[0040] Step S2: Generate DEM. First, use the CSF cloth simulation filter algorithm to extract ground points from the scene point cloud and downsample them. Then use the inverse distance weighted method to interpolate and generate DEM.
[0041] Step S3: Generate a normalized digital surface model, use map algebra to subtract the DSM from the DEM, obtain the maximum elevation value of the region and map the elevation value to a grayscale range of 0-255;
[0042] Step S4: preparing a deep learning training sample data set, using digital orthophotos and normalized digital surface models to construct a four-channel image, and combining manually drawn line features to prepare a training sample data set;
[0043] Step S5: Use deep neural network for learning and incrementally construct a sample data set for line feature extraction; realize UAV photogrammetry line feature extraction.
[0044] Preferably, in this embodiment, the specific implementation steps of plane segmentation and regularization in step S1 are:
[0045] Step S11: First, the image of the survey area obtained by drone photogrammetry is used to construct a DOM (such as Figure 2 )、DSM (such as Figure 3 ) and 3D point clouds. The main processes include image inspection, aerial triangulation, dense matching, region triangulation, and texture mapping.
[0046] In this embodiment, the specific implementation steps of generating DEM in step S2 are preferably:
[0047] Step S21: First, use the CSF cloth simulation point cloud filtering algorithm to extract ground points P from the scene point cloud ground ;
[0048] Step S22: Use random sampling to downsample the ground point cloud s ;
[0049] Step S23: downsample the point cloud P s The DEM is generated by interpolation using the inverse distance weighted method, where the distance weight is a quadratic function;
[0050] Preferably, in this embodiment, the specific implementation steps of generating the normalized digital surface model in step S3 are:
[0051] Step S31: using map algebra, subtract DSM from DEM to obtain the initial nDSM data of elevation;
[0052] Step S32: Obtain the maximum elevation value H of the area in the nDSM data;
[0053] Step S33: Map the elevation value to a 0-255 grayscale value according to the map algebra formula (nDSM>0)*(nDSM*255 / H);
[0054] Step S34: Convert the grayscale value range into an 8-bit integer and save it in *.jpg format.
[0055] Preferably, in this embodiment, the specific implementation steps of preparing the deep learning training sample data set in step S4 are:
[0056] Step S41: Use DOM and nDSM to construct a four-channel image, set the tile size to 320*320 pixels, the image resolution to 10 cm, and construct a training sample tile image set. The training sample data set of the study area constructed in the initial strength includes 1000 tile images ( Figure 4 );
[0057] Step S42: converting the marked line features into distance fields and straight line angle fields through manually drawn remote sensing image line features, and saving the results in *.hdf5 format;
[0058] Step S43: extract all training sample file names and store them in the train.txt file;
[0059] In this embodiment, the specific implementation steps of using the deep neural network for training and prediction in step S5 are preferably:
[0060] Step S51: Implement a deep neural network based on PyTorch. The network structure is as follows: Figure 5 As shown, RTX3090 is used for model training, the input image is (320,320) pixels, 5 images are processed in each batch, and 300 rounds of training are performed. The deep neural network is called to train the constructed training sample data set;
[0061] Step S52: In order to improve the generalization ability of the network, a sample data set for line feature extraction is incrementally constructed, and line feature recognition is performed on the newly added drone image data using a pre-trained model. On the basis of manual correction, the newly added training samples are added to the network for further training;
[0062] Step S53: Evaluate the training results; use the trained deep neural network to extract the line features of the UAV photogrammetry, such as Figure 6 Shown are the original image and the extracted line features (in black).
[0063] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A deep learning line feature extraction method integrating nDSM, characterized in that: The following steps are involved: Step S1: constructing DOM, DSM and 3D point cloud using photogrammetric 3D reconstruction method for the survey area images obtained by UAV photogrammetry; Step S2: extracting ground points from the three-dimensional point cloud and performing downsampling, and generating a DEM by interpolation using an inverse distance weighted method; Step S3: Using raster map algebra, subtract DSM from DEM to obtain the maximum elevation value of the region, map the maximum elevation value of the region to a grayscale value of 0-255, and convert the grayscale value range to an integer to generate nDSM; Step S4: construct a four-channel image using DOM and nDSM, and create a training sample dataset by combining the manually drawn line features; Step S5: Use the training sample data set to train the deep neural network and verify the model, and incrementally construct a sample data set for line feature extraction; use the trained deep learning network model to realize UAV photogrammetry line feature extraction.
2. A deep learning line feature extraction method integrating nDSM according to claim 1, characterized in that: The step S2 specifically includes: Step S21: extracting ground points from the three-dimensional point cloud using the CSF algorithm; Step S22: downsampling the ground point cloud by random sampling; Step S23: The downsampled point cloud is interpolated using the inverse distance weighted method to generate a DEM, wherein the distance weight adopts a quadratic function.
3. A deep learning line feature extraction method integrating nDSM according to claim 1, characterized in that: The specific implementation steps for preparing the deep learning training sample data set in step S4 are: Step S41: firstly, wireframe drawing is performed based on RGB three-channel digital and digital surface model; Step S42: Divide the DOM and nDSM images into blocks, keep the names of the divided images consistent, and store them in the train and ndsm folders respectively; Step S42: Convert the manually marked line feature vertex coordinates into pixel coordinates, generate an angle-spatial straight-line distance field, and mark training samples.
4. The deep learning line feature extraction method integrating nDSM according to claim 1 is characterized in that: The structure of the deep neural network in step S5 is: The network structure of the deep neural network includes a backbone network and two branch networks, and VGG-UNet is used as the backbone network. Downsampling and upsampling are realized through multi-layer convolution blocks to form a symmetrical U-shaped network structure; downsampling is used to extract image features layer by layer, and upsampling is used to gradually restore the detail information and position information of the image, and finally an output feature map reflecting the image features is obtained; the VGG-UNet structure includes five convolutional layers, and the number of convolutional kernels of the five convolutional layers is set to 64, 128, 256, 512 and 1024 respectively, the size of each convolutional kernel of the upsampling layer is 3×3, and the activation function is the ReLu function; the sampling is gradually downsampled to 8 times through three consecutive average pooling operations, and then the features are enlarged back to the original resolution through another series of convolutional layers and bilinear interpolation; In order to extract the estimated distance field and angle field, the deep features are divided into two branches, each branch contains 3 convolutional layers. The first two convolutional layers perform ReLU activation and batch normalization after performing convolution. The last convolutional layer of one branch network outputs the distance field through the ReLU function after performing convolution, and the other branch network uses the Sigmoid function to output the angle field.
5. A deep learning line feature extraction method integrating nDSM according to claim 4, characterized in that: The specific steps of training a deep neural network using a training sample data set include: For each pixel in the image, the distance field D gives the distance from the current pixel to the point on the nearest line segment, and the line angle field A returns the direction of the nearest line segment; these two quantities are connected by a two-dimensional offset field x, y∈R pointing to the nearest point on the line segment. H×W ×R H×W where (H,W) is the size of the image: The objective function of the constructed deep neural network is defined as the total loss of the distance field and the angle field: L=L D +L A Among them, L D is the L1 loss between the normalized distance fields, L A is the L2 angle loss considering the circularity of the angle, By predicting the value The normalized background value For comparison, only the pixel area with a distance less than r is selected to participate in the calculation. r is in pixels, then D n ∈R + ; For the predicted angle value The angle loss is calculated by comparing with the background angle field A∈[0,π]; the learning rate used in network training is e -3 , each time the validation loss reaches a stable state, the learning rate decreases to 1 / 10; when the total loss value L A The training ends when it is narrowed to a given threshold range, and the optimal neural network model for line feature extraction is obtained.
6. A deep learning line feature extraction method fused with nDSM according to claim 5, characterized in that: In the image line feature extraction stage, the trained neural network model is used to extract line features from the processed image, and finally a high-precision line feature extraction result is obtained. The distance field D is calculated by linear attenuation in the area defined by the distance r, that is:
Citation Information
Cited By
Unmanned aerial vehicle-based image data automatic generation method and system, electronic equipment and computer readable storage medium
CN119068134A
