Abstract
The inheritance and innovation of ancient architecture decoration art is an important way for the development of the construction industry. The data process of traditional ancient architecture decoration art is relatively backward, which leads to the obvious distortion of the digitalization of ancient architecture decoration art. In order to improve the digital effect of ancient architecture decoration art, based on neural network, this paper combines the image features to construct a neural network-based ancient architecture decoration art data system model, and graphically expresses the static construction mode and dynamic construction process of the architecture group. Based on this, three-dimensional model reconstruction and scene simulation experiments of architecture groups are realized. In order to verify the performance effect of the system proposed in this paper, it is verified through simulation and performance testing, and data visualization is performed through statistical methods. The result of the study shows that the digitalization effect of the ancient architecture decoration art proposed in this paper is good.
Introduction
Culture is the spiritual carrier and the soul of the nation. To realize the great rejuvenation of the Chinese nation, the first thing to achieve is the rejuvenation of national culture. The Chinese nation has a history of 5,000 years of history and culture. The study and research of traditional culture can increase the confidence and pride in our hearts. On November 30, 2016, General Secretary Xi said at the opening ceremony of the Tenth National Congress of the Federation of Chinese Literature and Art: The outstanding Chinese traditional culture bred in more than 5,000 years of civilization development and the revolutionary culture and advanced socialist culture bred in the great struggle of the party and the people have accumulated the deepest spiritual pursuit of the Chinese nation, which represents the unique spiritual identity of the Chinese nation. We must vigorously promote the national spirit with patriotism as the core and the spirit of the times with reform and innovation as the core, vigorously promote the excellent traditional culture of China, vigorously develop advanced socialist culture, and constantly strengthen the spiritual strength of the entire party and the people of all ethnic groups. This shows that the protection and inheritance of my country’s traditional culture is a major and urgent strategic task [1].
The ancient vernacular architecture is the epitome of Chinese agricultural civilization in the past 5,000 years, reflecting the harmonious relationship between man and nature. The protection of vernacular architecture should focus on the protection of its overall style, including the body of the heritage, the surrounding environment and the intangible cultural heritage it carries. In the first large-scale comprehensive encyclopedia in China, “The Encyclopedia of China”, the interpretation of residential houses is “residential architectures outside palace officials and government halls.” It is unofficial and limited to the field of daily life in the human living environment. The folk house has the characteristics of spontaneous, adapting to the natural environment and local. The quadrangle is a typical residential house, especially Beijing quadrangle is a representative work of the Chinese quadrangle. The quadrangle is strictly arranged according to the central axis. The main architectures are all distributed on the central axis and are symmetrically arranged. This unique layout method strictly follows the patriarchal clan system and etiquette system of the feudal society, and family members are allocated from the respect of the humble and the elder in the use of the room. Vernacular ancient architecture includes folk architecture, local architecture, traditional architecture, spontaneous architecture and other types, and its characteristics include spontaneous and simple features. Vernacular ancient architectures are widely distributed among the rural mountains and fields, have the natural nature of being native, and widely exist in rural society. Vernacular ancient architectures are closely related to social life, including private houses, family ancestral halls, shops and so on. According to the region, the vernacular ancient architecture is divided into Shanxi and Shaanxi caves, Jiangnan water village dwellings, Shanxi Qiaojia courtyard, southern Anhui Huipai dwellings, Beijing quadrangle, Fujian and Guangdong Tulou, Yunnan Dais bamboo dwellings, southwest minority hanging houses and so on. Well-known scholar Wen Yiduo once said: one of the biggest characteristics of our folk residence is harmony and unity, freedom, natural changes according to mountains and water villages, tranquility, layout, fictitiousness, staggering, etc. For example, because Jiangnan houses are located in the Jiangnan region of China and the Jiangnan region is rich in water resources, most townships and cities are built by the river, and the architectures along the river form a street. The ancient town of Zhouzhuang is a typical representative of the lower reaches of the Yangtze River, and its architectures are mostly built by the river. In order to protect against water and moisture, the architecture generally adopts a part of a large stone wall or faces stone [2].
The protection of vernacular ancient architectures in my country has begun to change from the protection of individual architectures to the protection of groups. At present, a national integrated protection system has been formed. National-level measures include national-level historical cities and national key cultural relics protection units, and local-level measures include key cultural relics protection units and local historical and cultural cities. In 2007, the Forum on the Protection of Chinese Cultural Heritage was held in Wuxi City, Jiangsu Province, the Pearl of Taihu Lake, and its central topic was the protection of vernacular ancient architectures. Many experts and professors such as Professor Chen Zhihua from the School of Architecture of Tsinghua University urged to strengthen the protection and called on all Chinese to protect the local ancient architecture, and attach importance to the protection of vernacular ancient architecture and local cultural characteristics [3]. In this forum, the programmatic document “Protection of Chinese Ancient Architectures-Wuxi Initiative” was adopted, which was China’s first document on the protection of ancient architectures.
Related work
The literature [4] based on the family model of Revit to carry out the three-dimensional parametric modeling of Zanjian Pavilion. Based on the analysis of the structure and manner of the ancient architectures in the Ming and Qing Dynasties, the literature [5] established the constraint relationship between the primary driving parameters and the secondary driving parameters according to its modulus system and shape characteristics. Moreover, it establishes a component parameter constraint database and a component structure regularity database, and sequentially calls the parameters in the two databases for component parametric modeling. The literature [6] used a architecture as an example to assemble a wooden frame. Although BIM has a better parametric modeling function and component management method, its 3D rendering effect is not good, and it does not have physical simulation function. The physical parameters of ancient architecture components are stored in the form of text attributes, so it is impossible to carry out real mechanical simulation in the dynamic construction process of ancient architectures.
In recent years, the CAD system has also introduced the concept of parametric design, which uses the parameter date as the control index of the operation, realizes the size drive through reasonable primary constraints and secondary constraints, and can automatically complete the entire product design process. Chen Yue realized the parametric design of the Qing Dynasty official ancient architectures in China by establishing a three-dimensional parameter-driven component based on a plane axis grid. The construction methods and parameter settings of various parts (abutments, columns, walls, roofs, beams, steps and railings) were discussed in detail, and a set of feasible parameterized design methods were established [7]. The literature [8] designed the framework and hierarchical structure of the ancient architecture component library and analyzed in detail the assembly features and rules of the temple-style wooden framework. Moreover, this literature used ObjectARX combined with the MFC framework to complete the parameterized design interface of the component and completed the management and call of the component library menu based on the AutoCAD platform. Literature [9] proposed a parametric modeling method of “closed polyline ⟶ basic voxel ⟶ CSG spanning tree ⟶ transformation matrix ⟶ Boolean operation”, and combined with ObjectARX, AutoCAD and OpenGL to develope a virtual simulation platform based on CAD model. Similarly, the three-dimensional rendering effect of CAD is yet to be developed, and it does not have physical simulation functions. It can only complete the assembly of the ancient architecture scene simulation.
Research and application of ontology in the simulation of ancient architectural scenes: Ontology is a philosophical category, which was later given a new definition with the development of artificial intelligence. It is a modeling tool that can describe domain concepts at the semantic and knowledge levels, and its use domains also include semantic networks, software engineering, and so on. Ontology describes the semantics of concepts through the relationship between concepts. As a method of knowledge expression, it is gradually applied to the field of ancient architecture protection. The literature [10] attempted to use the ontology method in the modeling process of ancient architectures to cope with the challenges of complex architectural scenes and architectural styles that are difficult to describe in the modeling of ancient architectures. Later, the literature proposed a modeling method for ancient architecture based on terminology and knowledge base rules. The literature [11] used semantic network technology to design an ancient architecture knowledge base containing ontology database and rule database. On this basis, this study combined with the rule inference system-Jess to achieve the entire process of ancient architecture simulation sequence animation simulation. The literature [12] introduced the theory, construction method, process and tools of the ontology of ancient architecture in detail one by one, and used the ontology editing tools and OWLFull language to construct the ontology of the Forbidden City. When applied to retrieval by this ontology, the retrieval recall rate and precision rate are higher than the traditional retrieval, which verifies the effectiveness of the ontology construction in retrieval. The literature [13] proposed a method of constructing the ontology of ancient architecture protection based on the concept lattice. This formal analysis method was used to express the hierarchical relationship between concepts in the ontology. Moreover, this literature verified the validity of the description of the relationship between concepts with a simple experiment. The literature [14] analyzed the structure of the ancient architecture protection ontology and constructed an ancient architecture protection knowledge management system framework including the base layer, resource layer, logical reasoning layer, business logic layer, presentation logic layer and user interface layer. Moreover, this literature analyzed the application of the framework in the field of ontology knowledge retrieval in ancient architecture and the dynamic reproduction of ancient architecture construction processes. Literature [15] pointed out that in terms of the dynamic reproduction of the ancient architecture construction process: According to the construction criterion that each part of the ancient architecture has a relatively fixed proportional relationship, the construction process of ancient architectures can be dynamically reproduced in the form of animation through the extraction of description information of ancient architecture structures, the derivation of architecture types and required components and numbers, the inference of component construction order, the calculation of the size and space position of each component, etc. The literature [16] used a combination of three-dimensional laser scanner, multiple photos and manual modeling to construct a database of ancient Chinese architecture components. Moreover, the literature further used a model retrieval method based on semantics and sketches to retrieve the three-dimensional model in the library and completes rapid scene construction on the virtual simulation platform VRStudio, and finally displayed the reconstructed scene in the Unity3D engine.
Convolutional neural network training method
The forward propagation process of the convolutional neural network mainly includes: the input layer propagates to the convolution layer, the convolution layer propagates to the convolution layer, the convolution layer propagates to the pooling layer, and the convolution layer propagates to the fully connected layer [17].
(1) The input layer propagates forward to the convolutional layer
The input layer is mainly responsible for the processing of image data. Generally, the types of images processed by convolutional neural networks are mainly black and white images, grayscale images and color images. The image is equivalent to a data matrix in the input layer and can be divided into a single matrix and a multi-matrix according to the type of the image, and the corresponding convolution kernel weight W is also a matrix of the same type. When the convolution operation is performed, the input image data matrix and the convolution kernel perform matrix operation, and the result of the operation is transferred to the next layer of convolution. Therefore, after multiple convolution operations, the feature dimensions of the image will gradually increase. However, no matter how high the dimension is, the process of input forward propagation can be expressed as [18]:
Among them, a represents the output result of the layer, the current layer number is represented by the superscript, the multiplication sign is the convolution operator, the offset is represented by b, and f is the activation function, which is generally the ReLU activation function.
(2) The convolutional layer propagates forward to convolutional layer
The propagation of the convolutional layer and the convolutional layer is a kind of equivalent operation propagation. The matrix data output by the convolutional layer of the previous layer must be consistent with the convolutional layer of the next layer. At this time, the expression is very similar to the input layer, namely:
It can also be written in the form of adding the corresponding positions after convolution of M sub-matrices, namely:
In the formula, k is the number of convolution kernels [19].
(3) The convolutional layer propagates forward to the pooling layer
The biggest function of the pooling layer is to reduce the number of parameters of the output feature matrix and reduce the operation cost. If we assume that the matrix of the convolution output is N × M-dimensional and the pooling kernel is k × k, then the pooled output is (N × M)/k2-dimensional. There are two modes of pooling design: one is maximum pooling, and the other is average pooling [20].
(4) The convolutional layer propagates forward to fully connected layer
The fully connected layer, as the name implies, is that all neurons in the current layer are connected to the neurons of the convolutional layer output previously. Its biggest function is to integrate the output of the previous convolution pooling structure to form information with a distinguishing effect. Therefore, the forward propagation algorithm logic of the fully connected layer can be expressed by the following formula [21]:
The activation function is generally sigmoid or tanh. After the fully connected layer is the operation of outputting results, generally, the Softmax function is added to the fully connected layer to achieve classification.
The back-propagation algorithm is based on the gradient descent method and is a multi-layer neuron network training algorithm guided by the value of the loss function. The input and output of the convolutional neural network is a high-dimensional mapping relationship. It is a continuous mapping of the Euclidean space of the input variable to the finite field in the Euclidean space of the output variable. This mapping is highly nonlinear. In deep neural networks, we assume that there are m training samples { (x1, y1) , (x2, y2) , ⋯ , (x
m
, y
m
) }. Among them, x is the input vector and the feature dimension is n, and y is the output vector and the feature dimension is n. The output matrix δ
l
of the output layer l can be expressed as [22]:
In the formula, ∂J (·) is expressed as the loss function measured by the mean square error, and ⊙ represents the Hadamard product. For two vectors A (a1, a2, a3, ⋯ , a
n
)
T
and B (b1, b2, b3, ⋯ , b
n
)
T
with the same dimension, A ⊙ B (a1b1, a2b2, ⋯ , a
n
b
n
)
T
. By using mathematical induction, the value of δl+1 is used to find the δ
l
of the l-th layer, and the expression is [23]:
After getting the expression of δ
l
, the gradient expression of W and b is derived:
After obtaining the gradient expression of W and b, we can use the gradient descent method to optimize W and b, and find all the final values of W and b.
Compared with deep neural networks, convolutional neural networks mainly solve the following four problems [24]: It solves the derivation of the pooling layer that lacks the activation function; Backward derivation of the δl-1 of the compressed input pooling layer during forward propagation; It inversely derives the δl-1 of the convolutional layer in the forward propagation through δ
l
; It derives W, b of all convolution kernels of this layer from c;
To solve the above four problems one by one, the problem (1) can make the activation function of the pooling layer f (z) = z, that is, it is itself after activation, so that the derivative of the activation function of the pooling layer is 1. Problem (2). In the forward propagation algorithm, the pooling layer generally uses maximum pooling or average pooling, and the size of the pooled area is known. When backpropagating, all data matrices of δ l will be restored to the dimensions before pooling. After that, different processing methods are selected according to the type of pooling, and the values after the pooling operations of the sub-matrix are placed in different positions [25].
For the value of
Problem (3): in the deep neural network, we can know the relationship between δl-1 and δ
l
:
Therefore, to derive δl-1 and δ
l
, we need to calculate the gradient expression of
Therefore, we can derive the following formula:
In the formula, rot180 means that the matrix flips up and down once, and then flips left and right once.
Problem (4). The relationship between the convolutional layers z and W, b is: z
l
= al-1 × W
l
+ b
l
, so the following formula can be derived:
Then for the l-th layer, the derivative of a convolution kernel matrix W can be expressed as follows [26–28]:
If we assume that the input a is a matrix of 4 × 4, the convolution kernel W is a matrix of 3 × 3, and the output z is a matrix of 2 × 2, then the gradient error t of the back-propagated z is also a matrix of 2 × 2. Then, we can derive the following formula:
The above formula is organized into a matrix expression as:
In the back propagation of the previous section, we calculated the weight W of each layer and the partial derivative of the bias b. After that, the last step is to update the weights and offsets. According to the previous derivation, the update of the weight W and offset b is expressed as the following formula:
In the formula, λ is the iteration coefficient. Considering the decay of iteration when updating, the iteration coefficient is usually set to a variable with a decreasing trend according to the number of trainings.
There are several reasons for using varying iteration coefficients:
(1) The iteration coefficient with decreasing trend can adjust the parameters in the network greatly in the early stage. The overall update speed is fast, and the step size is large. Another advantage is that it can avoid local traps and escape from the local minimum.
(2) If the model uses a fixed iteration coefficient, the network update will fall into an infinite loop in the later stage of training, and the accuracy rate will hardly change. Therefore, the dynamic iteration coefficient can make the network more flexible and the training strategy more advantageous.
In the convolutional neural network, the parameters of the convolutional layer and the fully connected layer need to be updated, including the update of the weight W and the bias b in each layer. In the convolutional neural network, the weights, offsets, and gradients are all stored linearly, so the data used in the entire update process can be regarded as an operation on a one-dimensional array, and it is not necessary to pay attention to the matrix dimension of the weight W. The topological structure of the three-layer neural network is used as an example for introduction. The specific structural diagram is shown in Fig. 1.

Topological structure of a three-layer neural network.
If it is assumed that the transfer function of the hidden layer is f1 (·) and the transfer function of the output layer is f2 (·), then the output of the hidden layer node is:
The output of the output layer node is:
The error of the vth sample is:
The weights of the output layer and the newly adopted cumulative error BP algorithm adjust W
jk
to minimize the global error E, namely:
In the formula, η is the iteration coefficient. Using the chain derivation rule, the following formula can be obtained:
Similarly, the update of hidden layer weights can be derived from the following formula:
Thus, the weight update formula of each neuron in the hidden layer is:
The system uses 3dmax to model ancient architectures, then export the model and save it as a file. Then, the system uses a program to parse the model file, import the model data into the computer memory, and then use OpenGL to draw according to the model data, you can get the three-dimensional geometry described by the model. An important application of OpenGL is to be able to read external 3D model files, such as OBJ, MD2, MD3, 3DS, etc. 3ds is a public format with good support. In addition, 3ds includes complete normal vectors, tbn, vert, st. and so on. It also includes commonly used information such as lighting, animation, roaming, virtual geometry and so on.
First, the structure of the architecture is analyzed, and the data is sampled. After that, the data is used to establish the model initially with 3DSMax as the platform, then the system application framework is established, the original model is imported, and then the model is optimized through mapping, and finally the roaming control is implemented. The specific implementation process is shown in Fig. 3.

System architecture diagram.

System implementation flow chart.
Almost all geometry types can be collapsed into editable polygon meshes, curves can also be collapsed, and closed curves can be collapsed into surfaces. In this way, the raw polygonal surface for polygon modeling is obtained. If the user does not want to use the collapse operation (because the modification history of the collapsed object is gone), he can specify an EditPoly modification.
The three-dimensional virtual scene is a key component of computer graphics, virtual reality and other fields, and is the reconstruction of the real three-dimensional scene through computer simulation. Virtual reality technology makes the protection and restoration of ancient architectures more scientific and efficient. In a three-dimensional scene, the observer can observe the three-dimensional entities in the scene from different angles by roaming in all directions to obtain richer information. Moreover, scene simulation has high application value for architectural planning and design, cultural relics protection and repair. With the popularization and deepening of virtual reality (VR) and augmented reality (AR) technologies, the application of game engines in the simulation of ancient construction scenes has also matured and evolved into a new means of expression. The construction animation is used to show the construction scheme, construction technology and construction progress in the construction of the architecture. Moreover, the three-dimensional simulation technology can accurately present the internal components of the architecture and can also be used to produce simulation animations that reflect the construction process of ancient architectures and simulate the entire construction process with dynamic effects. Work steps and objectives: (1) The software tools used to make 3D models, texture maps, scene animations and post-processing, high-performance hardware equipment that can undertake heavy load rendering and post-processing tasks are prepared in advance. (2) Three-dimensional model productionA three-dimensional model of building components of individual buildings of ancient buildings in a three-dimensional environment in real size.
Physics simulation and physics engine: The physics engine can be defined as a program that calculates the motion of objects, changes in scenes, the interaction between objects and two objects, and the effects of dynamic characteristics in a virtual scene. The calculation process of the physics engine is to perform physical calculations on each frame of the rendered scene, and then perform state and force analysis on the simulated objects with physical mechanical properties and perform collision detection. The mutual constraint information between moving objects is referenced, and the new velocity and displacement of each object are calculated according to Newtonian mechanics, thereby updating the orientation of the entity and obtaining a new virtual field. The PhysX engine has the ability to perform accurate collision detection and simulate the physical interaction between objects in the scene. The Unreal 4 engine uses its own integrated PhysX3.3 physics engine to drive physics simulation calculations and perform all collision calculations in the scene. The objects involved in the simulation in physical simulation are physical entities (Physics Bodies). The construction of the three-dimensional model may be very complicated. However, in real-time 3D rendering, it is usually necessary to use an approximate shape to drive the physical simulation. These simplified three-dimensional models participating in physical simulation are physical entities, which usually include boxes, spheres, capsules and convex hulls. In the Unreal 4 engine, we can set a series of properties of physical entities (gravity), and we can also set constraints on physical entities to limit their range and manner of movement: such as locking the movement or rotation of an entity in a certain axis direction, or restricting the range of motion of a physical entity to a two-dimensional plane. The connection methods between physical entities are divided into three types: hinge (Hinge), prism (Prismatic) and ball and socket (Ball and Socket). The hinge only allows physical entities to move in the same plane, and the prism only allows linear sliding motion.
Physical simulation requirements of ancient architecture scenes: Many details of existing research on stone architecture methods, construction methods and technological processes of ancient architectures have not been systematically clarified. Moreover, part of the restoration work was carried out using modern construction methods, and the technological process at the time of the ancient architecture’s initial construction has been unable to be verified. By introducing physical simulation technology to simulate the real physical properties of each architecture component (gravity, collision, friction, movement, angular velocity, linear velocity and other physical parameters), different construction schemes can be compared to verify their rationality. The combination of the physics engine and the graphics engine can retain the graphics engine’s better rendering capabilities and the physics engine’s accurate computing capabilities and is a key technology for constructing virtual scenes with physical attributes. Physical simulation combined with 3D simulation technology can realize the reproduction and simulation verification of ancient architecture structures. In order to achieve this goal, we need to reasonably build a model of architecture components and give the physical parameters of real stone.
After the model is built and imported into the engine, the three-dimensional objects with different attributes should be given corresponding materials and textures, and the objects in the final scene rendering should have realistic visual effects as much as possible. There are four types of light sources in the engine: directional light (Directional), point light (Point), spot light (Spot) and sky light (Sky). The directional light source is mainly used as a basic outdoor light source and needs to present a light source that emits light from near infinity. The point light source is a light source like a traditional “bulb” that emits light from a single point in all directions. The spotlight also emits light from a single point, but its light is limited by a set of cones. Skylight takes the background of the scene and uses it for the lighting effects of the scene mesh. As shown in Fig. 4.

Materials assigned to individual architectures.
In the ConstructionScript visual programming script of the engine, different StaticMesh type arrays are used to store the architecture components of each single architecture, and then the composition of the entire architecture scene is expressed through the loop and branch structure to obtain the final simulation scene. Figure 5 shows one of the cases.

Scene effects of architectural groups.
The system can perform rotation when the radian is taken as unit. When looking towards the origin along the axis of rotation, the angle is measured clockwise. Since rotation and translation are defined in the same form, they can be compounded to model complex motion relationships.. Inversion is also easier. The matrix saves a certain amount of calculation, as shown in Fig. 6. Figure 6(a)–(d) are the simulation images of the front of the architecture, rotated 45 degrees, rotated 120 degrees, and the back.

Example of architecture rotation model.
Through the above analysis, we can see that this research system can realize the digitalization of ancient architecture decoration art through 3D simulation. In order to verify the degree of reduction of the ancient architectures in this study, the degree of reduction of this paper was scored by expert evaluation. The three architectures of temples, houses and palaces were taken as examples. The reduction degree of 80% means that the reduction degree is high. The experiment was conducted through 60 sets of data. The results of the study are shown in Table 1 below.
Statistical table of the accuracy of system digitization
From the results shown in Fig. 7 and Table 1, it can be seen that the simulation accuracy of this research system after the data processing of ancient architectures is high, both exceeding 80%, so it meets the system requirements. Based on the above analysis, the reaction time of the system simulation digitization is analyzed. The results are shown in Table 2 and Fig. 8.

Statistical diagram of the accuracy of system digitization.
Statistical table of the response time of system digitization

Statistical diagram of the response time of system digitization.
As shown in Fig. 8, when the system proposed in this study performs data simulation of ancient architectures, the response time is all distributed between 100ms-200 ms, and the response time is relatively fast, which meets the actual needs.
By analyzing the research status and development trends of various ancient architecture scene simulation key technologies, this article graphically expresses the static construction methods and dynamic construction processes of architecture groups. Based on this, three-dimensional model reconstruction and scene simulation experiments of architecture groups are realized. Three-dimensional simulation and physical simulation methods are effective technical support in ancient architecture scene simulation. In the simulation part of the construction process, the physical simulation method based on the physics engine can verify the details of the construction process, but it is limited to the actual construction situation and the difficulty of obtaining data. In addition, this study verifies the effect of this study by simulating some architectures. The result of the study shows that the digitalization effect of the ancient architecture decoration art proposed in this paper is good. This article only made a preliminary discussion on the feasibility of architecture group physical simulation and did not give a rigorous theoretical derivation and experimental analysis. Therefore, the application of this technology in the simulation of ancient architecture scenes needs further study.
Footnotes
Acknowledgment
Hunan philosophy and Social Science Foundation (general project), Title: Research on the protection and inheritance of traditional ancestral hall decoration art in Western Hunan (No: 19YBA274).
