Urban motor vehicle diversified track generation method based on traffic network weight learning

Through the method based on traffic road network weight learning, combined with the A* search algorithm and graph neural network, the problem of trajectory discontinuity in bayonet data is solved, and diversified trajectories are generated through the VAE model, which realizes the generation of connectivity trajectories in line with road network constraints and the provision of diversified data.

CN119901302APending Publication Date: 2025-04-29CHENGDU UNIV OF INFORMATION TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411618747.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The prior art is difficult to effectively use bayonet data to generate connected urban motor vehicle trajectories, and cannot meet the diversified needs of trajectories in real road networks.

Method used

Through the method based on the weight learning of the traffic road network, the road network weight graph of the traffic road network is generated, combined with the A* search algorithm and graph neural network, the vehicle trajectory is reconstructed, and partition sampling is performed through the VAE model to generate diversified trajectories.

Benefits of technology

It realizes the generation of connected vehicle trajectories that meet road network constraints, and provides diversified trajectory data, which can more comprehensively analyze traffic conditions and provide more accurate optimization strategies for traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119901302A_ABST
    Figure CN119901302A_ABST
Patent Text Reader

Abstract

The invention discloses an urban motor vehicle diversified track generation method based on traffic road network weight learning. The method comprises the following steps: S1, generating a road network weight map of a traffic road network in a network layer; s2, based on the road network weight map, executing an A * search algorithm according to the starting point and the ending point of the vehicle, and outputting a vehicle reconstruction track; s3, reversely training a graph neural network GCN and a graph attention network GAT in a network layer according to the vehicle reconstruction trajectory and the loss of the corresponding real trajectory, and outputting a road network weight map with a connected vehicle trajectory; and S4, inputting the road network weight maps into a VAE model, obtaining a plurality of road network weight maps through coding, partition sampling and decoding processing and reconstruction in sequence, and executing an A * search algorithm on the road network weight maps to generate diversified vehicle tracks. The vehicle track generation method provided by the invention not only provides necessary data support and decision basis in the traffic management process, but also lays a solid foundation for future development of urban traffic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle trajectory generation, and in particular relates to a method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning. Background Art

[0002] With the rapid development of urban transportation and the growing demand for traffic management, the generation of large-scale vehicle trajectory datasets is of great significance for signal optimization, traffic flow analysis, accident investigation and other fields. Currently, the widely used vehicle trajectory generation methods mainly rely on global positioning system (GPS) positioning data. However, due to user privacy confidentiality agreements and policies prohibiting the permanent storage of urban pedestrian and vehicle trajectories, the cost of obtaining GPS data is high.

[0003] In recent years, the coverage of camera stations on urban roads has been increasing, providing another method to solve the problem of vehicle trajectory generation. Camera stations widely distributed in the road network will always record the location and time information of vehicles, providing researchers with a large amount of vehicle movement data. Therefore, this paper studies how to use camera station data to generate vehicle trajectories.

[0004] Considering the huge and complex urban road network, vehicle trajectory reconstruction and generation can be considered as a special pathfinding service. Early research focused on how to expand existing heuristic search algorithms (such as Dijkstra's shortest path algorithm and A* search algorithm). Among them, the A* algorithm has become a widely used algorithm for path planning due to its use of heuristic estimation, flexibility, and pruning to avoid duplication. With the development of deep learning, neural networks provide a better solution for vehicle trajectory reconstruction. At the same time, graph neural networks (GCN) and recurrent neural networks (RNN) have been widely used to model sequence trajectory data. Trajectory generation is essentially a generation problem. The fundamental purpose is to learn data features and generate a solution set that is indistinguishable from real data. At present, there are many generation models that can complete this task, such as autoencoders (AE), variational autoencoders (VAE), and generative adversarial networks (GAN).

[0005] However, previous models cannot cope with the following challenges: Challenge 1: The vehicle trajectories captured by the camera data are discontinuous. Figure 1 As shown in the figure, due to the large amount of money required for the installation and maintenance of checkpoint cameras, including hardware, software, manpower and operating costs, the coverage rate of checkpoint cameras in the road network is generally below 40%. The example vehicle trajectory is only captured and recorded at some checkpoints (the red dots indicate the locations captured by the cameras), so the recorded vehicle trajectory is a disconnected trajectory sequence.

[0006] Challenge 2: In previous studies, Xin et al. used LSTM to model trajectory features and then used the variational autoencoder (VAE) framework to generate trajectories; Choi et al. formalized the position sequence in the observed trajectory as an imitation learning problem in a partially observable Markov decision process. However, both methods are based on GPS data and cannot adapt to the missing checkpoint data.

[0007] Challenge 3: Sequence-based models focus on the spatiotemporal nature of generated trajectory sequences while ignoring road network constraints. Zhang et al. combined VAE and VRNN to encode trajectories, and generated trajectories based on LSTM and then entered the Markov model to obtain road network constraint trajectories; however, as Figure 1 In the example, the reconstructed trajectory still chooses to turn left at the intersection marked with no left driving. This trajectory generated off the road network is often not suitable for downstream applications that require actual vehicle simulation on the real road network.

[0008] Challenge 4: Trajectory-based generative models cannot meet the diverse requirements of trajectories in real road networks. Figure 1 middle, arrive There should be multiple potential trajectories. Existing models, such as the TrajVAE model designed by Xin et al. and the TrajGAIL model designed by Choi et al., calculate the loss between the generated trajectory and the sample data, aiming to generate trajectories that cannot be distinguished from the sample data. Therefore, after training, only vehicle trajectories that are approximate to the sample can be generated. In a real road network, there should be multiple possibilities for generating trajectories in the missing area. Summary of the invention

[0009] In view of the above-mentioned deficiencies in the prior art, the method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning provided by the present invention solves the above-mentioned problems in the background technology.

[0010] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning, comprising the following steps: S1, generating a road network weight graph of the traffic road network at the network layer; The network layer includes sequentially connecting spectral clustering, k-means clustering, graph neural network GCN and graph attention network GAT; S2, based on the road network weight graph, execute the A* search algorithm according to the starting and ending points of the vehicle, and output the vehicle reconstructed trajectory; S3, reversely train the graph neural network GCN and graph attention network GAT in the network layer according to the loss of the vehicle reconstructed trajectory and the corresponding real trajectory, and then output a road network weight graph with connected vehicle trajectories; S4. Input the road network weight map into the VAE model, and reconstruct multiple road network weight maps through encoding, partition sampling and decoding processing in sequence, and execute the A* search algorithm on them to generate diversified vehicle trajectories.

[0011] Furthermore, the step S1 includes the following sub-steps: S11, obtaining traffic network information and initializing the traffic network; S12, using a spectral clustering algorithm to divide the initialized traffic road network into functional areas, and using a k-means clustering algorithm to cluster the divided functional areas, obtaining a mapping relationship from the road network to the functional area network, and constructing a functional area road network; S13, capturing the features of adjacent clusters in the functional area road network through the graph convolutional neural network GCN, and generating a feature matrix of the functional area network; S14. Based on the feature matrix of the functional area network, the graph attention network GAT is used to capture the feature weights of road sections under different influencing factors, and the road network weight graph is generated by normalizing the high-dimensional weights.

[0012] Furthermore, in step S12, the mapping relationship from the road network to the functional area network is expressed as:

[0013] In the formula, represents the relationship matrix, Represents the road network, Represents a cluster, corresponding to the divided functional area; where the importance of each road segment node in the cluster is consistent, the soft assignment matrix of the road segment node in the functional area network is expressed as:

[0014] In the formula, Indicates the probability that the road segment belongs to a cluster.

[0015] Further, in step S13, the characteristic matrix of the functional area network is expressed as;

[0016]

[0017]

[0018] In the formula, represents the feature matrix, represents a graph convolutional neural network, represents the adjacency matrix of the functional area network, Indicates that the soft allocation matrix and the initial characteristic matrix of the traffic network Transpose the matrix obtained by multiplication, Represents the traffic network adjacency matrix; where the initial feature matrix The information in the network includes the POI classification label, actual length and section width, center point longitude and latitude, and number of lanes for each road segment in the traffic network.

[0019] Furthermore, the step S14 includes the following sub-steps: S14-1, reversely distribute the characteristic matrix of the functional area network to each road section node under its functional area to obtain the road network characteristic matrix; S14-2, according to the road network feature matrix, after performing linear transformation on the features of each road section, calculate the similarity coefficients of adjacent road sections, and perform normalization processing on them; S14-3. Based on the normalized similarity coefficients of adjacent road segments, a multi-head attention mechanism is used to learn and obtain the features of neighboring road segments; S14-4, aggregate all neighboring road segment features to obtain a complete road network feature matrix; S14-5. Normalize the high-dimensional features of each node in the complete road network feature matrix, and combine them with the directed graph connection relationship to generate a road network weight graph.

[0020] Furthermore, the step S2 is specifically as follows: Taking the road network weight graph as the search basis, starting from the starting point of a given vehicle, with the goal of minimizing the sum of the cost from the source node to the candidate node and the cumulative cost from the candidate node to the target node, the A* search algorithm is executed to obtain the reconstructed trajectory of the vehicle from the starting point to the end point.

[0021] Furthermore, the step S4 is specifically as follows: S41, dividing the road network weight graph into in-cluster road networks and outlier road segments, and inputting them into the VAE model; S42, calculating the mean and variance of the road network weight map through the encoder, thereby limiting the noise sampling of the road section within the cluster to the central area of ​​the Gaussian distribution, and limiting the noise sampling of the outlier road section to the edge area; S43, using the heavy parameter technique to perform partition sampling on the in-cluster road segments and the outlier road segments to generate latent variables; S44, the generated latent vector is mapped back to the original data space through the decoder to reconstruct the corresponding road network weight map.

[0022] Furthermore, in step S43, for the outlier section, the Gaussian distribution is divided into a central area based on the set standard deviation multiple, and the noise vector is sampled in the central area. , and then use the re-parameterization technique to generate latent variables , and Indicates that the encoder calculates the mean and variance of the road network weight graph; For the road sections within the cluster, the sampling interval is limited to the edge area divided based on 0.5 standard deviation multiples, and the noise vector is limited to be sampled in the edge area , and then use the re-parameterization technique to generate latent variables .

[0023] Furthermore, in step S4, the loss function of the VAE model is:

[0024] In the formula, represents the MSE reconstruction error between the road section sample data and the generated data, Represents KL difference, hyperparameter Expressed as

[0025] In the formula, represents sample data, represents the sampled data, and All represent constants, Indicates a specific common sense item, represents the accumulation of error and sampling period, n Indicates the total number of data.

[0026] The beneficial effects of the present invention are: (1) The method of the present invention uses checkpoint data to generate vehicle trajectories, and combines simulation technology to simulate various traffic scenarios and vehicle behaviors. By generating diverse trajectory data, it is possible to more comprehensively analyze the changes in driving speed, congestion points, and traffic congestion conditions in different time periods. This diverse data not only helps to identify the causes of traffic congestion, but also provides an important basis for traffic managers to formulate more accurate optimization strategies and response plans.

[0027] (2) The method of the present invention combines graph neural network and A* search algorithm to reconstruct vehicle trajectories; among them, the heuristic search algorithm A* essentially solves the path search problem under a given starting point. By optimizing the heuristic function, it can effectively generate high-quality approximate solutions. The powerful graph neural network in capturing spatial data features enables it to autonomously learn the data mapping between important nodes in the road network and given vehicle trajectories. The road network weight graph is constructed through a directed graph, and the searched vehicle trajectories fully comply with the road network constraints.

[0028] (3) Based on the sequence-based VAE model, the present invention forms a β-TrajVAE generation model by adding partition sampling. The model takes the road network weight map as input, generates multiple road network weight maps that conform to the feature distribution through partition sampling and optimization of the loss function, and generates diversified trajectories after performing A* search.

[0029] In summary, the vehicle trajectory generation method not only provides the necessary data support and decision-making basis in the process of traffic management, but also lays a solid foundation for the future development of urban transportation. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 This is the bayonet distribution diagram in the present invention.

[0031] Figure 2 This is a flow chart of the method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning in the present invention.

[0032] Figure 3 This is a framework diagram of the method for generating diversified trajectories of urban motor vehicles in the present invention.

[0033] Figure 4 This is a framework diagram for constructing a road network weight graph in the present invention.

[0034] Figure 5 This is a framework diagram of the road network weight graph reconstruction process in the present invention.

[0035] Figure 6 This is the bayonet matching road network diagram in the present invention.

[0036] Figure 7 Reconstruct trajectory visualization results for different algorithms in this invention.

[0037] Figure 8 The figure shows the performance comparison under different ablation models in the present invention.

[0038] Fig. 9 This is the impact of the number of feature dimensions on performance in the present invention.

[0039] Fig.10 This is the impact of the number of attention heads on the performance in the present invention.

[0040] Fig.11 Visualization results of diverse trajectories generated by β-TrajVAE in this invention. DETAILED DESCRIPTION

[0041] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0042] The embodiment of the present invention discloses a method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning, such as Figure 2 As shown, it is characterized in that it includes the following steps: S1, generating a road network weight graph of the traffic road network at the network layer; The network layer includes sequentially connecting spectral clustering, k-means clustering, graph neural network GCN and graph attention network GAT; S2, based on the road network weight graph, execute the A* search algorithm according to the starting and ending points of the vehicle, and output the vehicle reconstructed trajectory; S3, reversely train the graph neural network GCN and graph attention network GAT in the network layer according to the loss of the vehicle reconstructed trajectory and the corresponding real trajectory, and then output a road network weight graph with connected vehicle trajectories; S4. Input the road network weight map into the VAE model, and reconstruct multiple road network weight maps through encoding, partition sampling and decoding processing in sequence, and execute the A* search algorithm on them to generate diversified vehicle trajectories.

[0043] like Figure 3 As shown, the implementation framework of the above method is demonstrated.

[0044] The step S1 of the embodiment of the present invention includes the following sub-steps: S11, obtaining traffic network information and initializing the traffic network; Specifically, during the initialization of the traffic network, the road network context information is embedded into the road network layer. Taking each road section as a unit, five features including the road section POI classification label, the actual length and average width of the cross section, the center point longitude and latitude, and the number of lanes are embedded into the road network layer to initialize the feature matrix , forming an enhanced representation of the road segment context information; S12, using a spectral clustering algorithm to divide the initialized traffic road network into functional areas, and using a k-means clustering algorithm to cluster the divided functional areas, obtaining a mapping relationship from the road network to the functional area network, and constructing a functional area road network; S13, capturing the features of adjacent clusters in the functional area road network through the graph convolutional neural network GCN, and generating a feature matrix of the functional area network; S14. Based on the feature matrix of the functional area network, the graph attention network GAT is used to capture the feature weights of road sections under different influencing factors, and the road network weight graph is generated by normalizing the high-dimensional weights.

[0045] In step S12 of this embodiment, a spectral clustering algorithm is used to divide the functional areas. It divides the target data set into N different clusters by splitting weak links, so that the similarity between nodes in the same cluster is high, while the similarity between different clusters is low. This algorithm is suitable for dividing road sections with strong connection relationships. , minus the diagonal matrix Get the graph Laplacian matrix , by calculating The POI features are used and the standard k-means algorithm is executed to obtain the mapping relationship from the road network to the functional area network:

[0046] In the formula, represents the relationship matrix, Represents the road network, Represents a cluster, corresponding to the divided functional area; where the importance of each road segment node in the cluster is consistent, the soft assignment matrix of the road segment node in the functional area network is expressed as:

[0047] In the formula, Indicates the probability that the road segment belongs to a cluster.

[0048] In step S12 of this embodiment, a directed graph is used for the traffic network. Indicates that Represents a road segment node in the road network, It is an adjacency matrix composed of binary values, which represents the connectivity between road segments.

[0049] In step S12 of this embodiment, for the constructed functional area road network, assuming that the road segment contains N POI tags, a clustering algorithm is used to construct a functional area network based on the road network. ,in Represents clusters in the functional area network (each cluster consists of closely connected road segments that perform certain transportation functions), The adjacency matrix represents the connectivity between clusters. For any node in the road network ,use Indicates the cluster in the functional area network, using and Represents the feature matrix corresponding to the above two-layer network, is the feature dimension.

[0050] In step S13 of this embodiment, the characteristic matrix of the functional area network is expressed as:

[0051]

[0052]

[0053] In the formula, represents the feature matrix, represents a graph convolutional neural network, represents the adjacency matrix of the functional area network, Indicates that the soft allocation matrix and the initial characteristic matrix of the traffic network Transpose the matrix obtained by multiplication, Represents the traffic network adjacency matrix; where the initial feature matrix The information in the network includes the POI classification label, actual length and section width, center point longitude and latitude, and number of lanes for each road segment in the traffic network.

[0054] Step S14 of the embodiment of the present invention includes the following sub-steps: S14-1. The characteristic matrix of the functional area network Reversely assign to each road segment node under its functional area to obtain the road network feature matrix ; S14-2, according to the road network feature matrix, after performing linear transformation on the features of each road section, calculate the similarity coefficients of adjacent road sections, and perform normalization processing on them; Among them, the linear transformation of each road segment is expressed as:

[0055] In the formula, is the weight coefficient matrix; The similarity coefficient of adjacent road segments is calculated as:

[0056] In the formula, the attention mechanism , It's the road section and Features are stitched together.

[0057] In order to make the coefficients of different road sections easier to compare, in this embodiment, a normalization function is used after all neighboring road sections are activated:

[0058] S14-3. Based on the normalized similarity coefficients of adjacent road segments, a multi-head attention mechanism is used to learn and obtain the features of neighboring road segments; In order to obtain the neighboring road segment features more stably, multi-head attention is used to stabilize the learning process. indivual Taking the coefficient as an example, we use the mean to obtain a richer representation of information:

[0059] S14-4, aggregate all neighboring road segment features to obtain a complete road network feature matrix; The complete road network feature matrix is ​​expressed as:

[0060] S14-5. Normalize the high-dimensional features of each node in the complete road network feature matrix, and combine them with the directed graph connection relationship to generate a road network weight graph.

[0061] In this embodiment, the generated road network weight map , refers to each road segment node of the road network directed graph Assign weight Generated road network graph. Specifically, in the process of generating the road network weight graph, the goal is set: given the real vehicle trajectory , the camera sequence group is Taking each road node as a unit, by capturing the road network information and trajectory characteristics, another trajectory that conforms to the characteristic distribution is generated , which is divided into two subtasks: 1) Assume that there is The track of the road segment (The trajectory is not necessarily completely connected), the goal is to generate a completely connected trajectory ( represents the number of road sections), so that the trajectory and The difference between them satisfies:

[0062] The road network weight graph can only generate a single trajectory under the same OD. However, the trajectory should satisfy the diversity measurement index while satisfying the checkpoint location distribution. Therefore, task (2) is set.

[0063] (2) Assuming there is a target , so that the sample trajectory The sequence of the mounts being photographed and generate trajectories Photographed mount sequence group Satisfy between:

[0064] By evaluating the sample trajectory With the generated trajectory The difference between them is used to judge the quality of the generated trajectory, thereby generating a more accurate road network weight map.

[0065] For the above process S11~S14, if Figure 4 As shown, in Figure 4 In (a), the colored areas cover functional areas such as main roads, residential areas, and schools. Although these areas are far away, they often show high feature correlation in vehicle trajectories. In a typical graph neural network, nodes can only aggregate the features of neighboring nodes and cannot effectively capture the dependencies between long-range indirect nodes. Therefore, Figure 4 As shown in (b), the model constructs a functional area network based on the road network to describe certain special traffic areas. Figure 4 (c) Through the GCN network convolution, a similar Figure 4 (d) Weight map (colors are used to represent road weights, the darker the color, the greater the weight). After convolution, the road segments in the functional area gain greater weights, which guides the algorithm to explore the regional road segments with greater weights when performing A* search later. Finally, the GAT network is used to capture the influencing factors of different road segments, and the weights of short road segments are reduced to generate similar Figure 4 (e) Road network weight graph.

[0066] Step S2 of the embodiment of the present invention is specifically as follows: Taking the road network weight graph as the search basis, starting from the starting point of a given vehicle, with the goal of minimizing the sum of the cost from the source node to the candidate node and the cumulative cost from the candidate node to the target node, the A* search algorithm is executed to obtain the reconstructed trajectory of the vehicle from the starting point to the end point.

[0067] Specifically, in this embodiment, based on the road network weight graph, starting from the starting point, the optimal node is selected based on the following costs:

[0068] In the formula, is the cost from the source node to the candidate node, is the cumulative cost from the candidate node to the target node. In the algorithm, the road network weight graph is used (directed graph with weight parameters) as the basis for A* search, using and represents open and closed lists, Represents the current node, Represents the neighbor nodes of the current node.

[0069] Value calculation:

[0070] As mentioned before, use represents the cumulative cost from the vehicle starting point to the current node, Indicates the distance from the current node to the neighboring node moving costs.

[0071] Value calculation:

[0072] in, Indicates the current road segment The cluster in the functional area network, Indicates the end segment In the cluster where the functional area network is located, the Dijkstra algorithm is used to calculate the current cluster To the destination cluster The total cost of the current road segment is calculated at the road network level To the end section total cost.

[0073] By continuously updating the heuristic function during the pathfinding process, the A* algorithm can not only consider the optimal solution of the current neighboring road segment, but also consider the weight of the cluster where the candidate road segment is located from a global perspective. Finally, the algorithm outputs the starting point To the end The full path to .

[0074] In step S3 of the embodiment of the present invention, when the network layer is reversely trained, a trajectory containing n road segments is given. , generate m road segments with meaning ( ) output trajectory, and the DTW function is used to calculate the output trajectory The loss between the actual trajectory and the road network , and then obtain the road network weight graph with connected vehicle trajectories.

[0075] Step S4 of the embodiment of the present invention is specifically as follows: S41, dividing the road network weight graph into in-cluster road networks and outlier road segments, and inputting them into the VAE model; S42, calculating the mean and variance of the road network weight map through the encoder, thereby limiting the noise sampling of the road section within the cluster to the central area of ​​the Gaussian distribution, and limiting the noise sampling of the outlier road section to the edge area; S43, using the heavy parameter technique to perform partition sampling on the in-cluster road segments and the outlier road segments to generate latent variables; S44, mapping the generated potential vector back to the original data space through the decoder to reconstruct the corresponding road network weight map; S45. Execute an A* search algorithm on the reconstructed road network weight graph to generate diversified vehicle trajectories.

[0076] In step S43 of this embodiment, for the outlier road section, it itself presents a low correlation with the adjacent road section nodes, and the driver's intention for the road section is more single. Based on this, the Gaussian distribution is divided into a central area based on the set standard deviation multiple, and the noise vector is limited to be sampled in the central area. , and then use the re-parameterization technique to generate latent variables , and Indicates that the encoder calculates the mean and variance of the road network weight map; since the central area contains high probability density samples, its sampling values ​​are closer to the distribution of real data.

[0077] For the road segments within the cluster, they themselves show a higher correlation with the nodes of the adjacent road segments. The drivers have more diverse choices for the road segments within a cluster after clustering. Based on this, the sampling interval is limited to the edge area divided based on 0.5 standard deviation multiples, and the noise vector is limited to be sampled in the edge area. , and then use the re-parameterization technique to generate latent variables ; Since the edge area contains samples with lower probability density, its sampling values ​​are more innovative and diverse.

[0078] In this embodiment, by implementing partition sampling on the segments inside and outside the cluster, the model can reduce the disturbance of the edge segment weights on the A* pathfinding and amplify the weight changes of the core segments to achieve the diversification of the generated trajectories in the central area.

[0079] In this embodiment, in the above process, if Figure 5 As shown, in order to make the generated road network weight graph In order to satisfy the requirement of feature distribution and diversity, the VAE model in this embodiment modifies the sampling method and forms the β-TrajVAE model by designing partition sampling for subsequent reconstruction of the road network weight graph. Figure 5 As shown in (a), the road network weight map is used as input, and its corresponding trajectory passes through The model first divides the road network into cluster segments ( Figure 5 (b)) and outlier segments ( Figure 5 (b) in the outer area). Then Figure 5 As shown in (c), the encoder calculates The mean and variance , limit the noise sampling of the road sections within the cluster to the central area of ​​the Gaussian distribution, limit the noise sampling of the outlier road sections to the edge area, and use the re-parameterization technique to obtain the sampling value The decoder reconstructs the network weight graph based on the sampled values, such as Figure 5 (d) The weights of the road segments within the clustering area of ​​the road network change more, while the weights of the road segments outside the area change less. Figure 5 As shown in (e), the A* search algorithm is executed to generate A track that is fixed and non-repeating.

[0080] In this embodiment of the present invention, in order to balance the accuracy and divergence between sample data and generated data, the loss function of the VAE model consists of the following two parts:

[0081] However, when this loss function is used to deal with trajectory generation problems, if the KL divergence is too low, the diversity of the output samples will be very limited (called the KL vanishing or post-collapse problem). However, artificially increasing the proportion of KL divergence will lead to a loss of accuracy in the generated data. We hope that the weight map can be adjusted when the deviation between the reconstruction error and the KL divergence is adjusted, so we add a hyperparameter before the KL divergence value. The model first samples the KL divergence value in each round of training, using Indicates that, with the given setting value Perform difference calculation , and finally feed it back to the controller to balance the hyperparameters, The function is expressed as:

[0082] in, and is a constant, the second hyperparameter is the accumulation of error and sampling period. Due to the characteristics of exponential function, when the error value is larger and positive (KL value is lower than the set value), the first term of the formula is closer to 0, and the second term decreases as the accumulation continues, and a smaller value will be obtained. value to encourage the KL value to increase. Otherwise, a larger value to encourage the KL value to decrease. This accumulation will increase the ability of the controller to calibrate, forcing The value continues to move in the direction of the set KL divergence value. In particular, when the divergence difference reaches 0, the second term stops changing and the controller is allowed to maintain the same value output that was originally expected to result in zero error. The third term of the controller is a specific constant, which effectively plans the controller range of change.

[0083] Based on this, in step S4 of this embodiment, the loss function of the VAE model is:

[0084] In the formula, represents the MSE reconstruction error between the road section sample data and the generated data, represents the KL difference. In the embodiment of the present invention, an experimental example for verifying the effect of the trajectory generation method in the above embodiment is provided.

[0085] In this embodiment, the experimental trajectory data uses vehicle information captured by the checkpoint camera during the morning rush hour (7:00-9:00) in Dadukou District, Chongqing. The data set contains more than 95,000 vehicle trajectories, each of which contains checkpoint latitude and longitude information, license plate number, shooting time, checkpoint number and other information. After the license plate number is desensitized, the data fields are shown in Table 1. After being processed by methods such as sorting, checkpoint matching, license plate validity detection and time anomaly detection, the desensitized data is converted into the checkpoint vehicle passing data in Table 2.

[0086] Table 1 Original data sample

[0087] Table 2 Checkpoint vehicle passing data

[0088] In this embodiment, the experimental road network data uses the sumo road network map of Chongqing Dadukou District, which contains 203 checkpoints, 1072 road sections and 578 intersections. Figure 6 As shown in the figure, after matching the checkpoints to the road network, a road network directed graph is constructed through the connection relationship of the roads in the SUMO file so that the TrajGAT-A* model can perform path planning.

[0089] In this embodiment, for the trajectory reconstruction task, given a disconnected bayonet trajectory, the model reconstructs a trajectory with the same start and end points, and uses precision, recall and F1 value as indicators to evaluate the reconstructed trajectory, where the precision and recall respectively calculate the ratio of the overlapping part of the true trajectory and the reconstructed trajectory.

[0090] In this embodiment, the reconstructed trajectory is input into SUMO software for simulation, and the number of erroneous trajectories is counted. Total number of tracks The percentage of is used to measure whether the trajectory meets the road network constraints; for example, in the experiment, statistics are measured in groups of 1000 trajectories.

[0091] In this embodiment, the purpose of the generation model is to generate vehicle trajectories that conform to the feature distribution but have diversity. From a macro perspective, this embodiment uses the cross-entropy of the road section and the distribution of the checkpoint position to quantitatively evaluate the quality of the generated trajectory; wherein the cross-entropy of the road section is the cross-entropy that measures the probability of the road section distribution in the sample trajectory and the probability of the road section distribution in the generated trajectory, and its expression is:

[0092] In the formula, and Respectively represent the road sections in the sample trajectory Neutralize the generated trajectory The probability of The larger it is, the more diverse the generated trajectories are.

[0093] The location distribution of the checkpoint refers to the situation in which the driver Drive to the next section Often show a fixed-direction bias. Figure 1 In the example, vehicles often drive towards B5 after passing B4. We count all nodes captured by the camera in the input sample set and define this continuous behavior as state s. The probability distribution of the position of the checkpoint in the sample set is And output the distribution probability of the concentrated bayonet position , calculate the cross entropy between the bayonet state distributions:

[0094] In the formula, Indicates the status, Represents the amount of information about probability. When the cross entropy The smaller the time is, the smaller the distribution difference between the two sets is, and the closer the probability distribution of the trajectory containing the card-stop state is.

[0095] Based on the above experimental design, in this embodiment, for the trajectory reconstruction experiment, the checkpoint passing data is divided into long-distance (more than 15 checkpoints), medium-distance (5 to 15 checkpoints) and short-distance (less than 5 checkpoints) tasks, and comparative experiments, road network constraint experiments, ablation experiments and parameter sensitivity experiments are carried out respectively.

[0096] Comparative experiment: For the TrajGAT-A* model, given discontinuous checkpoint trajectories as training samples, the experiment hides all checkpoint sections except the starting point and the end point during the test phase, and ultimately needs to reconstruct a continuous and passable path.

[0097] Since the existing model requires continuous trajectories as input, the experiment uses the shortest path to complete the missing sections to form a continuous trajectory, and converts it into a GPS position sequence with a timestamp based on the longitude and latitude and the shooting time. The following models are selected for comparison, as shown in Table 3: Table 3. Comparative experimental results of reconstructed trajectories

[0098] Table 3 lists the F1 value experimental results of all the comparison models. It can be seen that TrajGAT-A* is significantly better than other models in reconstruction accuracy. AttnMove has a lower accuracy for long-distance tasks. One possible reason is that it cannot make good use of road network information. Although the History model fills the trajectory with the frequency of location appearance in the historical trajectory, it ignores the OD property and cannot generate a more accurate path.

[0099] exist Figure 7 The trajectories reconstructed by different models on the Chongqing road network are visualized in Figure 2. It can be seen that the trajectory reconstructed by the TrajGAT-A* model passes through the checkpoint and explores the road section in the vacant part of the functional area. The RF and History models are affected by the algorithm strategy and cannot accurately reconstruct the trajectory passing through the checkpoint. Although the reconstructed trajectories of the CTRR and NASR+ models pass through the checkpoint, they accidentally explore the low-flow road section outside the functional area, which is obviously not in line with the driving rules of motor vehicles.

[0100] Road network constraint experiment: In this embodiment, in order to verify whether the trajectories reconstructed by different models meet the road network constraints, the trajectories reconstructed by the model and the comparison model are input into the SUMO software for simulation, and the number of erroneous trajectories in every 1000 trajectories is counted.

[0101] From the results in Table 4, we can see that the trajectories reconstructed based on GPS data all have different degrees of error. However, thanks to the proposed method, which constructs a directed graph based on the connection relationship of the roads, the reconstructed trajectories completely comply with the road network constraints, which is our greatest advantage.

[0102] Table 4 Network constraint experiment results

[0103] Ablation experiment: In order to test the impact of each module on the experimental results, different modules in the model are removed to form different variants to observe the changes in the results. TrajGAT-A*-K: a model with the clustering function partitioning layer removed; TrajGAT-A*-A: a model with the segment attention mechanism removed; TrajGAT-A*-KA: a model with the clustering function partitioning layer and the segment attention mechanism removed, and only a simple GCN network is used.

[0104] exist Figure 8 The results of all ablation experiments are listed in . We found that the model without the clustering functional area layer showed a significant performance drop in long-distance tasks. One possible reason is the lack of feature learning of distant but highly correlated nodes by the functional area layer. The model without the attention mechanism showed a small drop in performance in short, medium and long tasks. Finally, the baseline model using only a simple graph neural network and A* can still achieve a good accuracy, which also shows that the heuristic algorithm combined with the neural network is very competitive in solving the task of trajectory reconstruction.

[0105] Parameter sensitivity experiment: In order to explore the best performance of the model, Figure 9-10 As shown in Figure 2, this experimental example explores the impact of the feature dimension of the adjacency matrix and the number of multi-head attention on the quality of trajectory reconstruction.

[0106] Feature dimension: the length of the node feature vector, that is, the number of columns in the feature matrix. Low-dimensional features may lead to information loss, while high-dimensional features can capture more information and details, thereby improving the expressiveness and performance of the model.

[0107] Multi-head attention: Multiple independent attention mechanisms are applied in each layer, each attention head generates a set of attention weights and calculates outputs, which are then aggregated. More heads allow the model to aggregate information from different perspectives and different subspaces, thereby improving the expressiveness and performance of the model.

[0108] Figure 9-10 The results show that as the feature dimension increases, the model performance also gradually improves. When the feature dimension is greater than 256, the performance gradually stabilizes, so 256 is selected as the feature dimension. The reconstruction performance is optimal when the number of multi-head attention is 8.

[0109] Based on the above experimental design, in this embodiment, for the trajectory generation experiment, the checkpoint vehicle data is also divided into long-distance (more than 15 checkpoints), medium-distance (5 to 15 checkpoints) and short-distance (less than 5 checkpoints) tasks. Given a single road network weight graph as training data, the model generates multiple road network weight graphs and then performs A* search to generate multiple trajectories. Based on this, comparative experiments and ablation experiments are performed respectively.

[0110] Comparative experiment: Since existing work does not involve generating diverse trajectories, the following models are selected for performance comparison, as shown in Table 5; Table 5. Comparative experimental results of generated trajectories

[0111] From the results in Table 5, it can be seen that the changes in the cross entropy of the road section and the cross entropy of the checkpoint position distribution of the TrajVAE variant are not obvious, indicating that although the generated trajectory conforms to the checkpoint distribution of the sample trajectory, it lacks diversity. As the cross entropy of the road section increases, the cross entropy of the checkpoint position distribution of EETG also increases significantly, indicating that the generated trajectory gradually loses precision as the number of road sections increases. Compared with other methods, the cross entropy of the road section of β-TrajVAE increases significantly with the length of the trajectory, but the cross entropy of the checkpoint position distribution only shows a slight increase, which shows that the generated trajectory has diversity while satisfying the checkpoint position distribution.

[0112] Ablation experiment: The ablation experiment takes a single road network weight map trained by the TrajGAT-A* model as input, and its goal is to test the impact of different modules on the diversity of generated trajectories. Finally, the following variants are designed: β-TrajVAE / og: Based on the method proposed in this article, the partition sampling module is removed and the initial loss function is used, which is the basic VAE model.

[0113] β-TrajVAE / ns: A variant of the proposed method with the partition sampling module removed.

[0114] β-TrajVAE / loss: Based on the method proposed in this paper, only the initial loss function is used to train the model.

[0115] Table 6. Experimental results of generated trajectories

[0116] As shown in Table 6, the trajectories generated by the basic VAE model obviously lack diversity. As the trajectory length increases, the variants that add partition sampling and optimize the loss function have a more obvious increase in the cross entropy of the road section while maintaining a slight increase in the cross entropy of the checkpoint position distribution, which ultimately shows that the model generates trajectories that conform to the feature distribution and have diversity.

[0117] exist Fig.11 The diverse trajectories generated under the same OD on the Chongqing road network are visualized in Figure 2. It can be seen that the trajectories generated by the road network weight graph after β-TrajVAE training will explore other sections in the functional area in the vacant part while passing through the checkpoint section passed by the sample trajectory, thereby generating diverse trajectories.

[0118] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0119] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning, characterized in that: The following steps are involved: S1, generating a road network weight graph of the traffic road network at the network layer; The network layer includes sequentially connecting spectral clustering, k-means clustering, graph neural network GCN and graph attention network GAT; S2, based on the road network weight graph, execute the A* search algorithm according to the starting and ending points of the vehicle, and output the vehicle reconstructed trajectory; S3, reversely train the graph neural network GCN and graph attention network GAT in the network layer according to the loss of the vehicle reconstructed trajectory and the corresponding real trajectory, and then output a road network weight graph with connected vehicle trajectories; S4. Input the road network weight map into the VAE model, and reconstruct multiple road network weight maps through encoding, partition sampling and decoding processing in sequence, and execute the A* search algorithm on them to generate diversified vehicle trajectories.

2. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 1, characterized in that: The step S1 comprises the following sub-steps: S11, obtaining traffic network information and initializing the traffic network; S12, using a spectral clustering algorithm to divide the initialized traffic road network into functional areas, and using a k-means clustering algorithm to cluster the divided functional areas, obtaining a mapping relationship from the road network to the functional area network, and constructing a functional area road network; S13, capturing the features of adjacent clusters in the functional area road network through the graph convolutional neural network GCN, and generating a feature matrix of the functional area network; S14. Based on the feature matrix of the functional area network, the graph attention network GAT is used to capture the feature weights of road sections under different influencing factors, and the road network weight graph is generated by normalizing the high-dimensional weights.

3. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 2, characterized in that: In step S12, the mapping relationship from the road network to the functional area network is expressed as: In the formula, represents the relationship matrix, Represents the road network, Represents a cluster, corresponding to the divided functional area; where the importance of each road segment node in the cluster is consistent, the soft assignment matrix of the road segment node in the functional area network is expressed as: In the formula, Indicates the probability that the road segment belongs to a cluster.

4. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 2, characterized in that: In step S13, the characteristic matrix of the functional area network is expressed as: In the formula, represents the feature matrix, represents a graph convolutional neural network, represents the adjacency matrix of the functional area network, Indicates that the soft allocation matrix and the initial characteristic matrix of the traffic network Transpose the matrix obtained by multiplication, Represents the traffic network adjacency matrix; where the initial feature matrix The information in the data includes the POI classification label, actual length and section width, center point longitude and latitude, and number of lanes for each road segment in the traffic network.

5. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 2, characterized in that: The step S14 comprises the following sub-steps: S14-1, reversely distribute the characteristic matrix of the functional area network to each road section node under its functional area to obtain the road network characteristic matrix; S14-2, according to the road network feature matrix, after performing linear transformation on the features of each road section, calculate the similarity coefficients of adjacent road sections, and perform normalization processing on them; S14-3. Based on the normalized similarity coefficients of adjacent road segments, a multi-head attention mechanism is used to learn and obtain the features of neighboring road segments; S14-4, aggregate all neighboring road segment features to obtain a complete road network feature matrix; S14-5. Normalize the high-dimensional features of each node in the complete road network feature matrix, and combine them with the directed graph connection relationship to generate a road network weight graph.

6. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 1, characterized in that: The step S2 is specifically as follows: Taking the road network weight graph as the search basis, starting from the starting point of a given vehicle, with the goal of minimizing the sum of the cost from the source node to the candidate node and the cumulative cost from the candidate node to the target node, the A* search algorithm is executed to obtain the reconstructed trajectory of the vehicle from the starting point to the end point.

7. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 1, characterized in that: The step S4 is specifically as follows: S41, dividing the road network weight graph into in-cluster road networks and outlier road segments, and inputting them into the VAE model; S42, calculating the mean and variance of the road network weight map through the encoder, thereby limiting the noise sampling of the road section within the cluster to the central area of ​​the Gaussian distribution, and limiting the noise sampling of the outlier road section to the edge area; S43, using the heavy parameter technique to perform partition sampling on the in-cluster road segments and the outlier road segments to generate latent variables; S44, the generated latent vector is mapped back to the original data space through the decoder to reconstruct the corresponding road network weight map.

8. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 7, characterized in that: In step S43, for the outlier section, the Gaussian distribution is divided into a central area based on the set standard deviation multiple, and the noise vector is limited to be sampled in the central area. , and then use the re-parameterization technique to generate latent variables , and Indicates that the encoder calculates the mean and variance of the road network weight graph; For the road sections within the cluster, the sampling interval is limited to the edge area divided based on 0.5 standard deviation multiples, and the noise vector is limited to be sampled in the edge area , and then use the re-parameterization technique to generate latent variables .

9. The method for generating diversified trajectories of urban motor vehicles based on traffic network weight learning according to claim 8, characterized in that: In step S4, the loss function of the VAE model is: In the formula, represents the MSE reconstruction error between the road section sample data and the generated data, Represents KL difference, hyperparameter Expressed as In the formula, represents sample data, represents the sampled data, and All represent constants, Indicates a specific common sense item, represents the accumulation of error and sampling period, n Indicates the total number of data.

Citation Information

Cited By

  • Vehicle track recovery method for missing road section-level data

    CN121071433A