Digital twin three-dimensional city modeling and analysis method based on deep learning
Patent Information
- Application Number
- CN202510761528.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-19
AI Technical Summary
Existing 3D urban modeling methods have defects in texture generation and semantic modeling, making them difficult to adapt to modeling needs in complex environments and lacking an expression mechanism for the hierarchical structure, functional attributes and dynamic state of spatial components.
A deep learning-based digital twin 3D city modeling method is adopted, which integrates the neural radiation field modeling network and the four-element capsule structure expression mechanism. The 3D radiation field is generated through multi-view images, the intermediate semantic features are extracted and the structural capsule map is constructed, and the modeling and analysis are carried out in combination with the city operation status data.
It achieves high-precision three-dimensional city model generation, enhances the semantic modeling capabilities of urban components, realizes a unified closed loop of modeling and analysis, has strong scalability and adaptability, and is suitable for large-scale urban scene reconstruction and operation analysis tasks driven by multi-source heterogeneous data.
Smart Images

Figure CN120671520A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of digital twin and three-dimensional modeling technology, and in particular to a digital twin three-dimensional city modeling and analysis method based on deep learning. Background Art
[0002] Amid the rapid development of smart cities, urban modeling and operational analysis technologies have become core support for urban management, emergency response, and resource scheduling. Digital twin cities construct three-dimensional virtual models that correspond to the real city, enabling unified representation and dynamic simulation of spatial structure, operational status, and semantic relationships. Therefore, efficiently, accurately, and semantically richly constructing three-dimensional city models and performing structured analysis of various urban components within the models have become crucial technical foundations for digital twin city development.
[0003] Existing 3D urban modeling methods primarily include rule-based modeling, point cloud-based geometric reconstruction, and image-based multi-view reconstruction. Rule-based modeling relies on predefined component templates, resulting in limited model expressiveness. Point cloud reconstruction can capture high-precision geometric structures, but suffers from limitations in texture generation and semantic modeling, and places high demands on equipment. Image reconstruction methods utilize multi-view imagery to restore urban structures, but these traditional methods rely on geometric optimization and manual feature extraction, making them difficult to adapt to modeling requirements in complex environments.
[0004] In recent years, neural implicit modeling methods such as Neural Radiance Field (NeRF) have begun to be applied to 3D reconstruction tasks. These methods use deep neural networks to learn the mapping relationship between spatial locations and viewing directions, directly predicting volume density and color values, and achieving high-quality modeling in continuous space. However, NeRF models lack native semantic parsing capabilities and lack a mechanism to express the hierarchical structure, functional attributes, and dynamic state of spatial components. Therefore, they cannot meet the requirements for full-factor modeling and dynamic perception of cities in digital twins.
[0005] At the same time, current research focuses on improving reconstruction accuracy and image fidelity, lacking a mechanism for semantic analysis and operational status identification of various urban components in the model. It has failed to establish a technical closed loop driven by modeling, resulting in a disconnect between the perception layer and the decision-making layer of three-dimensional urban models. Existing methods fail to effectively integrate geometric modeling and intelligent analysis in aspects such as state identification, traffic clustering, and energy consumption classification, limiting the depth of application of three-dimensional models in urban operation monitoring and intelligent scheduling.
[0006] Therefore, how to provide a digital twin three-dimensional city modeling and analysis method based on deep learning is an urgent problem that technicians in this field need to solve. Summary of the Invention
[0007] One objective of the present invention is to propose a deep learning-based method for modeling and analyzing digital twin 3D cities. This method integrates a neural radiation field modeling network with a four-element capsule structure representation mechanism. It generates a 3D radiation field using multi-view images, extracts intermediate semantic features, and constructs a structural capsule map. This method, combined with spatial location and operational status data, enables state recognition, traffic clustering, and energy consumption classification analysis. This method leverages neural rendering, capsule modeling, and map binding technologies, offering strong structural representation capabilities, high semantic modeling granularity, and a closed-loop analysis process.
[0008] A deep learning-based digital twin 3D city modeling and analysis method according to an embodiment of the present invention includes the following steps:
[0009] S1. Collect multi-view image data, extract camera intrinsic and extrinsic parameters, calculate the posture transformation matrix, and establish a three-dimensional city coordinate system;
[0010] S2. Construct a volume modeling network based on the NeRF method, receive coordinate points and observation directions in the 3D city coordinate system, predict the color value and volume density value of each coordinate point, and generate a 3D radiation field;
[0011] S3. Extract the intermediate layer semantic features in the volume modeling network, establish a mapping relationship from coordinate points to semantic features, and generate a spatial feature field;
[0012] S4, dividing the spatial feature field into local regions, extracting feature points in each region to form local feature blocks;
[0013] S5, inputting the local feature block into the quaternary capsule encoding network to generate a quaternary capsule unit containing an existence vector, a posture vector, a state vector, and an attribute vector;
[0014] S6. Based on the joint similarity of posture vector, state vector and attribute vector, a dynamic routing mechanism is constructed to aggregate four-element capsule units and generate structured capsule units.
[0015] S7. Construct a structural capsule map using the structural capsule units, and bind the collected urban operation status data to the structural capsule units in the structural capsule map;
[0016] S8, combining the three-dimensional radiation field and the structure capsule atlas to perform image rendering and generate a three-dimensional city model;
[0017] S9. Perform state recognition, traffic clustering and energy consumption classification analysis on the three-dimensional city model.
[0018] Optionally, the existence vector represents the appearance probability of the spatial component, the posture vector represents the three-dimensional position, direction and scale of the spatial component, the state vector represents the urban operation state parameters associated with the spatial component, and the attribute vector represents the functional category or semantic identification of the spatial component.
[0019] Optionally, the city operation status data is acquired in real time by environmental monitoring devices, traffic sensing equipment and energy consumption collection terminals deployed in urban areas, including crowd density, ambient temperature, traffic speed and energy consumption indicators.
[0020] Optionally, the three-dimensional city model includes spatial structure, state information and semantic attributes.
[0021] Optionally, the S2 specifically includes:
[0022] S21. Setting a spatial position point and an observation direction in a three-dimensional city coordinate system, where the spatial position point is composed of a horizontal coordinate, a longitudinal coordinate, and a vertical coordinate, and the observation direction is composed of three unit vector components;
[0023] S22. Perform multi-scale sine and cosine encoding processing on each coordinate component:
[0024] γ(p)=[sin(2 0 πp),cos(2 0 πp),…,sin(2 L-1 πp),cos(2 L-1 πp)];
[0025] Where γ(p) represents the output of the encoding function, p represents the single coordinate component of the input, π represents the pi constant, and L represents the number of encoding frequency layers;
[0026] S23, performing a position encoding function on the horizontal coordinate, the longitudinal coordinate, and the vertical coordinate to generate three encoding vectors, concatenating the three encoding vectors into a unified input, and inputting the unified input into the volume modeling network;
[0027] S24. Outputting a volume density value and an intermediate semantic feature vector of the spatial location point through the volume modeling network. The volume density value is used to represent the degree of occlusion of the spatial region, and the intermediate semantic feature vector is used as an input basis for color prediction.
[0028] S25, input the three components of the viewing direction into the position encoding function to generate a direction encoding vector, and concatenate it with the intermediate semantic feature vector as the input of the color prediction network;
[0029] S26, outputting a color value through a color prediction network, where the color value consists of three channels: red, green, and blue;
[0030] S27, combining the volume modeling network and the color prediction network to form a joint modeling structure, the input is the spatial position point and the observation direction, and the output is the volume density value and the color value;
[0031] S28. Input a set of spatial position points and observation directions into a joint modeling structure, obtain volume density values and color values within a continuous spatial region, and generate a three-dimensional radiation field;
[0032] S29. Establish rays along the observation direction, sample spatial position points for each ray, perform volume rendering integration based on the volume density value and color value of each position point, output the color intensity value of the image pixel, and complete the generation of the three-dimensional radiation field.
[0033] Optionally, the S3 specifically includes:
[0034] S31. Setting the middle layer in the volume modeling network structure as a semantic feature extraction channel, extracting the middle activation tensor corresponding to each spatial position point as a semantic vector;
[0035] S32. Construct a mapping function from a 3D city coordinate point to a semantic vector, assuming the horizontal coordinate is x, the vertical coordinate is y, and the vertical coordinate is z:
[0036]
[0037] Among them, Φ(x,y,z) represents the fusion semantic vector, λ i (x, y, z) represents the weight function value of the i-th channel, f i (x, y, z) represents the feature vector output by the i-th channel, M represents the total number of channels, and x, y, z represent the three-directional position coordinates in the city coordinate system;
[0038] S33. Perform nonlinear transformation on the mapping function result to construct a high-dimensional semantic vector function:
[0039] S(x,y,z)=ReLU(W2·tanh(W1·Φ(x,y,z)+b1)+b2);
[0040] Among them, S(x,y,z) represents the fused semantic features, W1,W2 represent the linear transformation matrix, b1,b2 represent the bias vector, tanh represents the hyperbolic tangent function, and ReLU represents the linear rectification function;
[0041] S34, let the query point position be (q x ,q y ,q z ), select K local neighborhood positions from the semantic feature function and define a distance-weighted semantic query function:
[0042]
[0043] Among them, s represents the query point semantic response, (x k ,y k ,z k ) represents the coordinates of the kth neighborhood point, d k represents the Euclidean distance between the query point and the kth point, β represents the smoothing coefficient, S(x k ,y k ,z k ) indicates that the position coordinate is (x k ,y k ,z k )’s spatial point corresponding to the semantic feature vector;
[0044] S35. Constructing a mapping set of all spatial coordinate points and corresponding semantic responses;
[0045] S36. Use a sparse tensor structure to organize all mapping results and establish a three-dimensional position indexing mechanism;
[0046] S37. Form a spatial feature field with three-dimensional city coordinates as input and high-dimensional semantic vectors as output.
[0047] Optionally, the S5 specifically includes:
[0048] S51, constructing an input structure of a local feature block, combining the spatial position point in each local area in the spatial feature field with the corresponding semantic feature vector to form an input tensor as the input of the four-element capsule encoding network;
[0049] S52. Input the semantic feature vector into the embedding network, perform multi-layer affine transformation, activation function and normalization processing, and obtain an embedding representation of uniform dimension:
[0050] u j =LN(W3·GELU(W2·ReLU(W1·v j +b1)+b2)+b3);
[0051] Among them, u j represents the jth embedding vector, v j represents the jth semantic feature vector, W1, W2, W3 represent affine mapping matrices, b1, b2, b3 represent bias vectors, ReLU represents linear rectification function, GELU represents Gaussian error linear unit function, and LN represents layer normalization function;
[0052] S53. Input the embedding vector into the four-way encoding module to generate the existence vector, posture vector, state vector and attribute vector, and construct the four-element capsule unit:
[0053] c j=[σ(e j ),R j ·p j +t j ,BN(W s ·s j ),tanh(W a ·a j +b a )];
[0054] Among them, c j represents the j-th quaternary capsule unit, e j represents the existence vector, σ represents the Sigmoid function, p j represents the posture vector, R j represents the rotation matrix, t j represents the translation vector, s j represents the state vector, W s Represents the state mapping matrix, BN represents the batch normalization function, a j represents the attribute vector, W a represents the attribute mapping matrix, b a represents the attribute bias vector;
[0055] S54. Organize all quaternion capsule units into a tensor with consistent structure, forming a third-order tensor with dimension (N, 4, D), where N is the number of units, 4 is the vector type, and D is the single-class vector dimension;
[0056] S55. performing normalization on the existence vector to limit the value to be between zero and one;
[0057] S56, introducing an affine structural transformation consisting of a rotation matrix and a translation vector into the posture vector;
[0058] S57, apply linear mapping to the state vector and attribute vector to unify them into the standard semantic space;
[0059] S58. Combine the location point coordinates in the three-dimensional city coordinate system, generate a location code, and fuse it into the four-element capsule tensor to complete the four-element capsule unit construction process.
[0060] Optionally, the S6 specifically includes:
[0061] S61. Setting an input structure of a dynamic routing mechanism, taking a quaternion capsule tensor as input, wherein the dimensions of the tensor are the number of paths, the number of vector types, and the dimension of a single-class vector, wherein the vector types include a posture vector, a state vector, and an attribute vector;
[0062] S62. Initialize the number of output structure capsule units, and construct an affine transformation matrix and bias vector for each set of input paths and output paths. Perform concatenation, linear mapping, and normalization on the three types of input vectors to generate a prediction representation:
[0063]
[0064] in, Represents the prediction vector of the four-element capsule unit with path index i to the structure capsule unit with path index j, p i Represents the posture vector with path index i, s i represents the state vector of path index i, a i represents the attribute vector with path index i, [·||·] represents the vector concatenation operation, represents the affine mapping matrix from path i to path j, represents the affine bias vector of the path pair (i, j), and LN represents the layer normalization function;
[0065] S63. Set the query vector of each output structure capsule unit to q j , the weighted aggregation vector is calculated based on the scaled dot product attention mechanism:
[0066]
[0067] Among them, z j represents the aggregate representation vector of the structure capsule unit with path index j, represents the prediction vector with path index i, q j represents the structure capsule query vector with path index j, represents the transposed form of the prediction vector, represents the inner product operation, and exp represents the exponential function. represents the scaling factor, D ′ represents the dimension of the embedding space, N represents the total number of input paths, and ∑ represents aggregation by all input paths;
[0068] S64. Input the aggregated vector into the nonlinear compression function to generate the output vector of the structure capsule unit:
[0069]
[0070] Among them, v j Represents the final output vector of the structure capsule unit with path index j, z j represents the aggregation vector, represents the square norm of the aggregate vector, ||z j ||2 represents the two-norm of the aggregate vector, and ∈ represents a positive constant to prevent division by zero;
[0071] S65: Output the structure capsule unit to complete the aggregation process of the dynamic routing mechanism.
[0072] Optionally, the S7 specifically includes:
[0073] S71. Set the initialization structure of the structure capsule atlas, use all the structure capsule units that have been output as atlas nodes, and extract the spatial coordinates, posture vector, state vector, and attribute vector corresponding to each structure capsule unit;
[0074] S72. Construct the graph connection relationship between the structure capsule nodes and define the graph edge weight based on the semantic similarity between the node attribute vectors and the Euclidean distance between the spatial coordinates:
[0075]
[0076] Among them, w mn Indicates that the structure capsule unit index is the edge weight between m and n, a m ,a n represents the attribute vector indexed by m and n, x m ,x n represents the three-dimensional city coordinate point, λ1,λ2 represent the weight adjustment coefficient, γ represents the distance attenuation coefficient, and ||·||2 represents the two-norm;
[0077] S73. Generate a structure capsule graph based on the construction results, where the graph nodes are structure capsule units, the edges are connection relationships, the node attributes include posture vectors, state vectors, and attribute vectors, and the spatial coordinates are used for geographic positioning;
[0078] S74. Collect city operation status data and map the city operation status data to regions according to geographic coordinates:
[0079]
[0080] Among them, α tj Represents the normalized binding weight of the state sampling point index t mapped to the structure capsule index j, x t Indicates the coordinates of the sampling point, x j represents the structural capsule unit coordinates, δ represents the binding attenuation coefficient, ∑ k represents the sum of all structure capsule indices;
[0081] S75. Assign the city operation status value to the state vector channel of the corresponding structure capsule unit according to the normalized weight, completing the injection and binding of the node status information in the structure capsule graph.
[0082] Optionally, the S9 specifically includes:
[0083] S91. Construct a structural capsule indexing system, establish a correspondence between each structural capsule unit in the three-dimensional city model according to the spatial coordinates, extract the state vector, attribute vector and three-dimensional coordinates of the structural capsule unit, and form an analysis input set;
[0084] S92, perform state recognition processing, set the state vector to s i , input the nested perception structure to generate the embedded representation and calculate the classification probability:
[0085] y i =Softmax(W3·GELU(W2·ReLU(W1·s i +b1)+b2)+b3);
[0086] Among them, y i Represents the state classification probability vector of the structure capsule unit index i, s i Represents the state vector, W1, W2, W3 represent the affine transformation matrix of the state recognition network, b1, b2, b3 represent the bias vector, ReLU represents the linear rectification function, GELU represents the Gaussian error linear unit function, and Softmax represents the multi-classification normalization function;
[0087] S93, construct the state and space joint similarity graph, let the state vector be s i , the coordinate vector is x i , use the weighted kernel function to calculate the similarity matrix:
[0088]
[0089] Among them, K ij Indicates the joint similarity between the structure capsule unit index i and j, s i ,s j represents the state vector, x i ,x j represents the three-dimensional coordinate vector, σ represents the scale factor of the state vector space, ρ represents the scale factor of the spatial coordinate, α, β represent the channel weighting coefficients, and ||·||2 represents the two-norm;
[0090] S94. Construct a traffic graph structure based on the similarity matrix, generate a graph Laplacian matrix, perform an eigenvector decomposition operation, and use a clustering algorithm to divide the traffic labels of the structure capsule units;
[0091] S95, performing energy consumption classification processing, concatenating the state vector and the attribute vector as input, building a multi-category classification model, and outputting an energy consumption label;
[0092] S96. Bind the state classification results, traffic cluster labels, and energy consumption labels to the structural capsule units, map them to corresponding coordinate positions in the three-dimensional city model, and complete the city operation state analysis.
[0093] The beneficial effects of the present invention are:
[0094] This invention introduces a volume modeling network based on neural radiation fields and a four-element capsule network structure to construct a complete processing flow from image perception to three-dimensional modeling, and from semantic expression to state analysis. In the modeling stage, multi-scale position encoding and neural volume rendering mechanisms are used to generate a continuous three-dimensional radiation field, effectively improving the continuity and accuracy of the urban model in terms of structural expression and texture reconstruction. In the structural construction stage, four-element capsule units are used to model local feature blocks, and four types of vectors, namely existence, posture, state, and attributes, are introduced to enhance the ability to characterize the semantics and state of urban components. The aggregation of structural capsule units is achieved through a dynamic routing mechanism, and a structural capsule map is further constructed. The urban operation status data from the sensor equipment is bound to each structural capsule unit, realizing the semantic fusion of the urban model and real data. In the analysis stage, based on the state and attribute information carried in the map, deep analysis modules such as state recognition, traffic clustering, and energy consumption classification are designed to complete the multi-dimensional semantic analysis of the digital twin three-dimensional city model. Compared with existing three-dimensional modeling methods, this invention not only improves the modeling ability of the hierarchical structure and semantic attributes of urban components, but also realizes a unified closed loop of modeling and analysis through a structured data binding mechanism and deep learning analysis process. It has strong scalability and adaptability, and is suitable for large-scale urban scene reconstruction and operation analysis tasks driven by multi-source heterogeneous data. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0096] Figure 1 This is a flowchart of a deep learning-based digital twin 3D city modeling and analysis method proposed in the present invention;
[0097] Figure 2 The network structure diagram of NeRF-based volume modeling;
[0098] Figure 3 Schematic diagram of the construction process of the four-element capsule encoding network. DETAILED DESCRIPTION
[0099] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0100] refer to Figure 1-3 , a digital twin 3D city modeling and analysis method based on deep learning, including the following steps:
[0101] S1. Collect multi-view image data, extract camera intrinsic and extrinsic parameters, calculate the posture transformation matrix, and establish a three-dimensional city coordinate system;
[0102] S2. Construct a volume modeling network based on the NeRF method, receive coordinate points and observation directions in the 3D city coordinate system, predict the color value and volume density value of each coordinate point, and generate a 3D radiation field;
[0103] S3. Extract the intermediate layer semantic features in the volume modeling network, establish a mapping relationship from coordinate points to semantic features, and generate a spatial feature field;
[0104] S4, dividing the spatial feature field into local regions, extracting feature points in each region to form local feature blocks;
[0105] S5, inputting the local feature block into the quaternary capsule encoding network to generate a quaternary capsule unit containing an existence vector, a posture vector, a state vector, and an attribute vector;
[0106] S6. Based on the joint similarity of posture vector, state vector and attribute vector, a dynamic routing mechanism is constructed to aggregate four-element capsule units and generate structured capsule units.
[0107] S7. Construct a structural capsule map using the structural capsule units, and bind the collected urban operation status data to the structural capsule units in the structural capsule map;
[0108] S8, combining the three-dimensional radiation field and the structure capsule atlas to perform image rendering and generate a three-dimensional city model;
[0109] S9. Perform state recognition, traffic clustering and energy consumption classification analysis on the three-dimensional city model.
[0110] The present invention provides a digital twin three-dimensional city modeling and analysis method based on deep learning, which constructs an integrated process from multi-view image perception to three-dimensional model generation and operation status analysis. A three-dimensional radiation field is generated by the NeRF volume modeling network, and semantic features are extracted in the middle layer to construct a spatial feature field. The local area is further divided, and feature points are extracted to generate local feature blocks. The four-element capsule coding network is used to construct existence, posture, state and attribute vectors to express the structure and semantics of urban components. Structural capsule units are generated through a dynamic routing mechanism, and a structural capsule atlas is constructed. The externally collected urban operation status data is bound to the atlas nodes to complete the integrated expression of the structural status. The atlas and radiation field are combined for image rendering to generate a three-dimensional city model containing semantic attributes and status information, and analysis tasks such as state recognition, traffic clustering and energy consumption classification are performed on the model. The present invention organically integrates neural modeling, semantic expression and state analysis to achieve a closed-loop fusion of modeling and analysis.
[0111] In this embodiment, the existence vector represents the appearance probability of the spatial component, the posture vector represents the three-dimensional position, direction and scale of the spatial component, the state vector represents the urban operation state parameters associated with the spatial component, and the attribute vector represents the functional category or semantic identification of the spatial component.
[0112] This paper introduces a four-element capsule unit consisting of an existence vector, an attitude vector, a state vector, and an attribute vector to achieve multidimensional feature modeling of three-dimensional urban components. The existence vector characterizes the component's probability of appearance in the scene, the attitude vector describes its spatial position, orientation, and scale, the state vector incorporates urban operational status data, and the attribute vector represents semantics and functional categories. This structure enhances the model's ability to express semantics and states while maintaining geometric accuracy, providing a unified data representation foundation for subsequent structural analysis and operational monitoring.
[0113] In this embodiment, the urban operation status data is acquired in real time by environmental monitoring devices, traffic sensing equipment and energy consumption collection terminals deployed in urban areas, including crowd density, ambient temperature, traffic speed and energy consumption indicators.
[0114] This invention integrates environmental monitoring devices, traffic sensing equipment, and energy consumption collection terminals to establish a real-time data collection mechanism for urban operation status. This mechanism captures dynamic multi-source information, including pedestrian density, ambient temperature, traffic speed, and energy consumption indicators. This data is bound to structural capsules during the modeling process, achieving a semantic fusion of physical components and operational status. This provides time-varying data support for the 3D city model, enhancing the model's expressive breadth and analytical depth.
[0115] In this embodiment, the three-dimensional city model includes spatial structure, state information and semantic attributes.
[0116] The 3D city model generated by this method simultaneously incorporates spatial structure, state information, and semantic attributes, achieving a unified representation from geometric modeling to semantic analysis and operational perception. The model not only accurately reproduces the spatial layout of urban components but also integrates the functional categories and real-time operational status of each component, providing a complete data foundation and visual framework for subsequent intelligent analysis, dynamic monitoring, and urban management.
[0117] In this embodiment, S2 specifically includes:
[0118] S21. Setting a spatial position point and an observation direction in a three-dimensional city coordinate system, where the spatial position point is composed of a horizontal coordinate, a longitudinal coordinate, and a vertical coordinate, and the observation direction is composed of three unit vector components;
[0119] S22. Perform multi-scale sine and cosine encoding processing on each coordinate component:
[0120] γ(p)=[sin(2 0 πp),cos(2 0 πp),…,sin(2 L-1 πp),cos(2 L-1 πp)];
[0121] Where γ(p) represents the output of the encoding function, p represents the single coordinate component of the input, π represents the pi constant, and L represents the number of encoding frequency layers;
[0122] S23, performing a position encoding function on the horizontal coordinate, the longitudinal coordinate, and the vertical coordinate to generate three encoding vectors, concatenating the three encoding vectors into a unified input, and inputting the unified input into the volume modeling network;
[0123] S24. Outputting a volume density value and an intermediate semantic feature vector of the spatial location point through the volume modeling network. The volume density value is used to represent the degree of occlusion of the spatial region, and the intermediate semantic feature vector is used as an input basis for color prediction.
[0124] S25, input the three components of the viewing direction into the position encoding function to generate a direction encoding vector, and concatenate it with the intermediate semantic feature vector as the input of the color prediction network;
[0125] S26, outputting a color value through a color prediction network, where the color value consists of three channels: red, green, and blue;
[0126] S27, combining the volume modeling network and the color prediction network to form a joint modeling structure, the input is the spatial position point and the observation direction, and the output is the volume density value and the color value;
[0127] S28. Input a set of spatial position points and observation directions into a joint modeling structure, obtain volume density values and color values within a continuous spatial region, and generate a three-dimensional radiation field;
[0128] S29. Establish rays along the observation direction, sample spatial position points for each ray, perform volume rendering integration based on the volume density value and color value of each position point, output the color intensity value of the image pixel, and complete the generation of the three-dimensional radiation field.
[0129] This invention enhances the model's ability to express spatial details and directional changes by setting spatial position points and viewing directions and performing multi-scale sine and cosine encoding on the coordinate and directional components. Combining a volume modeling network with a color prediction network to construct a joint modeling structure achieves a high-dimensional nonlinear mapping from three-dimensional coordinates and viewing directions to volume density and color values, thereby generating a continuously distributed three-dimensional radiation field. By performing volume rendering integration on rays, the volume density and color information are mapped to image pixel outputs, improving the model's ability to restore complex lighting, texture details, and geometric boundaries, providing a rendering foundation for subsequent high-fidelity urban modeling.
[0130] In this embodiment, S3 specifically includes:
[0131] S31. Setting the middle layer in the volume modeling network structure as a semantic feature extraction channel, extracting the middle activation tensor corresponding to each spatial position point as a semantic vector;
[0132] S32. Construct a mapping function from a 3D city coordinate point to a semantic vector, assuming the horizontal coordinate is x, the vertical coordinate is y, and the vertical coordinate is z:
[0133]
[0134] Among them, Φ(x,y,z) represents the fusion semantic vector, λ i (x, y, z) represents the weight function value of the i-th channel, f i (x, y, z) represents the feature vector output by the i-th channel, M represents the total number of channels, and x, y, z represent the three-directional position coordinates in the city coordinate system;
[0135] S33. Perform nonlinear transformation on the mapping function result to construct a high-dimensional semantic vector function:
[0136] S(x,y,z)=ReLU(W2·tanh(W1·Φ(x,y,z)+b1)+b2);
[0137] Among them, S(x,y,z) represents the fused semantic features, W1,W2 represent the linear transformation matrix, b1,b2 represent the bias vector, tanh represents the hyperbolic tangent function, and ReLU represents the linear rectification function;
[0138] S34, let the query point position be (q x ,q y ,q z ), select K local neighborhood positions from the semantic feature function and define a distance-weighted semantic query function:
[0139]
[0140] Among them, s represents the query point semantic response, (x k ,y k ,z k ) represents the coordinates of the kth neighborhood point, d k represents the Euclidean distance between the query point and the kth point, β represents the smoothing coefficient, S(x k ,y k ,z k ) indicates that the position coordinate is (x k ,y k ,z k )’s spatial point corresponding to the semantic feature vector;
[0141] S35. Constructing a mapping set of all spatial coordinate points and corresponding semantic responses;
[0142] S36. Use a sparse tensor structure to organize all mapping results and establish a three-dimensional position indexing mechanism;
[0143] S37. Form a spatial feature field with three-dimensional city coordinates as input and high-dimensional semantic vectors as output.
[0144] The present invention embeds a semantic feature channel in the volume modeling network, extracts the intermediate activation tensor as the semantic representation of each spatial position point, and realizes the spatial continuous modeling of semantic features by constructing a mapping function from three-dimensional coordinates to semantic vectors. The nonlinear transformation function is introduced to improve the dimension and expression ability of semantic representation, and the semantic response of any spatial point is obtained through a query mechanism based on position distance weighting. The sparse tensor structure is further used to organize the correspondence between coordinates and semantics, and a three-dimensional position indexing mechanism is established to form a spatial feature field with a high degree of fusion of spatial structure and semantic vectors. This structure improves the mapping ability of urban models between structure, semantics and coordinates, and provides a semantic basis for component identification and map generation.
[0145] In this embodiment, the S5 specifically includes:
[0146] S51, constructing an input structure of a local feature block, combining the spatial position point in each local area in the spatial feature field with the corresponding semantic feature vector to form an input tensor as the input of the four-element capsule encoding network;
[0147] S52. Input the semantic feature vector into the embedding network, perform multi-layer affine transformation, activation function and normalization processing, and obtain an embedding representation of uniform dimension:
[0148] u j =LN(W3·GELU(W2·ReLU(W1·v j +b1)+b2)+b3);
[0149] Among them, u j represents the jth embedding vector, v j represents the jth semantic feature vector, W1, W2, W3 represent affine mapping matrices, b1, b2, b3 represent bias vectors, ReLU represents linear rectification function, GELU represents Gaussian error linear unit function, and LN represents layer normalization function;
[0150] S53. Input the embedding vector into the four-way encoding module to generate the existence vector, posture vector, state vector and attribute vector, and construct the four-element capsule unit:
[0151] c j =[σ(e j ),R j ·p j +t j ,BN(W s ·s j ),tanh(W a ·a j +b a )];
[0152] Among them, c j represents the j-th quaternary capsule unit, e j represents the existence vector, σ represents the Sigmoid function, p j represents the posture vector, R j represents the rotation matrix, t j represents the translation vector, s j represents the state vector, W s Represents the state mapping matrix, BN represents the batch normalization function, a j represents the attribute vector, W a represents the attribute mapping matrix, b a represents the attribute bias vector;
[0153] S54. Organize all quaternion capsule units into a tensor with consistent structure, forming a third-order tensor with dimension (N, 4, D), where N is the number of units, 4 is the vector type, and D is the single-class vector dimension;
[0154] S55. performing normalization on the existence vector to limit the value to be between zero and one;
[0155] S56, introducing an affine structural transformation consisting of a rotation matrix and a translation vector into the posture vector;
[0156] S57, apply linear mapping to the state vector and attribute vector to unify them into the standard semantic space;
[0157] S58. Combine the location point coordinates in the three-dimensional city coordinate system, generate a location code, and fuse it into the four-element capsule tensor to complete the four-element capsule unit construction process.
[0158] The present invention extracts the semantic features of local areas in the spatial feature field, constructs a local feature block input tensor, and introduces a multi-layer embedding network to perform a unified dimensionality conversion on the semantic vector to enhance the feature alignment capability. Four types of vectors, namely existence, posture, state and attribute, are generated through a four-way encoding module to construct a four-element capsule unit with structural expression, state description and semantic distinction capabilities. In terms of capsule organization, a normalization and affine processing mechanism is designed to improve the numerical stability and semantic consistency of the four types of vectors, and position coding is generated in combination with three-dimensional city coordinates to integrate the spatial position information of the components. Finally, the four-element capsule structure is encapsulated in the form of a third-order tensor, providing a vector expression basis with consistent structure and clear semantics for subsequent graph construction and dynamic routing analysis.
[0159] In this embodiment, S6 specifically includes:
[0160] S61. Setting an input structure of a dynamic routing mechanism, taking a quaternion capsule tensor as input, wherein the dimensions of the tensor are the number of paths, the number of vector types, and the dimension of a single-class vector, wherein the vector types include a posture vector, a state vector, and an attribute vector;
[0161] S62. Initialize the number of output structure capsule units, and construct an affine transformation matrix and bias vector for each set of input paths and output paths. Perform concatenation, linear mapping, and normalization on the three types of input vectors to generate a prediction representation:
[0162]
[0163] in, Represents the prediction vector of the four-element capsule unit with path index i to the structure capsule unit with path index j, p i Represents the posture vector with path index i, s i represents the state vector of path index i, ai represents the attribute vector with path index i, [·||·] represents the vector concatenation operation, represents the affine mapping matrix from path i to path j, represents the affine bias vector of the path pair (i, j), and LN represents the layer normalization function;
[0164] S63. Set the query vector of each output structure capsule unit to q j , the weighted aggregation vector is calculated based on the scaled dot product attention mechanism:
[0165]
[0166] Among them, z j represents the aggregate representation vector of the structure capsule unit with path index j, represents the prediction vector with path index i, q j represents the structure capsule query vector with path index j, represents the transposed form of the prediction vector, represents the inner product operation, and exp represents the exponential function. represents the scaling factor, D ′ represents the dimension of the embedding space, N represents the total number of input paths, and ∑ represents aggregation by all input paths;
[0167] S64. Input the aggregated vector into the nonlinear compression function to generate the output vector of the structure capsule unit:
[0168]
[0169] Among them, v j Represents the final output vector of the structure capsule unit with path index j, z j represents the aggregation vector, represents the square norm of the aggregate vector, ||z j ||2 represents the two-norm of the aggregate vector, and ∈ represents a positive constant to prevent division by zero;
[0170] S65: Output the structure capsule unit to complete the aggregation process of the dynamic routing mechanism.
[0171] The present invention constructs a dynamic routing mechanism based on the joint input of posture, state and attribute vectors, uses a four-element capsule tensor as the input structure, and adopts affine mapping and normalization processing to generate prediction vectors, thereby improving the consistency of feature distribution and channel distinguishability. By introducing a scaled dot product attention mechanism, the prediction representations of multiple input paths are weightedly aggregated according to the query vector, realizing the focused expression of multi-source semantics by the structural capsule unit. In the aggregation output stage, a nonlinear compression function is used to suppress abnormal activation, enhance the convergence and discriminability of the output vector, and finally complete the construction process of the structural capsule unit. This mechanism effectively improves the expressive power of the model in urban component aggregation, semantic construction and structural reasoning.
[0172] In this embodiment, the S7 specifically includes:
[0173] S71. Set the initialization structure of the structure capsule atlas, use all the structure capsule units that have been output as atlas nodes, and extract the spatial coordinates, posture vector, state vector, and attribute vector corresponding to each structure capsule unit;
[0174] S72. Construct the graph connection relationship between the structure capsule nodes and define the graph edge weight based on the semantic similarity between the node attribute vectors and the Euclidean distance between the spatial coordinates:
[0175]
[0176] Among them, w mn Indicates that the structure capsule unit index is the edge weight between m and n, a m ,a n represents the attribute vector indexed by m and n, x m ,x n represents the three-dimensional city coordinate point, λ1,λ2 represent the weight adjustment coefficient, γ represents the distance attenuation coefficient, and ||·||2 represents the two-norm;
[0177] S73. Generate a structure capsule graph based on the construction results, where the graph nodes are structure capsule units, the edges are connection relationships, the node attributes include posture vectors, state vectors, and attribute vectors, and the spatial coordinates are used for geographic positioning;
[0178] S74. Collect city operation status data and map the city operation status data to regions according to geographic coordinates:
[0179]
[0180] Among them, α tj Represents the normalized binding weight of the state sampling point index t mapped to the structure capsule index j, x t Indicates the coordinates of the sampling point, x j represents the structural capsule unit coordinates, δ represents the binding attenuation coefficient, ∑k represents the sum of all structure capsule indices;
[0181] S75. Assign the city operation status value to the state vector channel of the corresponding structure capsule unit according to the normalized weight, completing the injection and binding of the node status information in the structure capsule graph.
[0182] The present invention constructs a structural capsule graph by using the output structural capsule units as nodes, extracting the spatial coordinates, posture, state and attribute vectors of the nodes to form a graph node set with multi-dimensional attributes embedded. Based on the semantic similarity between attribute vectors and the distance between spatial coordinates, the edge weights in the graph are jointly defined to achieve semantic and geographical dual-constraint modeling of the structural graph. By collecting urban operation status data and constructing a normalized mapping function for coordinate alignment, the state values are assigned to the corresponding nodes in the graph, thereby achieving the binding of dynamic state data and static structural units. This graph structure not only retains the spatial topology and semantic relationship of the components, but also incorporates real-time status information, providing a unified graph structure input basis for subsequent urban operation analysis.
[0183] In this embodiment, the S9 specifically includes:
[0184] S91. Construct a structural capsule indexing system, establish a correspondence between each structural capsule unit in the three-dimensional city model according to the spatial coordinates, extract the state vector, attribute vector and three-dimensional coordinates of the structural capsule unit, and form an analysis input set;
[0185] S92, perform state recognition processing, set the state vector to s i , input the nested perception structure to generate the embedded representation and calculate the classification probability:
[0186] y i =Softmax(W3·GELU(W2·ReLU(W1·s i +b1)+b2)+b3);
[0187] Among them, y i Represents the state classification probability vector of the structure capsule unit index i, s i Represents the state vector, W1, W2, W3 represent the affine transformation matrix of the state recognition network, b1, b2, b3 represent the bias vector, ReLU represents the linear rectification function, GELU represents the Gaussian error linear unit function, and Softmax represents the multi-classification normalization function;
[0188] S93, construct the state and space joint similarity graph, let the state vector be s i , the coordinate vector is x i , use the weighted kernel function to calculate the similarity matrix:
[0189]
[0190] Among them, K ij Indicates the joint similarity between the structure capsule unit index i and j, s i ,s j represents the state vector, x i ,x j represents the three-dimensional coordinate vector, σ represents the scale factor of the state vector space, ρ represents the scale factor of the spatial coordinate, α, β represent the channel weighting coefficients, and ||·||2 represents the two-norm;
[0191] S94. Construct a traffic graph structure based on the similarity matrix, generate a graph Laplacian matrix, perform an eigenvector decomposition operation, and use a clustering algorithm to divide the traffic labels of the structure capsule units;
[0192] S95, performing energy consumption classification processing, concatenating the state vector and the attribute vector as input, building a multi-category classification model, and outputting an energy consumption label;
[0193] S96. Bind the state classification results, traffic cluster labels, and energy consumption labels to the structural capsule units, map them to corresponding coordinate positions in the three-dimensional city model, and complete the city operation state analysis.
[0194] The present invention organizes the structural capsule units in the three-dimensional city model into an analysis input set by constructing a structural capsule indexing system, extracting state vectors, attribute vectors, and spatial coordinates to achieve spatial semantic unification of the analysis entry. The state recognition module calculates the state classification results based on a multi-layer perception network, and the similarity calculation module combines state characteristics and spatial position to construct a joint similarity graph to achieve traffic clustering structure division. By fusing state and attribute information to perform energy consumption classification, the model's multi-dimensional analysis capabilities for urban operation characteristics are further expanded. Finally, all analysis tags are bound to the structural capsule units and mapped to the three-dimensional city model coordinate space, completing the closed-loop process from modeling to state analysis, and improving the intelligent analysis and real-time feedback capabilities of the city model.
[0195] Example 1:
[0196] To verify the feasibility of this invention, we applied it to the core block between Zhongshan 1st Road and Dongfeng East Road in Yuexiu District, Guangzhou. This area is densely populated with buildings and people, a typical intersection of commercial activities and transportation. It has long suffered from road congestion, crowd retention, and high building energy consumption. Traditional static modeling methods cannot dynamically reflect actual operating conditions, making it difficult to support the real-time perception and intelligent scheduling requirements of urban management systems.
[0197] Multi-view high-definition cameras and edge computing nodes were deployed in the area, capturing approximately 183,000 images with a viewing angle range of 15° to 135°, and an average sampling frequency of one frame every three seconds. By extracting camera parameters and calculating pose transformations from the images, the system constructed a complete three-dimensional city coordinate system. Using a NeRF-based volume modeling network, a three-dimensional radiation field with high texture fidelity and continuous geometric structure was generated. Semantic features were then extracted from the intermediate layers of the modeling network to construct a spatial feature field. This feature field was then partitioned into regions and local feature blocks were constructed. This was then fed into a four-element capsule encoding network to generate structured four-element capsule units. This structure simultaneously expresses the existence, geometric pose, functional attributes, and operational status of spatial components.
[0198] On this basis, a structural capsule map was established, and real-time city operation status data was introduced for binding and injection. The status data was collected from October 1 to October 15, 2024, covering key dimensions such as pedestrian density, road speed, building energy consumption, and ambient temperature. During the analysis phase, the system performed three tasks on the 3D city model: state identification, traffic clustering, and energy consumption classification. Table 1 shows some typical analysis results:
[0199] Table 1 Summary of urban operation status data sampling and analysis results
[0200]
[0201]
[0202] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.
Claims
1. A deep learning-based digital twin 3D city modeling and analysis method, characterized by: The steps include: S1. Collect multi-view image data, extract camera intrinsic and extrinsic parameters, calculate the posture transformation matrix, and establish a three-dimensional city coordinate system; S2. Construct a volume modeling network based on the NeRF method, receive coordinate points and observation directions in the 3D city coordinate system, predict the color value and volume density value of each coordinate point, and generate a 3D radiation field; S3. Extract the intermediate layer semantic features in the volume modeling network, establish a mapping relationship from coordinate points to semantic features, and generate a spatial feature field; S4, dividing the spatial feature field into local regions, extracting feature points in each region to form local feature blocks; S5, inputting the local feature block into the quaternary capsule encoding network to generate a quaternary capsule unit containing an existence vector, a posture vector, a state vector, and an attribute vector; S6. Based on the joint similarity of posture vector, state vector and attribute vector, a dynamic routing mechanism is constructed to aggregate four-element capsule units and generate structured capsule units. S7. Construct a structural capsule map using the structural capsule units, and bind the collected urban operation status data to the structural capsule units in the structural capsule map; S8, combining the three-dimensional radiation field and the structure capsule atlas to perform image rendering and generate a three-dimensional city model; S9. Perform state recognition, traffic clustering and energy consumption classification analysis on the three-dimensional city model.
2. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The existence vector represents the appearance probability of the spatial component, the posture vector represents the three-dimensional position, direction and scale of the spatial component, the state vector represents the urban operation state parameters associated with the spatial component, and the attribute vector represents the functional category or semantic identification of the spatial component.
3. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The city operation status data is acquired in real time by environmental monitoring devices, traffic sensing equipment and energy consumption collection terminals deployed in urban areas, including crowd density, ambient temperature, traffic speed and energy consumption indicators.
4. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The three-dimensional city model includes spatial structure, state information and semantic attributes.
5. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S2 specifically includes: S21. Setting a spatial position point and an observation direction in a three-dimensional city coordinate system, where the spatial position point is composed of a horizontal coordinate, a longitudinal coordinate, and a vertical coordinate, and the observation direction is composed of three unit vector components; S22. Perform multi-scale sine and cosine encoding processing on each coordinate component: γ(p)=[sin(2 0 πp),cos(2 0 πp),…,sin(2 L-1 πp),cos(2 L-1 πp)]; Where γ(p) represents the output of the encoding function, p represents the single coordinate component of the input, π represents the pi constant, and L represents the number of encoding frequency layers; S23, performing a position encoding function on the horizontal coordinate, the longitudinal coordinate, and the vertical coordinate to generate three encoding vectors, concatenating the three encoding vectors into a unified input, and inputting the unified input into the volume modeling network; S24. Outputting a volume density value and an intermediate semantic feature vector of the spatial location point through the volume modeling network. The volume density value is used to represent the degree of occlusion of the spatial region, and the intermediate semantic feature vector is used as an input basis for color prediction. S25, input the three components of the viewing direction into the position encoding function to generate a direction encoding vector, and concatenate it with the intermediate semantic feature vector as the input of the color prediction network; S26, outputting a color value through a color prediction network, where the color value consists of three channels: red, green, and blue; S27, combining the volume modeling network and the color prediction network to form a joint modeling structure, the input is the spatial position point and the observation direction, and the output is the volume density value and the color value; S28. Input a set of spatial position points and observation directions into a joint modeling structure, obtain volume density values and color values within a continuous spatial region, and generate a three-dimensional radiation field; S29. Establish rays along the observation direction, sample spatial position points for each ray, perform volume rendering integration based on the volume density value and color value of each position point, output the color intensity value of the image pixel, and complete the generation of the three-dimensional radiation field.
6. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S3 specifically includes: S31. Setting the middle layer in the volume modeling network structure as a semantic feature extraction channel, extracting the middle activation tensor corresponding to each spatial position point as a semantic vector; S32. Construct a mapping function from a 3D city coordinate point to a semantic vector, assuming the horizontal coordinate is x, the vertical coordinate is y, and the vertical coordinate is z: Among them, Φ(x,y,z) represents the fusion semantic vector, λ i (x, y, z) represents the weight function value of the i-th channel, f i (x, y, z) represents the feature vector output by the i-th channel, M represents the total number of channels, and x, y, z represent the three-directional position coordinates in the city coordinate system; S33. Perform nonlinear transformation on the mapping function result to construct a high-dimensional semantic vector function: S(x,y,z)=ReLU(W2·tanh(W1·Φ(x,y,z)+b1)+b2); Among them, S(x,y,z) represents the fused semantic features, W1,W2 represent the linear transformation matrix, b1,b2 represent the bias vector, tanh represents the hyperbolic tangent function, and ReLU represents the linear rectification function; S34, let the query point position be (q x ,q y ,q z ), select K local neighborhood positions from the semantic feature function and define a distance-weighted semantic query function: Among them, s represents the query point semantic response, (x k ,y k ,z k ) represents the coordinates of the kth neighborhood point, d k represents the Euclidean distance between the query point and the kth point, β represents the smoothing coefficient, S(x k ,y k ,z k ) indicates that the position coordinate is (x k ,y k ,z k )’s spatial point corresponding to the semantic feature vector; S35. Constructing a mapping set of all spatial coordinate points and corresponding semantic responses; S36. Use a sparse tensor structure to organize all mapping results and establish a three-dimensional position indexing mechanism; S37. Form a spatial feature field with three-dimensional city coordinates as input and high-dimensional semantic vectors as output.
7. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S5 specifically includes: S51, constructing an input structure of a local feature block, combining the spatial position point in each local area in the spatial feature field with the corresponding semantic feature vector to form an input tensor as the input of the four-element capsule encoding network; S52. Input the semantic feature vector into the embedding network, perform multi-layer affine transformation, activation function and normalization processing, and obtain an embedding representation of uniform dimension: <h2 style=";text-align:left;direction:ltr">u<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> =LN(W3·GELU(W2·ReLU(W1·v<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> +b1)+b2)+b3); Among them, u j represents the jth embedding vector, v j represents the jth semantic feature vector, W1, W2, W3 represent affine mapping matrices, b1, b2, b3 represent bias vectors, ReLU represents linear rectification function, GELU represents Gaussian error linear unit function, and LN represents layer normalization function; S53. Input the embedding vector into the four-way encoding module to generate the existence vector, posture vector, state vector and attribute vector, and construct the four-element capsule unit: c j =[σ(e j ),R j ·p j +t j ,BN(W s ·s j ),tanh(W a ·a j +b a )]; Among them, c j represents the j-th quaternary capsule unit, e j represents the existence vector, σ represents the Sigmoid function, p j represents the posture vector, R j represents the rotation matrix, t j represents the translation vector, s j represents the state vector, W s Represents the state mapping matrix, BN represents the batch normalization function, a j represents the attribute vector, W a represents the attribute mapping matrix, b a represents the attribute bias vector; S54. Organize all quaternion capsule units into a tensor with consistent structure, forming a third-order tensor with dimension (N, 4, D), where N is the number of units, 4 is the vector type, and D is the single-class vector dimension; S55. performing normalization on the existence vector to limit the value to be between zero and one; S56, introducing an affine structural transformation consisting of a rotation matrix and a translation vector into the posture vector; S57, apply linear mapping to the state vector and attribute vector to unify them into the standard semantic space; S58. Combine the location point coordinates in the three-dimensional city coordinate system, generate a location code, and fuse it into the four-element capsule tensor to complete the four-element capsule unit construction process.
8. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S6 specifically includes: S61. Setting an input structure of a dynamic routing mechanism, taking a quaternion capsule tensor as input, where the dimensions of the tensor are the number of paths, the number of vector types, and the dimension of a single-class vector, where the vector types include a posture vector, a state vector, and an attribute vector; S62. Initialize the number of output structure capsule units, and construct an affine transformation matrix and bias vector for each set of input paths and output paths. Perform concatenation, linear mapping, and normalization on the three types of input vectors to generate a prediction representation: in, Represents the prediction vector of the four-element capsule unit with path index i to the structure capsule unit with path index j, p i Represents the posture vector with path index i, s i represents the state vector of path index i, a i represents the attribute vector with path index i, [·||·] represents the vector concatenation operation, represents the affine mapping matrix from path i to path j, represents the affine bias vector of the path pair (i, j), and LN represents the layer normalization function; S63. Set the query vector of each output structure capsule unit to q j , the weighted aggregation vector is calculated based on the scaled dot product attention mechanism: Among them, z j represents the aggregate representation vector of the structure capsule unit with path index j, represents the prediction vector with path index i, q j represents the structure capsule query vector with path index j, represents the transposed form of the prediction vector, represents the inner product operation, and exp represents the exponential function. represents the scaling factor, D′ represents the dimension of the embedding space, N represents the total number of input paths, and ∑ represents aggregation by all input paths; S64. Input the aggregated vector into the nonlinear compression function to generate the output vector of the structure capsule unit: Among them, v j Represents the final output vector of the structure capsule unit with path index j, z j represents the aggregation vector, represents the square norm of the aggregate vector, ||z j ||2 represents the two-norm of the aggregate vector, and ∈ represents a positive constant to prevent division by zero; S65: Output the structure capsule unit to complete the aggregation process of the dynamic routing mechanism.
9. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S7 specifically includes: S71. Set the initialization structure of the structure capsule atlas, use all the structure capsule units that have been output as atlas nodes, and extract the spatial coordinates, posture vector, state vector, and attribute vector corresponding to each structure capsule unit; S72. Construct the graph connection relationship between the structure capsule nodes and define the graph edge weight based on the semantic similarity between the node attribute vectors and the Euclidean distance between the spatial coordinates: Among them, w mn Indicates that the structure capsule unit index is the edge weight between m and n, a m ,a n represents the attribute vector indexed by m and n, x m ,x n represents the three-dimensional city coordinate point, λ1,λ2 represent the weight adjustment coefficient, γ represents the distance attenuation coefficient, and ||·||2 represents the second norm; S73. Generate a structure capsule graph based on the construction results, where the graph nodes are structure capsule units, the edges are connection relationships, the node attributes include posture vectors, state vectors, and attribute vectors, and the spatial coordinates are used for geographic positioning; S74. Collect city operation status data and map the city operation status data to regions according to geographic coordinates: Among them, α tj Represents the normalized binding weight of the state sampling point index t mapped to the structure capsule index j, x t Indicates the coordinates of the sampling point, x j represents the structural capsule unit coordinates, δ represents the binding attenuation coefficient, ∑ k represents the sum of all structure capsule indices; S75. Assign the city operation status value to the state vector channel of the corresponding structure capsule unit according to the normalized weight, completing the injection and binding of the node status information in the structure capsule graph.
10. The method for modeling and analyzing a digital twin 3D city based on deep learning according to claim 1, characterized in that: The S9 specifically includes: S91. Construct a structural capsule indexing system, establish a correspondence between each structural capsule unit in the three-dimensional city model according to the spatial coordinates, extract the state vector, attribute vector and three-dimensional coordinates of the structural capsule unit, and form an analysis input set; S92, perform state recognition processing, set the state vector to s i , input the nested perception structure to generate the embedded representation and calculate the classification probability: <h2 style=";text-align:left;direction:ltr">y<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> =Softmax(W3·GELU(W2·ReLU(W1·s).<h2 style=";text-align:left;direction:ltr"> i <h2 style=";text-align:left;direction:ltr"> +b1)+b2)+b3); Among them, y i Represents the state classification probability vector of the structure capsule unit index i, s i Represents the state vector, W1, W2, W3 represent the affine transformation matrix of the state recognition network, b1, b2, b3 represent the bias vector, ReLU represents the linear rectification function, GELU represents the Gaussian error linear unit function, and Softmax represents the multi-classification normalization function; S93, construct the state and space joint similarity graph, let the state vector be s i , the coordinate vector is x i , use the weighted kernel function to calculate the similarity matrix: Among them, K ij Indicates the joint similarity between the structure capsule unit index i and j, s i ,s j represents the state vector, x i ,x j represents the three-dimensional coordinate vector, σ represents the scale factor of the state vector space, ρ represents the scale factor of the spatial coordinate, α, β represent the channel weighting coefficients, and ||·||2 represents the two-norm; S94. Construct a traffic graph structure based on the similarity matrix, generate a graph Laplacian matrix, perform an eigenvector decomposition operation, and use a clustering algorithm to divide the traffic labels of the structure capsule units; S95, performing energy consumption classification processing, concatenating the state vector and the attribute vector as input, building a multi-category classification model, and outputting an energy consumption label; S96. Bind the state classification results, traffic cluster labels, and energy consumption labels to the structural capsule units, map them to corresponding coordinate positions in the three-dimensional city model, and complete the city operation state analysis.
Citation Information
Cited By
High-efficiency three-dimensional point cloud classification method and device based on spiking neural network
CN121438009A
High-efficiency 3D point cloud classification method and device based on spiking neural network
CN121438009B