Ancient building roof point cloud symmetry detection and structure reconstruction method and system based on deep learning

Through the deep learning-based method of symmetry detection and structural reconstruction of ancient building roofs, the efficiency and accuracy of data acquisition and model construction in ancient building surveys is solved, and the rapid extraction of symmetry axis and parameterized modeling is achieved, and the cultural protection and management of ancient building are supported.

CN120355778APending Publication Date: 2025-07-22NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510467804.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

In the survey of ancient buildings, the existing technology has problems such as long data collection cycle, high cost, high proportion of manual intervention in model construction, and is easily disturbed by subjective judgment, making it difficult to fully record the characteristics of the building details.

Method used

The symmetry axis and parameters of the ancient building roof are extracted through point cloud symmetry detection and structural reconstruction methods based on deep learning, through point cloud processing, data set construction, neural network training and visual programming, and three-dimensional modeling is realized.

Benefits of technology

Rapidly extract the symmetry axis of ancient buildings, improve geometric accuracy, meet the three-dimensional modeling needs of ancient buildings, provide intuitive management tools for cultural relics protection, and support drone image parameter extraction and model construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355778A_ABST
    Figure CN120355778A_ABST
Patent Text Reader

Abstract

The invention provides an ancient building roof point cloud symmetry detection and structure reconstruction method and system based on deep learning, and the method comprises the steps: carrying out the point cloud processing of an ancient building roof, carrying out the decentralization of the point cloud of the ancient building roof, and obtaining the point cloud of a single ancient building roof; constructing an ancient building roof point cloud sample data set comprising single ancient building roof point cloud and corresponding symmetric points, foot points and symmetric plane normal vector parameters of the single ancient building roof point cloud; constructing a symmetric parameter extraction neural network to carry out network training and model evaluation, and obtaining neural network model parameters; utilizing the model to obtain symmetric points and symmetric plane normal vectors of the roof of the historic building, and then extracting length, width and lifting parameters of the roof; and finally, building the ancient building roof BIM model on the basis of Dynamo visual programming. According to the method, the symmetric point and the normal vector of the symmetric axis of the ancient building roof can be rapidly extracted from the laser point cloud, the symmetric parameter extraction of the ancient building roof is met, and the extracted parameters are used for three-dimensional modeling of the ancient building roof.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of remote sensing science and technology, and surveying and mapping engineering technology, and particularly relates to a method and system for detecting the symmetry of an ancient building roof point cloud and reconstructing the structure based on deep learning. Background Art

[0002] In recent years, as a physical entity carrying historical memories and humanistic values, the construction of a scientific protection and restoration technology system for ancient buildings has become the focus of people's attention. Traditional survey methods not only have defects such as long data collection cycles and high costs, but also there are situations where the detailed features of buildings are difficult to be completely recorded. With the rise of measurement technologies such as three-dimensional laser scanning technology, three-dimensional reconstruction methods based on laser point clouds and UAV oblique images have gradually replaced traditional surveying and mapping. However, there are still problems in the model construction link of the existing technical process, such as too high proportion of manual intervention and being easily interfered by subjective judgments. Dynamo provides a new solution for the protection of ancient buildings through parametric modeling. This technology inputs the parameter information of ancient buildings into code blocks and performs visual programming through node connections. Its visual analysis function significantly improves the scientific nature of building condition assessment, and compared with traditional two-dimensional drawings, the BIM model shows unique advantages in the whole life cycle management. Summary of the Invention

[0003] Aiming at the problems existing in the prior art, the present invention provides a method and system for detecting the symmetry of an ancient building roof point cloud and reconstructing the structure based on deep learning, which can realize the extraction of the symmetry axis plane of the ancient building roof to meet the needs of ancient building cultural protection, and can provide an intuitive and visual management tool for the cultural relic protection department through three-dimensional modeling of ancient buildings by Dynamo.

[0004] To solve the above technical problems, the present invention provides the following technical solution: A method for detecting the symmetry of an ancient building roof point cloud and reconstructing the structure based on deep learning, comprising the following steps:

[0005] S1. Perform point cloud processing on the ancient building roof. After cropping out a single ancient building, retain the roof part of the ancient building, and decentralize the sampled ancient building roof point cloud to obtain the single ancient building roof point cloud P;

[0006] S2. Construct an ancient building roof point cloud sample data set including the single ancient building roof point cloud P, as well as its corresponding symmetric points, foot points, and symmetric plane normal vector parameters. When constructing the data set, use a labeling tool to draw the symmetry axis on the XOY plane projection image of the ancient building roof point cloud, and convert it into a symmetric plane, obtain the symmetric plane normal vector parameters, and construct a rotation transformation matrix around the Z axis to rotate the original point cloud and the labeled symmetric plane to achieve data augmentation;

[0007] S3. Construct a neural network for detecting the symmetry of the ancient building roof point cloud, train this neural network with the ancient building roof point cloud sample dataset to obtain an ancient building roof point cloud symmetry detection model; during the training process, perform feature extraction and embedding, and obtain the symmetric point, foot point, and symmetric plane normal vector parameters of each point through multi-task prediction. The loss of the model is the sum of the multi-task losses. At the same time, during the model training stage, adopt the Adam gradient descent algorithm to finally obtain the neural network model parameters.

[0008] S4. Use the ancient building roof point cloud symmetry detection model to perform symmetry detection on the preprocessed ancient building point cloud data, obtain the symmetric points and symmetric plane normal vectors, and then perform visual output;

[0009] S5. Combine the obtained symmetric points and symmetric plane normal vectors of the ancient building roof with the roof length L, width W, and lift height parameter H to realize the parametric modeling of the ancient building roof.

[0010] Furthermore, the aforementioned step S1 includes the following sub-steps:

[0011] S1.1. Cut out a single ancient building in the point cloud software, perform slicing on it, and only retain the roof building part;

[0012] S1.2: Downsample the ancient building roof. When there is a need for point cloud stitching in the model building, perform distance sampling on it to ensure uniform point cloud distribution;

[0013] S1.3: Subtract the point cloud from its own coordinates to centralize the coordinates, and use the annotation tool to draw the axis of symmetry.

[0014] Furthermore, the aforementioned step S2 includes the following sub-steps:

[0015] S2.1. Project the ancient building roof point cloud onto the XOY plane, use the annotation tool to draw a two-dimensional straight line segment L of the axis of symmetry on the projected image, and set the Z coordinate of each vertex of the straight line segment L to 0 to obtain a new three-dimensional straight line segment L.

[0016] S2.2. Calculate the direction vector of the straight line segment L Rotate 90 degrees around the Z axis to obtain a new vector as the normal vector of the symmetric plane;

[0017] S2.3. Obtain the symmetric plane normal vector parameters, define a rotation angle θ, and convert it to radians. Construct a rotation transformation matrix around the Z axis, rotate the ancient building roof point cloud and the annotated symmetric plane to achieve data augmentation, and generate a.sys format annotation file.

[0018] Furthermore, the ancient building roof point cloud symmetry detection neural network in the aforementioned step S3 is constructed based on the CABSym-Net deep neural network, and includes 1 feature extraction backbone network and 3 multi-task prediction branch networks: The feature extraction backbone network first extracts the geometric features of the point cloud. The network structure performs local feature extraction on each point through 4 shared multi-layer perceptrons, gradually increasing the feature dimension. The corresponding feature dimensions are {64, 128, 256, 1024} respectively. Then, a max pooling operation is used to aggregate all local features into 1024-dimensional global features. Each shared multi-layer perceptron is implemented using Conv1d convolution and the Relu function; the 3 multi-task prediction branch networks respectively predict the symmetric plane points, foot points, and normal vectors. Each branch contains 4 multi-layer perceptron layers, which are implemented using Conv1d convolution and the Relu function, and output the final predicted values, outputting the center point, foot point, and normal vector. All branches share the underlying feature extraction network, and each branch updates parameters independently.

[0019] Furthermore, the loss function of the ancient building roof point cloud symmetry detection neural network in the aforementioned step S3 is constructed according to the following steps:

[0020] S3.1. For the input roof point cloud P = {p i}, i = 1, 2, n, let the symmetric plane background value be expressed as where is any point on the symmetric plane, is the normal vector of the symmetric plane; the network predicts the foot point set O si of the point cloud P, and the foot point i of each point p on the symmetric plane si i is the projection point of the point p on the symmetric plane, and the background value is si S3.2. Adopt a composite loss function model that combines geometric alignment and symmetry constraints. For the input point cloud P, the multi-branch prediction model predicts the symmetric plane normal vector Q si 、any point C si on the symmetric plane、the foot point O The loss function corresponding to each branch includes the symmetric plane point loss the foot point loss and the corresponding loss si for the plane normal vector Q si 、any point C on the plane. Calculate the average Euclidean distance between the predicted point and the target point. The corresponding loss is obtained by summing the symmetric point and normal vector losses. The loss i of the network is the sum of the branch network losses. For each point p

[0021]

[0022]

[0023] In the formula, represents the background value of the normal vector of the symmetry plane, represents the background value of any point on the symmetry plane, represents the background value of the symmetric corresponding point.

[0024] Furthermore, in the model training stage of the aforementioned step S3, the Adam gradient descent algorithm is adopted to finally obtain the neural network model parameters. Specifically: first, forward propagation, input the point cloud data, extract features into the network, perform multi-branch prediction of parameters after fusing global features, and convert the coordinate system of the center point; then, backward propagation, calculate the total loss, use the Adam optimizer to reduce the loss value, with the initial learning rate lr = 0.0001, β1 = 0.9, β2 = 0.99, weight decay 0.9, and the number of training rounds is 500. Continuously update the parameters, evaluate whether it is the best model, if so, output, otherwise continue training.

[0025] Furthermore, the aforementioned step S4 includes the following sub-steps;

[0026] S4.1. Read the point cloud to be predicted, select the point cloud within the index range, normalize the selected point cloud, convert it into a tensor, do not use gradient descent, use the trained ancient building roof symmetry detection neural network model for prediction, and convert the result into an array;

[0027] S4.2. Reshape the predicted center point and the normal vector of the symmetry plane, normalize them, perform clustering analysis on the normal vector, calculate its confidence, and screen out effective features;

[0028] S4.3. Perform reflection transformation on the point cloud data, and calculate the reflection points and normal vectors on the symmetry plane according to the given center point and symmetry plane.

[0029] Furthermore, the aforementioned step S5 includes the following sub-steps;

[0030] S5.1. Combine the axial plane parameters of the ancient building roof extracted by the prediction model with the regulation parameters such as the length, width, and height of the roof, and calculate the slope curve structure of the roof by combining the method of lifting and folding;

[0031] S5.2. Use the axis of symmetry extracted by the neural network as the main axis, construct the curve of the lower edge of the roof as the lofting profile, loft along the lofting path, thicken the lofted roof, cut it into the shape required for the ancient building roof, draw a curve through the sampling points by Dynamo, and then perform lofting, encapsulation, thickening, and cutting. At the same time, construct the side roof, mirror the three surfaces and the side roof after assembly to complete the component process of the roof;

[0032] S5.3. Create different modules through Dynamo, use node connections, and complete the parametric modeling of the ancient building roof through visual programming.

[0033] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of any method described in the present invention are implemented.

[0034] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method described in the present invention are implemented.

[0035] Compared with the prior art, the beneficial technical effects of the present invention adopting the above technical solutions are as follows:

[0036] 1. The present invention can quickly extract the axisymmetric plane of the ancient building from the laser point cloud, has higher geometric accuracy, and can meet the needs of three-dimensional modeling of ancient buildings based on Dynamo.

[0037] 2. The present invention can realize the extraction of the axisymmetric plane of the ancient building roof to meet the needs of ancient building cultural protection, and can provide an intuitive and visual management tool for the cultural relic protection department through the three-dimensional modeling of ancient buildings, which is of great significance for protecting and carrying forward Chinese traditional architectural culture.

[0038] 3. The present invention can meet the roof parameter extraction and model construction based on drone images. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of the present invention.

[0040] Figure 2 It is a schematic diagram of the point cloud slice of the roof of a certain ancient building in the embodiment of the present invention.

[0041] Figure 3 It is a schematic diagram of the downsampling of the point cloud slice of the ancient building roof of the present invention.

[0042] Figure 4 It is a schematic diagram of the axis of symmetry annotation of the point cloud of the ancient building roof of the present invention.

[0043] Figure 5 Schematic diagram of the training model structure of the neural network for detecting the symmetry of ancient building roofs according to the present invention.

[0044] Figure 6 Schematic diagram of extracting the axis of symmetry by using the trained deep neural network according to the present invention.

[0045] Figure 7 Schematic diagram of using Dynamo for visual programming according to the present invention.

[0046] Figure 8 Schematic diagram of reconstructing the ancient building roof by using Dynamo according to the present invention. Specific implementation manner

[0047] In order to better understand the technical content of the present invention, specific embodiments are given below in conjunction with the accompanying drawings for illustration.

[0048] In the present invention, various aspects of the present invention are described with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the present invention are not limited to those described in the drawings. It should be understood that the present invention can be implemented by any one of the various concepts and embodiments introduced above, and those described in detail below, because the concepts and embodiments disclosed in the present invention are not limited to any embodiment. In addition, some aspects disclosed in the present invention can be used alone, or in any appropriate combination with other aspects disclosed in the present invention.

[0049] Reference Figure 1 , the present invention provides a method for detecting the symmetry and reconstructing the structure of the point cloud of the ancient building roof based on deep learning, including the following steps:

[0050] S1. Perform point cloud processing on the ancient building roof. After cropping out a single ancient building, retain the roof part of the ancient building, and decentralize the sampled point cloud of the ancient building roof to obtain the point cloud P of the roof of a single ancient building.

[0051] S2. Construct a sample data set of the point cloud of the ancient building roof including the point cloud P of the roof of a single ancient building, as well as its corresponding symmetric points, foot points, and symmetric plane normal vector parameters. When constructing the data set, use a labeling tool to draw the axis of symmetry on the XOY plane projection image of the point cloud of the ancient building roof, and convert it into a symmetric plane to obtain the symmetric plane normal vector parameters. Construct a rotation transformation matrix around the Z axis to rotate the original point cloud and the labeled symmetric plane to achieve data augmentation.

[0052] S3. Construct a neural network for detecting the symmetry of the ancient building roof point cloud, train this neural network with the ancient building roof point cloud sample dataset to obtain an ancient building roof point cloud symmetry detection model; during the training process, perform feature extraction and embedding, and obtain the symmetric point, foot point, and symmetric plane normal vector parameters of each point through multi-task prediction. The loss of the model is the sum of the multi-task losses. At the same time, during the model training stage, adopt the Adam gradient descent algorithm to finally obtain the neural network model parameters.

[0053] S4. Use the ancient building roof point cloud symmetry detection model to perform symmetry detection on the preprocessed ancient building point cloud data to obtain symmetric points and symmetric plane normal vectors, and then perform visual output;

[0054] S5. Combine the obtained symmetric points and symmetric plane normal vectors of the ancient building roof with the roof length L, width W, and lift height parameter H to realize the parametric modeling of the ancient building roof.

[0055] As a preferred embodiment of the present invention, step S1 specifically includes the following sub-steps:

[0056] S1.1. Cut out a single ancient building in the point cloud software, as Figure 2 shown, and then perform slicing processing on it, only retaining the roof building part;

[0057] S1.2: Downsample the number of points in each ancient building roof point cloud to 40960. When there is a need for point cloud stitching in the model building, perform distance sampling on it to ensure uniform point cloud distribution;

[0058] S1.3: Subtract the point cloud from its own coordinates to centralize the coordinates, and use the annotation tool to draw the axis of symmetry to obtain the single ancient building roof point cloud P, as Figure 3 shown.

[0059] As a preferred embodiment of the present invention, step S2 includes the following sub-steps:

[0060] S2.1: Project the ancient building roof point cloud onto the XOY plane, and use the annotation tool to draw the two-dimensional straight line segment L of the axis of symmetry on the projection image. Figure 4 In, set the Z coordinate of each vertex of the straight line segment L to 0 to obtain a new three-dimensional straight line segment L.

[0061] S2.2:: Calculate the direction vector of the straight line segment L Rotate 90 degrees around the Z axis to obtain a new vector as the normal vector of the symmetric plane.

[0062] S2.3: Obtain the normal vector parameters of the symmetry plane, define a rotation angle θ, and convert it to radians. Construct a rotation transformation matrix around the Z-axis to rotate the ancient building roof point cloud and the marked symmetry plane to achieve data augmentation, and generate an annotation file in the.sys format.

[0063] As a preferred embodiment of the present invention, in step S3, construct a symmetry detection network CABSym-Net, as Figure 5 and Figure 6 shown. The network includes 1 feature extraction backbone network and 3 multi-task prediction branch networks: The backbone network first extracts the geometric features of the point cloud. The network structure performs local feature extraction on each point through 4 shared multi-layer perceptrons (MLPs), increasing the feature dimension layer by layer, and the corresponding feature dimensions are {64, 128, 256, 1024} respectively. Then, use the max pooling operation to aggregate all local features into a 1024-dimensional global feature, where each shared MLP is implemented using Conv1d convolution and the Relu function; the 3 multi-task prediction branch networks respectively predict the symmetry plane points, foot points, and normal vectors. Each branch contains 4 MLP layers, which are implemented using Conv1d convolution and the Relu function, and output the final predicted values. All branches share the underlying feature extraction network, and each branch updates its parameters independently.

[0064] As a preferred embodiment of the present invention, in step S3, construct a loss function model for the input roof point cloud P = {p i}, i = 1, 2, n. Assume that the symmetry plane background value is expressed as where is any point on the symmetry plane, is the normal vector of the symmetry plane. The network predicts the foot point set O si of the point cloud P. For each point p i on the symmetry plane si, the foot point is the projection point of the point p i on the symmetry plane, and the background value is

[0065] Adopt a composite loss function model that combines geometric alignment and symmetry constraints. For the input point cloud P, the multi-branch prediction model predicts the symmetry plane normal vector Q si , any point C si on the plane, and the foot point O si . The loss function corresponding to each branch includes the symmetry plane point loss the foot point loss and the corresponding loss . The first two calculate the average Euclidean distance between the predicted point and the target point. The corresponding loss is obtained by summing the symmetry point and normal vector losses, and the loss weight w = 0.5. The loss It is the sum of the losses of the branch networks. For each point p i , the total loss calculation function for symmetric prediction is:

[0066]

[0067] As a preferred embodiment of the present invention, in step S3, when training the neural network, first perform forward propagation, input the point cloud data, enter the network to extract features, fuse the global features and then perform multi-branch prediction of parameters, and convert the coordinate system of the center point; then perform backpropagation, calculate the total loss, use the Adam optimizer to reduce the loss value, with the initial learning rate lr = 0.0001, β1 = 0.9, β2 = 0.99, weight decay 0.9, and the number of training rounds is 500 rounds. Continuously update the parameters, evaluate whether it is the best model, if so, output it, otherwise continue training.

[0068] As a preferred embodiment of the present invention, step S4 includes the following sub-steps:

[0069] S4.1: Read the point cloud to be predicted, select the point cloud within the index range. If the number of point clouds is greater than 4096, randomly select points from the point cloud; if the number of points is insufficient, repeat the selection. Normalize the selected point cloud and convert it into a tensor. Without using gradient descent, use the trained ancient building roof symmetry detection neural network model for prediction and convert the result into an array.

[0070] S4.2: Reshape the predicted center point and the normal vector of the symmetry plane, normalize them, perform clustering analysis on the normal vector, calculate its confidence, and screen out the effective features.

[0071] S4.3: Perform a reflection transformation on the point cloud data, and calculate the reflection points and normal vectors on the symmetry plane according to the given center point and symmetry plane.

[0072] As a preferred embodiment of the present invention, step S5 includes the following sub-steps:

[0073] S5.1: Combine the axial plane parameters of the ancient building roof extracted by the prediction model with the regulation parameters such as the length, width, and height of the roof, and calculate the slope curve structure of the roof using the method of lifting and folding.

[0074] S5.2: Use the symmetry axis extracted by the neural network as the main axis, construct the curve of the lower edge of the roof surface as the lofting contour, loft along the lofting path, thicken the lofted roof surface, and cut it into the shape required for the ancient building roof surface. Draw the curve of the sampling points through dynamo, and perform lofting, encapsulation, thickening, and cutting according to the same steps. At the same time, construct the side roof surface, assemble the three surfaces and the side roof surface and then perform mirroring to complete the component process of the roof.

[0075] S5.3: Create different modules through Dynamo and use node connections, such as Figure 7 , complete the parametric modeling of the ancient building roof through visual programming, and the constructed ancient building roof model is as shown in Figure 8 .

[0076] On the other hand, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the steps of the method described in any one of the embodiments are implemented.

[0077] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any one of the embodiments are implemented.

[0078] Although the present invention has been described above with preferred embodiments, it is not intended to limit the present invention. Those with ordinary knowledge in the technical field to which the present invention pertains can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to what is defined by the claims.

Claims

1. A method for detecting the symmetry of the point cloud of the ancient building roof and reconstructing the structure based on deep learning, characterized in that, It includes the following steps: S1. Perform point cloud processing on the ancient building roof. After cropping out a single ancient building and retaining the roof part of the ancient building, decentralize the sampled ancient building roof point cloud to obtain the point cloud P of the roof of a single ancient building. S2. Construct a sample data set of the ancient building roof point cloud including the point cloud P of the roof of a single ancient building, as well as its corresponding symmetric points, foot points, and symmetric plane normal vector parameters. When constructing the data set, use a labeling tool to draw the axis of symmetry on the XOY plane projection image of the ancient building roof point cloud, and convert it into a symmetric plane to obtain the symmetric plane normal vector parameters. Construct a rotation transformation matrix around the Z axis to rotate the original point cloud and the labeled symmetric plane to achieve data augmentation. S3. Construct a neural network for detecting the symmetry of the ancient building roof point cloud, train this neural network with the sample data set of the ancient building roof point cloud to obtain a model for detecting the symmetry of the ancient building roof point cloud; perform feature extraction and embedding during the training process, and obtain the symmetric points, foot points, and symmetric plane normal vector parameters of each point through multi-task prediction. The loss of the model is the sum of multi-task losses. At the same time, during the model training stage, use the Adam gradient descent algorithm to finally obtain the neural network model parameters. S4. Use the model for detecting the symmetry of the ancient building roof point cloud to perform symmetry detection on the preprocessed ancient building point cloud data, obtain the symmetric points and symmetric plane normal vectors, and then perform visual output. S5. Combine the obtained symmetric points and symmetric plane normal vectors of the ancient building roof with the roof length L, width W, and lift parameter H to realize the parametric modeling of the ancient building roof.

2. A method for detecting the symmetry of the point cloud of an ancient building roof and reconstructing the structure based on deep learning according to claim 1, characterized in that Step S1 includes the following sub-steps: S1.

1. Crop out a single ancient building in the point cloud software, perform slicing on it, and only retain the roof building part. S1.2: Downsample the ancient building roof. When there is a need for point cloud stitching in the model building, perform distance sampling on it to ensure uniform point cloud distribution. S1.3: Subtract the point cloud from its own coordinates to centralize the coordinates, and use a labeling tool to draw the axis of symmetry.

3. A method for detecting the symmetry of a point cloud of an ancient building roof and reconstructing its structure based on deep learning according to claim 1, characterized in that, Step S2 includes the following sub-steps: S2.

1. Project the ancient building roof point cloud onto the XOY plane, use a labeling tool to draw the two-dimensional straight line segment L of the axis of symmetry on the projection image, and set the Z coordinate of each vertex of the straight line segment L to 0 to obtain a new three-dimensional straight line segment L. S2.

2. Calculate the direction vector of the straight line segment L Rotate by 90 degrees around the Z-axis to obtain a new vector as the normal vector of the symmetry plane; S2.

3. Obtain the symmetric plane normal vector parameters, define a rotation angle θ, and convert it to radians. Construct a rotation transformation matrix around the Z axis to rotate the ancient building roof point cloud and the labeled symmetric plane to achieve data augmentation, and generate a labeled file in the.sys format.

4. A method for detecting the symmetry of the point cloud of the ancient building roof and reconstructing the structure based on deep learning according to claim 1, characterized in that Step S3: The ancient building roof point cloud symmetry detection neural network is constructed based on the CABSym-Net deep neural network, including 1 feature extraction backbone network and 3 multi-task prediction branch networks: The feature extraction backbone network first extracts the geometric features of the point cloud. The network structure performs local feature extraction on each point through 4 shared multi-layer perceptrons, gradually increasing the feature dimension. The corresponding feature dimensions are {64, 128, 256, 1024}. Then, a max pooling operation is used to aggregate all local features into a 1024-dimensional global feature. Each shared multi-layer perceptron is implemented using Conv1d convolution and the Relu function; The 3 multi-task prediction branch networks respectively predict the symmetric plane points, foot points, and normal vectors. Each branch contains 4 multi-layer perceptron layers, which are implemented using Conv1d convolution and the Relu function, and output the final prediction values, including the central point, foot point, and normal vector. All branches share the underlying feature extraction network, and the parameters of each branch are updated independently.

5. A method for detecting the symmetry of a point cloud of an ancient building roof and reconstructing its structure based on deep learning according to claim 1, characterized in that, In step S3, the loss function of the neural network for detecting the symmetry of the ancient building roof point cloud is constructed as follows: S3.

1. For the input roof point cloud P = {p i}, i = 1, 2, n, let the background value expression of the symmetry plane be where is any point on the symmetry plane, is the normal vector of the symmetry plane; the network predicts the foot point set O si of the point cloud P, and the foot point i of each point p on the symmetry plane si, that is, the projection point of the point p i on the symmetry plane, and the background value is S3.

2. Adopt a composite loss function model that combines geometric alignment and symmetry constraints. For the input point cloud P, the multi-branch prediction model predicts the normal vector Q of the symmetry plane si , any point C on the symmetry plane si , the foot point O si , and the loss function corresponding to each branch includes the symmetry plane point loss foot point loss and the corresponding loss plane normal vector Q si , any point C on the plane si . Calculate the average Euclidean distance between the predicted point and the target point. The corresponding loss is summed through the symmetry point and normal vector losses. The loss of the network is the sum of the branch network losses. For each point p i , the total loss calculation function for symmetric prediction is as follows: In the formula, represents the background value of the normal vector of the symmetry plane, represents the background value of any point on the symmetry plane, represents the background value of the symmetric corresponding point.

6. A method for detecting the symmetry of the point cloud of the ancient building roof and reconstructing the structure based on deep learning according to claim 1, characterized in that, In the model training stage of Step S3, the Adam gradient descent algorithm is adopted to finally obtain the neural network model parameters. Specifically: First, in the forward propagation, the point cloud data is input, features are extracted by entering the network, the parameters are predicted by multiple branches after fusing the global features, and the coordinate system of the central point is transformed; Then, in the backward propagation, the total loss is calculated, and the Adam optimizer is used to reduce the loss value. The initial learning rate lr = 0.0001, β1 = 0.9, β2 = 0.99, the weight decay is 0.9, and the number of training rounds is 500. The parameters are continuously updated, and it is evaluated whether it is the best model. If so, it is output; otherwise, the training continues.

7. A method for detecting the symmetry of the point cloud of an ancient building roof and reconstructing the structure based on deep learning according to claim 1, characterized in that, Step S4 includes the following sub-steps; S4.1: Read the point cloud to be predicted, select the point cloud within the index range, normalize the selected point cloud, convert it into a tensor, do not use gradient descent, use the trained ancient building roof symmetry detection neural network model to predict, and convert the result into an array; S4.2: Reshape the predicted central point and the symmetric plane normal vector, normalize them, perform clustering analysis on the normal vector, calculate its confidence, and filter out the effective features; S4.3: Perform a reflection transformation on the point cloud data, and calculate the reflection points and normal vectors on the symmetric plane according to the given central point and symmetric plane.

8. A method for detecting the symmetry of the point cloud of the ancient building roof and structural reconstruction based on deep learning according to claim 1, characterized in that, Step S5 includes the following sub-steps; S5.1: Combine the axial plane parameters of the ancient building roof extracted by the prediction model with the regulation parameters such as the length, width, and rise of the roof, and calculate the slope curve structure of the roof using the folding method; S5.2: Use the symmetry axis extracted by the neural network as the main axis, construct the curve of the lower edge of the roof surface as the lofting contour, loft along the lofting path, thicken the lofted roof surface, cut it into the shape required for the ancient building roof surface, draw the curve through the sampling points using dynamo, and then perform lofting, encapsulation, thickening, and cutting. At the same time, construct the side roof surface, mirror the three surfaces and the side roof surface after assembly to complete the component process of the roof; S5.3: Create different modules through Dynamo, connect the nodes, and complete the parametric modeling of the ancient building roof through visual programming.

9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.