Building recognition method and system based on three-dimensional point cloud

By preprocessing and spatially aligning the building roof point cloud data, the PCT model is improved to the NEW_PCT model, and the multi-head biased attention mechanism is used to extract the global feature vector, which solves the problems of geometric transformation sensitivity and local feature loss in three-dimensional point cloud building recognition, and improves the recognition accuracy and robustness.

CN120526319BActive Publication Date: 2025-09-23XIAN TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511024040.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-09-23
Estimated Expiration
2045-07-24

AI Technical Summary

Technical Problem

Existing technologies in 3D point cloud building recognition suffer from poor geometric robustness, local information loss, and data deviation amplification, resulting in insufficient recognition accuracy and robustness, especially poor performance in complex scenarios.

Method used

By undersampling, oversampling and data augmentation processing the input building roof point cloud data, using the T-net network for spatial alignment, and improving the PCT model to the NEW_PCT model, the multi-head biased attention mechanism is introduced to extract the global feature vector, combined with the global maximum pooling and classifier to output the building roof type.

Benefits of technology

It effectively overcomes the recognition performance bottlenecks caused by rotation and translation sensitivity, local information loss and sample bias in traditional methods, and improves the accuracy and robustness of three-dimensional point cloud building recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120526319B_ABST
    Figure CN120526319B_ABST
Patent Text Reader

Abstract

The three-dimensional point cloud-based building recognition method and system provided in this application specifically relate to the technical fields of computer vision and three-dimensional target recognition. The method first performs undersampling, oversampling and data enhancement preprocessing on the input building roof point cloud data, and then outputs the aligned data through T-net network spatial alignment. Then, the NEW_PCT model is obtained by improving the PCT model, and the aligned data is input into the NEW_PCT model. The point cloud feature matrix is ​​generated through the linear coding layer, and the query, key, and value matrices are obtained through linear transformation. The bias matrix is ​​introduced to calculate the multi-head attention output, and the intermediate correlation features are obtained after splicing and fusion. The global feature vector is generated through global maximum pooling. Finally, the vector is input into the classifier to output the building roof type. This method solves the technical problems of how to overcome the geometric transformation sensitivity and local feature loss while improving the accuracy and robustness of three-dimensional point cloud building recognition, thereby effectively improving the recognition accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and three-dimensional target recognition, and in particular to a building recognition method and system based on three-dimensional point clouds. Background Art

[0002] In recent years, 3D point cloud processing technology has rapidly developed in urban planning, autonomous driving, and clean energy. The widespread adoption of LiDAR (LiDAR) has driven demand for high-precision recognition of building rooftops and other features. However, rooftop recognition faces challenges such as point cloud data sparsity, sensitivity to geometric transformations (such as rotation / translation), and the loss of local features. This results in low computational efficiency for traditional methods that rely on manually designed descriptors (such as FPFH and SHOT), and insufficient recognition accuracy for deep learning models (such as PointNet and PCT) in complex scenarios. This severely hinders the implementation of applications such as 3D reconstruction and photovoltaic installation assessment.

[0003] Existing technologies improve point cloud recognition capabilities through multi-head attention mechanisms, hierarchical feature aggregation (such as PointNet++), or curvature feature enhancement (such as CurveNet), but they still have significant limitations:

[0004] 1. Poor geometric robustness: The traditional self-attention mechanism has low consistency in point cloud features after rotation / translation, resulting in degraded model performance after data augmentation;

[0005] 2. Local information loss: Key geometric details of sparse point clouds (such as roof slopes and edges) are easily overlooked during feature extraction, and single-head attention cannot fully capture multi-dimensional spatial relationships.

[0006] 3. Data bias amplification: Conventional data augmentation (such as random rotation) will destroy the original point cloud distribution and aggravate the category imbalance problem.

[0007] In summary, how to improve the accuracy and robustness of 3D point cloud building recognition while overcoming the technical problems of geometric transformation sensitivity and local feature loss is an urgent problem to be solved. Summary of the Invention

[0008] The main purpose of the present invention is to provide a building recognition method and system based on three-dimensional point clouds, so as to at least solve the technical problems of how to improve the accuracy and robustness of three-dimensional point cloud building recognition while overcoming the geometric transformation sensitivity and local feature loss, thereby overcoming the recognition performance bottleneck caused by rotation and translation sensitivity, local information loss and sample bias in traditional methods, and effectively improving the accuracy and robustness of three-dimensional point cloud building recognition.

[0009] In order to achieve the above objectives, the present invention provides a building recognition method and system based on three-dimensional point cloud.

[0010] In a first aspect, the present invention provides a method for identifying buildings based on a three-dimensional point cloud, the method comprising:

[0011] Step 1: Undersampling, oversampling, and data enhancement are performed on the input building roof point cloud data to obtain pre-processed roof point cloud data;

[0012] Step 2: spatially align the pre-processed roof point cloud data through the T-net network, and output the aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is the 3×3 transformation matrix generated by the T-net network;

[0013] Step 3: Improve the PCT model to obtain the NEW_PCT model;

[0014] Step 4: Input the aligned roof point cloud data into the NEW_PCT model, and extract the global feature vector through the multi-head biased attention mechanism in the NEW_PCT model, which specifically includes the following sub-steps:

[0015] Step 4.1: Generate a point cloud feature matrix X∈ by passing the aligned point cloud data through the linear encoding layer of the NEW_PCT model. , where N is the number of point clouds and d is the feature dimension;

[0016] Step 4.2: Perform linear transformation on the point cloud feature matrix X to generate query matrix Q, key matrix K, value matrix V, and introduce a learnable bias matrix B∈ , the output of multiple attention heads is calculated by the following formula:

[0017] ;

[0018] in, is the dimension of the bond matrix, is the transposed matrix of the key matrix;

[0019] Step 4.3: Concatenate the outputs of the multiple attention heads and fuse them through linear transformation to obtain intermediate correlation features.

[0020] Step 4.4: Perform global maximum pooling on the intermediate correlation features to generate the global feature vector. The global maximum pooling formula is:

[0021] ;

[0022] in, represents the global eigenvector, represents the feature vector of the i-th point in the intermediate correlation feature, and max represents the maximum value calculated independently for each feature channel;

[0023] Step 5: Input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

[0024] Specifically, the input building roof point cloud data is subjected to undersampling, oversampling, and data enhancement to obtain pre-processed roof point cloud data, including:

[0025] Step 1: Undersample the input building roof point cloud data:

[0026] Using a farthest point sampling algorithm, iteratively selects a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud;

[0027] Step 2: Oversampling the downsampled point cloud:

[0028] Identifying a sparse area in the downsampled point cloud whose density is lower than a second preset threshold, calculating the mean of the three-dimensional coordinates of K nearest neighboring points of each target point in the sparse area to generate an interpolated point, and adding the interpolated point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud;

[0029] Step 3: Perform data enhancement processing on the oversampled enhanced point cloud to generate a data-enhanced point cloud:

[0030] Applying a random rotation transformation to the oversampled enhanced point cloud within a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud;

[0031] Step 4: Label and balance samples to obtain labeled and balanced point cloud data:

[0032] Annotating the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbor points in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient type of samples through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460;

[0033] Step 5: Generate pre-processed roof point cloud data:

[0034] The labeled and balanced point cloud data is output as the pre-processed roof point cloud data.

[0035] Specifically, the pre-processed roof point cloud data is spatially aligned through the T-net network, and the aligned roof point cloud data P'=P·T is output, where P is the pre-processed roof point cloud data and T is the 3×3 transformation matrix generated by T-net, including:

[0036] Input the preprocessed roof point cloud data into the T-net network, perform the first layer 1×1 convolution, the second layer 1×1 convolution, the third layer 1×1 convolution, and global average pooling in sequence, and output the feature vector after global average pooling;

[0037] Input the globally averaged pooled feature vector into the fully connected layer of the T-net network and perform nonlinear mapping to obtain a transformation matrix;

[0038] The preprocessed roof point cloud data is multiplied by the transformation matrix to calculate the aligned roof point cloud data P'=P·T, where P is the preprocessed roof point cloud data and T is the 3×3 transformation matrix generated by T-net.

[0039] Specifically, improving the PCT model to obtain the NEW_PCT model includes:

[0040] The self-attention module in the PCT model is replaced by a multi-head bias attention module, and the attention calculation of each head introduces a learnable bias matrix B∈ .

[0041] Specifically, the structure of the multi-head biased attention module includes:

[0042] Multi-head parallel computing unit: The multi-head parallel computing unit is used to split the input features of the aligned roof point cloud data into 8 independent computing branches. Each computing branch generates query, key, and value parameters through linear transformation and is accompanied by a learnable bias matrix. The learnable bias matrix is ​​used to dynamically strengthen the attention weight of local areas in the aligned roof point cloud data.

[0043] A bias-enhanced attention weight calculation unit: In each of the calculation branches, the PCT model automatically focuses on the ridge line or slope edge of the building roof to suppress noise and redundant point interference by superimposing a bias matrix to adjust the correlation strength between points.

[0044] Multi-scale feature fusion unit: The outputs of 8 independent calculation branches are spliced ​​according to the feature dimension, fused into a unified feature through linear transformation, and combined with residual connection and normalization operations to preserve the original input information.

[0045] Specifically, the outputs of the multiple attention heads are concatenated and fused through linear transformation to obtain intermediate correlation features, including:

[0046] The outputs of the multiple attention heads are directly concatenated according to the feature channel dimension to form a merged feature matrix;

[0047] Using learnable weight parameters to perform linear transformation on the merged feature matrix, compress it to the target feature dimension, and generate a fused unified feature representation;

[0048] A ReLU activation function is applied to the fused unified feature representation to enhance the nonlinear expression capability, and the intermediate correlation feature is output.

[0049] Specifically, the inputting of the global feature vector into the classifier of the NEW_PCT model and outputting the building roof type includes:

[0050] The global feature vector is sequentially passed through two fully connected layers for nonlinear mapping, and each layer is followed by normalization and activation function processing to gradually compress the feature dimension of the global feature vector from 1024 dimensions to 256 dimensions, thereby generating a compressed 256-dimensional feature;

[0051] The compressed 256-dimensional features are input into the fully connected layer of the NEW_PCT model, mapped to a 17-dimensional output vector corresponding to the 17 roof type labels, and the roof type probability is predicted by probability normalization.

[0052] According to the difference between the predicted roof type probability and the roof type label, the parameters of the classifier of the NEW_PCT model are reversely optimized using a cross entropy loss function.

[0053] In a second aspect, the present invention provides a building recognition system based on a three-dimensional point cloud, wherein the recognition system is applied to the recognition method described in the first aspect, and the recognition system comprises:

[0054] A data preprocessing module is used to obtain preprocessed roof point cloud data by undersampling, oversampling, and data enhancement on the input building roof point cloud data;

[0055] A spatial alignment module, connected to the data preprocessing module, configured to spatially align the preprocessed roof point cloud data through a T-net network and output aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is a 3×3 transformation matrix generated by T-net;

[0056] A global feature vector extraction module, connected to the spatial alignment module, configured to input the aligned roof point cloud data into the NEW_PCT model and extract a global feature vector through a multi-head biased attention mechanism in the NEW_PCT model;

[0057] A building roof type output module is connected to the global feature vector extraction module, and is used to input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

[0058] Specifically, the data preprocessing module includes:

[0059] An undersampling submodule is configured to perform undersampling processing on the input building roof point cloud data: using a farthest point sampling algorithm, iteratively selecting a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud;

[0060] an oversampling submodule, the oversampling submodule being connected to the undersampling submodule and configured to perform oversampling processing on the downsampled point cloud: identifying a sparse region in the downsampled point cloud having a density lower than a second preset threshold, calculating, for each target point in the sparse region, the mean of the three-dimensional coordinates of its K nearest neighboring points to generate an interpolation point, and adding the interpolation point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud;

[0061] A data enhancement submodule is connected to the oversampling submodule, and is used to perform data enhancement processing on the oversampling enhanced point cloud to generate a data-enhanced point cloud: applying a random rotation transformation to the oversampling enhanced point cloud with a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud.

[0062] Specifically, the data preprocessing module also includes:

[0063] A labeling and balancing submodule, connected to the data enhancement submodule, is configured to label and balance samples to obtain labeled and balanced point cloud data: labeling the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbors in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient number of samples of each type through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460;

[0064] The pre-processed roof point cloud data output submodule is connected to the labeling and equalization submodule, and the pre-processed roof point cloud data output submodule is used to output the labeled and equalized point cloud data as the pre-processed roof point cloud data.

[0065] The present application provides a building recognition method and system based on three-dimensional point clouds. The method first implements undersampling, oversampling and data enhancement preprocessing on the building roof point cloud data, and then uses the T-net network to spatially align the preprocessed data to generate aligned point cloud data. Then, the PCT model is improved to obtain the NEW_PCT model, and the aligned data is input into the model. The point cloud feature matrix is ​​generated through its linear encoding layer. After linear transformation, the query, key, and value matrices are obtained, and the bias matrix is ​​introduced to calculate the multi-head attention output. The intermediate correlation features are spliced ​​and fused, and the global feature vector is generated through global maximum pooling. Finally, the vector is input into the classifier to output the building roof type. This method effectively overcomes the recognition performance bottleneck caused by rotation and translation sensitivity, local information loss and sample bias in traditional methods, and improves the accuracy and robustness of three-dimensional point cloud building recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:

[0067] Figure 1 A schematic diagram of the process of the building recognition method based on 3D point cloud provided in this application;

[0068] Figure 2 This is a connection diagram of the 3D point cloud-based building recognition system provided in this application.

[0069] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0070] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0071] The terms "first," "second," "third," "fourth," and so forth (if any) in the description and claims of the present invention and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present invention described herein can be practiced in sequences other than those illustrated or described herein.

[0072] In the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0073] This application provides a three-dimensional point cloud-based building recognition method and system. This method pre-processes the input building roof point cloud data and then uses the T-net network to perform spatial alignment to eliminate the effects of geometric transformations. Next, the PCT model is improved to construct the NEW_PCT model, into which the aligned data is input. A feature matrix is ​​generated through a linear encoding layer, and a multi-head biased attention mechanism is used to extract the global feature vector. This mechanism introduces a bias matrix to enhance feature expression capabilities. Finally, the global feature vector is input into a classifier, which outputs the building roof type, effectively overcoming the performance bottleneck of traditional methods.

[0074] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0075] Figure 1 The flowchart of the building recognition method based on 3D point cloud provided in this application is as follows: Figure 1 As shown in FIG, a building recognition method based on a three-dimensional point cloud provided in this embodiment includes:

[0076] S101: Undersampling, oversampling, and data enhancement are performed on the input building roof point cloud data to obtain pre-processed roof point cloud data.

[0077] Specifically, the input building roof point cloud data is subjected to undersampling, oversampling, and data enhancement to obtain pre-processed roof point cloud data, including:

[0078] Step 1: Undersample the input building roof point cloud data:

[0079] Using a farthest point sampling algorithm, iteratively selects a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud;

[0080] Step 2: Oversampling the downsampled point cloud:

[0081] Identifying a sparse area in the downsampled point cloud whose density is lower than a second preset threshold, calculating the mean of the three-dimensional coordinates of K nearest neighboring points of each target point in the sparse area to generate an interpolated point, and adding the interpolated point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud;

[0082] Step 3: Perform data enhancement processing on the oversampled enhanced point cloud to generate a data-enhanced point cloud:

[0083] Applying a random rotation transformation to the oversampled enhanced point cloud within a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud;

[0084] Step 4: Label and balance samples to obtain labeled and balanced point cloud data:

[0085] Annotating the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbor points in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient type of samples through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460;

[0086] Step 5: Generate pre-processed roof point cloud data:

[0087] The labeled and balanced point cloud data is output as the pre-processed roof point cloud data.

[0088] During implementation, step S101 specifically includes:

[0089] Step 1: Undersampling processing:

[0090] 1. Input the original building roof point cloud data, recorded as point cloud collection , where M is the number of original point clouds, Represents three-dimensional coordinates.

[0091] 2. Use the Farthest Point Sampling (FPS) algorithm to perform undersampling:

[0092] Initialize the sampling point set , randomly selected .

[0093] Iteratively select points: calculate all points The shortest distance to the midpoint of S , select The biggest point ,Will Join S.

[0094] Repeat until (first preset threshold), output downsampled point cloud .

[0095] Step 2: Oversampling processing:

[0096] 1. Input downsampled point cloud .

[0097] 2. Density estimation: calculate each point The local density ,in for The nearest neighbor point of , K=10.

[0098] 3. Identifying sparse regions: marking The points with the second preset threshold are sparse area points. .

[0099] 4. Generate interpolation points: For each , calculate the coordinate mean of its K=5 nearest neighbor points and generate the interpolation point ,Will join in .

[0100] 5. Repeat interpolation until the total number of points reaches =4096 (the third preset threshold), output oversampled enhanced point cloud .

[0101] Step 3: Data enhancement processing:

[0102] 1. Input oversampled enhanced point cloud .

[0103] 2. Random rotation transformation: generating a rotation matrix , the rotation angle around the x, y, and z axes From uniform distribution Sampling in the middle. Update point cloud coordinates .

[0104] 3. Random translation: translation along each coordinate axis , , meters, update coordinates +[Δx,Δy,Δz] T .

[0105] 4. Random Scaling: Scaling Factor , update the coordinates .

[0106] 5. Output data enhanced point cloud .

[0107] Step 4: Sample labeling and balancing:

[0108] 1. Point cloud after annotation data enhancement , assigning 17 roof type labels y∈{1,2,…,17} to each point cloud.

[0109] 2. Count the number of samples of each category. Let the number of samples of category c be , delete redundant samples:

[0110] For each class c, if , calculate each sample in this class The average distance to its K=5 nearest neighbors .

[0111] Delete Satisfaction (fourth preset threshold) samples until =6460.

[0112] 3. Supplement the deficiency category: For categories with less than 6460, K-nearest neighbor interpolation (K=5) is used to generate new samples until =6460.

[0113] 4. Output annotated and balanced point cloud dataset .

[0114] Step 5: Generate pre-processed point cloud:

[0115] 1. Divide into training set and validation set (ratio 8:2), output preprocessed roof point cloud data .

[0116] This step uses the FPS algorithm to reduce point cloud redundancy and preserve the geometric structure, combined with K-nearest neighbor interpolation to compensate for sparse areas and enhance data distribution uniformity; applies random rotation, translation, and scaling to improve the model's robustness to geometric transformations; through density threshold screening and sample balancing mechanisms, suppresses category bias and reduces noise interference, and ultimately generates clearly labeled and evenly distributed preprocessed point cloud data, providing high-quality input for subsequent feature extraction and classification.

[0117] S102: Spatially aligning the pre-processed roof point cloud data through the T-net network, and outputting aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is the 3×3 transformation matrix generated by the T-net.

[0118] Specifically, the pre-processed roof point cloud data is spatially aligned through the T-net network, and the aligned roof point cloud data P'=P·T is output, where P is the pre-processed roof point cloud data and T is the 3×3 transformation matrix generated by T-net, including:

[0119] Input the preprocessed roof point cloud data into the T-net network, perform the first layer 1×1 convolution, the second layer 1×1 convolution, the third layer 1×1 convolution, and global average pooling in sequence, and output the feature vector after global average pooling;

[0120] Input the globally averaged pooled feature vector into the fully connected layer of the T-net network and perform nonlinear mapping to obtain a transformation matrix;

[0121] The preprocessed roof point cloud data is multiplied by the transformation matrix to calculate the aligned roof point cloud data P'=P·T, where P is the preprocessed roof point cloud data and T is the 3×3 transformation matrix generated by T-net.

[0122] During implementation, step S102 specifically includes:

[0123] Step 1: Input pre-processed roof point cloud data:

[0124] 1. Input pre-processed point cloud data , where N=4096 is the number of point clouds, and each point contains three-dimensional coordinates (x, y, z).

[0125] 2. Enter the T-net network, whose structure consists of the following layers:

[0126] The first 1×1 convolutional layer: the number of input channels is 3 (corresponding to three-dimensional coordinates), the number of output channels is 64, the activation function is ReLU, and the feature matrix is ​​generated. .

[0127] The second 1×1 convolutional layer: the number of input channels is 64, the number of output channels is 128, the activation function is ReLU, and the feature matrix is ​​generated. .

[0128] The third 1×1 convolutional layer: the number of input channels is 128, the number of output channels is 256, the activation function is ReLU, and the feature matrix is ​​generated. .

[0129] Step 2: Global average pooling:

[0130] 1. Feature matrix Perform a global average pooling operation:

[0131] ,

[0132] in represents the eigenvector of the i-th point, is the global eigenvector.

[0133] Step 3: The fully connected layer generates the transformation matrix:

[0134] 1. Input the global feature vector G into the fully connected layer sequence:

[0135] The first fully connected layer has an input dimension of 256 and an output dimension of 512, and the activation function is ReLU.

[0136] Second fully connected layer: input dimension 512, output dimension 256, activation function is ReLU.

[0137] The third fully connected layer has an input dimension of 256 and an output dimension of 9 (corresponding to 3×3 matrix elements). There is no activation function.

[0138] 2. Reshape the output 9-dimensional vector into a 3×3 matrix .

[0139] 3. Yes Orthogonalize it to ensure it is a rotation matrix:

[0140] 3.1 Obtained by singular value decomposition (SVD) Keep the orthogonal matrices U and V.

[0141] 3.2 Generate orthogonal transformation matrix T=UV T .

[0142] Step 4. Multiply the point cloud by the transformation matrix:

[0143] 1. Calculate the aligned point cloud data ,in:

[0144] is the point cloud coordinate matrix after preprocessing.

[0145] is the generated transformation matrix.

[0146] is the aligned point cloud coordinate matrix, and each point coordinate satisfies ( is the row vector of the original point coordinates).

[0147] In this step, the 1×1 convolutional layer of the T-net network is used to extract local features of the point cloud, combined with global average pooling to capture the overall spatial distribution information. The fully connected layer generates a 3×3 orthogonal transformation matrix to eliminate the rotation and translation deviations of the original point cloud. Finally, matrix multiplication is used to achieve spatial alignment of the point cloud, improving the robustness of the subsequent feature extraction module to geometric transformations and ensuring the consistency of the roof structure features under different perspectives.

[0148] S103: Improve the PCT model to obtain the NEW_PCT model.

[0149] Specifically, improving the PCT model to obtain the NEW_PCT model includes:

[0150] The self-attention module in the PCT model is replaced by a multi-head bias attention module, and the attention calculation of each head introduces a learnable bias matrix B∈ .

[0151] Specifically, the structure of the multi-head biased attention module includes:

[0152] Multi-head parallel computing unit: The multi-head parallel computing unit is used to split the input features of the aligned roof point cloud data into 8 independent computing branches. Each computing branch generates query, key, and value parameters through linear transformation and is accompanied by a learnable bias matrix. The learnable bias matrix is ​​used to dynamically strengthen the attention weight of local areas in the aligned roof point cloud data.

[0153] A bias-enhanced attention weight calculation unit: In each of the calculation branches, the PCT model automatically focuses on the ridge line or slope edge of the building roof to suppress noise and redundant point interference by superimposing a bias matrix to adjust the correlation strength between points.

[0154] Multi-scale feature fusion unit: The outputs of 8 independent calculation branches are spliced ​​according to the feature dimension, fused into a unified feature through linear transformation, and combined with residual connection and normalization operations to preserve the original input information.

[0155] During implementation, step S103 specifically includes:

[0156] Step 1: Data input and feature encoding

[0157] 1. Input the aligned point cloud coordinate matrix:

[0158] Receive the output of step S102 .

[0159] 2. Linear coding layer conversion:

[0160] The 3D coordinates are mapped to 256-dimensional features through the fully connected layer:

[0161] ,

[0162] Among them, the weight matrix , bias , output point cloud feature matrix .

[0163] Step 2: Build a multi-head biased attention module

[0164] 1. Input the aligned roof point cloud features:

[0165] Input feature matrix , where N=4096 is the number of point clouds and d=256 is the feature dimension (output from step S102).

[0166] Split X into 8 independent computation branches (i.e., 8 attention heads), and the input feature dimension of each branch is =d / 8=32.

[0167] 2. Generate query (Q), key (K), value (V) matrix:

[0168] 2.1 For each branch i∈{1,2,…,8}: Generate query matrix through linear transformation layer , bond matrix , value matrix .

[0169] Among them, the weight matrix , initialized using the Xavier normal distribution.

[0170] Generate a learnable bias matrix , initialized to a zero matrix.

[0171] 3. Bias-enhanced attention weight calculation:

[0172] Calculate the attention weight for each branch:

[0173] ,

[0174] in, Represents the similarity between points, is the scaling factor, Used to enhance the association strength of local areas (such as roof lines).

[0175] Step 3: Multi-scale feature fusion and residual connection

[0176] 1. Splicing multiple outputs:

[0177] The output matrix of the 8 branches By splicing according to feature dimensions, we get .

[0178] 2. Linear transformation and activation:

[0179] Through the linear layer Fusion features:

[0180] .

[0181] 3. Residual connection and normalization:

[0182] Add the fused features to the original input:

[0183] ,

[0184] right Perform layer normalization (LayerNorm) and output normalized features .

[0185] Step 4: Construct the overall structure of the NEW_PCT model

[0186] 1. Replace the original PCT's self-attention module:

[0187] The standard self-attention layer in the original PCT model is replaced with the above-mentioned multi-head biased attention module, with a total of 4 layers stacked.

[0188] The structure of each layer is: multi-head biased attention → residual connection → layer normalization → feed-forward network (FFN) → residual connection → layer normalization.

[0189] 2. Feedforward Network (FFN) parameters:

[0190] FFN consists of two linear layers, and the intermediate dimension is expanded to =512, the activation function is GELU:

[0191] ,

[0192] Among them, the weight matrix , , biases b1, b2 are initialized to zero.

[0193] Step 5: Input and output configuration

[0194] 1. Input data: the aligned point cloud output from step S102 Transformed into X by the linear encoding layer .

[0195] 2. Output data: After being processed by 4 layers of NEW_PCT modules, the global feature vector is output (via global max pooling).

[0196] This step introduces a learnable bias matrix, enabling the attention mechanism to dynamically focus on key roof structures (such as ridge lines and slope edges), suppressing interference from noise points. Eight parallel branches capture multi-scale spatial relationships, while residual connections and layer normalization preserve the original geometric information, ultimately improving the model's ability to distinguish complex roof types. The NEW_PCT model significantly enhances the robustness of local feature representation and global context modeling while maintaining computational efficiency.

[0197] S104: Input the aligned roof point cloud data into the NEW_PCT model, and extract the global feature vector through the multi-head biased attention mechanism in the NEW_PCT model, which specifically includes the following sub-steps:

[0198] Step S104.1: Generate a point cloud feature matrix by passing the aligned point cloud data through the linear coding layer of the NEW_PCT model. , where N is the number of point clouds and d is the feature dimension;

[0199] Step S104.2: Perform a linear transformation on the point cloud feature matrix X to generate a query matrix Q, a key matrix K, a value matrix V, and introduce a learnable bias matrix , the output of multiple attention heads is calculated by the following formula:

[0200] ;

[0201] in, is the dimension of the bond matrix, is the transposed matrix of the key matrix;

[0202] Step S104.3: splicing the outputs of the multiple attention heads and fusing them through linear transformation to obtain intermediate correlation features. Specifically, splicing the outputs of the multiple attention heads and fusing them through linear transformation to obtain intermediate correlation features includes: directly splicing the outputs of the multiple attention heads according to the feature channel dimension to form a merged feature matrix; performing a linear transformation on the merged feature matrix using a learnable weight parameter to compress it to a target feature dimension to generate a fused unified feature representation; applying a ReLU activation function to the fused unified feature representation to enhance nonlinear expression capability, and outputting the intermediate correlation features;

[0203] Step S104.4: Perform global maximum pooling on the intermediate correlation features to generate the global feature vector. The global maximum pooling formula is:

[0204] ;

[0205] in, represents the global eigenvector, represents the feature vector of the i-th point in the intermediate correlation feature, and max represents the maximum value calculated independently for each feature channel;

[0206] Specific implementation step S104: extracting the global feature vector through the NEW_PCT model specifically includes:

[0207] Step S104.1: Linear coding layer generates feature matrix:

[0208] 1. Input the aligned point cloud data: Receive the aligned point cloud coordinate matrix output in step S102 .

[0209] 2. Linear encoding conversion: Mapping 3D coordinates to 256-dimensional features through a fully connected layer:

[0210] ,

[0211] Among them, the weight matrix , bias , initialized using Xavier normal distribution, output point cloud feature matrix , where N=4096 is the number of point clouds and d=256 is the feature dimension.

[0212] Step S104.2, multi-head bias attention calculation:

[0213] 1. Generate Q, K, V matrices:

[0214] For each attention head i∈{1,2,…,8}:

[0215] Generate query matrix through linear transformation layer , bond matrix , value matrix , the weight matrix , initialized using the Xavier normal distribution.

[0216] Initialize the learnable bias matrix , initialized to a zero matrix.

[0217] 2. Calculate attention output:

[0218] Calculate for each head according to the formula:

[0219] ;

[0220] in, Represents the similarity between points, =32 is the key matrix dimension, Used to enhance the correlation strength of local areas (such as ridge lines), Transpose the key matrix.

[0221] Step S104.3: Multi-attention head feature fusion:

[0222] 1. Splicing multiple outputs: Splice the output matrix of 8 branches By splicing according to feature dimensions, we get .

[0223] 2. Linear transformation and activation: through weight matrix Fusion features:

[0224] ,

[0225] Among them, bias , output intermediate correlation features .

[0226] Step S104.4: Global maximum pooling generates global features:

[0227] 1. Pooling operation:

[0228] right Perform global max pooling along the point cloud dimension (N=4096):

[0229] ,

[0230] Output global feature vector , each channel takes the maximum value of all points.

[0231] This step maps point cloud coordinates into high-dimensional features through linear encoding, and uses eight parallel attention heads to capture local structures such as ridge lines and slope edges. A learnable bias matrix is ​​introduced to strengthen the association between key areas and suppress interference from noise points. Multi-scale feature fusion and global pooling are used to extract compact global feature vectors, providing highly discriminative input for the classifier, significantly improving the accuracy of roof type recognition and model robustness.

[0232] S105: Input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

[0233] Specifically, the inputting of the global feature vector into the classifier of the NEW_PCT model and outputting the building roof type includes:

[0234] The global feature vector is sequentially passed through two fully connected layers for nonlinear mapping, and each layer is followed by normalization and activation function processing to gradually compress the feature dimension of the global feature vector from 1024 dimensions to 256 dimensions, thereby generating a compressed 256-dimensional feature;

[0235] The compressed 256-dimensional features are input into the fully connected layer of the NEW_PCT model, mapped to a 17-dimensional output vector corresponding to the 17 roof type labels, and the roof type probability is predicted by probability normalization.

[0236] According to the difference between the predicted roof type probability and the roof type label, the parameters of the classifier of the NEW_PCT model are reversely optimized using a cross entropy loss function.

[0237] Step S105: Outputting the building roof type through the classifier specifically includes:

[0238] Step 1: Input global eigenvector:

[0239] Receive the global feature vector output in step S104 .

[0240] Step 2: Two-layer fully connected layer nonlinear mapping:

[0241] 1. First fully connected layer (FC1):

[0242] Input dimension 256, output dimension 1024, weight matrix , bias , initialized using the Xavier normal distribution.

[0243] Calculation output:

[0244] ,

[0245] in: (Gaussian Error Linear Unit), is the cumulative distribution function of the standard Gaussian distribution.

[0246] LayerNorm is a layer normalization operation that calculates the mean and variance along the feature dimension.

[0247] 2. Second fully connected layer (FC2):

[0248] Input dimension 1024, output dimension 256, weight matrix , bias .

[0249] Calculation output: , get the compressed 256-dimensional features .

[0250] Step 3: Map the fully connected layer to the classification space:

[0251] 1. Classification fully connected layer (FC3):

[0252] Input dimension 256, output dimension 17, weight matrix , bias .

[0253] Calculation output: ,in is the unnormalized category score vector.

[0254] 2. Probability normalization:

[0255] Calculate the predicted probability distribution through the Softmax function:

[0256] ;

[0257] Represents the probability of belonging to the c-th type of roof, output probability vector .

[0258] Step 4: Loss calculation and parameter optimization:

[0259] 1. Cross entropy loss function: Given a true label y∈{1,2,…,17}, calculate the loss:

[0260] ,

[0261] Optimize the classifier weight matrix through backpropagation algorithm and bias , using Adam optimizer (learning rate 10 −3 , weight decay 10 −4 ).

[0262] This step gradually compresses feature dimensions through two fully connected layers, combining the GELU activation function with layer normalization to enhance nonlinear expression capabilities. Finally, the fully connected layer maps the features to a 17-dimensional classification space, and Softmax normalizes the output probability distribution. A cross-entropy loss function drives model parameter optimization, bringing the predicted probabilities closer to the true label distribution, thereby achieving high-precision recognition of 17 roof types. This classifier design retains discriminative features while suppressing overfitting, significantly improving model generalization performance.

[0263] This embodiment provides a building recognition method based on three-dimensional point cloud. The method first implements undersampling, oversampling and data enhancement preprocessing on the input building roof point cloud data to optimize data quality. The preprocessed point cloud data is then spatially aligned using the T-net network to eliminate the influence of geometric transformation and output the aligned data. Next, the PCT model is improved to obtain the NEW_PCT model, and the aligned data is input into the model. The point cloud feature matrix is ​​generated through the linear coding layer, and the query, key, and value matrices are obtained after linear transformation. A learnable bias matrix is ​​introduced, and the multi-head attention output is calculated. The intermediate correlation features are obtained by splicing and fusion. The global feature vector is then generated through global maximum pooling. The vector retains the key features and has a reduced dimension. Finally, the global feature vector is input into the classifier to output the building roof type. This method effectively overcomes the recognition performance bottleneck caused by rotation and translation sensitivity, local information loss and sample bias in traditional methods, and significantly improves the accuracy and robustness of three-dimensional point cloud building recognition.

[0264] Figure 2 The connection diagram of the building recognition system based on 3D point cloud provided in this application is as follows: Figure 2 As shown in the figure, the building recognition system based on three-dimensional point cloud provided by this embodiment is applied to Figure 1 The recognition method described in the embodiment, the recognition system includes:

[0265] A data preprocessing module is used to obtain preprocessed roof point cloud data by undersampling, oversampling, and data enhancement on the input building roof point cloud data;

[0266] A spatial alignment module, connected to the data preprocessing module, configured to spatially align the preprocessed roof point cloud data through a T-net network and output aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is a 3×3 transformation matrix generated by T-net;

[0267] A global feature vector extraction module, connected to the spatial alignment module, configured to input the aligned roof point cloud data into the NEW_PCT model and extract a global feature vector through a multi-head biased attention mechanism in the NEW_PCT model;

[0268] A building roof type output module is connected to the global feature vector extraction module, and is used to input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

[0269] Specifically, the data preprocessing module includes:

[0270] An undersampling submodule is configured to perform undersampling processing on the input building roof point cloud data: using a farthest point sampling algorithm, iteratively selecting a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud;

[0271] an oversampling submodule, the oversampling submodule being connected to the undersampling submodule and configured to perform oversampling processing on the downsampled point cloud: identifying a sparse region in the downsampled point cloud having a density lower than a second preset threshold, calculating, for each target point in the sparse region, the mean of the three-dimensional coordinates of its K nearest neighboring points to generate an interpolation point, and adding the interpolation point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud;

[0272] A data enhancement submodule is connected to the oversampling submodule, and is used to perform data enhancement processing on the oversampling enhanced point cloud to generate a data-enhanced point cloud: applying a random rotation transformation to the oversampling enhanced point cloud with a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud.

[0273] Specifically, the data preprocessing module also includes:

[0274] A labeling and balancing submodule, connected to the data enhancement submodule, is configured to label and balance samples to obtain labeled and balanced point cloud data: labeling the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbors in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient number of samples of each type through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460;

[0275] The pre-processed roof point cloud data output submodule is connected to the labeling and equalization submodule, and the pre-processed roof point cloud data output submodule is used to output the labeled and equalized point cloud data as the pre-processed roof point cloud data.

[0276] This embodiment provides a building recognition system based on a three-dimensional point cloud. The system includes the following modules. The connection relationship, functions, and technical features of each module are described in detail below:

[0277] 1. Data preprocessing module

[0278] Function: Downsample, oversample, geometrically enhance, and balance the original building roof point cloud data, and output annotated and geometrically robust preprocessed point cloud data.

[0279] Connection relationship: The data preprocessing module is connected to the spatial alignment module through the data bus, and passes the preprocessed data to the next module.

[0280] Submodule composition:

[0281] 1.1 Undersampling submodule

[0282] Function: Use the Farthest Point Sampling algorithm to downsample the input point cloud.

[0283] Processing steps:

[0284] (1) Input original point cloud data, including three-dimensional coordinates (x, y, z);

[0285] (2) Iteratively select the point farthest from the sampled point set until the number of point clouds drops to the first preset threshold of 2048;

[0286] (3) Output the downsampled point cloud, preserving the key geometric structure of the roof.

[0287] 1.2 Oversampling Submodule

[0288] Connection relationship: Directly connected to the undersampling submodule to receive downsampled point cloud data.

[0289] Function: Compensate for the point cloud density in sparse areas through K-nearest neighbor interpolation.

[0290] Processing steps:

[0291] (1) Calculate the local density of each point and identify sparse areas with density lower than a second preset threshold of 0.3;

[0292] (2) For each target point in the sparse area, calculate the mean of the three-dimensional coordinates of its K=5 nearest neighbor points to generate an interpolation point;

[0293] (3) Supplement the interpolation points to the downsampled point cloud so that the total number of points reaches the third preset threshold of 4096, forming an oversampled enhanced point cloud.

[0294] 1.3 Data Enhancement Submodule

[0295] Connection relationship: Directly connected to the oversampling submodule to receive oversampled enhanced point cloud.

[0296] Function: Enhance data diversity through random geometric transformation.

[0297] Processing steps:

[0298] (1) Apply random rotation transformation around the x, y, and z axes with a rotation angle range of ±15 degrees;

[0299] (2) Random translation of ±0.1 m along the three-dimensional coordinate axis;

[0300] (3) Scale the point cloud coordinates by 0.8 to 1.2 times;

[0301] (4) Output the enhanced point cloud.

[0302] 1.4 Labeling and Equalization Submodule

[0303] Connection relationship: Directly connected to the data enhancement submodule to receive the enhanced point cloud.

[0304] Function: Label roof types and balance sample distribution.

[0305] Processing steps:

[0306] (1) Label the point cloud with 17 roof type labels;

[0307] (2) Count the number of samples of each type and delete redundant samples of the same type whose average distance to the K=5 nearest neighbors is less than the fourth preset threshold of 0.05 meters;

[0308] (3) The samples of insufficient categories are supplemented by K=5 nearest neighbor interpolation until the number of samples in each category is balanced to 6460.

[0309] 1.5 Pre-processed roof point cloud data output submodule

[0310] (1) Connection relationship: directly connected to the labeling and balancing submodule.

[0311] (2) Function: Output pre-processed point cloud data.

[0312] (3) Output data format: Contains the three-dimensional coordinates of 4096 points and the corresponding roof type labels.

[0313] 2. Spatial Alignment Module

[0314] Connection relationship: Connected to the data preprocessing module through the data bus to receive preprocessed point cloud data.

[0315] Function: Generate a 3×3 transformation matrix through the T-net network to align the point cloud space coordinates.

[0316] Processing steps:

[0317] (1) T-net network structure:

[0318] The first 1×1 convolutional layer: 3 input channels, 64 output channels, ReLU activation function;

[0319] The second 1×1 convolutional layer has 64 input channels, 128 output channels, and ReLU activation function.

[0320] The third 1×1 convolutional layer: 128 input channels, 256 output channels, ReLU activation function;

[0321] Global average pooling layer: compresses 256-dimensional features into a global feature vector;

[0322] Sequence of fully connected layers: Input 256 dimensions, mapped to 512 dimensions, 256 dimensions, and finally output a 9-dimensional vector, reshaped into a 3×3 transformation matrix;

[0323] (2) Perform singular value decomposition (SVD) orthogonalization on the transformation matrix to generate an orthogonal transformation matrix T;

[0324] (3) Multiply the preprocessed point cloud data P by the matrix T and output the aligned point cloud data P'=P·T.

[0325] 3. Global feature vector extraction module

[0326] Connection relationship: Connected to the spatial alignment module through the data bus to receive the aligned point cloud data.

[0327] Function: Extract global feature vectors through the improved NEW_PCT model.

[0328] Processing steps:

[0329] (1) NEW_PCT model structure:

[0330] Input layer: receives aligned point cloud data (4096×3);

[0331] Linear encoding layer: The fully connected layer maps 3D coordinates to 256-dimensional features;

[0332] Multi-head biased attention layer (replacing the original PCT self-attention layer):

[0333] a. Run 8 independent computation branches in parallel, each branch generates a query matrix Q, a key matrix K, and a value matrix V;

[0334] b. Each branch introduces a learnable bias matrix B∈R^{4096×4096}, which is initialized to a zero matrix;

[0335] c. Attention calculation;

[0336] Multi-scale feature fusion: concatenate the output features of 8 branches and compress them to 256 dimensions through a fully connected layer;

[0337] Residual connections and layer normalization: preserve the original input information and stabilize the training process;

[0338] Feedforward network: contains two fully connected layers, the middle dimension is extended to 512, and the activation function is GELU;

[0339] (2) Global maximum pooling: Take the maximum value along the dimension of the number of point clouds and output a 256-dimensional global feature vector.

[0340] 4. Building roof type output module

[0341] Connection relationship: Connected to the global feature vector extraction module through the data bus to receive the 256-dimensional global feature vector.

[0342] Function: Predict roof type labels through classifier.

[0343] Processing steps:

[0344] (1) Classifier structure:

[0345] First fully connected layer: input 256 dimensions, output 1024 dimensions, activation function GELU, layer normalization;

[0346] Second fully connected layer: input 1024 dimensions, output 256 dimensions, activation function GELU, layer normalization;

[0347] The third fully connected layer has a 256-dimensional input and a 17-dimensional output, corresponding to 17 roof types.

[0348] (2) Probability normalization: The Softmax function maps the output to a probability distribution;

[0349] (3) Loss calculation: The cross entropy loss function optimizes the model parameters.

[0350] This embodiment provides a building recognition system based on 3D point clouds that can achieve the following technical effects:

[0351] 1. The undersampling submodule retains key geometric structures through farthest point sampling and reduces redundant calculations;

[0352] 2. The oversampling submodule compensates for sparse areas through K-nearest neighbor interpolation to improve data distribution uniformity;

[0353] 3. The T-net network generates an orthogonal transformation matrix to eliminate the interference of rotation and translation on feature extraction;

[0354] 4. The multi-head bias attention layer uses a learnable bias matrix to strengthen the association weights of local roof structures (such as ridge lines) and suppress the influence of noise points;

[0355] 5. Global maximum pooling extracts the most discriminative global features to improve classification accuracy;

[0356] 6. The sample balancing strategy filters out redundant samples through density thresholds to solve the problem of class imbalance.

[0357] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the apparatus disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.

[0358] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0359] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A building recognition method based on three-dimensional point cloud, characterized in that: include: Step 1: Undersampling, oversampling, and data enhancement are performed on the input building roof point cloud data to obtain pre-processed roof point cloud data; Step 2: spatially align the pre-processed roof point cloud data through the T-net network, and output the aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is the 3×3 transformation matrix generated by the T-net network; Step 3: Improve the PCT model to obtain the NEW_PCT model. The improved PCT model to obtain the NEW_PCT model specifically includes: replacing the self-attention module in the PCT model with a multi-head bias attention module, and introducing a learnable bias matrix B∈ into the attention calculation of each head. , where the structure of the multi-head bias attention module includes: Multi-head parallel computing unit: The multi-head parallel computing unit is used to split the input features of the aligned roof point cloud data into 8 independent computing branches. Each computing branch generates query, key, and value parameters through linear transformation and is accompanied by a learnable bias matrix. The learnable bias matrix is ​​used to dynamically strengthen the attention weight of local areas in the aligned roof point cloud data. A bias-enhanced attention weight calculation unit: In each of the calculation branches, the PCT model automatically focuses on the ridge line or slope edge of the building roof to suppress noise and redundant point interference by superimposing a bias matrix to adjust the correlation strength between points. Multi-scale feature fusion unit: concatenates the outputs of eight independent computation branches according to feature dimensions, fuses them into a unified feature through linear transformation, and combines residual connections and normalization operations to preserve the original input information; Step 4: Input the aligned roof point cloud data into the NEW_PCT model, and extract the global feature vector through the multi-head biased attention mechanism in the NEW_PCT model, which specifically includes the following sub-steps: Step 4.1: Generate a point cloud feature matrix X∈ by passing the aligned point cloud data through the linear encoding layer of the NEW_PCT model. , where N is the number of point clouds and d is the feature dimension; Step 4.2: Perform linear transformation on the point cloud feature matrix X to generate query matrix Q, key matrix K, value matrix V, and introduce a learnable bias matrix B∈ , the output of multiple attention heads is calculated by the following formula: ; in, is the dimension of the bond matrix, is the transposed matrix of the key matrix; Step 4.3: Concatenate the outputs of the multiple attention heads and fuse them through linear transformation to obtain intermediate correlation features. Step 4.4: Perform global maximum pooling on the intermediate correlation features to generate the global feature vector. The global maximum pooling formula is: ; in, represents the global eigenvector, represents the feature vector of the i-th point in the intermediate correlation feature, and max represents the maximum value calculated independently for each feature channel; Step 5: Input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

2. The method according to claim 1, characterized in that The input building roof point cloud data is subjected to undersampling, oversampling, and data enhancement to obtain pre-processed roof point cloud data, including: Step 1: Undersample the input building roof point cloud data: Using a farthest point sampling algorithm, iteratively selects a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud; Step 2: Oversampling the downsampled point cloud: Identifying a sparse area in the downsampled point cloud whose density is lower than a second preset threshold, calculating the mean of the three-dimensional coordinates of K nearest neighboring points of each target point in the sparse area to generate an interpolated point, and adding the interpolated point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud; Step 3: Perform data enhancement processing on the oversampled enhanced point cloud to generate a data-enhanced point cloud: Applying a random rotation transformation to the oversampled enhanced point cloud within a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud; Step 4: Label and balance samples to obtain labeled and balanced point cloud data: Annotating the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbor points in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient type of samples through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460; Step 5: Generate pre-processed roof point cloud data: The labeled and balanced point cloud data is output as the pre-processed roof point cloud data.

3. The method according to claim 1, characterized in that The pre-processed roof point cloud data is spatially aligned through the T-net network, and the aligned roof point cloud data P'=P·T is output, where P is the pre-processed roof point cloud data and T is the 3×3 transformation matrix generated by T-net, including: Input the preprocessed roof point cloud data into the T-net network, perform the first layer 1×1 convolution, the second layer 1×1 convolution, the third layer 1×1 convolution, and global average pooling in sequence, and output the feature vector after global average pooling; Input the globally averaged pooled feature vector into the fully connected layer of the T-net network and perform nonlinear mapping to obtain a transformation matrix; The preprocessed roof point cloud data is multiplied by the transformation matrix to calculate the aligned roof point cloud data P'=P·T, where P is the preprocessed roof point cloud data and T is the 3×3 transformation matrix generated by T-net.

4. The method according to claim 1, wherein The outputs of the multiple attention heads are concatenated and fused through linear transformation to obtain intermediate correlation features, including: The outputs of the multiple attention heads are directly concatenated according to the feature channel dimension to form a merged feature matrix; Using learnable weight parameters to perform linear transformation on the merged feature matrix, compress it to the target feature dimension, and generate a fused unified feature representation; A ReLU activation function is applied to the fused unified feature representation to enhance the nonlinear expression capability, and the intermediate correlation feature is output.

5. The method according to claim 1, wherein The global feature vector is input into the classifier of the NEW_PCT model to output the building roof type, including: The global feature vector is sequentially passed through two fully connected layers for nonlinear mapping, and each layer is followed by normalization and activation function processing to gradually compress the feature dimension of the global feature vector from 1024 dimensions to 256 dimensions, thereby generating a compressed 256-dimensional feature; The compressed 256-dimensional features are input into the fully connected layer of the NEW_PCT model, mapped to a 17-dimensional output vector corresponding to the 17 roof type labels, and the roof type probability is predicted by probability normalization. According to the difference between the predicted roof type probability and the roof type label, the parameters of the classifier of the NEW_PCT model are reversely optimized using a cross entropy loss function.

6. A building recognition system based on three-dimensional point cloud, characterized in that: The identification system is applied to the identification method according to any one of claims 1 to 5, and the identification system includes: A data preprocessing module is used to obtain preprocessed roof point cloud data by undersampling, oversampling, and data enhancement on the input building roof point cloud data; A spatial alignment module, connected to the data preprocessing module, configured to spatially align the preprocessed roof point cloud data through a T-net network and output aligned roof point cloud data P'=P·T, where P is the original point cloud data and T is a 3×3 transformation matrix generated by T-net; A global feature vector extraction module, connected to the spatial alignment module, configured to input the aligned roof point cloud data into the NEW_PCT model and extract a global feature vector through a multi-head biased attention mechanism in the NEW_PCT model; A building roof type output module is connected to the global feature vector extraction module, and is used to input the global feature vector into the classifier of the NEW_PCT model and output the building roof type.

7. The identification system according to claim 6, characterized in that The data preprocessing module includes: An undersampling submodule is configured to perform undersampling processing on the input building roof point cloud data: using a farthest point sampling algorithm, iteratively selecting a point farthest from a sampled point set from the input building roof point cloud data until the number of point clouds in the input building roof point cloud data drops to a first preset threshold, thereby generating a downsampled point cloud; an oversampling submodule, the oversampling submodule being connected to the undersampling submodule and configured to perform oversampling processing on the downsampled point cloud: identifying a sparse region in the downsampled point cloud having a density lower than a second preset threshold, calculating, for each target point in the sparse region, the mean of the three-dimensional coordinates of its K nearest neighboring points to generate an interpolation point, and adding the interpolation point to the downsampled point cloud so that the total number of points reaches a third preset threshold, thereby forming an oversampled enhanced point cloud; A data enhancement submodule is connected to the oversampling submodule, and is used to perform data enhancement processing on the oversampling enhanced point cloud to generate a data-enhanced point cloud: applying a random rotation transformation to the oversampling enhanced point cloud with a rotation angle range of ±15 degrees, and randomly translating the point cloud along the three-dimensional coordinate axis by a distance of ±0.1 meters, while scaling the point cloud coordinates by 0.8 to 1.2 times to generate a data-enhanced point cloud.

8. The identification system according to claim 7, characterized in that The data preprocessing module also includes: A labeling and balancing submodule, connected to the data enhancement submodule, is configured to label and balance samples to obtain labeled and balanced point cloud data: labeling the data-enhanced point cloud with 17 roof type labels; counting the number of samples of each type, deleting redundant samples of the same type whose average distance to the K nearest neighbors in the enhanced coordinate space is less than a fourth preset threshold, and supplementing the insufficient number of samples of each type through K-nearest neighbor interpolation until the number of samples of all types is balanced to 6460; The pre-processed roof point cloud data output submodule is connected to the labeling and equalization submodule, and the pre-processed roof point cloud data output submodule is used to output the labeled and equalized point cloud data as the pre-processed roof point cloud data.

Citation Information

Patent Citations

  • Three-dimensional point cloud change detection method based on attention mechanism enhanced feature comparison

    CN119131517A

  • Scene-level synthetic point cloud enhanced semantic segmentation method and system based on diffusion model

    CN119992082A