Cross-city trajectory generation method combining deep learning and shortest path search

By combining deep learning and shortest path search methods, we learn the representation of local topology structures of road sections, predict travel overhead and generate trajectories, which solves the problems of difficulty in collecting trajectories and insufficient generalization capabilities in the existing technology, and realizes the efficient generalization capabilities of cross-city trajectory generation.

CN119829688AActive Publication Date: 2025-04-15BEIHANG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411902357.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-15
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art has challenges in trajectory data collection, especially under the limitations of commercial conflicts and privacy regulations, making it difficult to obtain large-scale trajectory data sets. At the same time, when the existing method is generalized to new cities, it faces the problem of insufficient generalization capabilities of model caused by changes in urban topology.

Method used

Combining deep learning and shortest path search cross-urban trajectory generation method, by learning the representations related to the local topology of the section, the road segment travel overhead is predicted, and the shortest circuit search is used to generate trajectories, which improves the generalization ability of trajectory generation.

Benefits of technology

This method significantly improves the generalization ability of trajectory generation, can still predict the outbound section overhead and generate reasonable trajectories when urban changes, and solves the model failure problem of existing technology when promoting new cities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829688A_ABST
    Figure CN119829688A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-city trajectory generation method combining deep learning and shortest path search, and relates to the technical field of deep learning and trajectory generation. The method specifically comprises the steps of extracting topological features by using a spatial syntax method, learning invariant topological representation and predicting travel cost by adopting a decoupling adversarial domain adaptation algorithm, and finally learning urban invariant human travel preferences to generate a trajectory. Compared with an existing technical method, the generalization ability of track generation is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of trajectory generation, and more particularly to a cross-city trajectory generation method combining deep learning and shortest path search. Background Art

[0002] Trajectory data mining is crucial for smart city management. However, due to factors such as commercial conflicts and privacy regulations, collecting large-scale trajectory datasets is challenging. Therefore, trajectory generation technology is urgently needed to solve this problem.

[0003] Urban trajectory generation is an active research field. In the existing technology, researchers have proposed a variety of technical methods to solve the problem of difficulty in collecting large-scale trajectory data. These methods can be divided into two categories: knowledge-driven methods and data-driven methods.

[0004] Among them, knowledge-driven methods generate trajectories based on empirical patterns and statistical models of human mobility, including gravity models, intervention opportunity models, radiation models, and EPR models. These methods usually use coarse-grained grids to analyze human behavior and derive physical priors with practical significance. By empirically summarizing human mobility behavior, these knowledge-driven methods have achieved remarkable results in macroscopic traffic trajectory simulation. However, in order to capture human mobility behavior at a finer granularity, data-driven methods are increasingly valued.

[0005] Data-driven methods use deep neural networks to capture movement patterns in complex trajectory data. According to the architecture of different deep neural networks, data-driven methods can be divided into Seq2Seq-based, GAN-based, VAE-based, and Diffusion-based methods. These methods rely on statistical learning to implicitly model human movement behaviors through neural network parameters. Although they have achieved remarkable success by learning from large datasets, they also lead to data dependence.

[0006] In summary, the knowledge-driven methods in the existing technology require less trajectory data, but have difficulty capturing complex mobility patterns. In contrast, data-driven methods, although they perform better, face challenges when generalizing to new cities. In data-driven models, changes in urban topology may prevent previously learned road representations from being effectively transferred to new networks. Summary of the invention

[0007] In view of this, the present invention provides a cross-city trajectory generation method combining deep learning and shortest path search, which improves the generalization ability of trajectory generation by learning representations related to the local topological structure of road sections, predicting the travel costs of road sections based on the representations, and using the shortest path search to generate trajectories.

[0008] In order to achieve the above object, the present invention adopts the following technical solution:

[0009] The present invention discloses a method for generating cross-city trajectories by combining deep learning and shortest path search, comprising the following steps:

[0010] 1) Obtaining the space syntax topological features of the urban road network, wherein the urban road network includes the urban road networks of the source city and the target city:

[0011] The Metis algorithm is used to divide the urban road networks of the source city and the target city into several sub-graphs. and The divided subgraphs are respectively formed into a road network subgraph set corresponding to the source city and a road network subgraph set corresponding to the target city;

[0012] The spatially aware graph attention network is used to aggregate the node features of each subgraph in the source city’s road network subgraph set to generate the aggregated topological features of the source city’s road network.

[0013] The spatially aware graph attention network is used to aggregate the node features of each subgraph in the target city’s road network subgraph set to generate the aggregated topological features of the target city’s road network.

[0014] 2) Learn an invariant topological representation and predict the travel cost of the target city through a disentangled adversarial domain adaptation algorithm:

[0015] Based on the aggregated topological features of the source city road network, a semantic encoder is used to extract the semantic latent variables of the source city, and a domain encoder is used to extract the domain latent variables of the source city;

[0016] Based on the aggregated topological features of the target city’s road network, a semantic encoder is used to extract the target city’s semantic latent variables, and a domain encoder is used to extract the target city’s domain latent variables.

[0017] The domain discriminator is used to judge the aggregate topological characteristics of the source city and the target city;

[0018] Through decoupled adversarial training, the information between semantic latent variables and domain latent variables is decoupled to obtain city-independent semantic representation;

[0019] Constructing a travel cost prediction network, the travel cost prediction network comprising a multi-layer perceptron MLP and a softplus activation function module connected thereto, and using the travel cost prediction network to predict city-independent semantic representations to obtain predicted travel costs;

[0020] 3) Learn to generate trajectories based on travel preferences:

[0021] The predicted travel cost and the implicit cost are weightedly combined to obtain the travel preference of the target city, wherein the implicit cost includes the preference weights of different roads;

[0022] Through iterative training, the model learns the invariant mapping relationship between travel preferences and various travel costs, which is applied to the target city to generate trajectory data.

[0023] Furthermore, in the step 1) of obtaining the spatial syntax topological features of the urban road network, the spatially aware graph attention network SAGAT is used to perform attention on the subgraph set. Aggregate the node features of each subgraph in , which specifically includes the following steps:

[0024] Construct a spatially aware graph attention network SAGAT, the output layer of which is connected through a residual block;

[0025] The initial layer of SAGAT transforms the input subgraph node features through a multi-layer perceptron MLP;

[0026] The l+1th layer of SAGAT, l≥1, calculates the attention weights between nodes and embeds the spatial relationship between nodes into the attention weights:

[0027]

[0028] Where a,W s ,W t ,W e is a learnable parameter, It is road section r i The set of neighbor nodes, σ is the LeaklyReLU activation function; u ij Represents the spatial relationship between two nodes;

[0029] According to the attention weight The aggregated topological features of the urban road network output by the l+1th layer of the spatially aware graph attention network SAGAT are obtained:

[0030]

[0031] Furthermore, the spatial relationship u between the two nodes in the above method ij include:

[0032] Passing through road segment i and road segment r j The ratio of the number of shortest paths to the total number of shortest paths in the entire network Bet(r i ,r j )、Road section angle Angle(r i ,r j), and the center point travel distance Dist(r i ,r j ).

[0033] Furthermore, in the above method, the city-independent semantic representation is predicted to obtain the predicted travel cost, which specifically includes the following steps:

[0034] Semantic latent variables and domain latent variables Input the travel cost prediction network to get the predicted travel cost

[0035]

[0036] The loss functions used to train the travel cost prediction network include an MSE loss function and a ranking loss function.

[0037] Furthermore, in the above method, the MSE loss function specifically includes the following expression:

[0038]

[0039] Where N s is the size of the source city dataset; y i is the true value of the cost of traveling on the road segment, including travel time and speed.

[0040] Furthermore, in the above method, the ranking loss function specifically includes the following expression:

[0041]

[0042] in, Represents road segment r i The predicted travel cost is higher than the segment r j Predict the probability of a successful trip; Represents road segment r i and road segment r j The true ranking label value.

[0043] Furthermore, in the above method, a weighted combination of observable costs and implicit costs is used to obtain the travel preferences of the target city, specifically including:

[0044] Based on observable costs and hidden costs The travel preferences of the target city are obtained through the following formula:

[0045]

[0046] where w (m) are learnable weights.

[0047] Furthermore, in the above method, through iterative training, the model learns the invariant mapping relationship between travel preferences and various travel costs, and applies it to the target city, specifically including:

[0048] Randomly initialized parameters include: the parameters of the implicit cost prediction network and the combined weights w of various costs (m) ; The object of the shortest path search is the source city, and the parameters are updated according to the search results; The shortest path search uses the Dijkstra algorithm to obtain the road segment r in the urban road network of the source city i To road segment r j The shortest path

[0049] Calculate the shortest path The sum of preferences:

[0050]

[0051] Actual trajectory τ ij The sum of the preference values ​​is:

[0052]

[0053] The unsupervised loss function is defined as:

[0054]

[0055] First, predict the preference value of each road section, then input the real trajectory, search for the generated trajectory according to the starting point and the end point, use the total preference value of the real trajectory minus the total preference value of the generated trajectory as the loss function, back-propagate to update the initialization parameters, complete a round of iteration, decouple the adversarial training parameters (freeze and do not update), and in the next round, use the entire network with updated parameters to re-predict the preference value, and repeat this process to obtain loss convergence;

[0056] After the training is completed and applied to the target city, the trajectory can be generated by directly searching for the shortest path in the target city based on the starting point and the end point.

[0057] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method for generating cross-city trajectories by combining deep learning and shortest path search, which has the following beneficial effects:

[0058] The present invention uses a space syntax method to extract topological features, adopts a decoupled adversarial domain adaptation algorithm to learn an invariant topological representation and predict travel costs, and finally learns the invariant travel preferences of humans in the city to generate trajectories. Compared with existing technical methods, the generalization ability of the trajectory generation process of the present invention is significantly improved. Specifically, the method proposed in the present invention can learn representations related to the local topological structure of the road section, and then predict the travel costs of the road section and use the shortest path search to generate trajectories. When the city changes, the road network connection and the road section coding change, causing the existing methods to fail, while the present invention can still predict the road section costs and use the shortest path search to generate reasonable trajectories. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0060] Figure 1 A schematic diagram of the road network topology structure of two different cities provided in an embodiment of the present invention.

[0061] Figure 2 A schematic diagram of the overall network structure implemented by the cross-city trajectory generation method combining deep learning and shortest path search provided in an embodiment of the present invention.

[0062] Figure 3 A schematic diagram of comparing frequency heat maps of road sections on XA data using different methods provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] The key to achieving cross-city trajectory generation is to capture the invariant human mobility patterns in different urban environments. Based on existing research, this paper proposes two invariant human mobility patterns: (1) People in different cities have similar travel preferences. Generally speaking, people will choose the path with the lowest travel cost. By learning the combination of travel costs, we can generate trajectories that conform to human preferences. (2) The topological structure of the road network affects the function, frequency of use and congestion of the road, thereby determining the travel cost. Although the global road network structure of different cities is different, there are similar local topological structures. (e.g. Figure 1 As shown in Figure 2, the local road network topologies of two different cities are similar, making transfer learning possible.

[0065] The present invention aims to generate fine-grained segment-based travel trajectories and achieve inter-city generalization. The following are the necessary symbol definitions for the description of the patent briefing.

[0066] Definition 1: Roadmap: A roadmap is a directed graph G =<R,E> , where R is the set of road segments, represents the adjacency relationship between road segments. i and r j Connected by intersection, then E ij =1; otherwise, E ij =0.

[0067] Definition 2: Road Segment: A road segment is represented by the symbol r. i ∈R represents a specific line segment in the urban road network. Each road segment has several features, such as geographic coordinates, road type, length, etc. The feature vector of the road segment can be expressed as Where D s is the dimension of the feature vector. Based on the road segments of the city, this paper can construct a city road network graph structure to describe the road network of the entire city.

[0068] Definition 3: Road Segment-based Trajectory: A road segment-based trajectory is a sequence of road segments arranged in time order, denoted by τ. The nth trajectory point in the trajectory is represented by is the corresponding road segment, t n is the timestamp. In a trajectory based on road segments, the road segments corresponding to consecutive trajectory points are connected. This means that the trajectory should be a continuous one.

[0069] Definition 4: Travel Demand. Travel demand is a triple D = (r o ,rd ,t o ), where l o is the starting road segment, l d is the target road segment, t o is the departure time. The travel demand can be extracted through the actual trajectory data, which describes the travel goals of the intelligent agent in the city.

[0070] The purpose of the present invention is to: given a road network G src and trajectory datasets The source city, and a road network G tgt Lack of trajectory data The target city is trained as a model g θ , so that it can generate a new trajectory dataset To fit the human mobility pattern in the target city. Specifically, the present invention is trained on the data of the source city to obtain the parameter θ, and then the trained model is applied to the target city to generate simulated trajectories similar to the real trajectory data, which is formally defined as follows.

[0071] Input: Source city road network G src and trajectory datasets Target city road network G tgt

[0072] Optimization goal: Optimize the model parameters θ (the parameters here refer to the parameters of all neural networks in the entire technical framework diagram, including SAGAT, travel cost prediction network, domain discriminator, implicit cost prediction network, which is a general and formal description. The optimization process includes decoupled adversarial training and iterative training (preference learning)) so that the road network G of the target city tgt The generated trajectory dataset With real data Similar. During the training phase, the following functions are optimized

[0073]

[0074] Where L is the optimization target, which measures the difference between the generated trajectory and the true trajectory.

[0075] Output: Generate target city trajectory data using trained parameters:

[0076]

[0077] The present invention proposes a method for generating cross-city trajectories based on transfer learning. In order to achieve the cross-city mobility of the deep neural network model, the present invention proposes a method for extracting city-independent representations, predicting travel costs, learning travel preferences, and searching for the shortest path. The overall architecture of the technical solution of the present invention is as follows: Figure 2 As shown, it can be divided into the following three parts: topological feature extraction, travel cost prediction, and trajectory generation based on preference learning. In the topological feature extraction module, the present invention uses space syntax to construct a series of features, and then uses an inductive graph attention network to aggregate local features. In the travel cost prediction module, the present invention uses source city data for supervised training, and introduces domain adaptation loss for decoupled adversarial training to improve the prediction effect of the target city. In the travel preference learning module, this study uses the obtained preference value to find the shortest path, narrow the gap between the preference value and the predicted path and the actual path, and continuously iterates and updates the preference prediction.

[0078] The extraction of urban road network topology representation based on space syntax mainly includes the steps of space syntax feature calculation representation and feature aggregation based on inductive graph attention network. Each step is explained in detail below.

[0079] 1.1 Calculation and representation of spatial syntax features of urban road networks:

[0080] In the spatial structure analysis of cities and buildings, topological feature extraction is an important part of spatial morphology research, which can provide a deep understanding and quantitative description of the road network structure. This paper calculates four key spatial syntax features, including total depth, integration, connectivity and choice (also known as betweenness centrality). The specific calculation method is as follows.

[0081] 1) Total depth: The total depth refers to the sum of the step depths from a specific road segment to all other road segments in the network. i To another section within a certain range j The step depth is the total number of hops in the shortest path. The total depth of the road segment is r i The sum of the step depths of all sections within a certain range (specified local radius such as 10km), the present invention selects multiple different local radii to calculate multiple values. The calculation method is:

[0082] SD(r i ,r j )=Size(shortestpath(r i ,r j )),

[0083]

[0084] This metric identifies which road segments are more remote and thus require more driving time and steps to reach. Reducing the total depth in a specific area can effectively alleviate traffic congestion, especially during peak hours, as it can point out critical road segments that may become traffic bottlenecks.

[0085] 2) Integration: The integration reflects the centrality of a road segment in the entire road network and is calculated as follows:

[0086]

[0087] Among them, NC(r i ) refers to the section r i The sum of the number of sections required to start and reach all other sections within a certain range. is the total depth of the road segment. A road segment with high integration means that it is more central, and the path from this road segment to other road segments in the city is shorter and the travel cost is lower. Therefore, improving the integration of roads helps improve road traffic efficiency and reduce travel time.

[0088] 3) Connectivity: Connectivity refers to the number of direct connections between a road segment and other road segments. Road segments with high connectivity are usually located at the core of the transportation network and are the intersection of multiple roads. Such road segments usually bear high traffic volume and are key components of the urban transportation network. Enhancing the connectivity of road segments can improve the overall accessibility of the network, promote smoother traffic flow and reduce travel delays. Connectivity represents the number of neighbors directly connected to a road segment and can be calculated by the following formula:

[0089]

[0090] 4) Selectivity: Selectivity is also known as betweenness centrality, which measures the frequency of a road segment appearing on the shortest path between all road segment pairs. Road segments with high selectivity play an important role as a transfer or bridge in the network, which is crucial for dispersing traffic pressure, optimizing route selection and reducing travel time. Improving the selectivity of a road can make it a more effective channel for traffic flow distribution, helping to reduce the pressure on major traffic arteries. Road segment r i The selectivity is calculated by calculating its selectivity in all segments r j and r k The number of occurrences on the shortest path between them is calculated as follows:

[0091]

[0092] where δ ijk Indicates that from r j to r k Does the shortest path pass through ri , specifically stated as follows:

[0093]

[0094] Through the four topological features of space syntax, total depth, integration, connectivity and selectivity, the present invention can comprehensively analyze the spatial structure of the urban road network. type and direction will be combined into one feature vector as follows:

[0095]

[0096] The time slice index is used to learn the initial travel cost over time, and the discrete variables are encoded through the embedding layer.

[0097] 1.2 Feature aggregation based on inductive graph attention network:

[0098] After obtaining the initial spatial syntax topological features, the present invention aggregates them through inductive graph attention networks (GATs) to obtain representations containing richer topological information. These representations are not just simple sets of node features, but a comprehensive expression of spatial relationships and topological features learned by neural networks. This process is crucial for capturing complex road network structural characteristics. The inductive graph attention network requires the use of diverse graph structure data for training to enhance the generalization of the model. Therefore, the present invention first divides the global road network of the entire city into a large number of local subgraphs through a subgraph sampling method, and then designs a spatially aware graph attention network to aggregate features. Specifically, it may include the following:

[0099] Step 1.2.1 Sampling of road network subgraphs:

[0100] The present invention uses the Metis algorithm to divide the entire road network into multiple subgraphs, and randomly extracts some subgraphs for training. Specifically, K subgraphs are sampled each time, of which the first subgraph is directly traversed and selected, and the remaining K-1 subgraphs are randomly selected, so as to ensure that each subgraph can be sampled and obtain a diverse subgraph combination input. The traditional method performs convolution on the entire graph, and the performance of the network decreases when the road network structure changes. The use of subgraph convolution can avoid this problem and can also better utilize the local topological similarities between different cities. The subgraph convolution method also introduces the challenge of subgraph sampling.

[0101] In order to extract more diverse and representative samples from a huge road network, the Metis algorithm used in the present invention can efficiently divide the large-scale graph into several smaller subgraphs, while ensuring that the number of vertices in each subgraph is as balanced as possible and the number of edges between subgraphs is minimal. This balanced division method helps to enhance the adaptability of the model to different types of road networks. The sampling process is as follows:

[0102]

[0103] in It is a global map of the entire city road network. It is the subgraph segmented by Metis. It is a subgraph randomly sampled and combined.

[0104] Step 1.2.2 Spatial perception graph attention aggregation:

[0105] After sampling and obtaining diverse subgraphs, the present invention proposes a spatially aware graph attention network (SAGAT) to aggregate the features of the subgraphs and generate a road segment representation with surrounding topological information. When aggregating neighbor node information, the traditional GAT only uses the representation of the node to calculate the attention coefficient, ignoring the spatial relationship between nodes in the urban road network. For example, from the perspective of spatial syntax, the higher the selectivity (betweenness centrality) of the connecting edge between two road segments, the larger the attention coefficient should be. This spatial relationship is common in different cities, so this study introduces the spatial relationship between road segments into the attention mechanism. Enhanced the model's ability to perceive spatial information. In the present invention, the input of SAGAT is the node features of each subgraph, and feature aggregation is performed by stacking a series of attention layers to finally obtain the subgraph topological feature representation. The process is expressed as:

[0106]

[0107] where h i is the corresponding road segment r i The aggregation topology representation of .

[0108] Specifically, this process is achieved through multi-layer attention aggregation. The initial layer input is represented by the multi-layer perceptron (MLP) transformation, and the calculation method is:

[0109]

[0110] This MLP conversion layer helps to improve the richness of feature expression in the initial stage of the network and provide better input for the subsequent attention mechanism.

[0111] For the l+1th layer, the SAGAT network calculates the attention weights between nodes and embeds the spatial relationship into the attention mechanism. In this structure, the model not only pays attention to the characteristics of neighboring nodes, but also considers the spatial relationships between these nodes, such as turning angles, driving distances, and betweenness centrality. These spatial relationships reflect the physical connection and spatial relative position between road segments, which is important information for understanding the structure of urban road networks. The calculation process of this attention mechanism is:

[0112]

[0113] Where a,W s ,W t ,W e is a learnable parameter, It is road section r i The neighbor node set of u, σ is the LeaklyReLU activation function. ij Represents the spatial connection between two nodes, expressed as follows:

[0114] u ij =Bet(r i ,r j )||Angle(r i ,r j )||Dist(r i ,r j ),

[0115] Where Bet refers to the cross r i and r j The ratio of the number of shortest paths to the total number of shortest paths in the entire network. Angle is the turning angle of the road segment, and Dist represents the travel distance between the center points of two road segments. The output of the l+1 layer of the final spatially aware graph attention network is expressed as:

[0116]

[0117] 2. Cross-city travel cost prediction based on decoupled adversarial learning:

[0118] The present invention expects to achieve transferable trajectory generation through cross-city travel cost prediction and shortest path search. However, the difference in representation distribution between the source city and the target city reduces the generalization ability of the model. To solve this problem, the present invention uses decoupled learning and adversarial domain adaptation to obtain city-independent representations and predict the travel cost of the target city. This part can be divided into two parts: semantic and domain representation decoupling and travel cost prediction based on ranking loss. Each part is described in detail below.

[0119] 2.1 Decoupling of semantics and domain representation:

[0120] After aggregating the topological features, in order to obtain a city-independent representation, the present invention first uses two encoders to decouple different levels of information from the topological representation. The present invention assumes that the road segment information is determined by two independent latent variables: a semantic latent variable z (s) and a domain latent variable z (d) These variables are extracted by semantic encoder and domain encoder respectively. (s) captures the semantic information used to predict trajectory cost, while z (d) Contains city-specific domain information, as follows:

[0121]

[0122] The semantic encoder and domain encoder are implemented using two multi-layer perceptrons (MLPs) respectively. The present invention uses adversarial domain adaptation techniques to train these representations, including a predictor for travel cost estimation and a discriminator for city identification. These representations are updated synchronously during the calculation and optimization of travel cost prediction.

[0123] In the above steps, a multi-layer perceptron MLP is used as the discriminator, and the discriminant loss is used To achieve the adversarial effect, a gradient reversal layer GRL is added before the discriminator of the semantic latent variable and a layer of GRL is added before the travel cost prediction network of the domain latent variable.

[0124] 2.2 Travel cost prediction based on ranking loss:

[0125] The travel cost is represented by the average travel time and speed of a road segment in a specific period, expressed as:

[0126]

[0127] where m represents the cost type. Using the decoupled latent variable z i As input (superscripts omitted for simplicity), the travel cost prediction network can be expressed as:

[0128]

[0129] The prediction loss function used to train the neural network includes an MSE loss and a ranking loss. The MSE loss is calculated as:

[0130]

[0131] Where N s is the size of the source city dataset, y i is the true value of the travel cost of the road segment (including travel time and speed), expressed as the average value of the real data set.

[0132] In cross-city scenarios, there is often a potential deviation in the travel costs between different cities, which makes it difficult to predict the absolute size of the travel costs. To this end, the present invention introduces ranking loss to solve this problem. Specifically, the present invention predicts the distance between two road segments r i The travel cost is higher than r j The probability of

[0133]

[0134] The actual ranking label value is calculated as follows:

[0135]

[0136] The binary cross entropy loss is calculated as follows:

[0137]

[0138] The total loss predicted by travel costs is:

[0139]

[0140] where λ r is the balance weight between the two losses.

[0141] 2.3 Decoupled Adversarial Training:

[0142] In order to separate domain information from semantic information, this study introduces a domain discriminator to predict the domain label of the road segment. Sub-graph samples are extracted from the source city or the target city, and domain labels are assigned to each road segment as follows:

[0143]

[0144] The label 1 represents that the road segment comes from the source city road network, and the label 0 represents that the road segment comes from the target city road network. Given the latent variable z i As input, the domain discriminator classifies the source city and the target city as follows:

[0145]

[0146] For this domain discrimination task, the binary cross entropy loss is calculated as:

[0147]

[0148] Where N s and N t Represent the size of the source city and target city datasets respectively.

[0149] Disentangled adversarial training is used to promote and The decoupling of information between them. For semantic latent variables, the ultimate goal is to minimize the travel cost prediction loss while maximizing the domain discrimination loss; for domain latent variables, the goal is just the opposite. By using different representations as input, the loss function is calculated as:

[0150]

[0151] In order to further reduce information coupling, this study also introduces orthogonal loss, attempting to maximize the difference between the decoupled representations. The calculation of orthogonal loss is as follows

[0152]

[0153] The total loss function that characterizes disentangled adversarial training combines these losses, and the final loss function is:

[0154]

[0155] where λ g is a balancing factor. Through the decoupled adversarial training in this step, the model can separate domain-related information from the road segment representation, thereby making city-independent semantic representations and realizing cross-city travel cost prediction.

[0156] 3. Learn the trajectory based on travel preferences:

[0157] Specifically, this section includes:

[0158] 3.1 Travel Preference Prediction:

[0159] After completing the travel cost prediction, the shortest path search algorithm can be used to generate a driving trajectory for the target city. Most existing shortest path search models rely on fixed road cost factors, such as travel speed or time, to plan routes. However, relying solely on a single cost factor usually cannot fully capture the user's actual travel preferences, which are affected by more complex factors. To solve this problem, the present invention proposes to model travel preferences as a combination of observable costs and implicit costs. Implicit costs represent those factors that are difficult to explain and affect human choices, where observable costs refer to the travel costs predicted in the previous step, including the average travel time and average travel speed of the road section; the implicit cost is calculated using another multi-layer perceptron, and the formula is Updated by iterative training, where z i is a semantic latent variable. The implicit cost can be interpreted as people's preference for roads. For example, if people prefer to choose wide trunk roads, the implicit cost of trunk roads should be lower. This preference can be mined from trajectory data. These costs are trained using source city data and used to make predictions in the target city.

[0160] The forecasting model then estimates overall travel preferences using a weighted combination of observable and implicit costs as follows:

[0161]

[0162] where w (m) is a learnable weight. p(r i ) is smaller, indicating that the road segment r i This study assumes that this preference combination is consistent across cities.

[0163] 3.2 Travel Preference Update:

[0164] The learning of preferences is accomplished through unsupervised training. During the training process, the present invention first randomly initializes the parameters and searches for the shortest path. i to r j The shortest path is expressed as The sum of their preferences is:

[0165]

[0166] Actual trajectory τ ij The sum of the preference values ​​is:

[0167]

[0168] The unsupervised loss function is defined as:

[0169]

[0170] Through iterative training, the model learns the invariant mapping relationship between travel preferences and various travel costs, which can then be applied to the target city to generate trajectory data.

[0171] In order to implement the above method, the present invention also discloses a specific system or model capable of implementing the above method, and utilizes a computer system to implement the above corresponding method.

[0172] The present invention has been extensively experimented on multiple city datasets to verify the performance and generalization ability of the model. The experimental results show that compared with the existing trajectory generation methods, the present invention has significant performance advantages in the cross-city trajectory generation task. By comparing with the baseline model, the present invention not only outperforms other models in generation quality, but also performs well in the availability of generated data.

[0173] The experimental verification of the present invention is set up as follows:

[0174] (1) Datasets: We selected three real-world trajectory datasets to evaluate the performance of the present invention. These datasets are from three different cities, namely BJ, XA and CD. The road network data of these three cities are from OpenStreetMap (OSM), and the road segment trajectory data is obtained by applying a map matching algorithm. The table shows the corresponding statistical indicators of the three datasets, and gives the number of road segments and intersection trajectories of the three datasets, as well as the time period of collection.

[0175] Table 1 Trajectory dataset information

[0176]

[0177]

[0178] (2) Comparison of baseline methods: In order to evaluate the method of this method, the following trajectory generation models are selected as baseline controls, covering knowledge-driven models and data-driven models, and are appropriately modified according to the segment-based trajectory sequence.

[0179] EPR models: including Spatial-EPR (SE) and Density-EPR (DE). These models summarize human behavior into two modes: exploration and preferential return. They introduce a gravity model to simulate the impact of group movement on individuals and set empirical parameters for sampling.

[0180] TrajGen (TG): This method uses CNN-based GAN to generate synthetic trajectory images, then extracts location information from the images and uses a Seq2Seq model to infer the true trajectory sequence.

[0181] SeqGAN(SG): This method is a classic sequence generation method that combines policy gradient and GAN to solve the sequence generation problem.

[0182] SVAE (SV): This method combines the variational autoencoder with the Seq2Seq model for the first time to generate mobile trajectory data.

[0183] MoveSim(MS): This method builds a self-attention based trajectory generator and designs a discriminator that perceives movement patterns to train the generator in a reinforcement learning paradigm.

[0184] TS-TrajGen (TT): This method combines the A* search algorithm and neural networks to model the agent strategy and proposes a two-stage adversarial generative network to effectively generate trajectory data.

[0185] DiffTraj (DT): This method exploits the generative power of diffusion models to reconstruct and synthesize geographic trajectories from white noise via an inverse trajectory denoising process.

[0186] VOLUNTEER (VO): This method uses variational autoencoders (VAE) to model the complex spatiotemporal distribution of users and obtain accurate trajectory simulation.

[0187] (3) Result evaluation indicators: From the perspective of macro-similarity, this method focuses on the overall statistical distribution of the trajectory dataset. This method evaluates the quality of generated data by comparing the similarity of mobility patterns and urban traffic status indicators between the generated data and the real data. Here, the experiment uses Jensen-Shannon divergence (JS divergence) as a similarity metric to measure the similarity of the real trajectory dataset. And generate trajectory dataset Similarities between

[0188]

[0189] in It is a statistic of a trajectory data set, where the sample is a single trajectory or road segment. Specifically, JS divergence is calculated on the following statistical distribution:

[0190] Distance: represents the travel distance of the trajectory, that is, the spatial length.

[0191] Radius: Calculated by the rotation radius, indicating the spatial range of the trajectory.

[0192] Visit frequency (LocFreq): The visit frequency distribution of each road segment, which is used to indicate the popularity of the road.

[0193] From the perspective of micro-similarity, this method focuses on measuring the sequence distance between the real trajectory and the generated trajectory with the same travel demand. The average sequence distance is calculated by the following formula:

[0194]

[0195] SeqDist refers to various micro-similarity metrics. In this experiment, four trajectory distances are used for calculation:

[0196] Hausdorff distance: measures the maximum deviation of any point in each trajectory set from the nearest point in another trajectory set.

[0197] DTW (Dynamic Time Warping): minimizes the cumulative distance between corresponding points by aligning them on the time axis.

[0198] EDT (Edit Distance): Measures the minimum number of edit steps required to transform one sequence into another.

[0199] EDR (Edit Distance on Real Sequences): A variant of edit distance designed specifically for real-valued sequences.

[0200] These combined metrics help comprehensively assess macro- and micro-level trajectory similarities, ensuring that the generated data is consistent with real-world patterns in terms of statistical properties and structure.

[0201] (4) Programming and operating environment: All experiments were conducted on a machine equipped with an NVIDIA GeForce 3090 GPU and running the Ubuntu 20.04 operating system. The model was implemented using Pytorch 1.12.1. The number of SAGAT layers was 6. During training, the number of clusters K varied according to the size of the dataset; a batch of data consisted of 3 clusters; the learning rate was set to 1e-5; and the number of training times was 600. The balance weight in the loss function was: r =50,λ r =100 and λ g =50.

[0202] In order to verify the effectiveness of the present invention, the beneficial effects of the present invention are demonstrated from three aspects: cross-city trajectory generation, downstream task application and target city fine-tuning.

[0203] Verification of cross-city trajectory generation effect:

[0204] Table 2. Results of cross-city trajectory generation

[0205]

[0206]

[0207] In Table 1, the model proposed in the present invention is abbreviated as GTG (Generalizable Trajectory Generator). Among them, GTG1 refers to training on the XA dataset and generating on the BJ dataset; training on the BJ dataset and generating on the CD dataset; training on the CD dataset and generating on the XA dataset. GTG2 refers to training on the BJ dataset and generating on the XA dataset; training on the XA dataset and generating on the CD dataset; training on the CD dataset and generating on the BJ dataset.

[0208] The overall performance results are shown in Table 1. In the experiments on each dataset, the best results are highlighted in bold, while the second best results are underlined. Evaluated from both macro and micro perspectives, the proposed method shows excellent performance compared to all baseline models on three real-world trajectory datasets, with significant improvements in all indicators. Unlike other deep learning baseline methods that need to be trained on the target city data to produce accurate trajectories, the proposed method can run effectively without training on the target city. This demonstrates the generalization ability of the model.

[0209] By further visualizing the thermal image of the road segment visit frequency, such as Figure 3 As shown, 5 models with better performance data are selected for comparison with the real data heat map. By comparison, it can be seen that the present invention (GTG) has the best fitting effect on the real trajectory data in various urban areas. However, other models have the problem that the overall distribution is too low or too high, and the degree of fitting varies in different regions. This is because these models do not capture the local spatial heterogeneity, nor the difference in feature distribution between the target city and the source city. These methods do not capture the common laws that adapt to individual urban areas, and the model performance decreases when the urban road network structure changes. The present invention has learned more general data laws through spatial syntax, inductive topological feature extraction, adversarial domain adaptation, and preference learning, and therefore performs better.

[0210] Verification of downstream task application effects:

[0211] The application effect of downstream tasks mainly verifies whether the generated data can completely replace the real data for training downstream tasks. This scenario is designed to prove the availability of generated data. We divide the data into three parts, Data-Train, Data-Target, and Data-Test. Data-Train is used to train the trajectory generation model. Data-Traget is the set that the trajectory generation model wants to generate. Data-Test is used to test the performance of downstream tasks. Experimental method: First, use Data-Train to train the trajectory generation model, and then use the trained generation model to create the generated Data-Traget-Gen according to the travel demand in Data-Traget. Next, this method uses Data-Traget-Gen and Data-Traget to train two downstream models respectively, and finally uses Data-Test to evaluate the performance difference between the downstream models.

[0212] In this scenario, the method trains downstream application models based on the generated trajectory data and verifies them on real trajectory data. In this way, we are able to evaluate the utility of the generated trajectory data, thereby proving that the generated trajectory data of the present invention can support downstream applications. Specifically, we choose the trajectory next-hop position prediction task as the downstream application task. The trajectory next-hop position prediction task aims to predict the location of the trajectory and is widely used in POI recommendation applications. We choose DeepMove and LSTPM as the trajectory next-hop position prediction models, and train these downstream models using the synthetic trajectory data generated in Data-Target, and then test the downstream models on the real trajectory data from Data-Test.

[0213] Table 3 Application effects of downstream tasks

[0214]

[0215]

[0216] As shown in the results in Table 3, the baseline model shows poor performance, while the present invention achieves the effect of using the real trajectory dataset as the training set in all indicators. From the perspective of deep learning training, the test performance of the model is affected by the difference in distribution between the training set and the test set. The trajectory dataset generated by the present invention is closer to the real trajectory dataset distribution, so the generalization performance on these two models is better. From the perspective of use, this shows that the trajectory data generated by our method is more effective in supporting downstream tasks, and downstream tasks can directly use simulated data for training. This is even more important in some scenarios involving privacy protection and simulation.

[0217] Target city data fine-tuning experiment:

[0218] Considering that the gradual collection of trajectory data is a more realistic application scenario, it would be beneficial if the trajectory generation capability of the model could be further adjusted in the target city.

[0219] Table 4 Target city fine-tuning experimental results

[0220]

[0221]

[0222] We fine-tune the model using the trajectory of the target city to test its improved generation capability. The fine-tuning phase training includes travel cost prediction and preference learning. The experimental results are shown in Table 4. Fine-tuning using the target city data can improve the performance of the model. Before applying the model to a new city, collecting a small amount of trajectory data for fine-tuning can achieve good generation results without incurring excessive costs. The indicators in the table are all lower, the better. And as the number of fine-tuning trajectories increases, the performance of the present invention in each indicator is steadily improved.

[0223] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0224] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A cross-city trajectory generation method combining deep learning and shortest path search, characterized in that: The following steps are involved: 1) Obtaining the space syntax topological features of the urban road network, wherein the urban road network includes the urban road networks of the source city and the target city: The Metis algorithm is used to divide the urban road networks of the source city and the target city into several sub-graphs. and The divided subgraphs are respectively formed into a road network subgraph set corresponding to the source city and a road network subgraph set corresponding to the target city; The spatially aware graph attention network is used to aggregate the node features of each subgraph in the source city’s road network subgraph set to generate the aggregated topological features of the source city’s road network. The spatially aware graph attention network is used to aggregate the node features of each subgraph in the target city’s road network subgraph set to generate the aggregated topological features of the target city’s road network. 2) Learn an invariant topological representation and predict the travel cost of the target city through a disentangled adversarial domain adaptation algorithm: Based on the aggregated topological features of the source city road network, a semantic encoder is used to extract the semantic latent variables of the source city, and a domain encoder is used to extract the domain latent variables of the source city; Based on the aggregated topological features of the target city’s road network, a semantic encoder is used to extract the target city’s semantic latent variables, and a domain encoder is used to extract the target city’s domain latent variables. The domain discriminator is used to judge the aggregate topological characteristics of the source city and the target city; Through decoupled adversarial training, the information between semantic latent variables and domain latent variables is decoupled to obtain city-independent semantic representation; Constructing a travel cost prediction network, the travel cost prediction network includes a multi-layer perceptron MLP and a softplus activation function module connected thereto, and using the travel cost prediction network to predict city-independent semantic representations to obtain predicted travel costs; 3) Learn to generate trajectories based on travel preferences: The predicted travel cost and the implicit cost are weightedly combined to obtain the travel preference of the target city, wherein the implicit cost includes the preference weights of different roads; Through iterative training, the model learns the invariant mapping relationship between travel preferences and various travel costs, which is applied to the target city to generate trajectory data.

2. According to claim 1, a method for generating cross-city trajectories combining deep learning and shortest path search is characterized in that: 1) In the step of obtaining the spatial syntax topological features of the urban road network, the spatially aware graph attention network SAGAT is used to Aggregate the node features of each subgraph in , which specifically includes the following steps: Construct a spatially aware graph attention network SAGAT, the output layer of which is connected through a residual block; The initial layer of SAGAT transforms the input subgraph node features through a multi-layer perceptron MLP; The l+1th layer of SAGAT, l≥1, calculates the attention weights between nodes and embeds the spatial relationship between nodes into the attention weights: Where a,W s ,W t ,W e is a learnable parameter, It is road section r i The set of neighbor nodes, σ is the LeaklyReLU activation function; u ij Represents the spatial relationship between two nodes; According to the attention weight The aggregated topological features of the urban road network output by the l+1th layer of the spatially aware graph attention network SAGAT are obtained:

3. The method for generating cross-city trajectories by combining deep learning and shortest path search according to claim 2, characterized in that: The spatial relationship u between two nodes ij include: Passing through road segment i and road segment r j The ratio of the number of shortest paths to the total number of shortest paths in the entire network Bet(r i ,r j )、Road section angle Angle(r i ,r j ), and the center point travel distance Dist(r i ,r j ).

4. The method for generating cross-city trajectories by combining deep learning and shortest path search according to claim 1, characterized in that: Predicting the city-independent semantic representation to obtain the predicted travel cost includes the following steps: Semantic latent variables and domain latent variables Input the travel cost prediction network to get the predicted travel cost The loss functions used to train the travel cost prediction network include an MSE loss function and a ranking loss function.

5. The method for generating cross-city trajectories by combining deep learning and shortest path search according to claim 4, characterized in that: The MSE loss function specifically includes the following expression: Where N s is the size of the source city dataset; y i is the true value of the cost of traveling on the road segment, including travel time and speed.

6. The method for generating cross-city trajectories combining deep learning and shortest path search according to claim 4, characterized in that: The ranking loss function specifically includes the following expression: in, Represents road segment r i The predicted travel cost is higher than the segment r j Predict the probability of a successful trip; Represents road segment r i and road segment r j The true ranking label value of .

7. The method for generating cross-city trajectories combining deep learning and shortest path search according to claim 1, characterized in that: Using a weighted combination of observable costs and implicit costs, we can obtain travel preferences for target cities, including: Based on observable costs and hidden costs The travel preferences of the target city are obtained through the following formula: where w (m) are learnable weights.

8. The method for generating cross-city trajectories combining deep learning and shortest path search according to claim 1, characterized in that: Through iterative training, the model learns the invariant mapping relationship between travel preferences and various travel costs, and applies it to the target city, including: Randomly initialized parameters include: the parameters of the implicit cost prediction network and the combined weights w of various costs (m) ; The object of the shortest path search is the source city, and the parameters are updated according to the search results; The shortest path search uses the Dijkstra algorithm to obtain the road segment r in the urban road network of the source city i To road segment r j The shortest path Calculate the shortest path The sum of preferences: Actual trajectory τ ij The sum of the preference values ​​is: The unsupervised loss function is defined as: First, predict the preference value of each road section, then input the real trajectory, search for the generated trajectory according to the starting point and the end point, use the total preference value of the real trajectory minus the total preference value of the generated trajectory as the loss function, back-propagate to update the initialization parameters, complete a round of iteration, decouple the adversarial training parameters (freeze and do not update), and in the next round, use the entire network with updated parameters to re-predict the preference value, and repeat this process to obtain loss convergence; After the training is completed and applied to the target city, the trajectory can be generated by directly searching for the shortest path in the target city based on the starting point and the end point.

Citation Information

Patent Citations

  • Urban facility association mode mining method and related equipment

    CN115408452A

  • Travel trajectory generation and deep learning network model and training method

    CN116245973A

  • Different-source city taxi track generation method and system based on time-space door mechanism migration

    CN118569075A