Method, system and equipment for judging historical urban area boundary based on graph neural network
By using graph neural network-based methods to construct multiple graphs using data from river systems and public transportation systems, and combining them with graph convolutional neural networks to automatically determine historical urban boundaries, the problem of long processing time and high subjectivity in existing technologies is solved, achieving fast and accurate boundary determination and urban protection reference.
Patent Information
- Application Number
- CN202410742483.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-06-11
AI Technical Summary
Existing technologies require extensive manual surveys and are highly subjective when determining the boundaries of historical urban areas, which is time-consuming and traditional deep learning is difficult to effectively explain the complex structural hierarchy of cities.
Using a graph neural network-based approach, by constructing multiple graphs and graph convolutional neural networks, and utilizing data such as river systems, public transportation systems, and the locations of cultural heritage sites, the historical urban boundaries are automatically determined, and then compared with an algorithm that precisely quantifies the degree of difference.
It enables objective, rapid, and accurate determination of historical urban boundaries, reduces the need for large amounts of data, improves the efficiency and accuracy of judgment, and provides a reliable reference for urban protection measures.
Smart Images

Figure CN118314464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rapid determination of historic urban district boundaries, and in particular to a method, system and device for determining historic urban district boundaries based on a graph neural network. Background Art
[0002] Initially, the existing ancient city walls were usually used directly as the boundaries of the urban historic area (Urban Historic Area refers to an urban area of a certain size that is approved and announced by the people's governments of provinces, autonomous regions, and municipalities directly under the central government and has a particularly rich collection of cultural relics, concentrated historical buildings, and can fully and truly reflect the traditional pattern and historical style. This method is relatively simple and direct, but it is only suitable for cities with relatively intact city walls. Since then, the Delphi method has been used to formulate the boundaries of the urban areas of some well-known historical and cultural cities with incomplete city walls. Among them, the Delphi method refers to a method of widely soliciting expert opinions in written form, which is widely used in management science.
[0003] In addition, in related academic research, some technical methods of quantitative analysis have also been adopted; among them, Gan Quan and other researchers used a method called analytic hierarchy process (AHP) to determine the boundary position in the study of the demarcation of the control line of the historical and cultural blocks in Xiaoxian County. The essence of this method is to determine a quantitative model for the classification of cultural relics protection units. This quantitative model will determine a weight for each building based on several indicators such as the level of the cultural relics protection unit and the degree of damage to the building. Then, the level of the cultural relics protection unit is determined based on this weight, and the location of the boundary line is finally determined by combining the boundaries of the courtyard street and alley form and the natural environment such as rivers. Gao Yang and other researchers mentioned a method of using a multi-factor hierarchical evaluation system (MGES) to standardize the demarcation of the boundary line of the historical city. This multi-factor hierarchical evaluation system consists of dozens of evaluation factors, such as architectural style, architectural structure, architectural art level, scientific research value, surrounding traffic conditions, ownership, etc. Each factor has its weight, and the score is determined through field investigation and literature investigation, and finally the final result is calculated by formula. In his work on identifying the boundaries of the historical and cultural blocks in the ancient city of Jianchuan in Dali, Yunnan, Feng Haoyu relied on massive data collected on-site and obtained from reading local historical documents, and combined several different methods, including the Delphi method, the AHP method, a multi-factor hierarchical evaluation system, and GIS big data methods.
[0004] Obviously, the above mentioned methods need to conduct a lot of research and obtain very detailed data before proceeding, which will take a lot of time. The more significant drawback is that these methods need to artificially prescribe some "weights", "proportional factors" and "indicators" in advance. Such regulations are artificial, based on experience, and have great subjectivity. Using these methods to judge the boundaries of a historical urban area from scratch often takes months or even years.
[0005] In recent years, information technology has developed rapidly, especially the explosive development of artificial intelligence, which has brought new opportunities for urban research. At present, the research on artificial intelligence deep learning in the field of urban design and architectural design is more focused on pixel image processing, and has achieved great success. However, this deep learning technology based on Euclidean spatial data and temporal structure data is difficult to further explain the city, a complex system with rich structural levels.
[0006] In view of this, this application is filed. Summary of the invention
[0007] The present invention provides a method, system and device for determining the boundary of a historical urban area based on a graph neural network, which can at least partially improve the above-mentioned problems.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] A method for determining the boundary of a historical urban area based on a graph neural network, comprising:
[0010] Acquire multivariate data to be processed, and transform the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data;
[0011] Extracting the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix;
[0012] Importing the matrix set into a trained graph convolutional neural network model for operation processing to generate operation results;
[0013] Performing visualization processing on the operation results to generate visualization results, and calculating the visualization results in combination with the connection relationship to generate the boundary position of the historical and cultural block;
[0014] An accurate quantitative difference degree algorithm is used to compare the boundary position of the historical and cultural block with the actual total historical and cultural block control line position to generate a historical city boundary judgment conclusion, wherein the accurate quantitative difference degree algorithm includes a polar coordinate rotation change map and a point set similarity from a Hausdorff distance perspective.
[0015] The present invention also provides a device for determining the boundary of a historical urban area based on a graph neural network, which comprises:
[0016] A conversion unit is used to obtain multivariate data to be processed, and perform conversion processing on the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data;
[0017] A matrix information extraction unit, used for extracting the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix;
[0018] A neural network operation unit, used for importing the matrix set into a trained graph convolutional neural network model for operation processing to generate an operation result;
[0019] A visualization unit, used to perform visualization processing on the operation result to generate a visualization result, calculate the visualization result in combination with the connection relationship, and generate the boundary position of the historical and cultural block;
[0020] The detection and verification unit is used to compare the boundary position of the historical and cultural block with the actual total historical and cultural block control line position using an accurate quantitative difference degree algorithm to generate a historical city boundary judgment conclusion, wherein the accurate quantitative difference degree algorithm includes a polar coordinate rotation change diagram and a point set similarity from a Hausdorff distance perspective.
[0021] The present invention also provides a historical urban area boundary judgment device based on a graph neural network, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement any of the historical urban area boundary judgment methods based on a graph neural network as described above.
[0022] In summary, the method for judging the boundary of a historical urban area based on graph neural network has made great progress in the context of artificial intelligence technology based on neural network. It attempts to design a method for demarcating the boundary of a historical urban area with the help of graph theory and graph neural network technology. This method can take into account objectivity, efficiency, accuracy, digitization, and less data as much as possible. Based on graph theory, this method overcomes the limitations of directly applying traditional deep learning to graphic data and releases new capabilities; this method uses urban bus stations, bridges, urban landmark buildings, etc. as anchor points, and gives these anchor points objective attributes, and then forms a "graph" of urban systems such as road systems and river systems to characterize urban structures, and then uses graph neural networks to allow computers to judge the scope of urban protection by themselves. This method can better utilize more abstract information and structural hierarchical information in the city, and provide a reliable reference for the formulation of subsequent urban protection measures. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is a schematic diagram of the process of the historical urban area boundary determination method based on graph neural network provided by the first aspect of the present invention;
[0024] Figure 2 It is a schematic diagram of the flow of the method for determining the boundary of a historical urban area based on a graph neural network provided in the second aspect of the present invention;
[0025] Figure 3 is a comparison diagram of two methods for converting urban spatial structure into a graph provided by the first embodiment of the present invention;
[0026] Figure 4 is a schematic diagram of the structure of each part of the initial feature matrix provided by the first embodiment of the present invention;
[0027] Figure 5 is a schematic diagram of the changes in the spatial distribution of embeddings during the training process observed from a two-dimensional perspective provided by the first embodiment of the present invention;
[0028] Figure 6 is a schematic diagram of the spatial distribution change of the embedding observed from a three-dimensional perspective provided by the first embodiment of the present invention;
[0029] Figure 7 It is a module schematic diagram of a historical urban area boundary determination device based on graph neural network provided in the second embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0031] refer to Figure 1 , Figure 2 As shown, the first embodiment of the present invention discloses a method for determining the boundary of a historical urban area based on a graph neural network, which can be executed by a device for determining the boundary of a historical urban area based on a graph neural network (hereinafter referred to as a determining device), and in particular, executed by one or more processors in the determining device to implement the following method:
[0032] S101, obtaining multivariate data to be processed, and transforming the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data;
[0033] Before running, you need to prepare two types of data in advance: data representing the link relationship in the urban structure (such as bus route data and street node link data); data representing the node attributes in the urban structure (such as data on the number of historical monuments around each bus station). Save the above data as CSV files and name them "Link Relationship" and "Node Attributes". The environment that needs to be pre-deployed before running: hardware environment, CPU not less than 1GHz, GPU not less than 1GHz, memory not less than 4GB, storage space not less than 16G; software environment, Windows 10 or above operating system, python 3.6 or above and pre-install the following packages (libraries): networkX, pandas, matplotlib.pyplot, numpy, os, PyTorch1.6.0, CUDA9.2, torch_geometric, IPython.display. It is recommended to run on the colab online notebook. Other required environments are automatically installed in the source code. Please ensure that you are connected to the Internet when running.
[0034] See also Figure 3 , the spatial types of cities are very complex, including radial, belt, concentrated, constellation, and cluster types, but the spatial form of cities can still be easily judged by observing the form of roads. Kevin Lynch pointed out the deep reason in "The Intention of the City": roads are the skeleton of the city. In the city, a large amount of information is constrained to flow on the roads: population, vehicles, and goods. The form of the roads in the central city is very different from that of the edge of the city. If the roads can be represented, the structure of the city can be represented to a certain extent. The graph structure can easily represent the spatial structure of urban roads in a digital way. The city streets themselves can be directly regarded as the edges of the graph, and the intersections of streets can be regarded as the nodes of the graph. This method is called method A'. The advantage of method A' is that it is easy to understand and can retain the spatial structural relationship of the city to the greatest extent, but the disadvantage is that the nodes and edges of the entire graph will be very large. In order to make up for the shortcomings of method A', some special points on the road (such as bus stops and bridges) are regarded as nodes, and then the edges are constructed based on other clear connections (such as bus routes, subway lines, and urban canals). This method is called method B'. The advantage of method B' is that as long as an appropriate number of route data is selected, the number of nodes and edges in the entire graph can be reduced while retaining the spatial structure information of the city to the maximum extent. The bus route information and water system information in the city can be easily obtained on government websites or traffic navigation software. It only needs to supplement the historical unit information around these stations.
[0035] The collected urban multivariate data are organized into formatted files such as Table 1 and Table 2. Table 1 stores the link relationship between each node and other nodes in the urban spatial structure diagram and some edge information, and Table 2 stores the attributes of each node related to the historical city area. The open source library NetworkX in Python can construct a multigraph reflecting the urban structure from Table 1 and Table 2. The edges of the graph represent roads and water systems, and the nodes represent special points on the roads and water systems. Each node has its own attributes, such as the number of surrounding historical buildings, temples or ancestral halls, and ancient trees. Each edge also has its own attributes, such as the bus route number.
[0036] Table 1 Example table of link relationships between nodes
[0037]
[0038] Table 2 Node attribute example table
[0039]
[0040] The constructed multigraph often has hundreds of nodes and hundreds of edges. Three different matrices need to be obtained from the graph: the adjacency matrix A1 that reflects the link relationship between nodes, the one-hot encoding matrix B1 that reflects information that cannot be quantified, and the feature matrix C1 that reflects information that can be quantified. The initial feature matrix is constructed by horizontally splicing these three matrices. The initial feature matrix contains rich information, such as Figure 4 . Among them, the adjacency matrix: , is the total number of nodes, one-hot encoding matrix: , is the number of items of the uniquely encoded attributes, the information feature matrix that can be quantified: , is the number of information features that can be quantified, the initial feature matrix : .
[0041] Among them, the labels are designed into three types: if the number of ancient buildings within a radius of 500m is less than or equal to 2, it is considered a non-historical urban area; if the number of ancient buildings within a radius of 500m is greater than 2 but less than 6, it is considered to be the edge of the historical urban area; if the number of ancient buildings within a radius of 500m is greater than 6, it is considered to be a core historical area. In this task, the label is a reference, and the model is not expected to perfectly find nodes that meet the label, because the goal is to "find nodes belonging to the historical urban area", but it is impossible to directly know which "nodes belong to the historical urban area" are. Therefore, "the number of ancient buildings within a certain range of the surrounding area" is a simple substitute. In fact, more attempts can be made based on different data sets, using other things related to the historical urban area as reference labels, such as pedestrian flow, the number of century-old stores, etc.
[0042] Specifically, in this embodiment, taking the conversion of multivariate data into a graph as an example, based on the open source library NetworkX in the Python programming language, a multi-graph reflecting the urban structure is constructed by combining the data in Table 1 and Table 2. The following is a specific pseudo code:
[0043] #Import required libraries and modules
[0044] # Read connection relationship and edge weight data from CSV file
[0045] df = read from CSV file
[0046] df_2 = read from CSV file
[0047] # Filter empty nodes
[0048] Filter empty nodes (df)
[0049] #Create an empty multigraph G
[0050] # Add nodes and edges to the multigraph
[0051] For each row in the data frame df_links:
[0052] Get the previous node node1
[0053] Get the next node node2
[0054] Get the edge attribute edge_attr
[0055] If node1 and node2 are not empty:
[0056] Add (node1, node2) to the edge of graph G with attribute edge_attr
[0057] # Add node attributes to multigraph
[0058] For each row in the data frame df_attributes:
[0059] Get the node name node
[0060] Get node attributes attr1, attr2, attr3
[0061] If node is not empty:
[0062] Add node node to graph G
[0063] Set the properties of the node:
[0064] 'Region attributes' = attr1
[0065] 'Are there any cultural relics / historic sites / ancestral temples within the area' = attr2
[0066] 'Number of cultural relics / historic sites / ancestral temples within the scope' = attr3
[0067] S102, extracting the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix;
[0068] Specifically, step S102 includes: extracting the multigraph representing the urban structure to extract relevant data in the multigraph, wherein the relevant data includes connection relationship, scalar code, adjacency matrix, one-hot code, label, and edge matrix;
[0069] Reconstructing and generating an initial feature matrix according to the scalar encoding, the adjacency matrix, and the one-hot encoding;
[0070] Randomly generate a mask matrix according to the relevant data, wherein the mask matrix includes a test set label and a training set label;
[0071] According to the relevant data, an adjacency matrix, a label matrix, a one-hot encoding matrix, a measurable information matrix, and an initial feature matrix are obtained.
[0072] In this embodiment, the adjacency matrix refers to: using a one-dimensional array to store all vertex data in the graph; using a two-dimensional array to store the data of the relationship (edge or arc) between vertices, this two-dimensional array is called the adjacency matrix; using the adjacency matrix to represent the graph, it is easy to determine whether any two vertices in the graph are connected by an edge. The initial characteristic matrix refers to: a matrix that represents the initial characteristics, each row and column has a special meaning, and is used as an input parameter in an iteration.
[0073] S103, importing the matrix set into the trained graph convolutional neural network model for operation processing to generate an operation result;
[0074] Specifically, step S103 includes: importing the mask matrix, feature matrix, label, and edge matrix into the trained graph convolutional neural network model for operation processing to generate operation results;
[0075] Among them, the graph convolutional neural network model includes a convolution layer, a pooling layer, a back propagation mechanism, an activation function, and a loss function.
[0076] Preferably, before the matrix set is imported into the trained graph convolutional neural network model for operation processing and generating the operation result, the method further includes:
[0077] Constructing an initial graph convolutional neural network model, and inputting the initial feature matrix into the initial graph convolutional neural network model for training and calculation processing;
[0078] Each layer of the initial graph convolutional neural network model has two core functions, AGGREGATE function and COMBINE function, and the formula is:
[0079]
[0080]
[0081] in, , is the total number of layers of the initial graph convolutional neural network model, It is The set of neighbor nodes of a node, For the The AGGREGATE function of the layer, For the The COMBINE function of the layer, For the Layer neural network The representation of a node, For the Layer Neural Network Aggregation of information from all neighboring nodes of a node, For the Layer Neural Network Node Node representation;
[0082] The initial graph convolutional neural network model is trained by minimizing the loss function, and the formula is:
[0083]
[0084] in, For Node The annotation label, is the number of label nodes, is the loss function, is the objective function, For the neural network nodes The predicted label of
[0085] node Tag attributes The Softmax function is used for prediction, and the formula is:
[0086]
[0087] in, , is the number of labels in the output space, is the number of dimensions that represent the nodes, is the matrix representation symbol, One is the size of OK A matrix of columns, for Function to Node The predicted label of For the output layer Node representation;
[0088] Get the trained graph convolutional neural network model.
[0089] In this embodiment, Graph Neural Networks (GNN) refers to: a neural network architecture specially designed for deep learning on graph structures. Based on graph theory, Graph Neural Networks (GNN) are professional deep learning architectures that are good at extracting insights from graph structured data. In mathematics, a graph containing interconnected nodes and edges can represent abstract information and capture potential structural relationships. Urban system research has shown that graph theory performs well in many applications. GNNs combine graph theory and neural networks to perform feature aggregation and propagation between nodes and edges of complex graph topologies. This helps to learn potential patterns in the network at a deeper level.
[0090] In this embodiment, a graph convolutional neural network model is constructed, and the initial feature matrix is input into the graph convolutional neural network model for training and calculation. The information data of the historical city area is not complicated for computers, so it is not actually necessary to construct a particularly complex neural network to achieve good results. In essence, the graph neural network iteratively updates the representation of the node by combining the representation of the neighboring nodes and the representation of the node itself. The following is the general framework of the graph neural network: is the initial node representation; , , is Node representation of the layer; is the total number of layers of GNN, and each layer has two core functions: AGGREGATE function, which aggregates information from each node's neighbor nodes; COMBINE function, which updates the node representation by combining the aggregate information from neighbor nodes and the current node representation. :
[0091]
[0092]
[0093] in, It is The node representation of the last layer can be regarded as the final node representation. Given a set of labeled nodes, the entire model can be trained by minimizing the following loss function:
[0094]
[0095] in, For Node The annotation label, is the number of label nodes, is a loss function, such as the cross entropy loss function. The complete neural network can be back-propagated to make the objective function Minimize and optimize. If node representations are available, they can be used for downstream tasks. In this invention, it is a node classification task. Tag attributes The Softmax function can be used for prediction:
[0096]
[0097] in, , is the number of labels in the output space. The following is the pseudo code:
[0098] # Install required packages
[0099] Import os
[0100] Import torch
[0101] Set the environment variable 'TORCH' to the torch version number
[0102] Print the torch version number
[0103] Install the torch-scatter package
[0104] Install the torch-sparse package
[0105] Install the pytorch_geometric package
[0106] # Helper functions for visualization
[0107] import matplotlib.pyplot as plt
[0108] Import TSNE from sklearn.manifold
[0109] Define function visualize_graph(G, color)
[0110] Define function visualize_embedding(h, color, epoch, loss)
[0111] # Define model class GCN
[0112] Define class GCN inherited from torch.nn.Module
[0113] Define the initialization function __init__()
[0114] Initialize the random number generator using seed 1234
[0115] Initialize GCNConv layer conv1, input feature dimension is the number of columns of data.bT, output feature dimension is 64
[0116] Initialize GCNConv layer conv2 with input feature dimension of 64 and output feature dimension of 16
[0117] Initialize GCNConv layer conv3 with input feature dimension of 16 and output feature dimension of 6
[0118] Initialize the linear layer classifier with an input feature dimension of 6 and an output feature dimension of 6
[0119] Define the forward propagation function forward(x, edge_index)
[0120] Use conv1 to convolve the input x and edge index edge_index to get the hidden representation h
[0121] Apply tanh activation function to h
[0122] Use conv2 to convolve h and edge index edge_index to get the hidden representation h
[0123] Apply tanh activation function to h
[0124] Use conv3 to convolve h and edge index edge_index to get the hidden representation h
[0125] Apply tanh activation function to h
[0126] Use classifier to classify h
[0127] Return the classification result out and hidden representation h
[0128] Creating a GCN Model
[0129] _, h = forward pass of the model using the input data data.b.float() and the edge index data.edge_index
[0130] Visualize the embedding vector h, with the color of data.z
[0131] Import the time module
[0132] Importing the Javascript module in IPython.display
[0133] Define the training function train(data)
[0134] Clearing gradients in the optimizer
[0135] Perform forward propagation on the input data data.b.float() and edge index data.edge_index to obtain the classification result and hidden representation
[0136] Calculate the loss based only on the training nodes
[0137] Back propagation, calculating gradients
[0138] Update model parameters
[0139] Return loss and hidden representation
[0140] Initialize the loss list loss_remember
[0141] For each epoch in the range [0, 500]:
[0142] Call the train function to get the loss and hidden representation
[0143] Add the loss to the loss list loss_remember
[0144] If the current epoch is divisible by 10:
[0145] Visualize the embedding vector h, color is data.z, show the current epoch and loss
[0146] Wait for a number of milliseconds
[0147] S104, performing visualization processing on the calculation result to generate a visualization result, and calculating the visualization result in combination with the connection relationship to generate the boundary position of the historical and cultural block;
[0148] Specifically, step S104 includes: inputting the operation results into the embedding modules of all nodes to perform linear classification processing;
[0149] Input the calculation results after linear classification into the embedding module of the historical and cultural block node to generate visualization results;
[0150] The connection relationship and the visualization result are comprehensively acquired and processed to calculate and generate the boundary position of the historical and cultural block.
[0151] In this embodiment, after training is completed, the computer will output the embedding of each node. The embedding is a collection of 3-6 specific values that represent structural information and various data. Users can determine which nodes belong to the city's historical area by observing the spatial distribution of the embedding. Figure 5 and Figure 6 This is the training visualization of this program, showing the changes in the spatial distribution of embeddings during the training process from a two-dimensional perspective. As the number of iterations increases, the graph neural network gradually separates the nodes belonging to the historical district from the initial chaos. In the figure, the circular nodes gathered at the bottom are ordinary nodes, the triangular nodes and square nodes gathered at the top are nodes belonging to the historical city area, the nodes gathered in the upper left corner are the core nodes of the historical city area, and the nodes gathered in the upper right corner are the edge nodes of the historical city area. Figure 6 Shown is the spatial distribution of the embedding after 500 iterations viewed from a 3D perspective.
[0152] S105, using an accurate quantitative difference degree algorithm to compare the location of the historical and cultural block boundary and the actual total historical and cultural block control line location to generate a historical city boundary judgment conclusion, wherein the accurate quantitative difference degree algorithm includes a polar coordinate rotation change diagram and a point set similarity from a Hausdorff distance perspective.
[0153] Specifically, step S106 includes: obtaining point set A and point set B, and calculating the shortest distance from each point in point set A to point set B, and the calculation formula is:
[0154]
[0155] in, is the number of point set A;
[0156] Calculate the shortest distance from each point in point set B to point set A. The calculation formula is:
[0157]
[0158] in, is the number of point set B;
[0159] Calculate the average value of the global shortest distance between each point in point set A and point set B. The calculation formula is:
[0160]
[0161] In the calculation point set A, Point to The distance between points is:
[0162]
[0163] Calculate the average distance from each point in point set A to all other points, calculate the sum of each average value, and then find the final average value of point set A. The calculation formula is:
[0164]
[0165] In the calculation point set B, Point to The distance between points is:
[0166]
[0167] Calculate the average distance from each point in point set B to all other points, calculate the sum of each average value, and then find the final average value of point set B. The calculation formula is:
[0168]
[0169] Among them, the final average value of the point set A and the final average value of the point set B Used to reflect the density of point sets;
[0170] According to the final average value of the point set A and the final average value of the point set B The average value of the global shortest distance Normalization is performed to stabilize the Hausdorff distance similarity between the output point set A and the point set B. , Hausdorff distance similarity The calculation formula is:
[0171]
[0172] Among them, point set A is the historical urban area boundary corresponding to the boundary position of the historical and cultural block, and point set B is the officially announced boundary.
[0173] In this embodiment, Hausdorff Distance-Similarity Ratio (Hausdorff Distance-Similarity Ratio, ) refers to: a method to measure the similarity between point set A and point set B, focusing on the overlap in position.
[0174] Because the outlines of most historical urban areas are irregular, it is necessary to design a reliable algorithm to measure the difference between the calculated results and the actual boundaries. It can directly output the percentage of similarity between the boundaries determined by the new method and the actual boundaries. This algorithm is inspired by the Hausdorff distance algorithm, so it is called the Hausdorff distance similarity ratio. For any irregular contour line, it can be regarded as a point set composed of many points distributed on the contour line. For any two point sets A and B, the number of points they have is and . Define a metric called , which can directly measure the similarity between point set A and point set B in the form of percentage. It consists of the following parameters:
[0175] First, the shortest distance from each point in point set A to point set B:
[0176]
[0177] Likewise, It is the shortest distance from each point in point set B to point set A. Therefore, the average value of the global shortest distance between point set A and each point in point set B is: .
[0178] Second, in point set A, Point to The distance between the points is recorded as:
[0179]
[0180] Each point has an average distance to all other points, and the sum of these averages is averaged:
[0181]
[0182] The same goes for point set B.
[0183] and Reflects the density of the point set and is used for normalization Ensure that no matter whether point set A and point set B are sparse or dense, stable output can be achieved .
[0184] Third, the Hausdorff distance similarity between point set A and point set B is:
[0185]
[0186] Point set A is the boundary of the historical urban area determined by computer, and point set B is the boundary announced by the government.
[0187] The following is the pseudo code of this module:
[0188] # Define similarity calculation function
[0189] Define the function similarity(A, B)
[0190] Initialize the empty list min_dists_a
[0191] For each point a in A:
[0192] Calculate the shortest distance min_dist from point a to point set B and add it to min_dists_a
[0193] Initialize the empty list min_dists_b
[0194] For each point b in B:
[0195] Calculate the shortest distance min_dist from point b to point set A and add it to min_dists_b
[0196] Calculate the average of min_dists_a and min_dists_b to get diff
[0197] Calculate the internal average distance of point set A and point set B, and store them in inner_a and inner_b respectively
[0198] Calculate the average of inner_a and inner_b to get inner_diff
[0199] Calculate the ratio of diff to inner_diff to get ratio
[0200] Calculate the Hausdorff distance profile accuracy similarity, using max(1 - ratio, 0) for calculation
[0201] Returns similarity, ratio, diff, inner_diff
[0202] # Define a function to calculate the average distance within a point set
[0203] Define function inner_dist(points)
[0204] Initialize the empty list distances
[0205] For each point p1 in points:
[0206] Initialize the empty list p1_dists
[0207] For each point p2 in points:
[0208] If p1 is not equal to p2:
[0209] Calculate the distance dist from point p1 to point p2 and add it to p1_dists
[0210] Calculate the average distance p1_mean_dist from point p1 to all other points and add it to distances
[0211] Calculate the sum of distances total_dist
[0212] Return total_dist divided by the length of points to get the average internal distance
[0213] In summary, the historical urban area boundary judgment method based on graph neural network takes urban bus stations, bridges, urban landmark buildings, etc. as anchor points, and gives these anchor points objective attributes, and then forms a "graph" of urban systems such as road systems and river systems to represent the urban structure, and then uses graph neural network to let the computer judge the urban protection scope by itself. This method can better utilize the more abstract information and structural hierarchical information in the city, and provide a reliable reference for the formulation of subsequent urban protection measures.
[0214] See also Figure 7 The second embodiment of the present invention further provides a device for determining the boundary of a historical urban area based on a graph neural network, which includes:
[0215] The conversion unit 201 is used to obtain multivariate data to be processed, and perform conversion processing on the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data;
[0216] A matrix information extraction unit 202 is used to extract the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix;
[0217] A neural network operation unit 203 is used to import the matrix set into a trained graph convolutional neural network model for operation processing to generate an operation result;
[0218] A visualization unit 204 is used to perform visualization processing on the calculation result to generate a visualization result, and calculate the visualization result in combination with the connection relationship to generate the boundary position of the historical and cultural block;
[0219] The detection and verification unit 205 is used to use an accurate quantitative difference degree algorithm to compare the boundary position of the historical and cultural block and the actual total historical and cultural block control line position to generate a historical city boundary judgment conclusion, wherein the accurate quantitative difference degree algorithm includes a polar coordinate rotation change diagram and a point set similarity from a Hausdorff distance perspective.
[0220] The third embodiment of the present invention also provides a historical urban area boundary judgment device based on a graph neural network, which includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement any of the historical urban area boundary judgment methods based on a graph neural network as described above.
[0221] Exemplarily, the above-mentioned devices and process steps can be implemented by a computer program. The computer program can be divided into one or more units. The one or more units are stored in the memory and executed by the processor to complete the present invention.
[0222] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0223] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the present invention by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0224] Wherein, if the electronic device or printer integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0225] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0226] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for determining the boundary of a historical urban area based on graph neural network. It is characterized in that include: Acquire multivariate data to be processed, and transform the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data; Extracting the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix; Importing the matrix set into a trained graph convolutional neural network model for operation processing to generate operation results; Performing visualization processing on the operation results to generate visualization results, and calculating the visualization results in combination with the connection relationship to generate the boundary position of the historical and cultural block; The precise quantitative difference degree algorithm is used to compare the boundary position of the historical and cultural block with the actual total historical and cultural block control line position to generate a conclusion on the boundary judgment of the historical urban area, wherein the precise quantitative difference degree algorithm includes a polar coordinate rotation change diagram and a point set similarity from the Hausdorff distance perspective; The multiple graphs representing the urban structure are extracted to obtain a matrix set, which includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a measurable information matrix, and an initial feature matrix, specifically: Performing extraction processing on the multigraph representing the urban structure to extract relevant data in the multigraph, wherein the relevant data includes connection relationship, scalar encoding, one-hot encoding, label, and edge matrix; Reconstructing and generating an initial feature matrix according to the scalar encoding, the adjacency matrix, and the one-hot encoding; Randomly generate a mask matrix according to the relevant data, wherein the mask matrix includes a test set label and a training set label; According to the relevant data, an adjacency matrix, a label matrix, a one-hot encoding matrix, and a measurable information matrix are obtained; The operation results are visualized to generate visualization results, and the visualization results are calculated in combination with the connection relationship to generate the boundary position of the historical and cultural block, specifically: Inputting the operation results into the embedding modules of all nodes to perform linear classification processing; Input the calculation results after linear classification into the embedding module of the historical and cultural block node to generate visualization results; Comprehensively obtain and process the connection relationship and the visualization result to calculate and generate the boundary position of the historical and cultural block; Before the matrix set is imported into the trained graph convolutional neural network model for operation processing and generating the operation result, the method further includes: Constructing an initial graph convolutional neural network model, and inputting the initial feature matrix into the initial graph convolutional neural network model for training and calculation processing; Each layer of the initial graph convolutional neural network model has two core functions, AGGREGATE function and COMBINE function, and the formula is: Where k∈{1,2,3,…,K}, K is the total number of layers of the initial graph convolutional neural network model, N(v) is the set of neighbor nodes of the vth node, AGGREGATE k is the AGGREGATE function of the kth layer, COMBINE k is the COMBINE function of the kth layer, is the representation of the vth node in the kth layer of the neural network, is the information aggregation of all neighbor nodes of node v in the k-th layer neural network, is the representation of the vth node in the k-1th layer of the neural network; The initial graph convolutional neural network model is trained by minimizing the loss function, and the formula is: Among them, y i is the label of node i, n l is the number of label nodes, loss() is the loss function, O is the objective function, is the predicted label of node i by the neural network; The label attribute y of node v v The Softmax function is used for prediction, and the formula is: Where W∈R |n|×F , |n| is the number of labels in the output space, F is the number of node representation dimensions, R is the matrix representation symbol, and W is a matrix with size |n| rows and F columns. is the predicted label of node v by the Softmax function, is the representation of the v node in the output layer; Get the trained graph convolutional neural network model.
2. According to the method for determining the boundary of a historical urban area based on a graph neural network according to claim 1, It is characterized in that The matrix set is imported into the trained graph convolutional neural network model for operation processing to generate the operation results, specifically: Importing the mask matrix, feature matrix, label, and edge matrix into the trained graph convolutional neural network model for operation processing to generate operation results; Among them, the graph convolutional neural network model includes a convolution layer, a pooling layer, a back propagation mechanism, an activation function, and a loss function.
3. According to the method for determining the boundary of a historical urban area based on a graph neural network as described in claim 1, It is characterized in that The precise quantitative difference degree algorithm is used to compare the location of the boundary of the historical and cultural block and the location of the actual total historical and cultural block control line to generate the conclusion of the historical urban area boundary judgment, specifically: Get point set A and point set B, and calculate the shortest distance from each point in point set A to point set B. The calculation formula is: Among them, n A is the number of point set A; Calculate the shortest distance from each point in point set B to point set A. The calculation formula is: Among them, n B is the number of point set B; Calculate the average value of the global shortest distance between each point in point set A and point set B. The calculation formula is: Calculate the distance from the kth point to the lth point in the point set A. The formula is: D A(k→l) ,(k,l=1,2,3,…,n A ) Calculate the average distance from each point in point set A to all other points, calculate the sum of each average value, and then find the final average value of point set A. The calculation formula is: Calculate the distance from the k1th point to the l1th point in point set B. The formula is: D B(k1→l1) ,(k1,l1=1,2,3,…,n B ) Calculate the average distance from each point in point set B to all other points, calculate the sum of each average value, and then find the final average value of point set B. The calculation formula is: Among them, the final average value of the point set A and the final average value of the point set B Used to reflect the density of point sets; According to the final average value of the point set A and the final average value of the point set B The average value of the global shortest distance Normalization is performed to stabilize the Hausdorff distance similarity rate HDSR between the output point set A and the point set B A,B , Hausdorff distance similarity rate HDSR A,B The calculation formula is: Among them, point set A is the historical urban area boundary corresponding to the boundary position of the historical and cultural block, and point set B is the officially announced boundary.
4. A device for determining the boundary of a historical urban area based on a graph neural network, used to implement the method for determining the boundary of a historical urban area based on a graph neural network as claimed in claim 1, It is characterized in that include: A conversion unit is used to obtain multivariate data to be processed, and perform conversion processing on the multivariate data to construct a multi-graph representing the urban structure, wherein the multivariate data includes river system data, public transportation system data, location data of cultural relics protection units, administrative area data, location data of ancient and famous trees, and other data; A matrix information extraction unit, used for extracting the multiple graphs representing the urban structure to obtain a matrix set, wherein the matrix set includes an adjacency matrix, a label matrix, a mask matrix, a one-hot encoding matrix, a quantifiable information matrix, and an initial feature matrix; A neural network operation unit, used for importing the matrix set into a trained graph convolutional neural network model for operation processing to generate an operation result; A visualization unit, used to perform visualization processing on the operation result to generate a visualization result, calculate the visualization result in combination with the connection relationship, and generate the boundary position of the historical and cultural block; The detection and verification unit is used to compare the boundary position of the historical and cultural block with the actual total historical and cultural block control line position using an accurate quantitative difference degree algorithm to generate a historical city boundary judgment conclusion, wherein the accurate quantitative difference degree algorithm includes a polar coordinate rotation change diagram and a point set similarity from a Hausdorff distance perspective.
5. A device for judging the boundary of historical urban areas based on graph neural network. It is characterized in that It includes a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement the method for determining the boundary of a historical urban area based on a graph neural network as described in any one of claims 1 to 3.
Citation Information
Patent Citations
High-resolution PolSAR image urban terrain classification method based on deep learning
CN107194349A
Urban data real-time management method and system based on graph neural network of real network graph
CN115795996A
Urban functional area identification method and device, equipment and medium
CN117079148A
Wireless sensor network distributed node cooperative positioning method based on graph neural network
CN117241215A
Urban epidemic space-time prediction method and system, terminal and storage medium
WO2023123625A1
