Training method and device of trajectory prediction model based on meta-learning

By constructing training strategies for domain offset groups and cross-scene attention alignment loss functions in the trajectory prediction model, the problem of meta-learning model dependence on data in a specific source domain is solved, and cross-scene generalization ability and prediction performance are improved.

CN119106725AActive Publication Date: 2024-12-10AEROSPACE INFORMATION RES INST CAS
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411108453.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-12-10
Estimated Expiration
2044-08-13

AI Technical Summary

Technical Problem

In actual application, the existing meta-learning-based trajectory prediction model has excessive dependence on the specific source domain data used during training, resulting in poor generalization ability across scenarios and degradation of prediction performance when new target domain data that has not been encountered.

Method used

By obtaining the trajectory data of the target scene, a metatask is constructed and divided into multiple domain offset groups, each group contains virtual source domain and target domain data, and using a training strategy combined with serial parallelism, a cross-scene attention alignment loss function is constructed Carry out model training to optimize the model's adaptability to domain changes.

Benefits of technology

It improves the generalization performance of the model across scenarios, enhances the adaptability to domain changes, and improves the accuracy and stability of trajectory prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106725A_ABST
    Figure CN119106725A_ABST
Patent Text Reader

Abstract

The invention provides a trajectory prediction model training method and device based on meta-learning, and the method comprises the steps: obtaining the trajectory data of at least one target scene, constructing a meta-task, and dividing the meta-task into a plurality of domain offset groups; in any current training round in the training process, aiming at each domain offset group, on the basis of the training data of the meta-tasks, calling the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, obtaining a target loss function for executing the meta-tasks, and performing gradient propagation and updating in the domain offset group to obtain domain offset parameters; and according to the domain offset parameter of each domain offset group, updating an original model parameter of the trajectory prediction model in the current training round to obtain a final model parameter. By means of the trajectory prediction method and device, the technical problems that in the prior art, in practical application, a trajectory prediction model still excessively depends on specific source domain data used during training, the cross-scene generalization ability is poor, and prediction performance is reduced when new target domain data which is not encountered is predicted are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of autonomous driving technology, and in particular to a trajectory prediction model training method and device based on meta-learning. Background Art

[0002] Trajectory prediction technology usually plays a crucial midstream role in autonomous driving systems, and its prediction performance directly depends on the accuracy of upstream target detection and tracking. In practical applications, the trajectory prediction of vehicles, pedestrians and other targets is generally limited by the performance of sensor equipment, changing environmental conditions and differences in the prediction algorithm itself, and deviations in feature and data distribution often occur in the upstream process. These deviations not only affect the quality of the data, but may also cause serious domain shift problems in downstream tasks.

[0003] To address the domain shift problem in trajectory prediction tasks, existing technologies generally use some domain generalization methods, which train prediction models to predict unknown target domain data by training on data from multiple source domains, aiming to learn universal feature representations applicable to all source domains. For example, meta-learning-based methods attempt to achieve domain generalization by simulating domain shifts in real situations. However, since the definition of meta-tasks is generally not clear enough, these models may still be overly dependent on the specific source domain data used during training in actual applications, and have poor generalization capabilities across scenarios, resulting in decreased prediction performance when predicting new target domain data that has not been encountered. Summary of the invention

[0004] The present invention provides a meta-learning-based trajectory prediction model training method and device, which are used to solve the technical problem that the meta-learning-based trajectory prediction model in the prior art may still have excessive reliance on specific source domain data used in training in practical applications, and has poor generalization ability across scenarios, thereby causing a decrease in prediction performance when predicting new target domain data that has not been encountered.

[0005] The present invention provides a trajectory prediction model training method based on meta-learning, comprising the following steps: Acquire trajectory data of at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data; Constructing a meta-task according to the trajectory data and dividing it into a plurality of domain shift groups, wherein each of the domain shift groups is assigned at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing; In any current training round during the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is called to sequentially execute the meta-tasks in the domain offset group, and a target loss function for executing the meta-task is obtained, wherein the target loss function is constructed according to the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value; Gradient propagation is performed within the domain offset group according to the target loss function to update the domain offset parameters of the trajectory prediction model, and original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain final model parameters.

[0006] In some embodiments, the trajectory data is provided with five trajectory tags, and the five trajectory tags include a location tag, a time tag, a weather tag, a traffic tag, and a trajectory type tag for describing a target scene. The number of trajectory tags of the virtual source domain data is the same as the number of trajectory tags of the virtual target domain data, and the trajectory tag value of the virtual source domain data is different from the trajectory tag value of the virtual target domain data.

[0007] In some embodiments, the training data of the meta-task, calling the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, and obtaining the target loss function for executing the meta-task, includes: For each meta-task, calling the virtual source domain data to meta-train the trajectory prediction model, and updating the meta-learning original parameters of the trajectory prediction model according to the source domain loss value preset in the meta-training process to obtain the meta-learning temporary parameters; Performing a meta-test on the meta-learning temporary parameters of the trajectory prediction model through virtual target domain data to obtain a target domain loss value of the meta-testing process; Determine a cross-scene attention alignment loss value of the trajectory prediction model in the meta-training process and the meta-testing process; The target loss function for performing the meta-task is constructed according to the source domain loss value, the target domain loss value and the attention alignment loss value.

[0008] In some embodiments, determining the cross-scene attention alignment loss function of the trajectory prediction model in the meta-training process and the meta-testing process includes: For each first data sample in the virtual source domain data during the meta-training process, determining a training query vector and a training key vector obtained when the trajectory prediction model is trained using the first data sample, and determining a mean of the training query vector and a mean of the training key vector; For each second data sample in the virtual target domain data during the meta-test, determine a test query vector and a test key vector obtained when the second data sample tests the trajectory prediction model, and determine a mean of the test query vector and a mean of the test key vector; Determining a first difference between a mean of the training query vector and a mean of the test query vector, and a first normal form of the first difference, and determining a second difference between a mean of the training key vector and a mean of the test key vector, and a second normal form of the second difference; Determine the sum of the first paradigm and the second paradigm, and construct a cross-scene attention alignment loss function based on the sum.

[0009] In some embodiments, performing gradient propagation in the domain offset group according to the target loss function to update the domain offset parameters of the trajectory prediction model includes: Determining a task execution order of the trajectory prediction model to perform meta-tasks in the domain offset group; According to the task execution order, the meta-learning original parameters of the trajectory prediction model in the domain shift group are updated in sequence by the target loss function; After the trajectory prediction model completes the execution of the last meta-task in the domain shift group, the parameters obtained by updating the meta-learning original parameters of the last meta-task are used as the domain shift parameters of the domain shift group.

[0010] In some embodiments, updating the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters includes: Determining a parameter sum of domain shift parameters in each domain shift group, and determining a shift difference between the parameter sum and the original model parameter; The average value of the offset difference is weighted by the parallel learning rate, and the sum of the weighted result and the original model parameter is used as the model update parameter for the next training round; The model update parameters obtained in the last training round of the training process are used as the final model parameters.

[0011] The present invention also provides a training device for a trajectory prediction model based on meta-learning, comprising the following modules: An acquisition module, configured to acquire trajectory data of at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data; a partitioning module, configured to construct a meta-task according to the trajectory data, and partition the meta-task into a plurality of domain offset groups, wherein each of the domain offset groups is provided with at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing; An execution module is used to, in any current training round during the training process, for each domain offset group, based on the training data of the meta-task, call the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, and obtain a target loss function for executing the meta-task, wherein the target loss function is constructed based on a source domain loss value, a target domain loss value, and a cross-scene attention alignment loss value; An updating module is used to perform gradient propagation in the domain offset group according to the target loss function, update the domain offset parameters of the trajectory prediction model, and update the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a training method for a trajectory prediction model based on meta-learning as described in any one of the above is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a training method for a trajectory prediction model based on meta-learning as described in any one of the above.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the training method of the trajectory prediction model based on meta-learning as described in any one of the above is implemented.

[0015] The meta-learning-based trajectory prediction model training method and device provided by the present invention collects trajectory data of different target scenes and divides them into virtual source domain data and virtual target domain data. In the training process, the meta-learning framework is used, and a serial-parallel training strategy is adopted to divide the meta-task constructed according to the trajectory data into multiple domain offset groups, and meta-tasks and training data are set for each domain offset group. During serial training, for each domain offset group, the training data is called to execute the meta-tasks in the domain offset group in sequence, and the cross-scene attention alignment loss value when executing the meta-task is obtained, and then the target loss function is constructed to train the trajectory prediction model to obtain the domain offset parameters. During parallel training, the trajectory prediction model is trained according to the domain offset parameters of each domain offset group to obtain the final model parameters. Thus, meta-learning training is performed through virtual source domain data and virtual target domain data of different target scenes to optimize the model's adaptability to domain changes, and a serial-parallel training strategy is adopted to improve the model's performance in processing domain offset data. In the meta-learning process, the model is trained by constructing a cross-scene attention alignment loss value, which further improves the generalization performance of the model across scenes. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 It is a flowchart of the trajectory prediction model training method based on meta-learning provided by the present invention.

[0018] Figure 2 It is a training principle diagram of the trajectory prediction model training method based on meta-learning provided by the present invention.

[0019] Figure 3 It is a structural schematic diagram of a trajectory prediction model training device based on meta-learning provided by the present invention.

[0020] Figure 4 It is a schematic diagram of the physical structure of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.

[0022] Combine the following Figure 1 Describe the trajectory prediction model training method based on meta-learning of the present invention, Figure 1 is a flow chart of the trajectory prediction model training method based on meta-learning provided by the present invention, such as Figure 1 As shown, the method includes the following steps 101 to 104.

[0023] In step 101, trajectory data of at least one target scene is obtained, where the trajectory data includes virtual source domain data or virtual target domain data.

[0024] In an embodiment of the present invention, the trajectory prediction model is used to predict the possible trajectory changes of the target scene in the future based on the trajectory changes of some targets in the current target scene. For example, the target scene is a street, and the targets are vehicles and pedestrians on the street. If the trajectory prediction model is applied to the field of autonomous driving technology, it is necessary to predict in real time the possible movement trajectories of vehicles and pedestrians on the street in a future period of time in order to facilitate safe driving. In the process of trajectory change, the target scene may also change (for example, pedestrians walk from the street to the park), which requires the trajectory prediction model to be able to predict the trajectory of the target under cross-scene conditions.

[0025] Therefore, when collecting data for training the trajectory prediction model, the present invention obtains trajectory data of at least one target scene, and the trajectory data includes virtual source domain data or virtual target domain data. Here, each trajectory data describes a different target scene. In a target scene, there may be N moving targets (such as vehicles or pedestrians). Indicates that the i-th target is in the past The trajectories at each moment, so the position coordinates of these trajectories are expressed as , as the trajectory data of the target scene. Here, represents the spatial position coordinates in two-dimensional or three-dimensional space. These position coordinates represent the trajectory of the target in the current situation, and the trajectory prediction model predicts the target from now ( time) to a future period of time, that is, until The possible movement trajectory at any time can be expressed as .

[0026] Based on the above description, the embodiment of the present invention collects There are datasets of source domains, each of which corresponds to a target scene, represented as , and train the trajectory prediction model on these source domain datasets, hoping that the trained trajectory prediction model can seamlessly transition to the target domain data in a completely new scenario, denoted as , that is, the trajectory prediction model can perform cross-scenario trajectory prediction. Therefore, in the embodiment of the present invention, the collected trajectory data includes virtual source domain data or virtual target domain data. The data set of a source domain is divided into two categories: virtual source domain data and virtual target domain data.

[0027] However, due to the diversity and uncertainty of the target scene environment, the model is required to not only perform well in the known source domain (for example, the target scene environment represented by the training data), but also be able to adapt to the new scenes corresponding to the unseen target domain. This will lead to the problem of domain shift. One type of domain shift is low-data drift, which is the inconsistency in the distribution of trajectory types between the source domain and the target domain. Another type of domain shift is unseen data shift, which refers to the appearance of trajectory types that were not encountered during the training phase in the target domain.

[0028] In the embodiment of the present invention, the domain in trajectory prediction is defined by five factors. These five factors are also called five trajectory tags of trajectory data. Therefore, each trajectory data is provided with five trajectory tags, which specifically include a location tag, a time tag, a weather tag, a traffic tag, and a trajectory type tag for describing the target scene. Among them, the location tag sets the specific scene framework of the trajectory, which is directly related to the diversity of trajectory morphology and individual behavior. The time tag, although trajectory prediction mainly focuses on short-term changes, the difference in behavior patterns between day and night or weekdays and weekends is still significant. The weather tag, especially in extreme cases, sunny or rainy days have a significant impact on the behavior pattern, although this impact may be small under normal circumstances. The traffic tag reveals the degree of congestion in a specific scene (for example, the number of pedestrians on the street), which directly affects the individual's path selection and obstacle avoidance strategy. Finally, the trajectory type tag, the trajectory type includes straight, detour, etc., such as vehicles or pedestrians walking straight or turning. Although the trajectory type does not directly affect the prediction at the set level, it provides deep insights into understanding the future behavior pattern of the target.

[0029] Therefore, when collecting trajectory data, in the collection of trajectory data, multi-dimensional labels can be assigned to the trajectory data (i.e., the five trajectory labels mentioned above, one trajectory label represents one dimension). When some trajectory labels in the trajectory data are missing or difficult to obtain, first try to generate the missing trajectory labels based on data preprocessing technology. If this fails, only the available trajectory labels are retained. In the datasets of the source domains, each source domain dataset consists of trajectory data sets with specific multi-dimensional labels. These sets represent the specific environments and conditions that the trajectory prediction model needs to adapt to during the training phase, such as "city center-daytime-sunny-peak hours-straight driving".

[0030] The use of trajectory labels of multiple dimensions in the embodiments of the present invention enhances the accuracy of time domain definition and meta-task division in subsequent meta-learning applications.

[0031] In the trajectory data, in order to reflect the domain shift, When a data set of a source domain is divided into virtual source domain data and virtual target domain data, the division of the virtual target domain data needs to ensure that there is a difference in the trajectory labels of the virtual source domain data, that is, the number of trajectory labels of the virtual target domain data is the same as the number of trajectory labels of the virtual source domain data, for example, both are set with five trajectory labels. However, the trajectory label value of the virtual source domain data is different from the trajectory label value of the virtual target domain data. For example, the time label value and weather label value of the virtual source domain data are daytime and sunny, respectively, and the time label value and weather label value of the virtual target domain data can be planned as night and rainy. In this way, the domain shift problem that the trajectory prediction model may encounter in the actual application process is simulated, and the trajectory prediction model is trained to adapt to this domain shift phenomenon to increase the generalization ability of the trajectory prediction model.

[0032] In step 102, a meta-task is constructed according to the trajectory data and divided into a plurality of domain offset groups, wherein each domain offset group is provided with at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing.

[0033] Based on the domain shift problem, the embodiment of the present invention adopts a meta-task-based method to train the trajectory prediction model. Considering that the meta-learning training strategy in the prior art is to randomly select meta-tasks and then train them in sequence. However, this may cause the trajectory prediction model to overfit to certain meta-tasks, and the performance will decrease when facing novel or highly distributed meta-tasks. Therefore, the present invention adopts a serial and parallel training strategy in the training process of the trajectory prediction model. Figure 2 To explain in detail, Figure 2 It is a diagram of the training principle of the trajectory prediction model provided by an embodiment of the present invention.

[0034] First, construct a meta-task based on the trajectory data. Here, Figure 2 As shown, the source domain dataset include , , When constructing the meta-task, two trajectory data sets are randomly sampled from the trajectory data set to construct virtual source domain data and virtual target domain data. Figure 2 N meta-tasks are constructed in this paper, among which meta-task 1 is given as an example ( As virtual source domain data, as virtual target domain data), meta-task 2, meta-task 3.

[0035] Based on the serial-parallel training strategy, the constructed meta-tasks are divided into multiple domain offset groups. Here, according to the preset parallel parameter G, G types of domain offsets are selected, so that N meta-tasks are divided into G domain offset groups. In each domain offset group, M meta-tasks are allocated according to the preset serial parameter M (i.e., N=G×M), where M is an integer greater than 1, so each domain offset group is allocated with at least two meta-tasks. During training, the training data of each meta-task includes a metatrain for meta-training (denoted as ) and a virtual source domain data for meta-test (denoted as ) of the virtual target domain data, such as Figure 2 Meta-task 1 in As virtual source domain data for meta-training, As virtual target domain data, used for meta-testing.

[0036] Continue to see Figure 1 In step 103, in any current training round in the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is called to sequentially execute the meta-tasks in the domain offset group to obtain the target loss function for executing the meta-task, wherein the target loss function is constructed based on the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value.

[0037] In the embodiment of the present invention, the training process of the trajectory prediction model is performed iteratively according to the training rounds. For the convenience of description, only the training process of any current training round (denoted as e, indicating the e-th training round) in the training process is described here. In any current training round e in the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is called to sequentially execute the meta-tasks in the domain offset group to obtain the target loss function for executing the meta-task.

[0038] Here, during training, G domain offset groups ( Figure 2 In Figure 1, G domain offset groups are trained simultaneously, and the trajectory prediction model sequentially executes the M meta-tasks assigned to the domain offset groups, and continuously updates the parameters during the execution of the meta-tasks.

[0039] Specifically, the execution process of the meta-task is also the process of meta-task optimization, which is specifically divided into a meta-training process and a meta-testing process. That is, the trajectory prediction model is first meta-trained based on the virtual domain data, and then the meta-trained trajectory prediction model is meta-tested using the virtual target domain data. Therefore, the trajectory prediction model adopts a two-stage parameter update strategy in meta-learning. Specifically, in the meta-training process, for each meta-task, the virtual source domain data is called to meta-train the trajectory prediction model, and the meta-learning original parameters of the trajectory prediction model are updated according to the preset source domain loss value in the meta-training process to obtain the meta-learning temporary parameters.

[0040] The trajectory prediction model will have a meta-learning primitive parameter in the meta-learning process, collectively referred to as , this parameter only appears in the meta-learning process. According to the division of the domain shift group and the assignment of the meta-task, the meta-learning original parameters of the trajectory prediction model before performing the meta-task can be recorded as , represents the meta-learning original parameters of the g-th domain shift group before performing the m-th meta-task. Figure 2 As shown in the figure, there are M meta-tasks assigned to the first domain shift group, and the meta-learning original parameters of the trajectory prediction model before performing the meta-task are denoted as , while other domain offset groups are recorded as When performing meta-training in the domain offset group, the virtual source domain data is called Data batches Meta-train the trajectory prediction model and use the meta-training The source domain loss value preset in the process Update the meta-learning primitive parameters of the trajectory prediction model , get the temporary parameters of meta-learning Therefore, the process of updating the original parameters of meta-learning can be expressed as the following formula (1): (1)

[0041] In the above formula (1), represents the preset source domain loss value, represents the learning rate during meta-training, represents the meta-learning temporary parameters, m represents the mth meta-task, g represents the gth domain shift group, Represents the meta-learning primitive parameters. Represents a batch of data of virtual source domain data during meta-training.

[0042] Next is the meta test In this process, the meta-learning temporary parameters of the trajectory prediction model are meta-tested through virtual target domain data to obtain the target domain loss value of the meta-testing process.

[0043] Meta test here When the trajectory prediction model is trained, the meta-learning temporary parameters are obtained After that, it can be used to virtual target domain data Data batches Perform test verification to obtain the predicted target domain data, and then calculate the predicted target domain data and the virtual target domain data The difference between , constructs the target domain loss value, recorded as Therefore, the optimization objective function of executing the meta-task can be preliminarily expressed as the following formula (2): (2)

[0044] In the above formula (2), A data batch representing the virtual target domain data, Represents a data batch of virtual source domain data, represents the meta-learning original parameters of the trajectory prediction model before meta-training, Represents the meta-learned temporary parameters of the trajectory prediction model during meta-testing. represents the preset source domain loss value during meta-training, Represents the target domain loss value calculated during meta-testing.

[0045] If the final loss of the trajectory prediction model performing the meta-task is calculated according to the above formula (2), it will lead to high computational complexity, large storage requirements, and easy amplification of data noise and model uncertainty. and meta-test Gradient calculation and update in two stages. In order to improve the generalization ability of the trajectory prediction model across scenarios, the update strategy of the parameters of the trajectory prediction model in the meta-learning framework is finely managed. Considering that the trajectory prediction model in the present invention is based on the architecture of the transformer model, it is determined here that the trajectory prediction model is updated in the meta-training Process and meta-testing The cross-scene attention alignment loss value of the process is recorded as .

[0046] Since there are multi-head self-attention network modules in the trajectory prediction model based on the transformer architecture, and the calculation of attention parameters depends on the query vector, key vector and value vector. When calculating the cross-scene attention alignment loss value, the query vector (Q) and key vector (K) are kept unchanged, while other parameters such as the value vector (V) and other parameters of the encoder and decoder are allowed to be modified for dynamic update. The basis is that the spatial interaction and temporal dependency patterns of the target should be universal in various target scenarios. Even if the specific trajectory of the target varies from environment to environment, the response patterns of pedestrians or vehicles to the environment and other pedestrian behaviors are generally similar. Therefore, the parameters related to the generation of query vector Q and key vector K are maintained unchanged during the meta-training process and meta-testing process, which provides a basis for the generalization of trajectory prediction models across scenarios.

[0047] First, for meta-training Each first data sample in the virtual source domain data (e.g., the current trajectory position coordinates) ), determine the training query vector obtained when the first data sample trains the trajectory prediction model and the training key vector , and determine the mean of the training query vector and the mean of the training key vector.

[0048] The training query vector here is not the original training query vector , but instead the original training query vector Kernel function mapped to Reproducing kernel Hilbert space (RKHS) , training key vector The same applies, so I won’t go into details.

[0049] Next, for the meta test Each second data sample in the virtual target domain data (e.g., trajectory position coordinates in the future) ), determine the test query vector obtained when testing the trajectory prediction model for the second data sample and the test key vector , and determine the mean of the test query vector and the mean of the test key vector.

[0050] Similarly, the test query vector here is not the original test query vector , but instead the original test query vector Kernel function mapped to RKHS , the test key vector The same applies, so I won’t go into details.

[0051] Then determine the first difference between the mean of the training query vector and the mean of the test query vector, and the first normal form of the first difference, and determine the second difference between the mean of the training key vector and the mean of the test key vector, and the second normal form of the second difference. Finally, determine the sum of the first normal form and the second normal form, and construct the cross-scene attention alignment loss value based on the sum. , expressed as the following formula (3): (3)

[0052] In the above formula (3), represents the sample number of the first data sample in the virtual source domain data, represents the number of samples of the second data sample in the virtual target domain data, Represents the computational paradigm, Indicates the number of trajectory moments in the future that the trajectory prediction model needs to predict.

[0053] Finally, according to the source domain loss value , target domain loss value And the attention alignment loss value The objective loss function for executing the meta-task is constructed and recorded as Here, the target loss function is constructed by combining the two-stage loss of performing meta-tasks and the cross-scene attention alignment loss value, but the loss should be focused. Here, a weight coefficient is set Loss value for cross-scene attention alignment Weighted, and the weighted result is summed with the two-stage loss to obtain the target loss function for performing the meta-task It is expressed as the following formula (4): (4)

[0054] In the above formula (4), represents the source domain loss value, represents the data batch of virtual source domain data during meta-training, Represents the meta-learned raw parameters of the trajectory prediction model before meta-training. represents the target domain loss value, Indicates the data batch of virtual target domain data during meta-testing. Represents the meta-learning temporary parameters updated after meta-training of the trajectory prediction model. Represents the cross-scene attention alignment loss value The weight coefficient of . represents the original training query vector obtained from the first data sample in the virtual source domain data during the meta-training process, represents the original training key vector obtained from the first data sample in the virtual source domain data during the meta-training process, represents the original test query vector obtained according to the second data sample in the virtual target domain data during the meta-test process, Represents the original test key vector obtained according to the second data sample in the virtual target domain data during the meta-test process.

[0055] In an embodiment of the present application, a meta-learning framework is used to train a trajectory prediction model to overcome the domain shift problem that exists in the trajectory prediction model when performing trajectory prediction. A cross-scene attention alignment loss is constructed in the meta-learning process to train the trajectory prediction model to improve the generalization ability of the trajectory prediction model in cross-scenes.

[0056] Continue to see Figure 1 In step 104, gradient propagation is performed in the domain offset group according to the target loss function to update the domain offset parameters of the trajectory prediction model, and the original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0057] After determining the target loss function of the trajectory prediction model to perform the meta-task, the domain offset parameters of the trajectory prediction model are obtained by performing gradient propagation update in the domain offset group according to the target loss function. Here, since there are M meta-tasks assigned to the domain offset group, according to the serial training strategy, the task execution order of the trajectory prediction model in the domain offset group to perform the meta-task is first determined. Since the execution of the M meta-tasks must have a sequence, the trajectory prediction model needs to execute the M meta-tasks in sequence according to the task execution order. Therefore, in each domain offset group, according to the task execution order, the meta-learning original parameters of the trajectory prediction model in the domain offset group are updated in sequence through the target loss function. After the trajectory prediction model executes the last meta-task (i.e., the Mth meta-task) in the domain offset group, the parameters obtained after updating the meta-learning original parameters of the last meta-task (i.e., the Mth meta-task) are used as the domain offset parameters of the domain offset group.

[0058] Specifically, in the domain shift group, when executing the first meta-task, the target loss function is first calculated to update the meta-learning original parameters of the trajectory prediction model, and the updated new parameters are used as the meta-learning original parameters of the trajectory prediction model when executing the second meta-task, and then the target loss function is calculated to continue to update the meta-learning original parameters of the second meta-task, and so on. Until the trajectory prediction model completes the last meta-task in the domain shift group, the meta-learning original parameters of the last meta-task are updated by calculating the target loss function, and the updated parameters are used as the domain shift parameters of the domain shift group. Among them, the calculation process of updating the meta-learning original parameters of the trajectory prediction model through the target loss function can be expressed as the following formula (5): (5)

[0059] In the above formula (5), represents the meta-learning original parameters of the trajectory prediction model before executing the mth meta-task, Represents the objective loss function by performing the meta-task Update meta-learning primitive parameters The parameters obtained after , are used as the meta-learning original parameters of the trajectory prediction model before executing the m+1th meta-task, Represents the preset meta-learning learning rate.

[0060] For example, Figure 2 As shown, in the first domain shift group, the original meta-learning parameters of the trajectory prediction model in performing the first meta-task are , when executing the first meta-task, the meta-learning temporary parameters obtained during the meta-training process are , and construct the cross-scene attention alignment loss value Then construct the target loss function To update the original parameters of meta-learning , and the updated parameters are , as the meta-learning original parameters of the trajectory prediction model when performing the second meta-task, until when performing the Mth meta-task (i.e., the last meta-task in the first domain shift group), the meta-learning original parameters are , the temporary meta-learning parameters obtained during meta-training are , construct the target loss function To update the original parameters of meta-learning , get the updated parameters , as the domain offset parameter of the trajectory prediction model in the first domain offset group.

[0061] According to the parallel training strategy, the G domain shift groups are trained simultaneously. Therefore, when the first domain shift group is trained to obtain the domain shift parameters, the other domain shift groups are also trained to obtain the domain shift parameters accordingly, such as Figure 2 As shown, in the G-th domain shift group, the meta-learning original parameters of the trajectory prediction model when performing the first meta-task are , the updated parameters are When executing the last meta-task (i.e., the Mth meta-task) in the Gth domain shift group, the meta-learning original parameters are , the temporary meta-learning parameters obtained during meta-training are , construct the target loss function To update the original parameters of meta-learning , get the updated parameters , as the domain shift parameters of the trajectory prediction model trained in the Gth domain shift group.

[0062] After the trajectory prediction model completes the meta-learning process, the G domain shift groups have completed the M meta-tasks and trained to obtain the domain shift parameters, which are recorded as: , , …, Next, in the current training round, the original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0063] Here, according to the parallel training strategy, the domain offset parameters of each domain offset group are integrated to update the original model parameters of the trajectory prediction model. , where e represents the serial number of the current training round, i.e., the e-th training round. The integration process is as follows: first determine the sum of the domain offset parameters in each domain offset group, and determine the offset difference between the sum of the parameters and the original model parameters. Then calculate the average value of the offset difference, and weight the average value of the offset difference by the parallel learning rate, and sum the weighted result with the original model parameters as the model update parameter for the next training round (i.e., the e+1-th training round). The calculation formula is as follows: Formula (6): (6)

[0064] In the above formula (6), Represents the original model parameters of the trajectory prediction model in the current training round, represents the parallel learning rate, g represents the g-th domain shift group, G represents the total number of domain shift groups, represents the domain shift parameters obtained by the trajectory prediction model after the g-th domain shift group completes m meta-tasks.

[0065] like Figure 2 As shown, the model update parameters for the next round are updated. , and then test and verify the trajectory update model after updating the parameters, that is, execute the model test function The verification process is to execute the model test function through the trajectory prediction model ,get Source domain datasets The trajectory prediction results are combined with the target domain data in the new environment ( Figure 2 Two target domain data sets are shown in , ) to determine the difference in predictions. Then the next training round (i.e. training rounds).

[0066] After updating the original model parameters of the trajectory prediction model in the current training round through the above formula (6), the updated parameters are used as the original model parameters of the next training round to continue the meta-learning training process in serial and parallel. Until the last training round is reached, the model update parameters updated in the last training round of the training process are used as the final model parameters. At this time, the trajectory prediction model training is completed. Through the training process of each training round, the trajectory prediction results of the trajectory prediction model are consistent with the target domain data in the new environment. ( , ) will become closer and closer, and the difference will become smaller and smaller, indicating that the trajectory prediction model's ability to adapt to domain changes is gradually becoming stronger, and the generalization performance of the model across scenarios is also gradually improving.

[0067] After the final model parameters are determined, the trajectory prediction model can be used directly for prediction, and can predict the trajectory of the source domain data of the target in any target scene, and obtain the trajectory data of the target in the future (target domain data). For example, the trajectory prediction model can be deployed on an autonomous driving system, and the vehicle can predict the movement trajectory of pedestrians on the street in 2 seconds based on the movement trajectory of pedestrians collected on the street, so as to prompt the driver to control the speed and direction of the vehicle based on the movement trajectory, and assist the driver to drive safely.

[0068] The meta-learning-based trajectory prediction model training method provided in an embodiment of the present invention collects trajectory data of different target scenes and divides it into virtual source domain data and virtual target domain data. And set trajectory labels of five dimensions in the trajectory data, which enhances the accuracy of the time domain definition and the accuracy of meta-task division of the meta-learning method. In the training process, the meta-learning framework is used, and a serial-parallel combination training strategy is adopted. Meta-learning training is performed through virtual source domain data and virtual target domain data of different target scenes to optimize the model's adaptability to domain changes. The serial-parallel combination training strategy is adopted to improve the model's performance in processing diverse domain offset data. In the meta-learning process, the model is trained by constructing a cross-scene attention alignment loss value, which further improves the generalization performance of the model across scenes.

[0069] The meta-learning-based trajectory prediction model training device provided by the present invention is described below. The meta-learning-based trajectory prediction model training device described below and the meta-learning-based trajectory prediction model training method described above can refer to each other.

[0070] See also Figure 3 , Figure 3is a schematic diagram of the structure of a trajectory prediction model training device based on meta-learning provided by the present invention, such as Figure 3 As shown, the present invention provides a trajectory prediction model training device based on meta-learning, which specifically includes the following modules: an acquisition module 301, a division module 302, an execution module 303, and an update module 304. Among them, the acquisition module 301 is used to obtain trajectory data of at least one target scene, and the trajectory data includes virtual source domain data or virtual target domain data; the division module 302 is used to construct a meta-task according to the trajectory data, and divide it into multiple domain offset groups, wherein each domain offset group is provided with at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing; The execution module 303 is used to call the trajectory prediction model to execute the meta-tasks in the domain offset group in sequence for each domain offset group based on the training data of the meta-task in any current training round during the training process, and obtain the target loss function for executing the meta-task, wherein the target loss function is constructed based on the source domain loss value, the target domain loss value and the cross-scene attention alignment loss value; the update module 304 is used to perform gradient propagation within the domain offset group according to the target loss function, update the domain offset parameters of the trajectory prediction model, and update the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0071] Specifically, the above-mentioned meta-learning-based trajectory prediction model training device provided by the present invention can implement all the method steps implemented by the above-mentioned meta-learning-based trajectory prediction model training method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.

[0072] Figure 4 is a schematic diagram of the physical structure of an electronic device provided by the present invention, such as Figure 4As shown, the electronic device may include: a processor (processor) 410 , a communication interface (Communications Interface) 420 , a memory (memory) 430 and a communication bus 440 , wherein the processor 410 , the communication interface 420 , and the memory 430 communicate with each other through the communication bus 440 . The processor 410 can call the logic instructions in the memory 430 to execute a trajectory prediction model training method based on meta-learning, the method comprising: obtaining trajectory data of at least one target scene, the trajectory data comprising virtual source domain data or virtual target domain data; constructing a meta-task according to the trajectory data, and dividing it into multiple domain offset groups, wherein each of the domain offset groups is assigned at least two meta-tasks, and the training data of the meta-task comprises a virtual source domain data for meta-training and a virtual target domain data for meta-testing; in any current training round in the training process, for each domain offset group, based on the training data of the meta-task, calling the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, and obtaining a target loss function for executing the meta-task, wherein the target loss function is constructed according to a source domain loss value, a target domain loss value, and a cross-scene attention alignment loss value; performing gradient propagation in the domain offset group according to the target loss function, updating the domain offset parameters of the trajectory prediction model, and updating the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0073] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0074] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the meta-learning-based trajectory prediction model training method provided by the above methods, the method comprising: obtaining trajectory data of at least one target scene, the trajectory data including virtual source domain data or virtual target domain data; constructing a meta-task according to the trajectory data, and dividing it into multiple domain offset groups, wherein each of the domain offset groups is assigned with at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data. and a virtual target domain data for meta-testing; in any current training round during the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is called to execute the meta-tasks in the domain offset group in sequence, and a target loss function for executing the meta-task is obtained, wherein the target loss function is constructed according to the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value; according to the target loss function, gradient propagation is performed in the domain offset group to update the domain offset parameters of the trajectory prediction model, and the original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0075] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the trajectory prediction model training method based on meta-learning provided by the above methods, the method comprising: obtaining trajectory data of at least one target scene, the trajectory data comprising virtual source domain data or virtual target domain data; constructing a meta-task according to the trajectory data, and dividing it into a plurality of domain offset groups, wherein each of the domain offset groups is assigned with at least two meta-tasks, and the training data of the meta-task comprises a virtual source domain data for meta-training and a virtual target domain data for meta-testing. data; in any current training round during the training process, for each domain offset group, based on the training data of the meta-task, call the trajectory prediction model to execute the meta-tasks in the domain offset group in sequence, and obtain the target loss function for executing the meta-task, wherein the target loss function is constructed according to the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value; perform gradient propagation in the domain offset group according to the target loss function, update the domain offset parameters of the trajectory prediction model, and update the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0076] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0077] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A trajectory prediction model training method based on meta-learning, characterized in that: The training process of the trajectory prediction model is performed iteratively according to training rounds, and the method includes: Acquire trajectory data of at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data; Constructing a meta-task according to the trajectory data and dividing it into a plurality of domain shift groups, wherein each of the domain shift groups is assigned at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing; In any current training round during the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is called to sequentially execute the meta-tasks in the domain offset group, and a target loss function for executing the meta-task is obtained, wherein the target loss function is constructed according to the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value; Gradient propagation is performed within the domain offset group according to the target loss function to update the domain offset parameters of the trajectory prediction model, and original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain final model parameters.

2. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that: The trajectory data is provided with five trajectory tags, and the five trajectory tags include a location tag, a time tag, a weather tag, a traffic tag and a trajectory type tag for describing the target scene. The number of trajectory tags of the virtual source domain data is the same as the number of trajectory tags of the virtual target domain data, and the trajectory tag value of the virtual source domain data is different from the trajectory tag value of the virtual target domain data.

3. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that: The training data of the meta-task is used to call the trajectory prediction model to sequentially execute the meta-tasks in the domain shift group, and obtain the target loss function for executing the meta-task, including: For each meta-task, calling the virtual source domain data to meta-train the trajectory prediction model, and updating the meta-learning original parameters of the trajectory prediction model according to the source domain loss value preset in the meta-training process to obtain the meta-learning temporary parameters; Performing a meta-test on the meta-learning temporary parameters of the trajectory prediction model through virtual target domain data to obtain a target domain loss value of the meta-testing process; Determine a cross-scene attention alignment loss value of the trajectory prediction model in the meta-training process and the meta-testing process; The target loss function for performing the meta-task is constructed according to the source domain loss value, the target domain loss value and the attention alignment loss value.

4. The trajectory prediction model training method based on meta-learning according to claim 3 is characterized in that: Determining the cross-scene attention alignment loss function of the trajectory prediction model in the meta-training process and the meta-testing process includes: For each first data sample in the virtual source domain data during the meta-training process, determining a training query vector and a training key vector obtained when the trajectory prediction model is trained using the first data sample, and determining a mean of the training query vector and a mean of the training key vector; For each second data sample in the virtual target domain data during the meta-test, determine a test query vector and a test key vector obtained when the second data sample tests the trajectory prediction model, and determine a mean of the test query vector and a mean of the test key vector; Determining a first difference between a mean of the training query vector and a mean of the test query vector, and a first normal form of the first difference, and determining a second difference between a mean of the training key vector and a mean of the test key vector, and a second normal form of the second difference; Determine the sum of the first paradigm and the second paradigm, and construct a cross-scene attention alignment loss function based on the sum.

5. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that: Performing gradient propagation in the domain offset group according to the target loss function to update the domain offset parameters of the trajectory prediction model includes: Determining a task execution order for the trajectory prediction model to perform meta-tasks in a domain offset group; According to the task execution order, the meta-learning original parameters of the trajectory prediction model in the domain shift group are updated in sequence by the target loss function; After the trajectory prediction model completes the execution of the last meta-task in the domain shift group, the parameters obtained by updating the meta-learning original parameters of the last meta-task are used as the domain shift parameters of the domain shift group.

6. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that: The original model parameters of the trajectory prediction model in the current training round are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters, including: Determining a parameter sum of domain shift parameters in each domain shift group, and determining a shift difference between the parameter sum and the original model parameter; The average value of the offset difference is weighted by the parallel learning rate, and the sum of the weighted result and the original model parameter is used as the model update parameter for the next training round; The model update parameters obtained in the last training round of the training process are used as the final model parameters.

7. A training device for a trajectory prediction model based on meta-learning, characterized in that: The device comprises: An acquisition module, configured to acquire trajectory data of at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data; a partitioning module, configured to construct a meta-task according to the trajectory data, and partition the meta-task into a plurality of domain offset groups, wherein each of the domain offset groups is provided with at least two meta-tasks, and the training data of the meta-task includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing; An execution module is used to, in any current training round during the training process, for each domain offset group, based on the training data of the meta-task, call the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, and obtain a target loss function for executing the meta-task, wherein the target loss function is constructed based on a source domain loss value, a target domain loss value, and a cross-scene attention alignment loss value; An updating module is used to perform gradient propagation in the domain offset group according to the target loss function, update the domain offset parameters of the trajectory prediction model, and update the original model parameters of the trajectory prediction model in the current training round according to the domain offset parameters of each domain offset group to obtain the final model parameters.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the training method of the trajectory prediction model based on meta-learning as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the training method of the trajectory prediction model based on meta-learning as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the training method of the trajectory prediction model based on meta-learning as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Pedestrian re-identification technology based on double consistency constraint

    CN113065434A

  • User service recommendation method and system based on spatio-temporal data and meta learning

    CN115994269A

  • Trajectory prediction model generation method and device and model training method and device

    CN116187475A

  • Meta-learning for multi-task learning for neural networks

    US20190147298A1

  • Server and method for obtaining key performance indicator fast-adaptive artificial intelligence model

    WO2023038478A1