A controllable hierarchical road topology generation system and method based on AIGC

Through the AIGC-based hierarchical road topology generation system, the graph neural network and transformer model are used to independently generate nodes and edges, which solves the problem that single-level road network generation in the existing technology cannot meet the needs of multi-level road networks, and realizes efficient and diversified hierarchical road network topology generation, which improves planning and design efficiency and support for autonomous driving road network deployment.

CN118397449BActive Publication Date: 2025-03-21ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410475717.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2025-03-21
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

The existing road topology generation methods are mainly focused on the creation of single-level road networks, which cannot effectively reflect multi-level and multi-functional road network systems in complex urban environments, and relying on manual design leads to inefficiency and insufficient diversity.

Method used

A controllable hierarchical road topology generation system based on AIGC is adopted to obtain urban OSM data for rasterization processing and merging, and a hierarchical road network topology generation model is constructed, including a graph-based conditional variational autoencoder and a transformer-based generator to independently control the generation process of nodes and edges.

Benefits of technology

It realizes efficient generation of hierarchical road topology that meets given conditions, reduces dependence on manual design, improves the efficiency of road network planning and design, and provides simulation and computing support for the deployment of autonomous driving dedicated road networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397449B_ABST
    Figure CN118397449B_ABST
Patent Text Reader

Abstract

The present invention discloses a controllable hierarchical road topology generation system and method based on AIGC, which belongs to the technical field of urban road network generation. The method mainly includes: obtaining urban OSM data, rasterizing road networks of different levels, merging and clipping the processed road networks, and obtaining a hierarchical road network topology map; constructing and training a hierarchical road network topology generation model to obtain a generation model that can generate a corresponding hierarchical road network topology map according to an input conditional vector; when applied, only the conditional vector needs to be input into the trained generation model, and the model can generate a hierarchical road topology map that satisfies the conditional vector constraints. Among them, the hierarchical road network topology generation model includes a graph-based conditional variational autoencoder and a transformer-based generator. The model can decouple node attributes and edge connections, and can independently control the generation process of nodes and edges to adapt to different design requirements and constraints.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urban road network generation, and in particular to a controllable hierarchical road topology generation system and method based on AIGC (Artificial Intelligence Generated Content). Background Art

[0002] In the field of urban planning and traffic engineering, the generation of road topology is a complex and important task. It involves the design of road networks, which directly affects the efficiency, safety, and environmental sustainability of urban traffic flows. However, most of the existing road topology generation methods focus on the creation of single-level road networks, ignoring the reality and importance of multi-level road networks in complex urban environments. Single-level road network generation usually focuses on the local structure of roads to generate a coherent and practical road network. Although this method is effective enough for small-scale or relatively simple scenarios, it cannot reflect the multi-level and multi-functional road network system in the real world. Single-level road network generation does not consider the hierarchical relationship and functional differences between roads, which may lead to the inefficiency of the generated road network in handling different types of traffic flows, scales, and traffic densities.

[0003] At the same time, in traditional urban planning and design, everything from road network design to indicator setting is done manually by professional planners. When certain factors need to be adjusted, the entire work process needs to be repeated. As the complexity of road planning increases, manual road planning has become increasingly limited. In addition, the generated road network model is not diverse enough, and it is impossible to generate a certain number of road networks for selection in subsequent tasks.

[0004] In recent years, generative artificial intelligence has received extensive attention, and deep generative models such as variational autoencoder (VAE), generative adversarial network (GAN), and diffusion model have been formed. These models have shown good performance in uniqueness, novelty, and diversity in many fields such as image synthesis, image style transfer, text generation, and drug molecule design, and have been widely used. Deep generative models are usually based on deep neural networks to approximate the complex and high-dimensional probability distribution implicit in the data set; sampling under this probability distribution can generate new data samples, and the generated samples are statistically close to the training data set. However, although deep generative models have demonstrated their powerful capabilities and flexibility in many fields, the current development of technology has not been able to effectively apply these models to the generation of hierarchical road network topology. The generation of hierarchical road network topology involves complex geospatial information processing and road network structure design. The particularity and complexity of these problems require more specialized solutions and technological innovations. Summary of the invention

[0005] In view of the above-mentioned deficiencies, the present invention provides a controllable hierarchical road topology generation system and method based on AIGC.

[0006] The present invention first provides a controllable hierarchical road topology generation method based on AIGC, which comprises the following steps:

[0007] 1) Obtain city OSM data and perform rasterization on road networks of different levels; perform grayscale merging and RGB merging on the rasterized road networks of different levels to obtain grayscale merging images and RGB merging images; crop the grayscale merging images and RGB merging images to the same size, extract the road topology map from the cropped grayscale merging images, and obtain the attributes of each node in the road topology map from the cropped RGB merging images, thereby obtaining a hierarchical road network topology map as training data;

[0008] 2) constructing a hierarchical road network topology generation model, and using the training data in step 1) to train the model, to obtain a generation model that can generate a corresponding hierarchical road network topology map according to the input condition vector;

[0009] The hierarchical road network topology generation model includes a graph-based conditional variational autoencoder, a transformer-based generator, a node generation module, a degree generation module, an edge connection module and a post-processing module;

[0010] Among them, the graph-based conditional variational autoencoder takes the data and conditional vector of the hierarchical road network topology as input to generate node features that match the given conditions; the transformer-based generator accepts the node adjacency matrix and the node features output by the conditional variational autoencoder; the generator captures the local and global relationships between the graph nodes, thereby obtaining the edge features that describe the node connection relationship; the node generation module accepts the node features and conditional vectors generated by the conditional variational autoencoder to generate node attributes; the degree generation module obtains the edge features output by the transformer-based generator to generate the degree of the node; the edge connection module obtains the edge features output by the transformer-based generator to generate an adjacency probability matrix representing the probability of node connection, and then combines the degree of the node to select the nodes that each node is most likely to connect to from the adjacency probability matrix, that is, the nodes with the largest connection probability, and the number of selected nodes is equal to the degree of the node; after selection, an adjacency matrix that can represent the node connection relationship is obtained; the post-processing module assigns the node category attributes generated by the node generation module to the nodes in the adjacency matrix, and the generated hierarchical road topology map can be obtained;

[0011] 3) When applied, the conditional vector is input into the trained hierarchical road network topology generation model, and the model can generate a hierarchical road topology map that meets the conditional vector constraints.

[0012] Preferably, the condition vector C vec Average depth of the graph Average node degree of graph and road network density Composition, k1k2, k3 all represent the size of the dimension,

[0013]

[0014]

[0015]

[0016] Where N represents the total number of nodes in the graph. and Represent the depth and degree of node i respectively, and M represents the number of edges in the graph; these indicators are encoded using one-hot encoding, and then they are concatenated together to form the conditional vector C vec ; The conditional vector is used to guide the model to generate a hierarchical road network topology that meets the requirements of the conditional vector.

[0017] The total loss function L in the training process of the hierarchical road network topology generation model total It is expressed as:

[0018] L total =αL attr +βL KL+γL edge +δL degree

[0019] Among them, α, β, γ, δ are weight coefficients, L attr is the node attribute loss term and L KL is the KL divergence loss term of the node; L edhe is the positive and negative sample prediction loss term for edge connections, L degree is the loss term for the node degree prediction task.

[0020] The present invention also provides a controllable hierarchical road topology generation system for implementing the above method, which comprises:

[0021] A training data generation system obtains city OSM data, performs rasterization processing on road networks of different levels; performs grayscale merging and RGB merging on the rasterized road networks of different levels, respectively, to obtain grayscale merging images and RGB merging images; crops the grayscale merging images and RGB merging images to the same size, extracts a road topology map from the cropped grayscale merging images, and obtains the attributes of each node in the road topology map from the cropped RGB merging images, thereby obtaining a hierarchical road network topology map as training data;

[0022] A model building and training module, which is used to build the hierarchical road network topology generation model and train the generation model using the training data;

[0023] The application module calls the trained hierarchical road network topology generation model according to the input condition vector and outputs a hierarchical road topology map that meets the condition vector constraints.

[0024] Compared with the prior art, the hierarchical road network topology generation model proposed in the present invention includes two key components: a graph-based conditional variational autoencoder (GraphCVAE) and a transformer-based generator. GraphCVAE is used to generate nodes. It can learn and encode the complex distribution of node characteristics and generate new node data through variational inference. The advantage of graphCVAE is that it can capture the latent variables of node attributes and generate diverse node attributes that meet given conditions. The transformer-based generator is used to generate edge connections. The transformer model has a self-attention mechanism and can capture long-distance dependencies, which makes it excellent in understanding complex relationships between nodes. In road network topology generation, transformer can be used to effectively generate edge connections between nodes to ensure that the generated road network structure has a high degree of reliability and practicality. Through the combination of these two components, the model of the present invention can decouple node attributes and edge connections, which means that the generation process of nodes and edges can be independently controlled. The benefit of this decoupling is that the generation of nodes and edges can be optimized separately to adapt to different design requirements and constraints.

[0025] The present invention utilizes AIGC to efficiently generate a hierarchical road topology that meets given conditions, avoids dependence on manually designed road networks, and improves the efficiency of road network planning and design.

[0026] The hierarchical road topology generation model of the present invention can decouple node attribute generation and edge connection generation, which means that the node and edge generation processes can be independently controlled. The benefit of this decoupling is that the generation of nodes and edges can be optimized separately to adapt to different design requirements and constraints.

[0027] Different levels of autonomous driving technology have different requirements for road grades. Therefore, the generation of hierarchical road network topology can provide simulation and computing support for the deployment of dedicated road networks for autonomous driving, ensuring that the road network design can maximize the use of existing road network resources while optimizing traffic flow and improving the driving experience of autonomous driving vehicles. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is the process of extracting the hierarchical road network topology map;

[0029] Figure 2 Generate model framework diagram for hierarchical road network topology;

[0030] Figure 3A hierarchical road network topology diagram with different numbers of nodes that meet conditional constraints is generated in the embodiment. DETAILED DESCRIPTION

[0031] In order to describe the present invention more specifically, the technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0032] The present invention represents the hierarchical road network topology as a graph G = (V, E), which includes a node set V consisting of a finite number of points and an edge set E consisting of a finite number of edges, where an edge represents the connection relationship between two nodes. The nodes is the d-dimensional feature vector of node i in the graph, which consists of feature code + node first-level and second-level degrees + node type, expressed as formula (1):

[0033]

[0034] in Represents the node v in the hierarchical road network topology graph i The structured features encoded by the node2vec algorithm are composed of several irregular numbers. For example, when d1=10, the node v i N2V i =[-1.409,2.014,4.329,1.973,-1.827,2.279,1.324,1.022,1.167,0.254], and Respectively represent the node v i The first-level degree and second-level degree of node v are encoded using one-hot vectors. The first-level degree represents the i The total number of connected nodes. The second-level degree represents the number of nodes connected to node v. i The sum of the degrees of all nodes connected to , that is, node v i The sum of the number of nodes in the order. i Indicates the node type. The actual meaning of the node type here in the hierarchical topology road network is the intersection type, which can be an intersection of the same type of roads or an intersection of different types of roads.

[0035] represents an edge list, which details the indexes of the starting and ending points of the edges. Using the edge index information, the present invention can construct an adjacency matrix A={a uv}∈{0,1} N×N , which means: if edge(u,v)∈E, a uv =1, otherwise a uv= 0, edge(u,v) represents the edge connecting node u and node v. The present invention only focuses on the type of intersections and the connection relationship between intersections, ignoring the type of edges. Therefore, the hierarchical road network topology diagram of the present invention is a heterogeneous undirected graph. Most roads in reality are bidirectional, so describing the connection between nodes as undirected is also in line with the actual situation.

[0036] The basic process of the controllable hierarchical road topology generation method based on AIGC of the present invention includes the following steps:

[0037] 1) First, obtain the city OSM data and rasterize the road networks of different levels; perform grayscale merging and RGB merging on the rasterized road networks of different levels to obtain grayscale merging images and RGB merging images; crop the grayscale merging images and RGB merging images to the same size, extract the road topology map from the cropped grayscale merging images, and obtain the attributes of each node in the road topology map from the cropped RGB merging images, so as to obtain the hierarchical road network topology map as training data;

[0038] 2) constructing a hierarchical road network topology generation model, and using the training data in step 1) to train the model, to obtain a generation model that can generate a corresponding hierarchical road network topology map according to the input condition vector;

[0039] 3) When applied, the conditional vector is input into the trained hierarchical road network topology generation model, and the model can generate a hierarchical road topology map that meets the conditional vector constraints.

[0040] For step 1), there is currently no public data set specifically for hierarchical road network topology, and most of them are aerial image data sets. To this end, the present invention selects several large and medium-sized cities from the OSM data, and parses out different types of road networks (such as highways, main roads, and secondary roads) therefrom. In a real road network, different types of roads can be directly connected through intersections, and some are connected through ramps. Since the present invention only focuses on the connection relationship and does not pay attention to the specific implementation method of the connection, the present invention can extract the hierarchical road topology through a rasterized image. Specifically, the OSM road network topology data is first rasterized, and then the open source sknw tool is used to extract the road network topology on the rasterized image. At this time, the extracted road network topology nodes do not have category attributes and need further processing.

[0041] In order to obtain the specific attributes of the nodes, the present invention stores the aforementioned rasterized road network types as pictures of different colors, that is, each color represents a road network type. Finally, the present invention can use the color relocation algorithm proposed in this article to realize the classification of road network topology nodes. Specifically, before RGB merging in step 1), different levels of road networks are colored with different colors, and each color represents a road network type; when RGB is merged, the intersections between different levels of road networks are assigned colors; the method of obtaining the attributes of each node in the road topology map from the cropped RGB merged image is to adopt a color relocation method. The general principle of the color relocation algorithm is to use the pixel coordinates of the node to query the color information of the road network of different colors at this position, and we classify the nodes according to the color information. The color relocation method is specifically: using the pixel coordinates of the node to query the color at the node coordinate from the RGB merged image, determining the category of the node according to the color, and assigning the category to the node as the attribute of the node.

[0042] Figure 1 The process of obtaining a hierarchical road network topology map in a specific embodiment is shown. First, the OSM data of a city is downloaded from the OSM official website. Then, the road networks of different levels are rasterized. The present invention processes two levels of road networks, namely, the first level road network: elevated roads and expressways, and the second level road network: urban trunk roads. Then, the grayscale images of the two levels of road networks are stacked together ( Figure 1 Before RGB merging, the two-level road network needs to be colored, with the first-level road network colored red and the second-level road network colored blue. When RGB is merged, the intersection of the first-level and second-level road networks is colored red. After that, the road network of a city can be cut into small pictures of different sizes according to the needs of the road network design. For example, the present invention cuts the picture according to 512*512 pixels. Figure 1 The topology extraction in is to extract the road topology map from the cropped grayscale merged map. At the same time, the RGB merged map is also cropped according to the same size, and then the color relocation method can be used to obtain the attributes of each node in the topology map. After the above processing, the hierarchical road network topology map can be obtained.

[0043] like Figure 2 As shown, the hierarchical road network topology generation model in step 2) of the present invention includes a graph-based conditional variational autoencoder GraphCVAE, a transformer-based generator, a node generation module, a degree generation module, an edge connection module and a post-processing module.

[0044] Among them, the graph-based conditional variational autoencoder takes the data and conditional vector of the hierarchical road network topology map as input to generate node features matching the given conditions; the transformer-based generator accepts the node adjacency matrix and the node features output by the conditional variational autoencoder; the generator captures the local and global relationships between the graph nodes, thereby obtaining the edge features describing the node connection relationship; the node generation module accepts the node features and conditional vectors generated by the conditional variational autoencoder to generate node attributes; the degree generation module obtains the edge features output by the transformer-based generator to generate the degree of the node; the edge connection module obtains the edge features output by the transformer-based generator to generate an adjacency probability matrix representing the probability of node connection, and then combines the degree of the node to select the nodes that each node is most likely to connect to from the adjacency probability matrix, that is, several nodes with the largest connection probability, and the number of selected nodes is equal to the degree of the node; after selection, an adjacency matrix that can represent the node connection relationship is obtained; the post-processing module assigns the node category attributes generated by the node generation module to the nodes in the adjacency matrix, and the generated hierarchical road topology map can be obtained.

[0045] The present invention focuses on the generation of hierarchical road network topology, which can be regarded as a heterogeneous undirected graph. If node attributes and their edges are generated simultaneously, the complexity of network design will be significantly increased. To meet this challenge, the present invention adopts a strategy of decomposing the task into two stages: node generation and edge generation, achieving decoupling between tasks. For node generation, the present invention designs and implements a graph-based conditional variational autoencoder (GraphCVAE) network, which consists of two main parts: an encoder and a decoder. The encoder uses the GraphSAGE model, which is an efficient framework that uses the local neighborhood feature information of nodes to generate node embeddings. Further, the present invention combines the framework with a multi-layer perceptron (MLP) layer to generate a graph-level potential representation of the input graph. The decoder uses the MLP architecture and a GraphSAGE-based model to perform the inverse process of the encoder to predict reconstructed node features. These reconstructed node features are not only used to predict node attributes (obtained through a graph convolutional layer), but also serve as the input of the subsequent Transformer-based generator to provide the necessary information basis for edge generation. In the present invention, we start from the assumption that the road network topology in the real world represents an optimal layout. In order to achieve the generated hierarchical road network topology to be consistent with the real road network, that is, to increase the controllability of the generation process, the present invention conducts an in-depth analysis of the real road network topology graph. Specifically, the present invention calculates key indicators such as the average depth of the graph, the average node degree, and the road network density, and converts these indicators through one-hot encoding, and integrates them into the input of the network model as conditional control vectors. In this way, the present invention ensures that the road network topology generated by the model is not only similar in structure to the road network in the real world, but can also be adjusted according to specific statistical characteristics, thereby improving the usability of the model in practical applications and the authenticity of the generated road network.

[0046] In the present invention, the type of edge is actually related to the node attributes. This is why the present invention divides the generation of the hierarchical road network topology map into two stages. That is, in the edge connection prediction of the graph, the present invention only focuses on the existence of the edge between the nodes, but not the type of the edge. As can be seen from the node type, there are naturally differences in the edge types between different nodes, and the edge types between nodes of the same type are consistent. The weight of the edge is not considered here for the time being. This natural attribute is also coupled with the road network in the real scene. For example, the road between the various connection points of the highway is a highway, and the connection between the highway and the urban express road is a ramp.

[0047] In order to capture the local and global relationships between graph nodes, the present invention creates a transformer-based generator. It is specifically divided into a multi-head attention module and a graph modeling module. In view of the fact that the graph structure essentially lacks natural ordering, the positional encoding (PE) used for sequence elements in the traditional transformer model cannot be used directly. In order to solve this problem, the present invention combines the degree of each node with the learnable positional encoding to construct a positional encoding for the graph node. The multi-head attention module is used to obtain the global relationship between nodes. The graph modeling module is used to obtain local information between graph nodes. Two task heads are connected to the transformer-based generator to generate the degree of the node and the edge connection relationship between the nodes. The task of the present invention mainly consists of node attribute and edge connection relationship prediction. When training the model, the loss function of the GraphCVAE model is: the node attribute loss term L attr And the KL (Kullback-Leibler, KL) divergence loss term L of the node KL The transformer-based generator module contains two loss terms. The first is the edge connection positive and negative sample prediction loss term L edge Secondly, the node degree in the road network is usually limited. For example, the degree of an intersection is 4, and the degree of some roundabouts may be 5. Using the node degree constraint, the present invention also constructs a loss term L for the node degree prediction task. degree , which helps the generated road network to be more realistic. The overall loss function is shown in formula (2), where α, β, γ, and δ are weight coefficients that will be adjusted according to the training stage.

[0048] L total =αL attr +βL KL +γL edge +δL degree (2)

[0049] The following is a detailed description of the graph-based conditional variational autoencoder and transformer-based generator in the hierarchical road network topology generation model of the present invention. The graph-based conditional variational autoencoder takes the data of the hierarchical road network topology graph and the conditional vector as input to generate node features that match the given conditions; the transformer-based generator accepts the node adjacency matrix and the node features output by the conditional variational autoencoder; the generator captures the local and global relationships between graph nodes, thereby obtaining edge features that describe the node connection relationship;

[0050] like Figure 2As shown, the graph-based conditional variational autoencoder of the present invention consists of two main parts: an encoder and a decoder. The encoder uses the GraphSAGE model in the existing method, which is an efficient framework that uses the local neighborhood feature information of the node to generate node embedding. Furthermore, the present invention combines the framework with a multi-layer perceptron (MLP) layer to generate a graph-level potential representation of the input graph. The encoder can be expressed as shown in formula (3):

[0051] P(Z)=ENC(X+C,E)=MLP(GraphSAGE(X+C,E)) (3)

[0052] Where P(Z) is the latent representation of the graph, ENC is a GraphSAGE model followed by an MLP layer, and GraphSAGE stands for Graph Sample and Aggregate model. represents the original node features excluding the node type label, and C is the conditional vector.

[0053] The decoder uses an MLP architecture and a GraphSAGE-based model to perform the opposite process of the encoder to generate reconstructed node features.

[0054]

[0055] in, are the reconstructed node features from the encoder. These reconstructed features After a graph convolution layer, the node attributes can be obtained, as shown in formula (5):

[0056]

[0057] in, Represents the predicted node category, C is the number of node types; GCN represents graph convolutional network.

[0058] The present invention calculates some indicators related to the road network graph and uses them as conditional vectors. Specifically, the present invention calculates the average depth of the graph Average node degree of graph and road network density

[0059]

[0060]

[0061]

[0062] Where N represents the total number of nodes in the graph. and Respectively represent the depth and degree of node i, and M represents the number of edges in the graph. These indicators are encoded using one-hot encoding, and then they are concatenated together to form the conditional vector C vec ,

[0063] C vec ←{Dep avg ;Deg avg ;Den net} (9)

[0064] In order to capture the local and global relationships between graph nodes, the transformer-based generator of the present invention is divided into a multi-head attention module and a graph modeling module. Given that the graph structure lacks natural ordering, the positional encoding (PE) used for sequence elements in the traditional transformer model cannot be used directly. To solve this problem, the present invention converts each node x i The degree of is combined with the learnable positional encoding to construct a positional encoding PE(x i ), as shown in formula (10),

[0065] PE(x i )=[deg(x i )||PE learn (x i )] (10)

[0066] The multi-head node attention module in the Transformer-based generator is used to capture the global relationship between nodes, which is expressed as follows:

[0067]

[0068] in, represents the new feature vector of node i at layer l+1, and Respectively represent the feature vectors of node i and node j in layer l, W O and W V are all learnable weight matrices, and the attention coefficient α i,j The calculation is as follows:

[0069]

[0070] Among them, d k is the dimension of the key-value vector, W Q and W K is a learnable weight matrix.

[0071] Output X of the multi-head node attention mechanisml It is fed into a graph creation module, which is designed to capture local information between graph nodes and consists of two layers of GCN, one layer of LayerNorm (LN), and an MLP. The operation process is described by the following formula:

[0072] out = MLP(LN(GCN(E,GCN(E,X l |P1)|P2))) (13)

[0073] Among them, P1 and P2 are the learnable parameters of the first and second layers of GCN, LN represents layer normalization, and out represents the processing of X through the graph creation module. l After the Transformer-based generator, two task heads are attached, namely the degree generation module and the edge connection module, the former is used to generate the degree of the node and the latter is used to generate the connection between the nodes.

[0074] The loss terms in formula (2) are calculated as follows: Node attribute loss L attr The calculation is as follows:

[0075]

[0076] Among them, T ij represents the true label value of node i on attribute j, p ij Represents the probability value predicted by the model for node i on attribute j, α j is the category weight of attribute j, and γ is the adjustment factor of the loss term.

[0077] KL divergence loss term: KL It is used to optimize the difference between the output probability distribution of the model and the true probability distribution. Specifically, if the probability distribution of the model output is P and the true probability distribution is Q, then the KL divergence loss term can be defined as D KL (Q‖P). The smaller this value is, the closer the output probability distribution of the model is to the true probability distribution, and the better the performance of the model is. It is calculated as follows:

[0078] L KL =D KL (q(Z|X,C)||p(Z|C)) (15)

[0079] The positive and negative sample prediction loss term L of the edge connection edge The calculation is as follows:

[0080]

[0081] In this formula, σ represents the Sigmoid activation function, Y ijis the actual edge connection label (1 for positive edge connection and 0 for negative edge connection), S ij is the raw fraction of edge connections predicted by the model to exist, and |E| is the total number of edge connections considered.

[0082] The loss term L for the node degree prediction task degree The calculation is as follows:

[0083]

[0084] in, Represents the model's predicted probability of the true degree of node i.

[0085] The present invention is described below with reference to a specific example. This embodiment extracts 71 medium and large urban hierarchical road network topology graphs from OSM data, including highways and urban trunk roads. The highway intersections, urban trunk road intersections, and the intersections of the two in the data set are respectively referred to as first-level nodes, second-level nodes, and intersection nodes. In addition, when processing road network images, the present invention randomly crops them into 512*512, with each pixel representing 10m. The image is then processed using the method proposed in the present invention, and 14,326 graph samples are ultimately obtained. These graph samples are then divided into a training set, a validation set, and a test set in a ratio of 7:2:1. The training set is used to train the generative model, and the validation set is used to evaluate the performance of the model in the training process, so as to adjust relevant training parameters, such as the various weight factors in formula (2). The test set is used to evaluate the final generation performance of the model.

[0086] In the application phase, assuming the average depth Dep avg =5.6, average degree Deg avg =2.6, road network density, Den net = 0.04 as the conditional vector C vec The parameters are input into the trained hierarchical road topology generation model to generate a hierarchical road network topology graph with different numbers of nodes that meet the conditional constraints, such as Figure 3 As shown in the figure, the red nodes represent the first-level road network and the blue nodes represent the second-level road network. In the generated graph, the number of red nodes is less than the number of blue nodes, and they are distributed between the blue nodes, indicating that the generated road network conforms to the actual road network situation. The generated topology map can be used for road planning and design in the transportation field. Combined with traffic operation indicators, the road network that meets the planning requirements can be screened out, thereby greatly improving the efficiency of road network planning operations. At the same time, the generated hierarchical road network topology can provide simulation and calculation support for the deployment of dedicated road networks for autonomous driving, ensuring that the road network design can maximize the use of existing road network resources, while optimizing traffic flow and improving the driving experience of autonomous driving vehicles.

[0087] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. For ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A controllable hierarchical road topology generation method based on AIGC, characterized in that: The steps include: 1) Obtain the OSM data of the city and perform rasterization processing on the road networks of different levels; perform grayscale merging and RGB merging on the road networks of different levels after rasterization processing to obtain grayscale merging images and RGB merging images; The grayscale merged image and the RGB merged image are cropped to the same size, and the road topology map is extracted from the cropped grayscale merged image. The attributes of each node in the road topology map are obtained from the cropped RGB merged image, so as to obtain a hierarchical road network topology map as training data. 2) constructing a hierarchical road network topology generation model, and using the training data in step 1) to train the model, to obtain a generation model that can generate a corresponding hierarchical road network topology map according to the input condition vector; The hierarchical road network topology generation model includes a graph-based conditional variational autoencoder, a transformer-based generator, a node generation module, a degree generation module, an edge connection module and a post-processing module; Among them, the graph-based conditional variational autoencoder takes the data and conditional vector of the hierarchical road network topology map as input to generate node features that match the given conditions; the transformer-based generator receives the node adjacency matrix and the node features output by the conditional variational autoencoder; the generator captures the local and global relationships between the graph nodes, thereby obtaining the edge features that describe the node connection relationship; the node generation module receives the node features and conditional vectors generated by the conditional variational autoencoder to generate node attributes; the degree generation module obtains the edge features output by the transformer-based generator to generate the degree of the node; the edge connection module obtains the edge features output by the transformer-based generator to generate an adjacency probability matrix representing the probability of node connection, and then combines the degree of the node to select the nodes that each node is most likely to connect to from the adjacency probability matrix, that is, several nodes with the largest connection probability, and the number of selected nodes is equal to the degree of the node; after selection, an adjacency matrix that can represent the node connection relationship is obtained; the post-processing module assigns the node category attributes generated by the node generation module to the nodes in the adjacency matrix, and the generated hierarchical road topology map can be obtained; 3) When applied, the conditional vector is input into the trained hierarchical road network topology generation model, and the model can generate a hierarchical road topology map that meets the conditional vector constraints.

2. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: In step 1), before RGB merging, different levels of road networks are colored with different colors, and each color represents a road network type; When RGB is merged, colors are assigned to the intersections between different levels of road networks; The method for obtaining the attributes of each node in the road topology map from the cropped RGB merged map is to use a color relocation method. The color relocation method is specifically as follows: The pixel coordinates of the node are used to query the color at the node coordinates from the RGB merge graph, the category of the node is determined according to the color, and the category is assigned to the node as the node attribute.

3. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: In step 2), the graph-based conditional variational autoencoder includes an encoder and a decoder, the encoder is used to generate a graph-level potential representation P(Z) of the input graph, and the decoder performs the opposite process of the encoder to generate reconstructed node features Reconstruct node features After a graph convolution layer, the node attributes are obtained: in, represents the predicted node attribute, that is, the node category, C is the number of node categories; GCN represents the graph convolution operation.

4. The controllable hierarchical road topology generation method based on AIGC according to claim 3 is characterized in that: The encoder is a GraphSAGE model followed by an MLP layer. The encoder operates as follows: P(Z)=ENC(X+C,E)=MLP(GraphSAGE(X+C,E)) Where C represents the conditional vector, ENC represents the encoding operation of the encoder, MLP represents the multi-layer perceptron, and GraphSAGE represents the graph sampling and aggregation model. represents the original node features excluding the node category label, where d′ represents the feature dimension size of a node and E is the edge index; The decoder performs the opposite process of the encoder to generate reconstructed node features. DEC represents the decoding operation of the decoder, and C represents the conditional vector; the conditional vector is combined with the node feature to facilitate encoding the conditional information into the node feature; The conditional vector is combined with the graph-level latent representation P(Z) so that the node features decoded by the decoder contain conditional information.

5. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: In step 2), the conditional vector is denoted as C vec , which is determined by the average depth of the graph Average node degree of graph and road network density Composition, k1k2, k3 all represent the size of the dimension, Where N represents the total number of nodes in the graph. and Represent the depth and degree of node i respectively, and M represents the number of edges in the graph; these indicators are encoded using one-hot encoding, and then they are concatenated together to form the conditional vector C vec ; The conditional vector is used to guide the model to generate a hierarchical road network topology that meets the requirements of the conditional vector.

6. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: In step 2), the transformer-based generator includes a multi-head node attention module and a graph creation module; The multi-head node attention module is used to capture the global relationship between nodes, which is expressed as follows: in, represents the new feature vector of node i at layer l+1, and Respectively represent the feature vectors of node i and node j in layer l, W O and W V are all learnable weight matrices, and the attention coefficient α i,j The calculation is as follows: Among them, d k is the dimension of the key-value vector, W Q and W K is a learnable weight matrix; Output X of the multi-head node attention mechanism l It is sent to the graph creation module, which captures the local information between graph nodes and consists of two layers of GCN, one layer of LN and one MLP; the operation process is described by the following formula: out=MLP(LN(GCN(E,GCN(E,X l |P1)|P2))) Among them, P1 and P2 are the learnable parameters of the first and second layers of GCN, LN represents layer normalization, and out represents the processing of X by the graph construction module. l The final output after.

7. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: In step 2), the total loss function L of the hierarchical road network topology generation model training process is total It is expressed as: L total =αL attr +βL KL +γL edge +δL degree Among them, α, β, γ, δ are weight coefficients, L attr is the node attribute loss term and L KL is the KL divergence loss term of the node; L edge is the positive and negative sample prediction loss term for edge connections, L degree is the loss term for the node degree prediction task.

8. The method for generating controllable hierarchical road topology based on AIGC according to claim 7, characterized in that: Node attribute loss L attr The calculation is as follows: Among them, T ij represents the true label value of node i on attribute j, p ij Represents the probability value predicted by the model for node i on attribute j, α j is the category weight of attribute j, and γ is the adjustment factor of the loss term; KL divergence loss term L KL It is used to optimize the difference between the output probability distribution of the model and the true probability distribution. If the probability distribution of the model output is P and the true probability distribution is Q, then the KL divergence loss term is defined as D KL (Q‖P), calculated as follows: L KL =D KL (q(Z|X,C)||p(Z|C)) The positive and negative sample prediction loss term L of the edge connection edge The calculation is as follows: In this formula, σ represents the Sigmoid activation function, Y ij is the actual edge connection label, S ij is the raw fraction of edge connections predicted by the model to exist, and |E| is the total number of edge connections considered; The loss term L for the node degree prediction task degree The calculation is as follows: in, Represents the model's predicted probability of the true degree of node i.

9. The controllable hierarchical road topology generation method based on AIGC according to claim 1 is characterized in that: The hierarchical road topology generated in step 3) is represented as a graph G = (V, E), which includes a node set V consisting of a finite number of points and an edge set E consisting of a finite number of edges. An edge represents the connection between two nodes. The nodes is the d-dimensional feature vector of node i in the graph, expressed as: in Represents the node v in the hierarchical road network topology graph i Features encoded by the node2vec algorithm, and Represents the first-level degree and second-level degree of a node respectively. The first-level degree represents the node v i The total number of connected nodes, that is, node v i The sum of the number of neighbor nodes; the second-level degree represents the relationship with node v i The sum of the degrees of all connected nodes; L i Indicates the node category; Represents the edge list, using the edge index information to construct the adjacency matrix A = {a uv }∈{0,1} N×N , a uv is the element in the uth row and vth column of the adjacency matrix A, representing the connection between nodes u and v. If edge(u,v)∈E, then a uv =1, otherwise a uv =0, edge(u,v) represents the connecting edge edge consisting of node u and node v.

10. A controllable hierarchical road topology generation system for implementing the method of claim 1, characterized in that: include: The training data generation system obtains the city OSM data and performs rasterization on the road networks of different levels; Grayscale merging and RGB merging are performed on the road networks of different levels after rasterization to obtain grayscale merging images and RGB merging images; The grayscale merged image and the RGB merged image are cropped to the same size, and the road topology map is extracted from the cropped grayscale merged image. The attributes of each node in the road topology map are obtained from the cropped RGB merged image, so as to obtain a hierarchical road network topology map as training data. A model building and training module, which is used to build the hierarchical road network topology generation model and train the generation model using the training data; The application module calls the trained hierarchical road network topology generation model according to the input condition vector and outputs a hierarchical road topology map that meets the condition vector constraints.

Citation Information

Patent Citations

  • Distributed processing of pose graphs for generating high definition maps for navigating autonomous vehicles

    CN113906414A

  • Graph topology learning method and system based on data statistics and knowledge guidance

    CN114860952A