Urban crowd trajectory generation method and device based on generative adversarial network

By combining generative adversarial networks with time labels and trajectory start points, the spatial constraints and realism issues in urban crowd trajectory generation are solved, generating urban crowd movement trajectories that meet time conditions and are suitable for urban planning and autonomous driving.

CN116049665BActive Publication Date: 2026-01-02BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211585440.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2026-01-02
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

Existing technologies struggle to generate realistic trajectories of urban populations in motion at specific times. Trajectory simulation models based on expert knowledge simplify movement patterns, while data-driven trajectory simulation models fail to effectively capture spatial constraints.

Method used

Generative adversarial networks are used to generate urban population movement trajectories that conform to time labels by training a condition generator and a discriminator, and combining time labels and trajectory start points. Feature fusion and adversarial training are used to improve the spatial continuity and realism of trajectory generation.

Benefits of technology

It enables the generation of urban population movement trajectories at specific times, improving the spatial continuity and realism of trajectory generation and meeting the application needs of urban planning and autonomous driving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116049665B_ABST
    Figure CN116049665B_ABST
Patent Text Reader

Abstract

The application provides a kind of urban crowd trajectory generation method and device based on generative adversarial network, the method comprises: obtaining the time label of the generated trajectory of urban crowd, and determining the trajectory starting point of the generated trajectory;The time label and trajectory starting point are input into the generative adversarial network model that has been trained to obtain the moving trajectory of urban crowd that meets the time label;The trained generative adversarial network model includes the trained conditional generator and the trained discriminator, the conditional generator is obtained by training based on the feedback of the discriminator, and the discriminator is obtained by training based on real trajectory data set and the generated trajectory data set output by the conditional generator.The application can generate the moving trajectory of urban crowd in a specific time and in a moving state by combining time label with generative adversarial network model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of generative adversarial networks, and particularly relates to a method and device for generating urban crowd trajectories based on generative adversarial networks. BACKGROUND

[0002] Urban crowd movement simulation has a wide range of applications in real life and production environments. By obtaining the movement trajectories of crowds in continuous space, not only can the living habits of crowds be studied, but also decision-making problems such as urban planning, autonomous driving, etc. can be helped to be completed. The generation of trajectories is influenced by various factors, for example, although the same person is at the same starting point, but under different time conditions, such as morning and evening rush hours and special holidays, the trajectories generated by the person can be different. Secondly, due to the individual's movement mode, the movement trajectories of the crowd have strong constraints on the spatial distribution. Therefore, in order to obtain more realistic trajectories, it is necessary to ensure the continuity of the generated trajectories in space on the premise of being able to capture the movement mode of the crowd in different environments. In recent years, a large number of trajectory simulation models have been proposed, and these methods can be roughly divided into two categories: trajectory simulation models based on expert knowledge and data-driven trajectory simulation models.

[0003] The advantage of the trajectory simulation model based on expert knowledge is the interpretability of the parameters, as long as the rules of movement can be formulated, different crowd movement modes in different environments can be simulated, and the generated trajectories have strong continuity in space. However, these models simplify the mobility of the crowd and cannot effectively capture deeper trajectory movement rules, which limits the practical value of such methods for trajectory simulation.

[0004] The data-driven trajectory simulation model itself is generated for text sequences and does not consider the spatial constraints of trajectories, so although it can generate sequence data well, there is still a lot of room for improvement in the specific trajectory sequence generation task.

[0005] Therefore, how to generate the trajectories of urban crowds in a specific time and in a moving state is a technical problem that needs to be solved at present. SUMMARY

[0006] The present application provides a method and device for generating urban crowd trajectories based on generative adversarial networks, to solve the above-mentioned defects in the prior art, and to realize the generation of trajectories of urban crowds in a specific time and in a moving state through generative adversarial networks.

[0007] The present application provides a method for generating urban crowd trajectories based on generative adversarial networks, comprising:

[0008] acquire a time label of a generated trajectory of an urban crowd, and determine a trajectory starting point of the generated trajectory;

[0009] input the time label and the trajectory starting point into a trained generative adversarial network model to obtain a moving trajectory of the urban crowd that meets the time label;

[0010] The trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is obtained by training based on feedback of the discriminator, and the discriminator is obtained by training based on a real trajectory dataset and a generated trajectory dataset output by the conditional generator.

[0011] According to the method, the training method of the generative adversarial network model comprises the following steps:

[0012] acquiring a real trajectory dataset of an urban crowd;

[0013] establishing a generative adversarial network model to be trained, the generative adversarial network model to be trained comprises a conditional generator to be trained and a discriminator to be trained;

[0014] performing feature fusion on an incomplete generated trajectory to obtain a first feature sequence, inputting the incomplete generated trajectory into the conditional generator to be trained to obtain a complete generated trajectory, and performing feature fusion on the complete generated trajectory or a real trajectory to obtain a second feature sequence;

[0015] training the conditional generator to be trained based on feedback of the discriminator to obtain a generated trajectory dataset, training the discriminator based on the generated trajectory dataset and a real trajectory dataset, and obtaining a trained generative adversarial network model if a JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value.

[0016] According to the method, the training method of the generative adversarial network model comprises the following steps:

[0017] inputting the first feature sequence into the conditional generator to be trained to obtain a distribution probability of a candidate position point, performing action space pruning on the candidate position point based on the distribution probability, selecting a target position point from the candidate position point, cyclically obtaining a plurality of target position points, combining the plurality of target position points to obtain a generated trajectory, and training the conditional generator based on feedback of the discriminator;

[0018] obtaining a generated trajectory dataset based on a plurality of generated trajectories, inputting the generated trajectory dataset and a real trajectory dataset into the discriminator to be trained to obtain a first confidence and a second confidence, training the discriminator to be trained based on the first confidence, the second confidence and a cross-entropy loss function, and determining a JS divergence, and if the JS divergence reaches a target value, obtaining a trained generative adversarial network model.

[0019] According to the urban crowd trajectory generation method based on the generative adversarial network provided in the application, after data preprocessing is performed on the original trajectory dataset to obtain a real trajectory dataset, the method further includes:

[0020] counting the number of trajectories in each hour in the real trajectory dataset, and counting the frequency distribution of each place as a trajectory starting point in each hour;

[0021] randomly selecting a target hour as a time label of a new trajectory based on the number of trajectories, and selecting a target place as a trajectory starting point based on the frequency distribution;

[0022] determining the generated trajectory based on the time label and the trajectory starting point.

[0023] According to the urban crowd trajectory generation method based on the generative adversarial network provided in the application, the feature fusion is performed on the incomplete generated trajectory to obtain a first feature sequence, the incomplete generated trajectory is input into the conditional generator to be trained to obtain a complete generated trajectory, and the feature fusion is performed on the complete generated trajectory or a real trajectory to obtain a second feature sequence, including:

[0024] determining a conditional feature based on a time label of the incomplete generated trajectory;

[0025] converting a latitude-longitude data pair in the original trajectory dataset and a timestamp in the original trajectory dataset into a position sequence, and determining a position feature based on the position sequence;

[0026] determining a moving distance of adjacent trajectory points based on the position sequence, and determining a speed feature by combining the moving distance with the timestamp;

[0027] The condition feature, the position feature and the speed feature are fused to obtain the first feature sequence, and the position feature and the speed feature are fused to obtain the second feature sequence.

[0028] According to the urban crowd trajectory generation method based on the generative adversarial network provided in the application, the first confidence, the second confidence and the cross-entropy loss function are used to train the to-be-trained discriminator, including:

[0029] The first loss function and the second loss function are determined, a first loss value is obtained based on the first confidence, the second confidence and the first loss function, a second loss value is obtained based on the first confidence, the second confidence and the second loss function, and the cross-entropy loss function is determined based on the first loss function, the second loss function and a proportion parameter;

[0030] The cross-entropy loss value is determined based on the cross-entropy loss function, the first loss value and the second loss value, and the to-be-trained discriminator is trained based on the cross-entropy loss value.

[0031] According to the urban crowd trajectory generation method based on the generative adversarial network provided in the application, the first feature sequence is obtained by fusing the features of the incomplete generated trajectory, the incomplete generated trajectory is input into the to-be-trained conditional generator to obtain a complete generated trajectory, and the second feature sequence is obtained by fusing the features of the complete generated trajectory or the real trajectory, and the method further includes:

[0032] The to-be-trained conditional generator and the discriminator are pre-trained based on the first feature sequence and the second feature sequence;

[0033] The prediction result of the next position point output by the pre-trained conditional generator and the distinguishing result of the real trajectory and the false data output by the pre-trained discriminator are obtained, and the false data is obtained by randomly shuffling and replacing the trajectory points of the real trajectory.

[0034] According to the urban crowd trajectory generation method based on the generative adversarial network provided in the application, the conditional generator includes a first attention layer and a full connection layer, and the discriminator includes a second attention layer and a multi-layer perception machine.

[0035] The first attention layer or the second attention layer is used to determine a query vector, a key vector and a value vector based on the first feature sequence or the second feature sequence, and obtain an attention result based on an attention matrix.

[0036] The full connection layer is used to extract the correlation of different time steps of the attention result to obtain a probability distribution of a candidate position of a next time step of a current position.

[0037] The multi-layer perception is used to obtain a first confidence and a second confidence based on the attention result, the first confidence being a confidence that the trajectory is true, and the second confidence being a confidence that the trajectory meets the time label classification.

[0038] The application further provides a city crowd trajectory generation device based on a generative adversarial network, comprising:

[0039] A data acquisition module is configured to acquire a time label of a generated trajectory of a city crowd and determine a trajectory starting point of the generated trajectory.

[0040] A trajectory acquisition module is configured to input the time label and the trajectory starting point into a trained generative adversarial network model to obtain a moving trajectory of the city crowd that meets the time label.

[0041] The trained generative adversarial network comprises a trained conditional generator and a trained discriminator, the conditional generator being obtained by training based on feedback of the discriminator, and the discriminator being obtained by training based on a real trajectory data set and a generated trajectory data set output by the conditional generator.

[0042] The application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the city crowd trajectory generation method based on the generative adversarial network as described above.

[0043] The application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the city crowd trajectory generation method based on the generative adversarial network as described above.

[0044] The application further provides a computer program product comprising a computer program, wherein the computer program is executable on a processor to implement the city crowd trajectory generation method based on the generative adversarial network as described above.

[0045] The city crowd trajectory generation method and device based on the generative adversarial network provided by the application can obtain a time label of a generated trajectory of a city crowd, determine a trajectory starting point of the generated trajectory, input the time label and the trajectory starting point into a trained generative adversarial network model, and obtain a moving trajectory of the city crowd that meets the time label. BRIEF DESCRIPTION OF DRAWINGS

[0046] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0047] Figure 1 is one of the flowcharts of the urban crowd trajectory generation method based on the generative adversarial network provided by the present application;

[0048] Figure 2 is another flowchart of the urban crowd trajectory generation method based on the generative adversarial network provided by the present application;

[0049] Figure 3 is a third flowchart of the urban crowd trajectory generation method based on the generative adversarial network provided by the present application;

[0050] Figure 4 is a fourth flowchart of the urban crowd trajectory generation method based on the generative adversarial network provided by the present application;

[0051] Figure 5 is a structural schematic diagram of the urban crowd trajectory generation device based on the generative adversarial network provided by the present application;

[0052] Figure 6 is a structural schematic diagram of the electronic device provided by the present application. DETAILED DESCRIPTION

[0053] In order to make the technical solutions in the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.

[0054] With reference to Figure 1 The urban crowd trajectory generation method based on the generative adversarial network provided by the present application comprises:

[0055] Step 110: acquiring a time label of a generated trajectory of an urban crowd and determining a trajectory starting point of the generated trajectory;

[0056] Step 120: inputting the time label and the trajectory starting point into a trained generative adversarial network model to obtain a moving trajectory of the urban crowd conforming to the time label;

[0057] The trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is trained based on feedback of the discriminator, and the discriminator is trained based on a real trajectory data set and a generated trajectory data set output by the conditional generator.

[0058] It can be understood that the embodiment is a specific application process of the generative adversarial network model, that is, a process of actually generating trajectories by using the trained model.

[0059] Firstly, the time label and the starting point of the trajectory of the urban population need to be determined through step 110, that is, it is determined that the trajectory data is collected at which time point and which position.

[0060] Then, the time label and the starting point of the trajectory are input into the trained generative adversarial network model according to step 120, the conditional generator of the generative adversarial network model samples each place according to the time label, and the starting point of the generated trajectory is cycled to obtain the moving trajectory.

[0061] It should be noted that the generative adversarial network model in the embodiment is established on a conditional generative adversarial network (CGAN) architecture, comprising a conditional generator and a discriminator, and by adding additional condition information to the original GAN generator (Generator) and discriminator (Discriminator), the model can generate data under a given condition.

[0062] The conditional generator and the discriminator of the embodiment output a moving trajectory by using the conditional generator, and then the discriminator is used to perform adversarial training on the moving trajectory and the real trajectory data, so as to continuously improve the parameters of the conditional generator and the discriminator, until the JS divergence output by the discriminator reaches a preset target value, and the trained conditional generator and the discriminator are obtained.

[0063] The urban population trajectory generation method based on the generative adversarial network provided by the application obtains the time label of the generated trajectory of the urban population, determines the starting point of the trajectory of the generated trajectory, inputs the time label and the starting point of the trajectory into the trained generative adversarial network model, and obtains the moving trajectory of the urban population conforming to the time label. The application can generate the moving trajectory of the urban population in a specific time and in a moving state by using the generative adversarial network model combined with the time label.

[0064] Reference Figure 2 In some optional embodiments, the training method of the generative adversarial network model comprises:

[0065] Step 210, obtaining an original trajectory dataset of urban population;

[0066] Step 220, establishing a generative adversarial network model to be trained, the generative adversarial network model to be trained comprising a conditional generator to be trained and a discriminator to be trained;

[0067] Step 230, performing feature fusion on an incomplete generated trajectory to obtain a first feature sequence, inputting the incomplete generated trajectory into the conditional generator to be trained to obtain a complete generated trajectory, and performing feature fusion on the complete generated trajectory or a real trajectory to obtain a second feature sequence; wherein the incomplete generated trajectory is obtained by random sampling based on a trajectory starting point by the conditional generator to be trained;

[0068] Step 240, training the conditional generator to be trained based on feedback of the discriminator to obtain a generated trajectory dataset, training the discriminator based on the generated trajectory dataset and a real trajectory dataset, and obtaining a trained generative adversarial network model if JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value.

[0069] It can be understood that the embodiment is a training process of the model, i.e., a process of obtaining the generative adversarial network model.

[0070] First, an original trajectory dataset of urban population is obtained. It should be noted that the original dataset is composed of a large amount of original trajectory data of urban population, and the proportion of the training set and the test set can be set to 7:3. Then, a generative adversarial network model to be trained is established, including a conditional generator to be trained and a discriminator to be trained.

[0071] The original trajectory dataset collected is preprocessed to obtain a real trajectory dataset of urban population. The preprocessing process includes: discretizing elements of the trajectory of the original trajectory dataset to convert into a position ID sequence. And for the trajectory with missing data, a completion operation is performed.

[0072] Then, an incomplete generated trajectory is selected for feature fusion, that is, the moving distance between adjacent trajectory points in the target trajectory is calculated according to the trajectory data, and the time step is determined according to the time stamp of the target trajectory. Then, the moving speed is calculated according to the time step. The urban context information, speed feature and position feature are fused to obtain a fusion vector with urban background information, speed feature and conditional label (time label) and other features, which can be counted as a first feature sequence as the input of the conditional generator.

[0073] Then, a complete generated trajectory or a real trajectory is selected for feature fusion to obtain a second feature sequence, and the second feature sequence is input into the discriminator.

[0074] It should be noted that the difference between the first feature sequence and the second feature sequence is that the second feature sequence is input to the discriminator and does not contain a conditional label.

[0075] Finally, the conditional generator to be trained is trained based on the feedback of the discriminator to obtain a generated trajectory data set, and the discriminator is trained based on the generated trajectory data set and the real trajectory data set. That is, the conditional generator and the discriminator are adversarially trained, and the JS divergence is determined, and if the JS divergence reaches a target value, a trained generative adversarial network model is obtained.

[0076] The urban crowd trajectory generation method and device based on the generative adversarial network provided by the application obtain different sequences by obtaining an original trajectory data set and performing data preprocessing and feature fusion, input the different sequences into a conditional generator and a discriminator for adversarial training, and thus obtain a trained generative adversarial network model. The trained generative adversarial network model can be used to generate a moving trajectory of an urban crowd at a specific time and in a moving state.

[0077] In some optional embodiments, after the data preprocessing of the original trajectory data set to obtain a real trajectory data set, the method further includes:

[0078] The number of trajectories in each hour in the real trajectory data set is counted, and the frequency distribution of each place as a trajectory starting point in each hour is counted.

[0079] A target hour is randomly selected as a time label of a new trajectory based on the number of trajectories, and a target place is selected as a trajectory starting point based on the frequency distribution.

[0080] The generated trajectory is determined based on the time label and the trajectory starting point.

[0081] It can be understood that the embodiment is a specific training process of a target trajectory.

[0082] First, the number of trajectories in each hour in the real trajectory data set is counted, and the frequency distribution of each place as a trajectory starting point in each hour is counted, to obtain two probability distributions P condition and P condition-loc . Then, a target hour is randomly selected as a time label of a new trajectory based on the number of trajectories, a target place is selected as a trajectory starting point based on the frequency distribution, and a target trajectory is determined based on the time label and the trajectory starting point. Specifically, the embodiment includes:

[0083] According to the probability distribution P condition and P condition-locRandomly sampling, obtaining the time label and starting point of the newly generated trajectory. Then, the generator is called iteratively to generate the next position point until the length of the generated trajectory reaches the preset value.

[0084] Further, for the above-mentioned incomplete trajectory The feature embedding and feature fusion of each trajectory point are performed, and the first feature sequence is obtained.

[0085] In some embodiments, the first feature sequence is input into the conditional generator to be trained to obtain a distribution probability of a candidate position point, the action space of the candidate position point is cropped based on the distribution probability, a target position point is selected from the candidate position point, a plurality of target position points are obtained by iteration, the plurality of target position points are combined to obtain a generated trajectory, and the conditional generator is trained based on the feedback of the discriminator.

[0086] The first feature sequence is input into the conditional generator to be trained to obtain a distribution probability of a candidate position point, the action space of the candidate position point is cropped based on the distribution probability, a target position point is selected from the candidate position point, a plurality of target position points are obtained by iteration, the plurality of target position points are combined to obtain a generated trajectory, and the conditional generator is trained based on the feedback of the discriminator.

[0087] The first feature sequence is input into the conditional generator to be trained to obtain a distribution probability of a candidate position point, the action space of the candidate position point is cropped based on the distribution probability, a target position point is selected from the candidate position point, a plurality of target position points are obtained by iteration, the plurality of target position points are combined to obtain a generated trajectory, and the conditional generator is trained based on the feedback of the discriminator.

[0088] It can be understood that the present embodiment is a specific training process of the conditional generator and the discriminator.

[0089] First, the first feature sequence is input into the conditional generator to be trained, the distribution of the time label in the real data and the distribution of the location in each time period are counted, and the distribution probability of the next position point of the first feature sequence, i.e., the candidate position point, is obtained.

[0090] Then, the distribution probability is used to crop the action space of the candidate position point, the target position point is selected from the candidate position point, a plurality of target position points are obtained by iteration, and the plurality of target position points are combined to obtain a generated trajectory. That is, the process of obtaining the target position point is iterated until the length of the generated trajectory reaches the preset value. Then, the generated trajectory is used to update the parameters of the generator.

[0091] Further, in some optional embodiments, the penalty function L p The trajectories generated by the generator are then inputted into the discriminator, and the return value of each step in the generated trajectory is obtained using Monte Carlo tree search. Finally, the parameters of the generator are updated using policy gradient based on L p and the return value of each step. This process is repeated g-step times in each epoch of training.

[0092] The process of training the discriminator is as follows: based on a plurality of generated trajectories, a generated trajectory dataset is obtained, the generated trajectory dataset and the real trajectory dataset are inputted into the discriminator to be trained to obtain a first confidence and a second confidence, the discriminator to be trained is trained based on the first confidence, the second confidence and a cross-entropy loss function, and a JS divergence is determined, and if the JS divergence reaches a target value, a trained generative adversarial network model is obtained.

[0093] Using the generator trained as described above, a plurality of trajectories are generated to construct a generated trajectory dataset. The generated trajectory dataset and the real trajectory dataset are shuffled and inputted into the discriminator for training. The training task of the discriminator is to give a lower confidence to the generated trajectory, and to give a high confidence to the real trajectory data, which are respectively denoted as a first confidence p r and a second confidence p c . A loss function L D of the discriminator is calculated according to p r and p c , and the parameters of the discriminator are updated using gradient descent. This process is repeated d-step times in each training, and after the parameters of the conditional generator and the discriminator are updated in each round, the JS divergence is calculated, and if the JS divergence reaches a target value, the training is stopped.

[0094] It should be noted that the conditional generator in the present embodiment sends the candidate point probability distribution of the next position of the current trajectory to the action space clipping module, and considers modifying the value of using real space constraints.

[0095] The trajectory generation process is regarded as a Markov decision process (MDP), and the conditional generator is regarded as an agent in the MDP; the feedback of the discriminator is regarded as the return in the environment, and the prediction of the next position by the conditional generator is regarded as the action of the agent. After such definition, the candidate positions far from the current position can be regarded as invalid actions, and these actions can be removed using action space clipping.

[0096] The workflow of the motion space clipping module is as follows: First, a threshold μ is set. This threshold μ can be determined based on the maximum possible movement speed or the researcher's specific requirements. If the candidate position... Distance from current position l i If the Euclidean distance is greater than μ, then the probability of selecting it is... Set to 0. Based on the threshold μ and the current position l k We can determine a value starting with l k A circular region ρ with center μ and radius μ k The formula for the motion space clipping module is:

[0097]

[0098] in, Represents generator G θ Calculated candidate positions The probability is calculated, and after passing through the action space clipping module, a new probability p is obtained for each candidate position. k+1,j .

[0099] In addition, for regions not belonging to ρ i To reduce the probability of candidate points assigned by the generator, a penalty function was designed:

[0100]

[0101] Here, the set of location points U represents all points not located in the circular region ρ. k The set of candidate points, where x and y represent pairs of positions on the Mercator plane. L P Candidate points in all U were calculated and l i The penalty is the product of the Euclidean distance and the probability. It can be seen that the larger the distance, the greater the penalty. Finally, summing all the products yields a total penalty function.

[0102] In some optional embodiments, the step of fusing features on the incomplete generated trajectory to obtain a first feature sequence, inputting the incomplete generated trajectory into the conditional generator to be trained to obtain a complete generated trajectory, and fusing features on the complete generated trajectory or the real trajectory to obtain a second feature sequence includes:

[0103] Determine conditional features based on the time labels of the incomplete generated trajectory;

[0104] The latitude and longitude data pairs and timestamps in the original trajectory dataset are converted into location sequences, and location features are determined based on the location sequences.

[0105] determine a moving distance of adjacent trajectory points based on the position sequence, determine a speed feature based on the moving distance and the time stamp;

[0106] perform feature fusion on the condition feature, the position feature and the speed feature to obtain the first feature sequence, and perform feature fusion on the position feature and the speed feature to obtain the second feature sequence.

[0107] It can be understood that the embodiment is a specific way of feature fusion.

[0108] First, a specific process of data preprocessing needs to be determined. The city is first cut into grids of equal size, and the size of the grid can be selected as 1km*1km, and each grid is assigned a position ID. For a sequence of GPS coordinate pairs, each coordinate pair is projected onto a grid to obtain a target trajectory T = {[l1, l2, …, li, …, lT}, t} of the urban population, where li represents the position ID of the i-th time step in the trajectory, and the position feature of the target trajectory can be determined according to the time step and the position ID. The time step in the trajectory is a fixed value, and t is a condition label, i.e., a time label, representing 24 hours of a day. n i

[0109] The city interest points (POI, Points Of Interests) around each trajectory point are encoded as urban background information, and the POI feature is represented as represents the POI feature at the position li i i,j represents the j-th feature. The one-hot encoding is performed on li i and each p i,j to obtain vectors and

[0110] Next, an embedding layer is used to obtain the embedding representation of these vectors Since different POIs have different importance in the division of urban functional areas, a trainable weight matrix E is introduced to model the importance of different POIs. Each element e j in E represents the importance of li i and its POI feature. Finally, the weighted average value of li i and its POI feature embedding is calculated using the weights in the weight matrix to obtain the position embedding with urban information:

[0111]

[0112]

[0113] ​​​By introducing the exponential operation, the contribution of all features is ensured to be positive.

[0114] Further, in order to enable the trajectory to learn the relationship between the crowd moving speed and the candidate point, the moving distance of the continuous positions in the trajectory T = {[l1, l2, …, l n}, t} is calculated, and then the speed V = {v1, v2, …, v n} is obtained, v1 is set to 0, and then each element in V is discretized to obtain the speed feature of the real data set. Then, the position feature, the condition feature and the speed feature are fused to obtain the input of the condition generator and the discriminator. Specifically, as shown in the following formula:

[0115]

[0116]

[0117] wherein, and are the first feature sequence and the second feature sequence respectively, H i is the position feature, is the speed feature, and O t is the time label. The time label of the real trajectory data set is the condition feature.

[0118] In some optional embodiments, the training of the to-be-trained discriminator based on the first confidence, the second confidence and the cross-entropy loss function comprises:

[0119] determining a first loss function and a second loss function, obtaining a first loss value based on the first confidence, the second confidence and the first loss function, and obtaining a second loss value based on the first confidence, the second confidence and the second loss function, determining the cross-entropy loss function based on the first loss function, the second loss function and a proportion parameter;

[0120] determining a cross-entropy loss value based on the cross-entropy loss function, the first loss value and the second loss value, and training the to-be-trained discriminator based on the cross-entropy loss value.

[0121] It should be noted that the present embodiment is the process of training the discriminator according to the loss function. The first loss function is the loss function of the trajectory authenticity, as shown in the following formula:

[0122] L r = -y r ·log(p r )-(1-y r )·log(1-p r )

[0123] The second loss function is a label indicating whether the trajectory comes from the real data set, as shown in the following formula:

[0124] L c =-y r ·log(p r )

[0125] The cross-entropy loss function is as shown in the following formula:

[0126] L D =L r +λL c

[0127] Wherein, λ is a proportion parameter, which can be set as L r ≈λL c . y r is a label indicating whether the trajectory comes from the real data set.

[0128] In some optional embodiments, the incomplete generated trajectory is subjected to feature fusion to obtain a first feature sequence, the incomplete generated trajectory is input into the conditional generator to be trained to obtain a complete generated trajectory, and the complete generated trajectory or the real trajectory is subjected to feature fusion to obtain a second feature sequence. After that, the method further comprises:

[0129] The conditional generator to be trained and the discriminator are pre-trained based on the first feature sequence and the second feature sequence.

[0130] The prediction result of the next position point output by the pre-trained conditional generator and the distinguishing result of the real trajectory and the false data output by the pre-trained discriminator are obtained, wherein the false data is obtained by randomly shuffling and replacing the trajectory points of the real trajectory.

[0131] It should be noted that, in order to avoid the phenomenon of gradient disappearance of the model in the early adversarial training process, two sub-tasks with low difficulty are designed to pre-train the generator and the discriminator.

[0132] In the pre-training stage, the generator is used to predict the next position point of a real trajectory, and the pre-training task of the discriminator is to distinguish the real trajectory and the false data artificially made. The false data is obtained by randomly shuffling and replacing the trajectory points of the real trajectory.

[0133] In some optional embodiments, the conditional generator comprises a first attention layer and a fully connected layer, and the discriminator comprises a second attention layer and a multi-layer perceptron.

[0134] The first attention layer or the second attention layer is configured to determine a query vector, a key vector, and a value vector based on the first feature sequence or the second feature sequence, and obtain an attention result based on an attention matrix.

[0135] The fully connected layer is configured to extract the relevance of different time steps from the attention result, and obtain a probability distribution of a candidate position of a next time step of a current position.

[0136] The multi-layer perceptron is configured to obtain a first confidence and a second confidence based on the attention result, the first confidence being a confidence that the trajectory is true, and the second confidence being a confidence that the trajectory meets a time label classification.

[0137] It should be noted that the conditional generator and the discriminator in the present example each include four attention layers, the conditional generator further includes one fully connected layer, and the discriminator includes two multi-layer perceptrons.

[0138] The attention layer is configured to calculate a query vector a key vector and a value vector of each Then, a weighted average value of each is calculated by using an attention score, that is, the following matrix multiplication is performed:

[0139] Q g =X g W Q , K g =X g W K , V g =X g W V

[0140]

[0141] wherein Q g , K g , V g are matrices of d p is a dimension of the query vector, and A g is a result of self-attention.

[0142] The fully connected layer is a fully connected network with a softmax activation function, configured to extract the relevance of different time steps from the attention result, and obtain a probability distribution of a candidate position of a next time step of a current position

[0143] The multi-layer perceptron (MLP, Multilayer Perceptron) is configured to output two confidences p r and pc p, representing the confidence that the trajectory is real r and the confidence that the trajectory matches the time label classification p c According to p r and p c , the loss function L of the discriminator is calculated D , and the gradient descent is used to update the parameters of the discriminator.

[0144] It needs to be pointed out that the original generative adversarial network is initially set to generate real values and continuous data, and using the generative adversarial network to generate discrete data has the following problems: (1) the generator outputting discrete values will hinder the back propagation of the discriminator; (2) the discriminator only receives complete sequences, so the generator must run multiple times to generate complete sequences, which hinders the generator from obtaining feedback of intermediate values.

[0145] Model the prediction process of the generator as an MDP: consider the generator as an agent, the next position as the action of the agent, the score of the discriminator as the reward of the environment, and the state of the agent as the incomplete trajectory T 1:k ={[l1, l2, …, l k ], t}. In this way, the policy gradient algorithm can be used to optimize the generator. The reward of the discriminator consists of two parts:

[0146] R(T 1:k )=p r (T 1:k )+γ*p c (T 1:k )

[0147] Where P r (T 1:k ) is the confidence calculated by the discriminator, indicating the authenticity of the current state T 1:k , and p c (T 1:k ) is the confidence of the conditional label calculated by the discriminator in state T 1:k , Y is a hyperparameter that controls the proportion of the two rewards. According to the reward R(T 1:k ), we can get the loss of the generator with parameters θ:

[0148]

[0149]

[0150] Where G θ (T 1:k ) is the reward obtained by the action of the agent R(T 1:kThe probability of T, we can generate the gradient of the parameters of the generator G according to the above.

[0151] Further, using Monte Carlo Tree Search (Monte Carlo Tree Search), the last step of training retains G θ Backup as G r , G r Will keep the current state and generate a complete trajectory to get p r (T 1:k ) and p c (T 1:k ) estimate, in order to reduce the variance of P r (T 1:k ) and p c (T 1:k ) estimate, G r Will run N times under the same state T 1:k , and then take the average of p r (T 1:k ) and p c (T 1:k ).

[0152] Referring to Figure 3 , Figure 3 is the flowchart of the urban crowd trajectory generation method based on the generative adversarial network provided by the application, and the specific process is as follows:

[0153] The generated trajectory (incomplete target trajectory) is attached with a time label for multi-feature fusion position embedding, and is input into the generator after position coding, and then passes through four attention layers and fully connected layers of the generator, and then the action space is cropped to obtain the generated trajectory dataset.

[0154] The generated trajectory dataset and the real trajectory dataset are subjected to multi-feature fusion position embedding and position coding, and are input into the discriminator, and then pass through four attention layers and two multilayer perceptrons of the generator to obtain authenticity scores and classification scores. According to the policy gradient, the generator is trained.

[0155] Referring to Figure 4 , Figure 4 is the flowchart of the urban crowd trajectory generation method based on the generative adversarial network provided by the application, and the specific process is as follows:

[0156] After the flow starts, data preprocessing and trajectory point embedding are performed, and then model pre-training is performed, and given training EPOCH, G-step and D-step; randomly select the generation trajectory time label and the starting point, generate the next position candidate point distribution probability, then perform action space clipping processing distribution probability, and randomly select the candidate point to make the trajectory length +1; judge whether the generated trajectory length meets the preset value, if yes, calculate Lp and the trajectory each time step return, if not, return to generate the next position candidate point distribution probability, after calculating Lp and the trajectory each time step return, update the generator parameter, make G-step+1, judge whether G-step meets the given value, if yes, use the generated, real data to optimize the discriminator, if not, return to randomly select the generation trajectory time label and the starting point; after using the generated, real data to optimize the discriminator, make D-step+1, judge whether D-step meets the given value, if yes, make EPOCH+1, judge whether EPOCH meets the given value, if yes, generate the trajectory, if not, clear EPOCH+1, G-step and D-step, after clearing, return to randomly select the generation trajectory time label and the starting point.

[0157] The following describes the urban crowd trajectory generation device based on the generative adversarial network provided by the application, which can be correspondingly referred to with the urban crowd trajectory generation method based on the generative adversarial network described above.

[0158] Reference Figure 5 The urban crowd trajectory generation device based on the generative adversarial network provided by the application comprises:

[0159] The data acquisition module 510 is configured to acquire the time label of the generated trajectory of the urban crowd and determine the trajectory starting point of the generated trajectory.

[0160] The trajectory acquisition module 520 is configured to input the time label and the trajectory starting point into the trained generative adversarial network model to obtain the movement trajectory of the urban crowd conforming to the time label.

[0161] The trained generative adversarial network comprises a trained conditional generator and a trained discriminator, the conditional generator is obtained by training based on the feedback of the discriminator, and the discriminator is obtained by training based on the real trajectory data set and the generated trajectory data set output by the conditional generator.

[0162] In some optional embodiments, the training method of the generative adversarial network model comprises:

[0163] Acquiring the original trajectory data set of the urban crowd;

[0164] establish a to-be-trained generative adversarial network model, the to-be-trained generative adversarial network model comprising a to-be-trained conditional generator and a to-be-trained discriminator;

[0165] feature fusion is performed on the incomplete generated trajectory to obtain a first feature sequence, the incomplete generated trajectory is input into the to-be-trained conditional generator to obtain a complete generated trajectory, feature fusion is performed on the complete generated trajectory or a real trajectory to obtain a second feature sequence; wherein the incomplete generated trajectory is obtained by random sampling based on a trajectory starting point by the to-be-trained conditional generator;

[0166] the to-be-trained conditional generator is trained based on the feedback of the discriminator to obtain a generated trajectory dataset, the discriminator is trained based on the generated trajectory dataset and a real trajectory dataset, and if the JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value, a trained generative adversarial network model is obtained.

[0167] In some optional embodiments, the to-be-trained conditional generator is trained based on the feedback of the discriminator to obtain a generated trajectory dataset, the discriminator is trained based on the generated trajectory dataset and a real trajectory dataset, and if the JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value, a trained generative adversarial network model is obtained, comprising:

[0168] the first feature sequence is input into the to-be-trained conditional generator to obtain a distribution probability of candidate position points, the candidate position points are action space cropped based on the distribution probability, a target position point is selected from the candidate position points, a plurality of target position points are obtained by circulation, the plurality of target position points are combined to obtain a generated trajectory, and the conditional generator is trained based on the feedback of the discriminator;

[0169] the generated trajectory dataset is obtained based on a plurality of the generated trajectories, the generated trajectory dataset and a real trajectory dataset are input into the to-be-trained discriminator to obtain a first confidence and a second confidence, the to-be-trained discriminator is trained based on the first confidence, the second confidence and a cross-entropy loss function, and a JS divergence is determined, and if the JS divergence reaches a target value, a trained generative adversarial network model is obtained.

[0170] In some optional embodiments, after the real trajectory dataset is obtained by data preprocessing on the original trajectory dataset, the following steps are further included:

[0171] the number of trajectories in each hour in the real trajectory dataset is counted, and the frequency distribution of each location as a trajectory starting point in each hour is counted;

[0172] randomly selecting a target hour as a time label of a new trajectory based on the number of trajectories, and selecting a target location as a trajectory starting point based on the frequency distribution;

[0173] determining the generated trajectory based on the time label and the trajectory starting point.

[0174] In some optional embodiments, the incomplete generated trajectory is subjected to feature fusion to obtain a first feature sequence, the incomplete generated trajectory is input into the conditional generator to be trained to obtain a complete generated trajectory, and the complete generated trajectory or the real trajectory is subjected to feature fusion to obtain a second feature sequence, including:

[0175] determining a conditional feature based on a time label of the incomplete generated trajectory;

[0176] converting a latitude-longitude data pair in the original trajectory dataset and a timestamp in the original trajectory dataset into a position sequence, and determining a position feature based on the position sequence;

[0177] determining a moving distance of adjacent trajectory points based on the position sequence, and combining the moving distance with the timestamp to determine a speed feature;

[0178] performing feature fusion on the conditional feature, the position feature, and the speed feature to obtain the first feature sequence, and performing feature fusion on the position feature and the speed feature to obtain the second feature sequence.

[0179] In some optional embodiments, the conditional generator to be trained is trained based on the first confidence, the second confidence, and the cross-entropy loss function, including:

[0180] determining a first loss function and a second loss function, obtaining a first loss value based on the first confidence, the second confidence, and the first loss function, and obtaining a second loss value based on the first confidence, the second confidence, and the second loss function, and determining the cross-entropy loss function based on the first loss function, the second loss function, and a proportionality parameter;

[0181] determining a cross-entropy loss value based on the cross-entropy loss function, the first loss value, and the second loss value, and training the conditional generator to be trained based on the cross-entropy loss value.

[0182] In some optional embodiments, after the incomplete generated trajectory is subjected to feature fusion to obtain a first feature sequence, the incomplete generated trajectory is input into the conditional generator to be trained to obtain a complete generated trajectory, and the complete generated trajectory or the real trajectory is subjected to feature fusion to obtain a second feature sequence, the method further includes:

[0183] The condition generator and discriminator to be trained are pre-trained based on the first feature sequence and the second feature sequence;

[0184] The system obtains the prediction result of the next position point output by the pre-trained conditional generator, and the distinction result between the real trajectory and the fake data output by the pre-trained discriminator. The fake data is obtained by randomly shuffling the real trajectory and replacing the trajectory points.

[0185] In some optional embodiments, the condition generator includes a first attention layer and a fully connected layer, and the discriminator includes a second attention layer and a multilayer perceptron;

[0186] The first attention layer or the second attention layer is used to determine the query vector, key vector and value vector based on the first feature sequence or the second feature sequence, and to obtain the attention result based on the attention matrix;

[0187] The fully connected layer is used to extract the correlation of different time steps from the attention results and obtain the probability distribution of the candidate positions of the next time step of the current position.

[0188] The multilayer perceptron is used to obtain a first confidence level and a second confidence level based on the attention result. The first confidence level is the confidence level that the trajectory is true, and the second confidence level is the confidence level that the trajectory conforms to the time label classification.

[0189] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a method for generating urban crowd trajectories based on generative adversarial networks, the method including:

[0190] Obtain the time label of the generated trajectory of urban population, and determine the starting point of the generated trajectory;

[0191] The time labels and trajectory starting points are input into the trained generative adversarial network model to obtain the movement trajectories of urban populations that conform to the time labels.

[0192] The trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is trained based on feedback of the discriminator, and the discriminator is trained based on a real trajectory data set and a generated trajectory data set output by the conditional generator.

[0193] In addition, the logic instructions in the memory 630 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0194] On the other hand, the present application also provides a computer program product, the computer program product comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, and the computer can execute the urban crowd trajectory generation method based on the generative adversarial network provided by the above-mentioned method, the method comprises:

[0195] Obtaining the time label of the generated trajectory of the urban crowd, and determining the trajectory starting point of the generated trajectory;

[0196] Inputting the time label and the trajectory starting point into the trained generative adversarial network model to obtain the moving trajectory of the urban crowd conforming to the time label;

[0197] The trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is trained based on feedback of the discriminator, and the discriminator is trained based on a real trajectory data set and a generated trajectory data set output by the conditional generator.

[0198] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the urban crowd trajectory generation method based on the generative adversarial network provided by the above-mentioned method, the method comprises:

[0199] Obtain a time label of a generated trajectory of an urban crowd, and determine a trajectory starting point of the generated trajectory;

[0200] Input the time label and the trajectory starting point into a trained generative adversarial network model to obtain a moving trajectory of the urban crowd that meets the time label;

[0201] The trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is obtained by training based on feedback of the discriminator, and the discriminator is obtained by training based on a real trajectory data set and a generated trajectory data set output by the conditional generator.

[0202] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment scheme according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0203] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and necessary general hardware platforms, and of course, can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0204] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating urban crowd trajectory based on a generative adversarial network, characterized in that, The method comprises the following steps: acquiring time labels of generated trajectories of urban crowds and determining trajectory starting points of the generated trajectories; inputting the time labels and the trajectory starting points into a trained generative adversarial network model to obtain moving trajectories of the urban crowds conforming to the time labels; the trained generative adversarial network model comprises a trained conditional generator and a trained discriminator, the conditional generator is trained based on feedback of the discriminator, and the discriminator is trained based on a real trajectory dataset and a generated trajectory dataset output by the conditional generator; the training method of the generative adversarial network model comprises the following steps: acquiring an original trajectory dataset of urban crowds; establishing a generative adversarial network model to be trained, the generative adversarial network model to be trained comprises a conditional generator to be trained and a discriminator to be trained; performing data preprocessing on the original trajectory dataset to obtain a real trajectory dataset, performing feature fusion on incomplete generated trajectories to obtain a first feature sequence, inputting the incomplete generated trajectories into the conditional generator to be trained to obtain complete generated trajectories, and performing feature fusion on the complete generated trajectories or the real trajectories to obtain a second feature sequence; wherein the incomplete generated trajectories are randomly sampled based on trajectory starting points by the conditional generator to be trained; training the conditional generator to be trained based on feedback of the discriminator to obtain a generated trajectory dataset, training the discriminator based on the generated trajectory dataset and the real trajectory dataset, and obtaining a trained generative adversarial network model if a JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value. 2.The urban crowd trajectory generation method based on a generative adversarial network according to claim 1, wherein, The method of training the conditional generator to be trained based on feedback of the discriminator to obtain a generated trajectory dataset, training the discriminator based on the generated trajectory dataset and the real trajectory dataset, and obtaining a trained generative adversarial network model if a JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value comprises the following steps: inputting the first feature sequence into the conditional generator to be trained to obtain a distribution probability of candidate position points, performing action space clipping on the candidate position points based on the distribution probability, selecting target position points in the candidate position points, cyclically acquiring a plurality of target position points, combining the plurality of target position points to obtain generated trajectories, and training the conditional generator based on feedback of the discriminator; inputting the generated trajectory dataset and the real trajectory dataset into the discriminator to be trained to obtain a first confidence and a second confidence, training the discriminator to be trained based on the first confidence, the second confidence and a cross-entropy loss function, determining a JS divergence, and obtaining a trained generative adversarial network model if the JS divergence reaches a target value. 3.The urban crowd trajectory generation method based on a generative adversarial network according to claim 1, wherein, After the data preprocessing on the original trajectory dataset to obtain a real trajectory dataset, the method further comprises the following steps: counting the number of trajectories in each hour in the real trajectory dataset, and counting the frequency distribution of each place as a starting point of a trajectory in each hour; randomly selecting a target hour as a time label of a new trajectory based on the number of trajectories, and selecting a target place as a starting point of a trajectory based on the frequency distribution; determining the generated trajectory based on the time label and the starting point of the trajectory. 4.The urban crowd trajectory generation method based on a generative adversarial network according to claim 3, characterized in that, The first feature sequence is obtained by feature fusion on the incomplete generated trajectory, the incomplete generated trajectory is input into the conditional generator to be trained to obtain a complete generated trajectory, and the second feature sequence is obtained by feature fusion on the complete generated trajectory or the real trajectory. determining a conditional feature based on the time label of the incomplete generated trajectory; converting the longitude and latitude data pairs in the original trajectory dataset and the time stamps in the original trajectory dataset into a position sequence, and determining a position feature based on the position sequence; determining a moving distance of adjacent trajectory points based on the position sequence, and combining the moving distance with the time stamp to determine a speed feature; the first feature sequence is obtained by feature fusion on the conditional feature, the position feature, and the speed feature, and the second feature sequence is obtained by feature fusion on the position feature and the speed feature. 5.The urban crowd trajectory generation method based on a generative adversarial network according to claim 2, characterized in that, The conditional generator includes a first attention layer and a fully connected layer, and the discriminator includes a second attention layer and a multi-layer perceptron. The first attention layer or the second attention layer is configured to determine a query vector, a key vector, and a value vector based on the first feature sequence or the second feature sequence, and obtain an attention result based on an attention matrix. ​ 6.The urban crowd trajectory generation method based on a generative adversarial network according to claim 1, characterized in that, ​ ​ ​ 7.The urban crowd trajectory generation method based on a generative adversarial network according to claim 1, characterized in that, ​ ​ The full connection layer is used for extracting the correlation of different time steps from the attention result, to obtain a probability distribution of a candidate position of a next time step of a current position; The multi-layer perception is used for obtaining a first confidence and a second confidence based on the attention result, the first confidence being a confidence that a trajectory is true, and the second confidence being a confidence that the trajectory meets a time label classification. 8.A city crowd trajectory generation device based on a generative adversarial network, characterized in that, Comprise: A data acquisition module configured to acquire a time label of a generated trajectory of a city population and determine a trajectory starting point of the generated trajectory; A trajectory acquisition module configured to input the time label and the trajectory starting point into a trained generative adversarial network model to obtain a movement trajectory of the city population meeting the time label; The trained generative adversarial network comprises a trained conditional generator and a trained discriminator, the conditional generator being obtained by training based on feedback of the discriminator, and the discriminator being obtained by training based on a real trajectory dataset and a generated trajectory dataset output by the conditional generator; The training method of the generative adversarial network model comprises: Acquiring a real trajectory dataset of a city population; Establishing a generative adversarial network model to be trained, the generative adversarial network model to be trained comprising a conditional generator to be trained and a discriminator to be trained; Performing data preprocessing on the real trajectory dataset to obtain a real trajectory dataset, performing feature fusion on an incomplete generated trajectory to obtain a first feature sequence, inputting the incomplete generated trajectory into the conditional generator to be trained to obtain a complete generated trajectory, and performing feature fusion on the complete generated trajectory or the real trajectory to obtain a second feature sequence; wherein the incomplete generated trajectory is obtained by random sampling based on a trajectory starting point by the conditional generator to be trained; Training the conditional generator to be trained based on feedback of the discriminator to obtain a generated trajectory dataset, training the discriminator based on the generated trajectory dataset and the real trajectory dataset, and obtaining a trained generative adversarial network model if a JS divergence of the generated trajectory dataset and the real trajectory dataset reaches a target value.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the city population trajectory generation method based on the generative adversarial network according to any one of claims 1 to 7 when executing the program.

10. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the city population trajectory generation method based on the generative adversarial network according to any one of claims 1 to 7 when executed by the processor.

Citation Information

Patent Citations

  • TCN-GRU ship trajectory prediction method, system and device based on coding-decoding structure, and medium

    CN116342657A

  • Virtual scene generation method and apparatus, computer device and storage medium

    WO2021232229A1