Multi-scale planar building group similarity calculation method fusing spatial relationship and SimGNN
By using the SimGNN model combined with graph-level and fine-grained node-level strategies, the multi-scale similarity of building groups was solved, and the problem that existing methods failed to fully consider spatial relationships was improved, and the accuracy and effectiveness of the calculation were improved.
Patent Information
- Application Number
- CN202510291550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-17
AI Technical Summary
The existing method of calculating similarity of building groups fails to fully take into account the spatial relationships such as topology, direction, and distance, resulting in deviations in the calculation results.
The graph neural network SimGNN model is used, combining two strategies of graph-level and fine-grained node-level, to calculate the multi-scale similarity of building groups and consider the spatial relationship characteristics between goals.
The accuracy of multi-scale building cluster similarity calculation is improved, spatial data can be analyzed more accurately, and cognitive confusion caused by data differences is reduced.
Smart Images

Figure CN120164000A_ABST
Abstract
Description
Technical Field
[0003] The present invention relates to the field of calculating the similarity of building groups, and more specifically to a multi-scale planar building group similarity calculation method that integrates spatial relationships and SimGNN. Background Art
[0004] Planar building groups account for the largest proportion in urban vector maps and are an important part of the maps. With the continuous change of building group data, similarity calculation is becoming increasingly important in the field of geographic information. By quantifying the similarity between building groups at different scales, it can help researchers analyze spatial data more accurately and reduce the cognitive confusion caused by data differences. Therefore, similarity calculation plays a key role in fields such as scene similarity retrieval, building group recognition and matching, and map generalization.
[0005] Existing building group similarity calculation methods are mainly divided into two types: traditional geometric methods and deep learning methods. Traditional geometric methods usually select the geometric features of the group and calculate the similarity by subjectively setting weights. However, these methods can only extract low-dimensional features of buildings, and the subjective assignment of weights to each feature value will lead to inaccurate calculation results. Compared with traditional geometric methods, deep learning methods can automatically extract the spatial high-dimensional information of the target, reduce the influence of subjectively setting weights, and thus improve the accuracy of processing complex data. However, although existing deep learning methods have achieved certain results, when selecting building group features, they do not fully consider spatial relationships such as topology, direction, and distance; and the features extracted only obtain the context information of the entire group through graph-level processing, which easily ignores the differences in local details and leads to deviations in the calculation results. Summary of the Invention
[0006] In view of this, the present invention proposes a multi-scale planar building group similarity calculation method that integrates spatial relationships and SimGNN. The SimGNN model of the graph neural network is selected, the spatial relationship features between targets are considered, and two strategies of graph-level and fine-grained node-level are used to calculate the similarity, so as to overcome the defects of existing methods and improve the accuracy of multi-scale building group similarity calculation. The present invention mainly includes four parts: data preprocessing, selection of feature description indicators, construction of the SimGNN model, and calculation results and analysis of multi-scale planar building group similarity:
[0007] (1) Data preprocessing. The large-scale data at two different scales are finely divided in the same area, and pseudo-data is added at the positions where group buildings are missing to obtain several small-area building groups; according to the vertex coordinates of each building in the group, the centroid of each building is calculated as the node of the graph structure, and the minimum spanning tree is constructed for each building group to obtain its adjacency matrix.
[0008] (2) Selection of feature description indicators. Select geometric feature description indicators for buildings: select the area, perimeter, average radius, and number of sides of each building as its size features, select compactness and extensibility as shape features; select density and solidity as density features, select the extension direction of the minimum area circumscribed rectangle of the building as its direction feature; select spatial relationship feature description indicators between buildings: select proximity as its topological relationship feature, select the Voronoi diagram model to describe its direction relationship feature, and select centroid distance as its distance relationship feature.
[0009] (3) Construction of the SimGNN model. Use graph convolutional layers and fully connected layers to build a network model, convert the building group data into graph structure data, divide the training set and validation set at a ratio of 8:2, use the structure and feature attribute information of the input data itself to generate "data-driven labels", train the model through self-supervised learning, and adjust the various parameters of the model to make the output effect of the model reach the best.
[0010] (4) Calculation results and analysis of the similarity of multi-scale planar building groups. Input the test data into the trained model to calculate the similarity, analyze the specific changes of the test data according to the total similarity and node similarity; and analyze the influence of geometric features and spatial relationship features on the calculation of group similarity. Description of the Drawings
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only schematic diagrams of the present invention. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0012] Figure 1 It is a flowchart of a method for calculating the similarity of multi-scale planar building groups considering spatial relationships provided by the present invention.
[0013] Figure 2 It is a schematic diagram of constructing a building group graph structure provided by the present invention.
[0014] Figure 3 It is a schematic diagram of the proximity between a building and a neighboring target provided by the present invention.
[0015] Figure 4 It is a direction Voronoi diagram of a building and a neighboring target provided by the present invention.
[0016] Figure 5 It is a schematic diagram of the centroid distance between the same target at different scales provided by the present invention.
[0017] Figure 6The summary graph of SimGNN provided by the present invention.
[0018] Figure 7 The schematic diagram of three groups of building clusters at different scales provided by the present invention.
[0019] Figure 8 The schematic diagram of the similarity of each feature provided by the present invention.
[0020] Figure 9 The schematic diagram of the similarity of each node provided by the present invention.
[0021] Figure 10 The schematic diagram of the results of the similarity psychological cognition survey of building cluster data at different scales provided by the present invention.
[0022] Figure 11 The schematic diagram of building clusters with similar geometric features but different spatial relationships provided by the present invention.
[0023] Figure 12 The curve graph of the change of training loss after inputting different features provided by the present invention.
[0024] Figure 13 The schematic diagram of the time-consuming statistics of experimental data provided by the present invention.
[0025] Table 1 shows the geometric features of the building clusters extracted by the present invention.
[0026]
[0027]
[0028] Table 2 shows the statistical results of the similarity distribution and the calculation results of the total similarity obtained by the present invention.
[0029]
[0030] Table 3 shows the similarity calculation results of the present invention and the traditional subjective weight method for different groups.
[0031] Detailed implementation manners
[0032] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0033] An embodiment of the present invention discloses a method for calculating the similarity of multi-scale planar building groups by integrating spatial relationships and SimGNN, which includes four parts: data preprocessing, feature description index selection, SimGNN model construction, and calculation result and analysis of the similarity of multi-scale planar building groups. The flowchart of the calculation method is as Figure 1 shown.
[0034] 1. The data preprocessing steps are as follows:
[0035] Step1: Convert the geodetic coordinates of the original data into spatial rectangular coordinates, and experienced cartographers subdivide the large-scale data at two different scales for the same area according to other geographical features such as road networks and rivers, ensuring that the two sets of data within the same area can comprehensively cover all buildings in the area, and obtain several small-area building groups; when scaling the scale, some buildings are deleted or merged, and pseudo-building data needs to be added at the centroid position of the missing buildings in the figure to make all buildings in the group meet the "1:1" condition.
[0036] Step2: Calculate the centroid coordinates of each building in the group as the nodes of the graph structure, and connect the centroids of each building through the minimum spanning tree algorithm to construct the graph structure of the building group, as Figure 2 shown. The edges of the MST are used as the edges of the graph structure to obtain its adjacency matrix.
[0037] 2. The feature description index selection steps are as follows:
[0038] Step3: The geometric feature description indexes of buildings include size features, shape features, density features, and self-extension direction features. Let building A have n vertices, which are respectively {(x1,y1),(x2,y2),...,(x n ,y n )}, and the calculation indexes and meanings of its various geometric features are shown in Table 1.
[0039] Step4: Use proximity to describe the spatial topological relationship features between buildings pairwise, as Figure 3 shown. Taking Figure 3 as an example, first calculate the centroid distance matrix between each building in the building group, where n represents the number of buildings in the group; then, find the maximum value d in the distance matrix, divide the maximum value into three equal parts, and draw circles with the centroids of each building as the centers and d as the radii respectively; finally, calculate the number m i of buildings whose centroids fall within the circles, and perform weighted averaging according to the weights of 3:2:1 to obtain the proximity of each building.
[0040] Step 5: Use the directional Voronoi diagram model to describe the spatial directional relationship characteristics between buildings pairwise. For example, Figure 4 As shown, first, construct a Delaunay triangulation within the building group to obtain visible area triangles; second, starting from the initial triangle, connect the midpoints of the waists of right-angled and acute-angled triangles, the intersection of the perpendicular line from the midpoint of one waist of an obtuse-angled triangle and the other waist, the shared edges, and the shared points to generate a directional Voronoi diagram; then, calculate the azimuth angle α of the normal of each Voronoi edge and use the length of the Voronoi edge as its weight; finally, classify the edges in the same main direction and perform weighted averaging to obtain the directional relationship of the building relative to the group.
[0041] Step 6: Use the centroid distance to describe the spatial distance relationship characteristics between buildings pairwise. For example, Figure 5 As shown, the blue dashed line is the original building and its centroid M(x1, y1), and the black solid line is the building and its centroid N(x2, y2) at a small scale. The calculation of the centroid distance is shown in Equation (10).
[0042]
[0043] Step 7: Extract geometric features and spatial relationship features for the n buildings in each group to form a node feature matrix; combine with the adjacency matrix obtained in Step 2 to construct the entire data Data of the group and convert it into the PyTorchGeometric format for easy processing by the neural network.
[0044] 3. The construction steps of the SimGNN model are as follows:
[0045] Step 8: The SimGNN model is divided into two strategies to process input information, namely the graph-level processing strategy and the fine-grained node-level processing strategy. The model overview diagram is as Figure 6 shown. Build the graph-level processing strategy framework in the SimGNN model: First, perform node embedding, use GCN to encode each node feature and structural attribute to obtain an initial node embedding vector; then perform graph-level embedding: apply the attention mechanism to assign weights to each node embedding, perform a weighted operation on the node embeddings to obtain weighted node features, and aggregate them into a global embedding feature vector representing the entire graph; finally, in the graph-to-graph interaction stage, receive the weighted graph-level embedding vectors of the two graphs, process the interaction information between the embedding vectors through a fully connected layer, and obtain a preliminary graph-level similarity tensor.
[0046] Step 9: To reflect the subtle differences between the two groups, a fine-grained node-level processing strategy is designed: First, extract all node embeddings in the groups, calculate the similarity between the corresponding nodes in the two groups to obtain a paired node similarity matrix; then, count the values in the node similarity matrix to obtain a frequency vector of the node similarity distribution, and after normalizing this vector, obtain a preliminary node similarity tensor.
[0047] Step 10: After processing by the two strategies, concatenate the obtained graph-level similarity tensor and node similarity tensor, input them into a fully connected layer, and finally output a scalar value in the range of [0, 1], representing the similarity score between the groups.
[0048] Step 11: Use the structure and feature attribute information of the input data itself to generate "data-driven labels" without using external label information. Select 500 pairs of building groups with completely similar features as positive sample data, with a label of 1; select 500 pairs of building groups with no corresponding relationship in different regions as negative sample data, with a label of 0. The training set and validation set are divided at a ratio of 8:2.
[0049] Step 12: Train the model with a large amount of data, set the learning rate to 0.001, and select the Sigmoid function as the activation function. This function maintains gradient stability during the backpropagation process and compresses the output value to between [0, 1]. The output value can be directly used as the similarity, making the result more intuitive and interpretable.
[0050] 4. The steps for calculating and analyzing the similarity of multi-scale planar building groups are as follows:
[0051] Step 13: As shown in the test data Figure 7 , input the test data into the trained model to calculate the similarity. Taking Figure 7 (b) as an example, the results and distributions of the similarity of each feature output by the model are as shown in Figure 8 , and the results and distributions of the node similarity are as shown in Figure 9 . Count the similarity values of each feature and each node similarity value in the 3 pairs of building groups in Figure 7 , and calculate the overall similarity. The results are shown in Table 2.
[0052] Step 14: To verify whether the calculation results are consistent with human cognition, randomly select 300 interviewees for a psychological cognition experiment, let each interviewee score the similarity of the 3 pairs of building groups in Figure 7 , and count the score distribution of each pair of building groups. The results are as shown in Figure 10 . As shown in Figure 10It can be seen that the similarity values obtained by the SimGNN model are in good agreement with the results of the psychological cognition experiment, further indicating that this method has better effects in measuring the similarity between building groups at different scales, and verifying the practicability and reliability of this algorithm.
[0053] Step15: To analyze the influence of geometric features and spatial relationship features on the calculation of group similarity, a dataset with similar geometric features but different spatial relationship features from the original building group is constructed. As Figure 11 shown, the traditional subjective weight method and the SimGNN model are respectively used to calculate the group similarity, and the results are shown in Table 3. It can be seen from Table 3 that considering the spatial relationship features can better reflect the differences between groups, and the results obtained by considering the spatial relationship features are more in line with human cognition compared with only considering geometric features.
[0054] Step16: To analyze the influence of spatial relationship features on model training, five groups of experiments are respectively set up: only including geometric features, adding topological features, adding direction features, adding distance features, and adding these three spatial relationship features at the same time. The model is trained in turn, and the change trend of its training loss is obtained, as Figure 12 shown. It can be seen from Figure 12 that the loss of the model only including 9 geometric features decreases significantly slower, and the required step size for convergence is longer, indicating that geometric features cannot effectively capture the main differences between samples. When only adding topological relationship features or direction relationship features, the model loss decreases slightly, indicating that the contributions of these two features to the model are limited. While when only adding distance relationship features, the loss decreases the fastest and the model convergence effect is better, indicating that distance relationship plays a key role in the feature combination. When adding topological, direction, and distance relationship features at the same time, the model performs best and has the fastest convergence speed. This shows that combining geometric features with spatial relationship features can more effectively improve the feature extraction ability and convergence speed of the model, and enhance the effectiveness of the model.
[0055] Step17: To evaluate the efficiency of the algorithm in this paper when dealing with different building groups, the running times of the traditional subjective weight method and the SimGNN algorithm in 30 pairs of groups are respectively counted, as Figure 13 shown.
[0056]
[0057] From equations (11) and (12), the correlation coefficient and covariance between the number of buildings and the running time of the SimGNN algorithm are approximately 0.87 and 0.0073 respectively, indicating that the number of buildings and the running time of the algorithm tend to increase simultaneously, and there is a strong positive correlation between them. As the amount of processed data increases, the required time will also increase accordingly, but it is still within an acceptable range. Compared with traditional methods, the SimGNN algorithm takes less time and has higher efficiency in practical applications, further proving the effectiveness and practicality of the algorithm proposed in this paper for calculating the similarity of building groups.
[0058] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined by this solution can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown in this solution, but will conform to the widest scope consistent with the principles and novel features disclosed in the present invention.
Claims
1. A method for calculating the similarity of multi-scale planar building groups by integrating spatial relationships and SimGNN, including data preprocessing, feature description index selection, SimGNN model construction, and multi-scale planar building group similarity calculation results and analysis: The data preprocessing steps are as follows: S1: Experienced cartographers divide the same area into smaller parts based on two large-scale data sets at different scales according to other geographical features such as road networks and rivers, ensuring that the two sets of data in the same area can fully cover all buildings in the area and obtain several small-area building groups; S2: Calculate the centroid of each building according to the vertex coordinates of each building in the group, use it as the node of the graph structure, construct a minimum spanning tree for each building group, and obtain its adjacency matrix; The steps for selecting feature description indicators are as follows: S3: The geometric characteristics of buildings are described by selecting the area, perimeter, average radius, and number of sides of each building as its size characteristics, and compactness and extension as shape characteristics; Density and solidity are selected as density features, and the extension direction of the building's minimum area circumscribed rectangle is selected as its direction feature; S4: The spatial relationship characteristics between two buildings are described by selecting proximity as the topological relationship characteristics, selecting the Voronoi diagram model to describe the direction relationship characteristics, and selecting the centroid distance as the distance relationship characteristics; The steps for building the SimGNN model are as follows: S5: In the graph-level processing strategy: GCN is used to encode the features and structural attributes of each node, and the attention mechanism is used to assign weights to each node embedding. The weighted node features are aggregated into a global embedding feature vector representing the entire graph. The interaction information between the embedding vectors is processed through the fully connected layer to obtain a preliminary graph-level similarity tensor. S6: In the node-level comparison strategy: extract all node embeddings in the group, calculate the similarity between the corresponding nodes in the two groups, obtain the paired node similarity matrix, count the values in the node similarity matrix, obtain the frequency vector of the node similarity distribution and normalize it, and obtain the preliminary node similarity tensor; S7: concatenate the obtained graph-level similarity tensor with the node similarity tensor, input it into the fully connected layer, and finally output a scalar value in the range of [0,1], which represents the similarity score between the groups; S8: Use the structure and feature attribute information of the input data to generate "data-driven labels" and train the model through self-supervised learning. The training set and validation set are divided in a ratio of 8:2; The calculation results and analysis steps of the similarity of multi-scale planar building groups are as follows: S9: Input the test data into the trained model to calculate the similarity, and analyze the specific changes of the test data based on the total similarity and node similarity; S10: Analyze the impact of geometric features and spatial relationship features on group similarity calculation; S11: End.
2. According to claim 1, a method for calculating the similarity of multi-scale planar building groups by integrating spatial relationship and SimGNN, characterized in that: In step S4, three spatial relationship features, namely, topological relationship features, directional relationship features and distance relationship features, are selected as characteristic description indicators of buildings, and the similarity of building groups taking into account spatial relationships is calculated.
3. According to claim 1, a method for calculating the similarity of multi-scale planar building groups by integrating spatial relationship and SimGNN, characterized in that: In steps S5 to S7, based on the graph-level processing of group context information, the differences in local details are taken into account, and the various features of the building group are calculated using both graph-level and fine-grained node-level strategies. Through fine-grained node-level comparison, the similarities between each target and each feature in the building group are obtained, which helps to analyze the specific change details of the target.
4. The method for calculating the similarity of multi-scale planar building groups by integrating spatial relationship and SimGNN according to claim 1 or claim 2, characterized in that: In steps S5 to S9, a neural network is combined to calculate the similarity of building groups. The automatic generation of weights is achieved through self-supervised training of the model, which reduces human intervention, effectively avoids the shortcomings of subjective weight allocation, and improves the calculation accuracy of multi-scale building group similarity.
