A training method and device of a trajectory prediction model based on meta learning

By constructing domain offset groups in the trajectory prediction model and adopting a training strategy that combines serial and parallel approaches, and by optimizing model parameters using cross-scene attention alignment loss values, the problem of model dependence on specific source domain data is solved, thereby improving cross-scene generalization ability and prediction accuracy.

CN119106725BActive Publication Date: 2026-05-08AEROSPACE INFORMATION RES INST CAS
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AEROSPACE INFORMATION RES INST CAS
Filing Date
2024-08-13
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing meta-learning-based trajectory prediction models rely excessively on specific source domain data used during training in practical applications, resulting in poor generalization ability across scenarios and performance degradation when predicting new target domain data that have not been encountered before.

Method used

By acquiring trajectory data of the target scene, a meta-task is constructed and divided into multiple domain offset groups. A training strategy combining serial and parallel approaches is adopted. The target loss function is constructed by aligning cross-scene attention loss values, updating the domain offset parameters of the trajectory prediction model, and optimizing the model's adaptability to domain changes.

Benefits of technology

It improves the model's generalization performance across scenarios, enhances its ability to process domain offset data, and improves the prediction accuracy of the trajectory prediction model in diverse environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119106725B_ABST
    Figure CN119106725B_ABST
Patent Text Reader

Abstract

The application provides a trajectory prediction model training method and device based on meta learning, which comprises the following steps: obtaining trajectory data of at least one target scene and constructing meta tasks, and dividing the meta tasks into multiple domain offset groups; 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, obtaining a target loss function of executing the meta task, and performing gradient propagation within the domain offset group to update the domain offset parameter; and updating the original model parameter of the trajectory prediction model in the current training round according to the domain offset parameter of each domain offset group to obtain a final model parameter. Through the application, the technical problem that the trajectory prediction model in the prior art still excessively depends on specific source domain data used in the training, has poor cross-scene generalization capability, and leads to a decline in prediction performance when predicting new target domain data not encountered before is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous driving technology, and in particular to a method and apparatus for training a trajectory prediction model based on meta-learning. Background Technology

[0002] Trajectory prediction technology typically plays a crucial midstream role in autonomous driving systems, with its prediction performance directly dependent on the accuracy of upstream target detection and tracking. In practical applications, it generally predicts the trajectories of vehicles, pedestrians, and other multiple targets. Due to limitations in sensor performance, varying environmental conditions, and differences in the prediction algorithms themselves, deviations in feature and data distribution often occur in the upstream process. These deviations not only affect data quality but can also lead to severe domain offset problems in downstream tasks.

[0003] To address the domain shift problem in trajectory prediction tasks, existing techniques generally employ domain generalization methods. These methods train the model on data from multiple source domains, aiming to learn a universal feature representation applicable to all source domains, and then train the prediction model to predict unknown target domain data. For example, meta-learning-based methods attempt to achieve domain generalization by simulating domain shifts in real-world scenarios. However, because the definition of meta-tasks is generally not well-defined, these models may still over-rely on the specific source domain data used during training in practical applications, exhibiting poor cross-scenario generalization ability. Consequently, when predicting new target domain data that has not been encountered before, prediction performance degrades. Summary of the Invention

[0004] This invention provides a training method and apparatus for a trajectory prediction model based on meta-learning, which addresses the technical problem that existing meta-learning-based trajectory prediction models may still over-rely on specific source domain data used during training and have poor generalization ability across scenarios, thus leading to a decline in prediction performance when predicting new target domain data that have not been encountered before.

[0005] This invention provides a method for training a trajectory prediction model based on meta-learning, comprising the following steps:

[0006] Acquire trajectory data for at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data;

[0007] A meta-task is constructed based on the trajectory data and divided into multiple domain offset groups. Each domain offset group is equipped with at least two meta-tasks. The training data of the meta-tasks includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing.

[0008] 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 to obtain the target loss function for executing the meta-tasks. 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.

[0009] Gradient propagation is performed within the domain offset group based on the target loss function to update the domain offset parameters of the trajectory prediction model. The original model parameters of the trajectory prediction model in the current training round are then updated based on the domain offset parameters of each domain offset group to obtain the final model parameters.

[0010] In some embodiments, the trajectory data has five trajectory labels, which include a location label, a time label, a weather label, a traffic label, and a trajectory type label for describing the target scene. The number of trajectory labels in the virtual source domain data is the same as the number of trajectory labels in the virtual target domain data, and the trajectory label values ​​in the virtual source domain data are different from those in the virtual target domain data.

[0011] In some embodiments, the training data of the meta-tasks are used to call the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group to obtain the target loss function for executing the meta-tasks, including:

[0012] For each meta-task, virtual source domain data is invoked to perform meta-training on the trajectory prediction model, and the original meta-learning parameters of the trajectory prediction model are updated according to the preset source domain loss value during the meta-training process to obtain the meta-learning temporary parameters.

[0013] Meta-testing is performed on the meta-learning temporary parameters of the trajectory prediction model using virtual target domain data to obtain the target domain loss value of the meta-testing process.

[0014] Determine the cross-scene attention alignment loss value of the trajectory prediction model during the meta-training process and the meta-testing process;

[0015] The target loss function for performing the meta-task is constructed based on the source domain loss value, the target domain loss value, and the attention alignment loss value.

[0016] In some embodiments, determining the cross-scene attention alignment loss function of the trajectory prediction model during the meta-training process and the meta-testing process includes:

[0017] For each first data sample in the virtual source domain data during the meta-training process, determine the training query vector and training key vector obtained when the first data sample trains the trajectory prediction model, and determine the mean of the training query vector and the mean of the training key vector.

[0018] For each second data sample in the virtual target domain data during the meta-testing process, determine the test query vector and test key vector obtained when the second data sample tests the trajectory prediction model, and determine the mean of the test query vector and the mean of the test key vector;

[0019] Determine a first difference between the mean of the training query vector and the mean of the test query vector, and a first normal form of the first difference; and determine a second difference between the mean of the training key vector and the mean of the test key vector, and a second normal form of the second difference.

[0020] The sum of the first paradigm and the second paradigm is determined, and a cross-scene attention alignment loss function is constructed based on the sum.

[0021] In some embodiments, the domain offset parameters of the trajectory prediction model are updated by performing gradient propagation within the domain offset group according to the target loss function, including:

[0022] Determine the task execution order of the meta-tasks in the domain offset group for the trajectory prediction model;

[0023] According to the task execution order, the original meta-learning parameters of the trajectory prediction model in the domain offset group are updated sequentially using the target loss function.

[0024] After the trajectory prediction model completes the last meta-task in the domain offset group, the parameters obtained by updating the original meta-learning parameters of the last meta-task will be used as the domain offset parameters of the domain offset group.

[0025] In some embodiments, 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:

[0026] 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;

[0027] The average value of the offset difference is weighted by the parallel learning rate, and the weighted result is summed with the original model parameters as the model update parameters for the next training round.

[0028] The model update parameters obtained in the last training round are used as the final model parameters.

[0029] The present invention also provides a training device for a trajectory prediction model based on meta-learning, comprising the following modules:

[0030] The acquisition module is used to acquire trajectory data of at least one target scene, wherein the trajectory data includes virtual source domain data or virtual target domain data;

[0031] The partitioning module is used to construct meta-tasks based on the trajectory data and divide them into multiple domain offset groups. Each domain offset group has at least two meta-tasks. The training data of the meta-tasks includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing.

[0032] The execution module is used to, at 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 to obtain the target loss function for executing the meta-tasks. 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.

[0033] The update module 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.

[0034] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the training method of the trajectory prediction model based on meta-learning as described above.

[0035] 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 the training method of the trajectory prediction model based on meta-learning as described above.

[0036] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements a training method for a trajectory prediction model based on meta-learning as described above.

[0037] This invention provides a meta-learning-based trajectory prediction model training method and apparatus. It collects trajectory data from different target scenes and divides it into virtual source domain data and virtual target domain data. During training, a meta-learning framework is used, employing a combined serial and parallel training strategy. The meta-tasks constructed based on the trajectory data are divided 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 sequentially execute the meta-tasks within that group, obtaining cross-scene attention alignment loss values. These losses are then used to construct a target loss function to train the trajectory prediction model, yielding domain offset parameters. During parallel training, the trajectory prediction model is trained based on the domain offset parameters of each domain offset group, resulting in the final model parameters. Thus, meta-learning training using virtual source and virtual target domain data from different target scenes optimizes the model's adaptability to domain changes. The combined serial and parallel training strategy improves the model's performance in processing domain offset data. Furthermore, the construction of cross-scene attention alignment loss values ​​during meta-learning further enhances the model's generalization performance across different scenes. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in this invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a flowchart illustrating the training method for the trajectory prediction model based on meta-learning provided by the present invention.

[0040] Figure 2 This is a diagram illustrating the training principle of the trajectory prediction model training method based on meta-learning provided by this invention.

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

[0042] Figure 4 This is a schematic diagram of the physical structure of an electronic device provided by the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0044] The following is combined Figure 1 The present invention describes a method for training a trajectory prediction model based on meta-learning. Figure 1 This is a flowchart illustrating the training method for the trajectory prediction model based on meta-learning provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps 101 to 104.

[0045] In step 101, trajectory data of at least one target scene is obtained, including virtual source domain data or virtual target domain data.

[0046] In this embodiment of the invention, the trajectory prediction model is used to predict possible future trajectory changes of a target scene 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 the possible movement trajectories of vehicles and pedestrians on the street in real time over a future period of time to facilitate safe driving. During the trajectory change process, the target scene may also change (for example, a pedestrian moves from the street to a park), which requires the trajectory prediction model to still be able to predict the trajectory of the target under cross-scene conditions.

[0047] Therefore, when collecting data to train the trajectory prediction model, this invention acquires trajectory data for at least one target scene. This trajectory data includes virtual source domain data or virtual target domain data. Here, each trajectory data describes a different target scene. Within a single target scene, there may be N moving targets (e.g., vehicles or pedestrians). Indicates that the i-th target was in the past The trajectories at each moment are thus represented as follows: This serves as trajectory data for the target scene. Here, These coordinates represent spatial positions in two-dimensional or three-dimensional space, indicating the trajectory of a target under current conditions. The trajectory prediction model, on the other hand, predicts the target's trajectory from its current position. (moment) to a future period of time, that is, until The trajectory that can move at any given time can be represented as: .

[0048] Based on the above description, embodiments of the present invention collect data including... A dataset with *n* source domains, each source domain corresponding to a target scene, represented as... Furthermore, a trajectory prediction model is trained on these source domain datasets, with the aim of seamlessly transitioning the trained model to target domain data in a completely new scene, denoted as... This means that the trajectory prediction model can perform trajectory prediction across different scenarios. Therefore, in this embodiment of the invention, the collected trajectory data includes virtual source domain data or virtual target domain data. The datasets from each source domain are divided into two categories: virtual source domain data and virtual target domain data.

[0049] The diversity and uncertainty of target scene environments require models to not only perform well in the known source domain (e.g., the target scene environment represented by the training data), but also to adapt to entirely new scenes corresponding to unseen target domains. This leads to the problem of domain shift. One type of domain shift is low-data drift, which is an inconsistency in the distribution of trajectory types between the source and target domains. Another type of domain shift is unseen data shift, which refers to the appearance of trajectory types in the target domain that were not encountered during the training phase.

[0050] In this embodiment of the invention, the domain in trajectory prediction is defined by five factors, also known as the five trajectory labels for the trajectory data. Therefore, each trajectory data set contains five trajectory labels, specifically including a location label, a time label, a weather label, a traffic label, and a trajectory type label to describe the target scenario. The location label sets the specific scenario framework of the trajectory, which directly relates to the diversity of trajectory patterns and individual behavior. The time label, although trajectory prediction mainly focuses on short-term changes, still shows significant differences in behavioral patterns between day and night or weekdays and weekends. The weather label, especially in extreme cases, shows that sunny or rainy weather has a significant impact on behavioral patterns, although this impact may be smaller under normal circumstances. The traffic label reveals the congestion level of a specific scenario (e.g., the number of pedestrians on the street), which directly affects an individual's path selection and obstacle avoidance strategies. Finally, the trajectory type label, including straight-line and detour routes (such as vehicles or pedestrians walking in a straight line or turning), while not directly affecting ensemble-level predictions, provides profound insights into understanding the target's future behavioral patterns.

[0051] Therefore, when collecting trajectory data, multi-dimensional labels can be assigned to the trajectory data set (i.e., the five trajectory labels mentioned above, each representing one dimension). When some trajectory labels are missing or difficult to obtain, the missing trajectory labels are first attempted to be generated based on data preprocessing techniques. If this fails, only the available trajectory labels are retained. The collected data contains... In each source domain dataset, the dataset consists of a set of trajectory data with specific multidimensional 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 day - peak hours - straight ahead".

[0052] The use of trajectory labels in multiple dimensions in this embodiment of the invention enhances the accuracy of subsequent meta-learning applications in terms of temporal domain definition and meta-task division.

[0053] In trajectory data, to reflect domain offset, therefore... When a dataset from a source domain is divided into virtual source domain data and virtual target domain data, the partitioning of the virtual target domain data must ensure that the trajectory labels differ from those of the virtual source domain data. That is, the number of trajectory labels in the virtual target domain data is the same as the number of trajectory labels in the virtual source domain data, for example, both are set to five trajectory labels. However, the trajectory label values ​​of the virtual source domain data are different from those of the virtual target domain data. For example, if the time label and weather label values ​​of the virtual source domain data are daytime and sunny respectively, then the time label and weather label values ​​of the virtual target domain data can be planned as nighttime and rainy. This simulates the domain offset problem that the trajectory prediction model may encounter in practical applications, trains the trajectory prediction model to adapt to this domain offset phenomenon, and increases the generalization ability of the trajectory prediction model.

[0054] In step 102, a meta-task is constructed based on the trajectory data and divided into multiple domain offset groups. Each domain offset group has at least two meta-tasks. The training data of the meta-tasks includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing.

[0055] To address the domain offset problem, this invention employs a meta-task-based method to train the trajectory prediction model. Existing meta-learning training strategies randomly select meta-tasks and then train them sequentially. However, this can lead to overfitting of the trajectory prediction model to certain meta-tasks, resulting in performance degradation when faced with novel or disparate meta-tasks. Therefore, this invention utilizes a combined serial and parallel training strategy for the trajectory prediction model training process, which is described below. Figure 2 Let me explain in detail. Figure 2 This is a diagram illustrating the training principle of the trajectory prediction model provided in this embodiment of the invention.

[0056] First, a meta-task is constructed based on the trajectory data, as shown below. Figure 2 As shown, the source domain dataset include , , During the construction of the meta-task, two trajectory data sets are randomly sampled from the three source domain trajectory data sets to construct virtual source domain data and virtual target domain data. For example... Figure 2 The process constructs N meta-tasks, among which meta-task 1 is shown as an example. As virtual source domain data As virtual target domain data), meta-task 2, meta-task 3.

[0057] Based on a training strategy combining serial and parallel processing, the constructed meta-tasks are divided into multiple domain offset groups. Here, according to a preset parallel parameter G, G types of domain offsets are selected, thus dividing N meta-tasks into G domain offset groups. Within each domain offset group, M meta-tasks are allocated according to a preset serial parameter M (i.e., N = G × M), where M is an integer greater than 1. Therefore, each domain offset group is allocated at least two meta-tasks. During training, the training data for each meta-task includes a metatrain (denoted as...)... The virtual source domain data and a meta test (denoted as ) Virtual target domain data, such as Figure 2 Meta-task 1 in the middle will As virtual source domain data, it is used for meta-training. This data serves as a virtual target domain for meta-testing.

[0058] See also Figure 1 In step 103, at 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 to obtain the target loss function for executing the meta-task. 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.

[0059] In this embodiment of the invention, the training process of the trajectory prediction model is performed iteratively according to training rounds. For ease of description, only the training process of any current training round (denoted as e, representing the e-th training round) is described here. In any current training round e, 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-tasks.

[0060] Here, during training, G domain offset groups ( Figure 2 The model demonstrates that G domain offset groups are trained simultaneously, and the trajectory prediction model sequentially executes M meta-tasks assigned to the domain offset groups, continuously updating parameters during the execution of meta-tasks.

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

[0062] Trajectory prediction models have a set of primitive parameters for meta-learning during the meta-learning process, collectively referred to as... This parameter only appears during the meta-learning process. After the domain offset group division and meta-task assignment, the original meta-learning parameters of the trajectory prediction model before executing the meta-tasks can be denoted as... , representing the original meta-learning parameters of the g-th domain offset group before performing the m-th meta-task. Here, for example... Figure 2 As shown, M meta-tasks are assigned in the first domain offset group. The original meta-learning parameters of the trajectory prediction model before executing the meta-tasks are denoted as... In other domain offset groups, it is denoted as During meta-training in the offset group of the domain, virtual source domain data is invoked. Data batch Meta-training is performed on the trajectory prediction model, and based on the meta-training... Preset source domain loss value during the process Update the meta-learning original parameters of the trajectory prediction model Obtain 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):

[0063] (1)

[0064] In the above formula (1), This represents the preset source domain loss value. This represents the learning rate during the meta-training process. Let m represent the m-th meta-task and g represent the g-th domain offset group. This represents the original parameters learned by the meta-learning. This represents the data batch of virtual source domain data during meta-training.

[0065] Next is the meta-test. The process involves meta-testing the meta-learning temporary parameters of the trajectory prediction model using virtual target domain data, thereby obtaining the target domain loss value of the meta-testing process.

[0066] Meta-testing is performed here. At that time, during the training of the trajectory prediction model, meta-learning temporary parameters are obtained. Afterwards, it can be used for virtual target domain data. Data batch Tests were conducted to obtain the predicted target domain data, and then the predicted target domain data and the virtual target domain data were calculated. The difference is used to construct the target domain loss value, denoted as . Therefore, the optimization objective function for performing the meta-task can be initially expressed as the following formula (2):

[0067] (2)

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

[0069] Calculating the final loss of the trajectory prediction model performing the meta-task according to the above formula (2) would result in high computational complexity, large storage requirements, and amplification of data noise and model uncertainty. This is because the calculation process involves meta-training. Heyuan Test Gradient calculation and updating are performed in two stages. To improve the generalization ability of the trajectory prediction model across different scenarios, the parameter update strategy of the trajectory prediction model under the meta-learning framework is managed in a refined manner. Considering that the trajectory prediction model in this invention is based on the transformer model architecture, the meta-training stage of the trajectory prediction model is determined here. Process and meta-test The cross-scene attention alignment loss value of the process is denoted as .

[0070] Because trajectory prediction models based on the transformer architecture contain multi-head self-attention network modules, and the calculation of attention parameters depends on the query vector, key vector, and value vector, this paper proposes a method to dynamically update the cross-scene attention alignment loss value. This is because the spatial interaction and temporal dependency patterns of the target should be universal across various target scenarios. Even though the specific trajectory of the target varies depending on the environment, the response patterns of pedestrians or vehicles to the environment and other pedestrian behaviors are generally similar. Therefore, maintaining the parameters related to the generation of the query vector Q and key vector K unchanged during the meta-training and meta-testing processes provides a foundation for the cross-scene generalization of the trajectory prediction model.

[0071] Firstly, regarding meta-training Each first data sample in the virtual source domain data during the process (e.g., the current trajectory position coordinates) The training query vector obtained when determining the training trajectory prediction model for the first data sample. and training key vectors And determine the mean of the training query vector and the mean of the training key vector.

[0072] The training query vector here is not the original training query vector. Instead, it uses the original training query vector. Kernel functions mapped to the reproducing kernel Hilbert space (RKHS) Training key vectors The same principle applies, so I won't elaborate further.

[0073] Next, regarding meta-testing Each second data sample in the virtual target domain data during the process (e.g., trajectory position coordinates over a future time period) The test query vector obtained when determining the test trajectory prediction model for the second data sample. and test key vector And determine the mean of the test query vector and the mean of the test key vector.

[0074] Similarly, the test query vector here is not the original test query vector. Instead, it uses the original test query vector. Kernel functions mapped to RKHS Test key vector The same principle applies, so I won't elaborate further.

[0075] 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. Next, 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 and second normal forms, and construct the cross-scene attention alignment loss value based on this sum. It is expressed as the following formula (3):

[0076] (3)

[0077] In the above formula (3), This indicates the number of samples in the first data sample within the virtual source domain data. This indicates the number of samples in the second data sample within the virtual target domain data. Representing the computational paradigm, This indicates the number of trajectory moments that the trajectory prediction model needs to predict over a future period of time.

[0078] Finally, based on the source domain loss value Target domain loss value and attention alignment loss value Construct the objective loss function for performing the meta-task, denoted as Here, the target loss function is constructed by combining the two-stage loss of the meta-task and the cross-scene attention alignment loss value. However, the loss should have a focus, so a weighting coefficient is set here. Cross-scene attention alignment loss value The weighted values ​​are then summed with the two-stage loss to obtain the objective loss function for the meta-task. This can be expressed as the following formula (4):

[0079] (4)

[0080] In the above formula (4), Represents the source domain loss value. This indicates the data batches of virtual source domain data during the meta-training process. This represents the original meta-learning parameters of the trajectory prediction model before meta-training. This represents the target domain loss value. This indicates the data batch of the virtual target domain data during the meta-testing process. This represents the meta-learning temporary parameters obtained after the trajectory prediction model is updated following meta-training. Indicates the cross-scene attention alignment loss value The weighting coefficients. This represents the original training query vector obtained from the first data sample in the virtual source domain data during the meta-training process. This represents the original training key vector obtained from the first data sample in the virtual source domain data during the meta-training process. This represents the original test query vector obtained from the second data sample in the virtual target domain data during the meta-testing process. This represents the original test key vector obtained from the second data sample in the virtual target domain data during the meta-testing process.

[0081] In this embodiment of the application, the trajectory prediction model is trained by using a meta-learning framework to overcome the domain offset problem that exists in the trajectory prediction model when performing trajectory prediction. In the meta-learning process, a cross-scene attention alignment loss is constructed to train the trajectory prediction model, thereby improving the generalization ability of the trajectory prediction model in cross-scenes.

[0082] See also Figure 1 In step 104, 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 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.

[0083] After determining the target loss function for the meta-tasks performed by the trajectory prediction model, the domain offset parameters of the trajectory prediction model are updated by gradient propagation within the domain offset groups based on the target loss function. Since there are M meta-tasks assigned within each domain offset group, according to the sequential training strategy, the execution order of the meta-tasks within the domain offset groups is first determined. Because the execution of the M meta-tasks must have a specific order, the trajectory prediction model needs to execute all M meta-tasks sequentially. Therefore, in each domain offset group, the original meta-learning parameters of the trajectory prediction model are updated sequentially using the target loss function according to the task execution order. After the trajectory prediction model completes the last meta-task (i.e., the Mth meta-task) in the domain offset group, the parameters obtained after updating the original meta-learning parameters of the last meta-task (i.e., the Mth meta-task) are used as the domain offset parameters of the domain offset group.

[0084] Specifically, in the domain offset 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 parameters are used as the meta-learning original parameters of the trajectory prediction model when executing the second meta-task. Then, the target loss function is calculated again to continue updating the meta-learning original parameters of the second meta-task, and so on. Until the trajectory prediction model has completed the last meta-task in the domain offset 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 offset parameters of the domain offset group. 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):

[0085] (5)

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

[0087] For example, such as Figure 2 As shown, in the first domain offset group, the original parameters of the trajectory prediction model for meta-learning when performing the first meta-task are... When performing the first meta-task, the temporary meta-learning parameters obtained during meta-training are: Furthermore, a cross-scene attention alignment loss value is constructed. Then construct the target loss function. To update the original parameters of meta-learning The updated parameters are obtained as follows The original parameters for meta-learning are used as the initial parameters for the trajectory prediction model when performing the second meta-task, until the Mth meta-task (i.e., the last meta-task in the first domain offset group). The temporary meta-learning parameters obtained during meta-training are Construct the target loss function To update the original parameters of meta-learning To obtain the updated parameters , which serves as the domain offset parameter for the trajectory prediction model in the first domain offset group.

[0088] According to the parallel training strategy, the G domain offset groups are trained simultaneously. Therefore, when the domain offset parameters of the first domain offset group are obtained, the domain offset parameters of the other domain offset groups are also trained accordingly. Figure 2 As shown, in the Gth domain offset group, the original meta-learning parameters of the trajectory prediction model when performing the first meta-task are... The updated parameters are When executing the last meta-task in the G-th domain offset group (i.e., the M-th meta-task), the original parameters for meta-learning are: The temporary meta-learning parameters obtained during meta-training are Construct the target loss function To update the original parameters of meta-learning To obtain the updated parameters , which serves as the domain offset parameter obtained by training the trajectory prediction model in the Gth domain offset group.

[0089] After the trajectory prediction model completes the final meta-learning process, all G domain offset groups have performed M meta-tasks and been trained to obtain domain offset parameters, denoted as: , … Next, in the current training epoch, the original model parameters of the trajectory prediction model in the current training epoch are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0090] This involves integrating the domain offset parameters of each domain offset group according to the parallel training strategy to update the original model parameters of the trajectory prediction model. , where e represents the current training round number, i.e. the eth 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 parameters and the original model parameters. Then calculate the average value of the offset difference, and weight the average value of the offset difference through the parallel learning rate, and sum the weighted result with the original model parameters as the model update parameters for the next training round (i.e., the e+1th training round). The calculation formula is as follows: Formula (6):

[0091] (6)

[0092] In the above formula (6), This represents the original model parameters of the trajectory prediction model in the current training epoch. Let g represent the parallel learning rate, g represent the g-th domain offset group, and G represent the total number of domain offset groups. This represents the domain offset parameters obtained by the trajectory prediction model after completing m meta-tasks in the g-th domain offset group.

[0093] like Figure 2 As shown, the model update parameters for the next round are obtained through updating. Then, the trajectory update model with updated parameters is tested and verified, that is, the model test function is executed. The verification process involves executing the model test function through the trajectory prediction model. ,get Source domain datasets The trajectory prediction results are compared with the target domain data in the new environment. ( Figure 2 The image shows two target domain datasets. , The differences in predictions are compared, and then the next training epoch (i.e., the difference is used to construct a loss function) is performed. The meta-learning process (in training rounds).

[0094] After updating the original model parameters of the trajectory prediction model in the current training round using the above formula (6), the updated parameters are used as the original model parameters for the next training round to continue the serial-parallel meta-learning training process. This continues until the last training round, at which point the updated model parameters obtained in the last training round are used as the final model parameters, and the trajectory prediction model training is complete. Through the training process of each training round, the trajectory prediction results of the trajectory prediction model are compared with the target domain data in the new environment. ( , The results will become increasingly similar and the differences will become smaller, indicating that the trajectory prediction model's ability to adapt to domain changes is gradually becoming stronger, and the model's generalization performance across scenarios is also gradually improving.

[0095] Once the final model parameters are determined, the trajectory prediction model can be directly used for prediction. It can predict the trajectory of a target in any target scene based on the source domain data, obtaining the target's trajectory data (target domain data) over a future period. For example, the trajectory prediction model can be deployed on an autonomous driving system. The vehicle can predict the pedestrian's movement trajectory on the street two seconds later based on the pedestrian's movement trajectory collected on the street, and then use the movement trajectory to prompt the driver to control the vehicle's speed and direction, assisting the driver in driving safely.

[0096] The trajectory prediction model training method based on meta-learning provided in this invention collects trajectory data from different target scenes and divides it into virtual source domain data and virtual target domain data. Five-dimensional trajectory labels are set in the trajectory data, enhancing the accuracy of temporal definition and meta-task partitioning in the meta-learning method. During training, a meta-learning framework is utilized, employing a combined serial and parallel training strategy. Meta-learning training is performed using virtual source and virtual target domain data from different target scenes to optimize the model's adaptability to domain changes. The combined serial and parallel training strategy improves the model's performance in handling diverse domain offset data. Furthermore, the construction of cross-scene attention alignment loss values ​​during meta-learning training further enhances the model's generalization performance across different scenes.

[0097] The following describes the trajectory prediction model training device based on meta-learning provided by the present invention. The trajectory prediction model training device based on meta-learning described below can be referred to in correspondence with the trajectory prediction model training method based on meta-learning described above.

[0098] See Figure 3 , Figure 3 This is a schematic diagram of the structure of a trajectory prediction model training device based on meta-learning provided by the present invention, as shown below. Figure 3 As shown, this invention provides a trajectory prediction model training device based on meta-learning, specifically including the following modules: an acquisition module 301, a partitioning module 302, an execution module 303, and an update module 304. The acquisition module 301 is used to acquire trajectory data of at least one target scene, the trajectory data including virtual source domain data or virtual target domain data; the partitioning module 302 is used to construct meta-tasks based on the trajectory data and partition them into multiple domain offset groups, wherein each domain offset group has at least two meta-tasks, and the training data of the meta-tasks includes one virtual source domain data for meta-training and one virtual target domain data for meta-testing.

[0099] The execution module 303 is used to, at any current training epoch 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 to obtain the target loss function for executing the meta-tasks. 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 epoch according to the domain offset parameters of each domain offset group to obtain the final model parameters.

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

[0101] Figure 4 This is a schematic diagram of the physical structure of an electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call logic instructions in the memory 430 to execute a meta-learning-based trajectory prediction model training method. This method includes: acquiring 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 based on the trajectory data and dividing it into multiple domain offset groups, wherein each domain offset group is assigned at least two meta-tasks, the training data of the meta-tasks including a virtual source domain data for meta-training and a virtual target domain data for meta-testing; in any current training epoch during the training process, for each domain offset group, based on the training data of the meta-tasks, calling the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group to obtain a target loss function for executing the meta-tasks, 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; performing gradient propagation within the domain offset group based on the target loss function to update the domain offset parameters of the trajectory prediction model, and updating the original model parameters of the trajectory prediction model in the current training epoch based on the domain offset parameters of each domain offset group to obtain the final model parameters.

[0102] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0103] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the trajectory prediction model training method based on meta-learning provided by the above methods. This method includes: acquiring trajectory data of at least one target scene, the trajectory data including virtual source domain data or virtual target domain data; constructing meta-tasks based on the trajectory data and dividing them into multiple domain offset groups, wherein each domain offset group is assigned at least two meta-tasks, and the training data of the meta-tasks includes virtual source domain data for meta-training. The system includes a virtual target domain for meta-testing; in any current training epoch during training, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is invoked to sequentially execute the meta-tasks in the domain offset group to obtain the target loss function for executing the meta-tasks. 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. 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. The original model parameters of the trajectory prediction model in the current training epoch are updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0104] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for training a trajectory prediction model based on meta-learning provided by the methods described above. This method includes: acquiring trajectory data of at least one target scene, the trajectory data including virtual source domain data or virtual target domain data; constructing meta-tasks based on the trajectory data and dividing them into multiple domain offset groups, wherein each domain offset group is assigned at least two meta-tasks, and the training data for the meta-tasks includes virtual source domain data for meta-training and virtual target domain data for meta-testing. Data; In any current training epoch during the training process, for each domain offset group, based on the training data of the meta-task, the trajectory prediction model is invoked to sequentially execute the meta-tasks in the domain offset group to obtain the target loss function for executing the meta-tasks. 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. 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. The original model parameters of the trajectory prediction model in the current training epoch are then updated according to the domain offset parameters of each domain offset group to obtain the final model parameters.

[0105] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0106] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for training a trajectory prediction model based on meta-learning, characterized in that, The training process of the trajectory prediction model is carried out iteratively according to training rounds, and the method includes: The system acquires trajectory data for at least one target scene, including virtual source domain data or virtual target domain data. A trajectory prediction model is used to predict possible future trajectory changes of the target scene based on the trajectory changes of some targets in the current target scene. The trajectory data has five trajectory labels, including a location label, a time label, a weather label, a traffic label, and a trajectory type label to describe the target scene. A meta-task is constructed based on the trajectory data and divided into multiple domain offset groups. Each domain offset group is equipped with at least two meta-tasks. The training data of the meta-tasks 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 execute the meta-tasks in the domain offset group in sequence to obtain the target loss function for executing the meta-tasks. 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. Gradient propagation is performed within the domain offset group based on the target loss function to update the domain offset parameters of the trajectory prediction model. The original model parameters of the trajectory prediction model in the current training round are then updated based on the domain offset parameters of each domain offset group to obtain the final model parameters. The training data based on meta-tasks is used to call the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, resulting in the target loss function for executing the meta-tasks, including: For each meta-task, virtual source domain data is invoked to perform meta-training on the trajectory prediction model, and the original meta-learning parameters of the trajectory prediction model are updated according to the preset source domain loss value during the meta-training process to obtain the meta-learning temporary parameters. Meta-testing of the meta-learning temporary parameters of the trajectory prediction model is performed using virtual target domain data to obtain the target domain loss value of the meta-testing process. Determine the cross-scene attention alignment loss value of the trajectory prediction model during the meta-training process and the meta-testing process; The target loss function for performing the meta-task is constructed based on the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value. Determining the cross-scene attention alignment loss value of the trajectory prediction model during the meta-training and meta-testing processes includes: For each first data sample in the virtual source domain data during the meta-training process, determine the training query vector and training key vector obtained when the first data sample trains the trajectory prediction model, and determine the mean of the training query vector and the mean of the training key vector. For each second data sample in the virtual target domain data during the meta-testing process, determine the test query vector and test key vector obtained when the second data sample tests the trajectory prediction model, and determine the mean of the test query vector and the mean of the test key vector; Determine a first difference between the mean of the training query vector and the mean of the test query vector, and a first normal form of the first difference; and determine a second difference between the mean of the training key vector and the mean of the test key vector, and a second normal form of the second difference. The sum of the first paradigm and the second paradigm is determined, and a cross-scene attention alignment loss function is constructed based on the sum.

2. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that, The number of trajectory labels in the virtual source domain data is the same as the number of trajectory labels in the virtual target domain data, but the trajectory label values ​​in the virtual source domain data are different from those in the virtual target domain data.

3. The trajectory prediction model training method based on meta-learning according to claim 1, characterized in that, The domain offset parameters of the trajectory prediction model are updated by performing gradient propagation within the domain offset group based on the target loss function, including: Determine the task execution order of the trajectory prediction model performing meta-tasks in the domain offset group; According to the task execution order, the original meta-learning parameters of the trajectory prediction model in the domain offset group are updated sequentially through the target loss function. After the trajectory prediction model completes the last meta-task in the domain offset group, the parameters obtained by updating the original meta-learning parameters of the last meta-task will be used as the domain offset parameters of the domain offset group.

4. 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 based on the domain offset parameters of each domain offset group to obtain the final model parameters, including: 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; The average value of the offset difference is weighted by the parallel learning rate, and the weighted result is summed with the original model parameters as the model update parameters for the next training round. The model update parameters obtained in the last training round are used as the final model parameters.

5. A training device for a trajectory prediction model based on meta-learning, characterized in that, The device includes: The acquisition module is used to acquire trajectory data of at least one target scene, the trajectory data including virtual source domain data or virtual target domain data; the trajectory prediction model is used to predict possible future trajectory changes of the target scene based on the trajectory changes of some targets in the current target scene; the trajectory data has five trajectory labels, the five trajectory labels include a location label, a time label, a weather label, a traffic label, and a trajectory type label for describing the target scene; The partitioning module is used to construct meta-tasks based on the trajectory data and divide them into multiple domain offset groups. Each domain offset group has at least two meta-tasks. The training data of the meta-tasks includes a virtual source domain data for meta-training and a virtual target domain data for meta-testing. The execution module is used to, at 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 to obtain the target loss function for executing the meta-tasks. 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 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. The training data based on meta-tasks is used to call the trajectory prediction model to sequentially execute the meta-tasks in the domain offset group, resulting in the target loss function for executing the meta-tasks, including: For each meta-task, virtual source domain data is invoked to perform meta-training on the trajectory prediction model, and the original meta-learning parameters of the trajectory prediction model are updated according to the preset source domain loss value during the meta-training process to obtain the meta-learning temporary parameters. Meta-testing is performed on the meta-learning temporary parameters of the trajectory prediction model using virtual target domain data to obtain the target domain loss value of the meta-testing process. Determine the cross-scene attention alignment loss value of the trajectory prediction model during the meta-training process and the meta-testing process; The target loss function for performing the meta-task is constructed based on the source domain loss value, the target domain loss value, and the cross-scene attention alignment loss value. Determining the cross-scene attention alignment loss value of the trajectory prediction model during the meta-training and meta-testing processes includes: For each first data sample in the virtual source domain data during the meta-training process, determine the training query vector and training key vector obtained when the first data sample trains the trajectory prediction model, and determine the mean of the training query vector and the mean of the training key vector. For each second data sample in the virtual target domain data during the meta-testing process, determine the test query vector and test key vector obtained when the second data sample tests the trajectory prediction model, and determine the mean of the test query vector and the mean of the test key vector; Determine a first difference between the mean of the training query vector and the mean of the test query vector, and a first normal form of the first difference; and determine a second difference between the mean of the training key vector and the mean of the test key vector, and a second normal form of the second difference. The sum of the first paradigm and the second paradigm is determined, and a cross-scene attention alignment loss function is constructed based on the sum.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the training method for the trajectory prediction model based on meta-learning as described in any one of claims 1 to 4.

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

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

Citation Information

Patent Citations

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

    US20190147298A1

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

    WO2023038478A1