A self-supervised pre-training method and system for trajectory prediction

By optimizing the trajectory prediction model through self-supervised pre-training and combining the interaction between the trajectory encoder and the map encoder, the problem of combining kinematic and social compliance objectives in trajectory prediction is solved, thereby improving the model's generalization and prediction accuracy.

CN122862771BActive Publication Date: 2026-11-10WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611275704.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-21
Publication Date
2026-11-10
Estimated Expiration
2046-08-21

AI Technical Summary

Technical Problem

In existing technologies, self-supervised pre-training methods cannot effectively combine kinematic feasibility and social compliance objectives in trajectory prediction tasks, resulting in insufficient model generalization ability, and the heterogeneity of pre-trained representations under different task objectives is difficult to integrate.

Method used

By constructing a trajectory prediction model, self-supervised pre-training is performed using a trajectory encoder, map encoder, and interactor. By combining historical traffic data and road network data, random occlusion, permutation, and interactive encoding are performed to optimize the pre-training loss function and improve the model's ability to understand and integrate trajectory features.

Benefits of technology

It improves the accuracy and reliability of trajectory prediction models, enhances their generalization ability to unknown scenarios, and ensures the physical feasibility and social compliance of predicted trajectories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122862771B_ABST
    Figure CN122862771B_ABST
Patent Text Reader

Abstract

This invention discloses a self-supervised pre-training method and system for trajectory prediction. The method includes: constructing a trajectory prediction model; acquiring historical traffic agent data and road network data and inputting them into the constructed trajectory prediction model; performing random occlusion processing and reconstruction on the historical trajectory data, and training the trajectory encoder; performing random permutation processing and recovery on the road network data, and training the map encoder; using an interactor to perform trajectory-road interaction encoding and recovery, and training the interactor; and using a decoder to perform trajectory prediction calculation based on interaction features, completing the self-supervised pre-training of the trajectory prediction model. By training the trajectory prediction model using a self-supervised model pre-training method, the accuracy of the trajectory, road, and interaction feature encoding outputs of the three encoding structures of the trajectory prediction model is effectively improved, thereby enhancing the accuracy and reliability of the trajectory prediction model for trajectory prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous driving, and in particular to a self-supervised pre-training method and system for trajectory prediction. Background Technology

[0002] Trajectory prediction, a core task of autonomous driving, enables vehicles to anticipate potential collision risks and make informed decisions. Recent research has focused on improving the generalization ability of models across different scenarios, achieving significant progress. Among these efforts, self-supervised pre-training (SSP) has emerged as a promising solution, allowing models to learn representations transferable across different scenarios, thereby enhancing understanding of diverse driving situations and improving generalization ability under unknown conditions.

[0003] However, directly applying self-supervised pre-training to trajectory prediction (a highly task-specific downstream task) is inherently limited. Fundamentally, self-supervised pre-training is primarily designed to learn task-independent representations shared across different tasks. While this design facilitates cross-task generalization, it inevitably reduces the model's focus on predicting specific cues during the learning process. Furthermore, the pre-trained representations act as inductive biases during fine-tuning, guiding the model to preferentially utilize features built up during the pre-training phase. Therefore, when pre-training is performed with a task-independent objective, the model must relearn prediction-related knowledge from scratch during fine-tuning, and pre-training biases inconsistent with the downstream objective further hinder the learning of task-specific patterns, ultimately leading to poor performance.

[0004] This observation highlights the need to shift towards explicitly tailoring pre-training objectives to the specific needs of trajectory prediction. However, such task-oriented approaches remain relatively underdeveloped in trajectory prediction due to the following challenges: First, accurate trajectory prediction must simultaneously satisfy multiple objectives, such as kinematic feasibility and social compliance. These objectives are often highly abstract and semantically ambiguous, making it difficult to formulate suitable pre-training objectives that precisely match them.

[0005] Secondly, different task objectives often involve vastly different pre-training objectives and data modalities, resulting in highly heterogeneous learned representations. Effectively integrating these heterogeneous representations poses another challenge. Summary of the Invention

[0006] To address the limitation that the traditional self-supervised pre-training tasks of trajectory prediction models in existing technologies are out of sync with the needs of autonomous driving trajectory prediction, this invention provides a self-supervised pre-training method and system for trajectory prediction, thereby improving the generalization and prediction performance of trajectory prediction models.

[0007] The technical solution adopted in this invention is: A self-supervised pre-training method for trajectory prediction is provided, the method comprising: A trajectory prediction model is constructed, and historical traffic participation agent data and road network data are acquired. The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder, and an interactor. The historical traffic participation agent data includes the historical trajectory data of the target agent and neighboring agents. Historical trajectory data is randomly occluded according to time and input into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. The trajectory encoder is trained with the goal of minimizing reconstruction loss, and the trained trajectory encoder is used to generate agent trajectory features of historical trajectory data. The road network data is randomly arranged and input into the map encoder of the trajectory prediction model to encode and recover the processed road network data. The map encoder is trained with the goal of minimizing the recovery loss, and the trained map encoder is used to generate map features of the road network data. The trajectory features of the agent are segmented to obtain a mask tensor. The mask tensor and map features are combined, and an interactor is used to encode and recover the trajectory-road interaction. The interactor is trained with the goal of minimizing the interaction objective function, and the trained interactor is used to generate the interaction features of the agent trajectory features and map features. The decoder is used to perform trajectory prediction calculations based on interaction features, generating predicted trajectories and their confidence scores, thus completing the self-supervised pre-training of the trajectory prediction model.

[0008] According to the above scheme, the self-supervised model pre-training uses the sum of the regression loss and classification loss of the decoder for the predicted trajectory of the target agent, and the regression loss for the predicted trajectory of neighboring agents as the overall training objective of the self-supervised pre-training; wherein, the regression loss for the predicted trajectory of the target agent is calculated based on the predicted trajectory of the target agent that is closest to the true value and the true trajectory of the target agent; the regression loss for the predicted trajectory of neighboring agents is calculated based on the predicted trajectory of the neighboring agents that is closest to the true value and the true trajectory of the neighboring agents; and the classification loss for the target agent is calculated based on the probability distribution of the multimodal candidate trajectories of the target agent.

[0009] According to the above scheme, the reconstruction of historical trajectory data specifically utilizes a learnable mask to randomly occlude historical trajectory data segments, and maps the occluded segments into a high-dimensional representation through a trajectory encoder, which is then input into the MPL prediction head. Based on the visible context, the position information and motion attribute information of the occluded segments are reconstructed.

[0010] According to the above scheme, the self-supervised pre-training of the trajectory prediction model also performs motion pattern discrimination based on historical trajectory data, and further trains the trajectory encoder by minimizing the discrimination objective function. Specifically, the trajectory features of each trajectory are output by the trained trajectory encoder, max pooling is applied to the encoded trajectory features to extract the salient motion representation of each sample, and K-means clustering is performed to divide them into different groups. Trajectories within the same group are assigned the same motion pattern label. The discrimination objective function is calculated based on the number of agents, the trajectory representation of each trajectory and its positive samples, and the number of positive samples corresponding to each trajectory. The positive samples corresponding to a trajectory are specifically trajectories with the same motion pattern label as that trajectory.

[0011] According to the above scheme, the road network data is randomly arranged and restored. Specifically, the lane segments of the road network data are randomly arranged at multiple levels. The map features of the shuffled lane segments are encoded by a map encoder to extract the spatial structure and topological dependencies. The encoded lane segments are then restored by a decoder. The map encoder is pre-trained with the goal of minimizing the total restoration loss.

[0012] According to the above scheme, multiple levels include point level and block level; at the point level, the road tensor of the given road network data is randomly arranged and input processing is performed along the point dimension to obtain a shuffled tensor and the corresponding permutation index, which is then encoded by a map encoder; at the block level, the road tensor of the given road network data is randomly arranged and divided into multiple blocks to obtain a block-level representation, and the multiple blocks are randomly arranged along the block dimension and encoded by a map encoder.

[0013] According to the above scheme, trajectory-road interaction modeling specifically involves filtering the historical trajectory data of the target agent and neighboring agents, giving a trajectory tensor based on the filtered historical trajectory data of the target agent and neighboring agents, dividing it into head segment and tail segment along the time dimension, and occluding the tail trajectory of the target agent and the head trajectory of the neighboring agents to obtain a mask tensor. The mask tensor and the road tensor are encoded by an encoder to obtain interaction features, and the occluded part is recovered by a decoder.

[0014] According to the above scheme, the historical trajectory data of the target agent and neighboring agents are screened through an interactive evaluation mechanism. The interactive evaluation mechanism uses a uniform Kalman filter as the motion baseline to predict the trajectory of the historical trajectory data of the target agent and neighboring agents, and calculates the error between the actual trajectory of the target agent and the generated prediction value. When the error is greater than a certain threshold, the historical trajectory data is used as the data sample that passes the screening; otherwise, the sample is filtered.

[0015] According to the above scheme, the self-supervised pre-training of the trajectory prediction model also extracts fragments of historical trajectory data to construct local subgraphs, and uses the trained map encoder to generate local subgraph features, and performs unified embedding projection with the agent trajectory features generated by the trained trajectory encoder, so as to maximize the similarity matrix of the projection to train the trajectory encoder and the map encoder.

[0016] A self-supervised pre-training system for trajectory prediction is also provided, the system comprising: The model building module is used to build a trajectory prediction model and acquire historical traffic-participating agent data and road network data and input them into the constructed trajectory prediction model. The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder and an interactor. The historical traffic-participating agent data includes the historical trajectory data of the target agent and neighboring agents. The trajectory encoder training module is used to randomly occlude historical trajectory data over time and input it into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. The trajectory encoder is trained with the goal of minimizing reconstruction loss, and the trained trajectory encoder is used to generate agent trajectory features of historical trajectory data. The map encoder training module is used to randomly arrange road network data and input it into the map encoder of the trajectory prediction model to encode and recover the processed road network data. The map encoder is trained with the goal of minimizing the recovery loss, and the trained map encoder is used to generate map features of the road network data. The interactor training module is used to segment the trajectory features of the agent to obtain a mask tensor. Combining the mask tensor and map features, the interactor is used to perform trajectory-road interaction encoding and recovery. The interactor is trained with the goal of minimizing the interaction objective function, and the trained interactor is used to generate interaction features of the agent trajectory features and map features. The prediction output module is used to perform trajectory prediction calculations based on interaction features using the decoder, generate predicted trajectories and their confidence scores, and complete the self-supervised pre-training of the trajectory prediction model.

[0017] The beneficial effects of this invention are as follows: This invention trains the trajectory prediction model using a self-supervised model pre-training method. Specifically, by randomly occluding historical trajectory data over time and reconstructing the state attributes of the masked trajectory points, the trajectory encoder learns the state-time dependencies of historical real trajectory data. Furthermore, by randomly arranging and restoring road network data, the map encoder enhances its understanding of road topology, providing strict spatial constraints for predicted trajectories and ensuring their physical feasibility. Combining the trained trajectory encoder and the agent trajectory features and map features generated by the map encoder, an interactor is used for trajectory-road interaction encoding and restoration, enabling the interactor to accurately capture the mutual influence between the agent and the scene. Through the above sequential training, the accuracy of the trajectory, road, and interaction feature encoding outputs of the three encoding structures of the trajectory prediction model is effectively improved, thereby enhancing the accuracy and reliability of the trajectory prediction model for trajectory prediction.

[0018] Furthermore, this invention designs a method for further training the trajectory encoder by discriminating motion patterns. By minimizing the discriminating objective function, the trajectory encoder improves its ability to distinguish trajectory features between different motion patterns, thereby avoiding the problems of fuzzy judgment of the motion patterns exhibited by the model and unrealistic trajectory prediction, and further improving the reliability of trajectory prediction.

[0019] Furthermore, this invention constructs local subgraphs based on fragments of historical trajectory data and inputs them into a map encoder for feature encoding. The encoded results of the trajectory encoder are then mapped to a unified embedding space. This avoids the problem of significant heterogeneity between feature representations learned under different pre-training objectives and data modalities, which leads to integration difficulties. It enhances the synergistic effect between multiple pre-training objectives and promotes the effective integration of features by the interactor.

[0020] Furthermore, in the trajectory-road interaction modeling training, this invention filters samples by calculating the error between historical trajectory data and predicted values. This filters out simple samples that only follow simple kinematic laws and exhibit only limited interactions, reducing their impact on the learning quality of the trajectory prediction model and improving the training efficiency of the model. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the method flow of the self-supervised pre-training method for trajectory prediction according to an embodiment of the present invention; Figure 2 This is an overall architecture diagram of the trajectory prediction model according to an embodiment of the present invention; Figure 3 This is an overall training block diagram of the trajectory prediction model according to an embodiment of the present invention; Figure 4(a) shows the predicted trajectory of the embodiment of the present invention without pre-training the model. Figure 1; Figure 4(b) shows the predicted trajectory of the model during pre-training according to an embodiment of the present invention. Figure 1 ; Figure 5(a) shows the predicted trajectory of the embodiment of the present invention without pre-training the model. Figure 2 ; Figure 5(b) shows the predicted trajectory of the model during pre-training according to an embodiment of the present invention. Figure 2 ; Figure 6 This is a schematic diagram of the system structure of a self-supervised pre-training system for trajectory prediction according to an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0023] To address the disconnect between the pre-training objectives of traditional self-supervised pre-training methods and the requirements of autonomous driving trajectory prediction, this invention provides a self-supervised pre-training method for trajectory prediction, such as... Figure 1 As shown, the method includes: S1. Construct a trajectory prediction model and obtain historical traffic participation agent data and road network data.

[0024] The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder, and an interactor. The historical traffic participation agent data includes the historical trajectory data of the target agent and neighboring agents.

[0025] S2. Perform random occlusion processing on historical trajectory data according to time, and input it into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. Train the trajectory encoder with the goal of minimizing reconstruction loss, and use the trained trajectory encoder to generate agent trajectory features of historical trajectory data.

[0026] S3. Randomly arrange the road network data and input it into the map encoder of the trajectory prediction model to encode and recover the processed road network data. Train the map encoder with the goal of minimizing the recovery loss, and use the trained map encoder to generate map features of the road network data.

[0027] S4. The trajectory features of the agent are segmented to obtain a mask tensor. The mask tensor and map features are combined, and the interaction device is used to encode and recover the trajectory-road interaction. The interaction device is trained with the goal of minimizing the interaction objective function, and the trained interaction device is used to generate the interaction features of the agent trajectory features and map features.

[0028] S5. Utilize the decoder to perform trajectory prediction calculations based on interaction features, generate predicted trajectories and their confidence scores, and complete the self-supervised pre-training of the trajectory prediction model.

[0029] Specifically, such as Figure 2 As shown, the trajectory prediction model in this embodiment adopts a general data-driven trajectory prediction model architecture, which mainly consists of four components: a trajectory encoder, a map encoder, and an interactor for scene encoding, and a decoder for generating multimodal trajectories.

[0030] The trajectory encoder is constructed using a three-layer stacked Transformer, with trajectory tensors... As input, self-attention computation is performed in the time dimension to generate agent features. Where N represents the number of agents, T represents the number of time steps in the historical trajectory, and D represents the feature dimension.

[0031] The map encoder also uses a three-layer stacked Transformer, with road tensors As input, self-attention computation is performed in the spatial dimension to generate map features. , where L represents the number of lane segments included, and P represents the number of road points sampled for each lane segment.

[0032] The aggregator is a one-dimensional convolutional layer used to aggregate agent features and map features in the temporal and spatial dimensions, respectively, to obtain aggregated features. and .

[0033] The interactor consists of a three-layer stacked Transformer, based on scene features. As input, self-attention is performed on the factor dimension to facilitate feature interactions between dynamic and static elements, generating interactive features. .

[0034] The decoder mainly consists of a two-layer stacked Transformer, whose input is the interactive features. and a set of learnable query vectors (Where M represents the number of modalities). After cross-attention calculation, the trajectory features of the target agent are output. Subsequently, two multilayer perceptrons (MLPs) are used to map the trajectory features to the physical space, generating M predicted trajectories and their corresponding confidence scores.

[0035] The trajectory prediction model uses the sum of the regression loss and classification loss of the target agent's predicted trajectory, and the regression loss of the predicted trajectories of neighboring agents as the overall training objective, which can be expressed as:

[0036]

[0037]

[0038]

[0039] in, and These represent the predicted trajectories that are closest to the true values. Represents the actual trajectory of the intelligent agent. This represents the probability distribution of the multimodal candidate trajectories of the target agent.

[0040] Specifically, based on the overall training objective, this embodiment provides a self-supervised model pre-training method to train specific architectures of the model separately, thereby improving the transferability of pre-trained knowledge to downstream prediction tasks. The overall training flowchart of this embodiment is as follows: Figure 3 As shown.

[0041] Specifically, the prediction task requires the generated trajectory to strictly satisfy kinematic constraints to ensure physical feasibility. Therefore, a trajectory encoder is needed to accurately capture the agent's kinematic patterns. To this end, this embodiment proposes a masked trajectory modeling task based on historical trajectory data reconstruction. It reconstructs randomly masked trajectory segments based on the visible context, encouraging the model to learn the temporal evolution between trajectory points, thereby capturing the agent's potential motion patterns.

[0042] Specifically, this embodiment utilizes a learnable mask to randomly occlude historical trajectory data segments, intentionally disrupting their temporal continuity, and inputs this mask into a trajectory prediction model. Then, the occluded trajectory data segments are mapped into a high-dimensional representation by a trajectory encoder and input into a two-layer MLP prediction head to reconstruct the masked segments from the visible context. Preferably, the historical trajectory data in this embodiment includes the state attributes of each trajectory point, including its corresponding position, current heading, and speed. Unlike existing methods that only reconstruct position information, this embodiment also recovers this set of motion-related state attributes from the context, encouraging the model to focus on motion-related information and thus training the trajectory encoder. The pre-training objective is defined as the mean square error between the reconstructed trajectory points and the original trajectory points, which can be expressed as:

[0043] in, This indicates the number of points that are masked. and These represent the original point and the reconstructed point, respectively.

[0044] Meanwhile, specifically, in complex scenarios, an agent may exhibit multiple reasonable motion patterns, such as going straight or turning right at an intersection. If these patterns are not clearly distinguished, pattern ambiguity may occur, causing the predicted trajectory to collapse towards its average value under multimodal future conditions, resulting in unrealistic trajectories. Therefore, this embodiment proposes a motion pattern discrimination task based on contrastive learning to bring trajectory features belonging to the same motion pattern closer together while distancing features from different patterns, thereby effectively decoupling the representation of specific patterns and alleviating pattern ambiguity. To obtain motion pattern labels, this embodiment utilizes a trajectory encoder pre-trained through a masked trajectory modeling task to effectively capture the motion dynamics of each trajectory, thereby automatically generating pseudo-labels.

[0045] Specifically, the trained trajectory encoder outputs the trajectory features of each encoded trajectory, and max pooling is applied to the encoded trajectory features to extract the salient motion representation of each sample. Then, K-means clustering is performed to divide them into different groups, with trajectories within the same group assigned the same mode label. Preferably, in this embodiment, the number of clusters is set to 6, corresponding to representative motion modes: constant speed, acceleration, deceleration, turning (left / right), U-turn, and lane change. After assigning pseudo-labels, trajectories sharing the same label are considered positive samples, and those with different labels are considered negative samples. Given a trajectory representation... By optimizing the discriminative objective function to increase its similarity to positive samples and decrease its similarity to negative samples, the model is encouraged to learn representations with pattern discrimination capabilities. This pre-trained discriminative objective function can be expressed as:

[0046] in, This refers to the number of agents in each batch. and These are the trajectories and their corresponding positive samples. It is a randomly selected trajectory. It is a trajectory The number of positive samples, It is the trajectory feature of the encoding. It is a temperature parameter.

[0047] Furthermore, specifically, the predicted trajectories output by the trajectory prediction model must strictly adhere to the road topology to ensure they remain within the feasible region. To this end, this embodiment proposes a road jigsaw puzzle task, which randomly arranges lane segments at multiple granularities and requires the model to reconstruct the original configuration. By restoring the correct spatial arrangement, the map encoder is encouraged to learn the potential topological dependencies of the road network, including lane orientation, connectivity, and spatial continuity.

[0048] Specifically, this embodiment performs shuffling operations at both the point and block levels and inputs them into the trajectory prediction model to capture fine-grained and coarse-grained structural information respectively, thereby enabling the training of the map encoder: at the point level, given the road tensor... The input is randomly arranged along the point dimension to disrupt the original lane connectivity, generating a shuffled tensor. and the corresponding permutation index A two-layer MLP decoder is applied to the shuffled features to predict the original order of the points, resulting in... At the block level, given the same road tensor Divide it into multiple blocks to produce a shape of The block-level representation is used, and a shuffled and predictive procedure is applied along the block dimension to facilitate the learning of the coarse-grained topology of the road network. This pre-training aims to minimize the total recovery loss and can be represented as:

[0049]

[0050]

[0051] in, To recover losses at the point level, To recover the loss at the block level, To recover the total losses.

[0052] Furthermore, an agent's motion is not only controlled by its inherent kinematic constraints but also influenced by its interactions with the surrounding environment. Therefore, trajectory prediction models need to effectively capture the interaction effects between agent motion and environmental dynamics to avoid generating predictions that lead to collisions or violate socially rational behavior. However, interaction information is high-dimensional and abstract, making it difficult to design suitable pre-training tasks to accurately capture such information. Existing work often simplifies the modeling of interaction information and designs pre-training tasks accordingly, such as describing interactions through relative lane configurations between agents or using proximity metrics and frequency of occurrence to characterize interaction type and intensity; this simplification inevitably leads to a significant loss of interaction semantics. Recognizing that agent behavior and its surrounding environment exhibit a mutually conditional dependency (i.e., while the environment constrains agent behavior, the agent's motion also reshapes the dynamics of nearby agents), this embodiment proposes a trajectory-road masked interaction modeling task (MIM), a conditional generation strategy for interaction modeling that departs from the traditional simplification paradigm. By jointly generating target trajectories under the conditions of the environmental context and modeling the induced responses of surrounding agents, MIM captures the inherent coupling between agent behavior and environmental dynamics. Furthermore, MIM is a regression-based generative paradigm that strictly follows temporal causality, thereby further enhancing the consistency between the pre-training stage and the downstream prediction task.

[0053] Specifically, a trajectory tensor is given based on the historical trajectory data of the target agent and neighboring agents. Divided into head segments along the time dimension and tail section ,in and It also occludes the tail trajectory of the target agent and the head trajectory of adjacent agents, generating a mask tensor. Subsequently, the mask tensor is processed by the encoder. and map Encode to obtain interaction features Finally, the interactive features of intelligent agents The masked portion is recovered using a two-layer MLP decoder. The training objective is to minimize the interaction objective function, which can be represented as: , in, and These are the original point and the reconstructed point, respectively. In this way, the trajectory prediction model reconstructs the tail trajectory segment of the target agent based on the tail segments of surrounding agents and the road topology, thereby learning how external factors affect the movement of the target agent; while by reconstructing the head segments of neighboring agents from the head segments of the target agent, the model can capture their passive responses to the behavior of the target agent.

[0054] Furthermore, preferably, driving datasets typically exhibit a long-tailed distribution, where trajectories follow simple kinematic laws and exhibit only limited interactions in most scenarios. Pre-training models on such datasets may dilute the learning signal, introduce noise, and limit the quality of the learned representation. This embodiment proposes an interaction evaluation mechanism to select high-interaction scenarios for pre-training. Specifically, this embodiment uses a uniform kalman filter (CV-KF) as the motion baseline to predict the trajectory. If the error between the target agent's actual trajectory and the predicted value generated by the CV-KF exceeds a predetermined threshold, it indicates that the trajectory is largely dominated by environmental interactions rather than simple inertial motion; such high-interaction scenarios are then prioritized for the MIM task, while simple samples following linear motion patterns are filtered out.

[0055] Finally, since different modules are pre-trained using heterogeneous targets and modalities, the learned representations often exhibit significant differences. This problem is particularly pronounced between trajectory encoders that focus on temporal dynamics and map encoders that capture spatial topology. These differences cannot be fully addressed with limited fine-tuning budgets, thus limiting the efficiency of feature fusion and leading to performance degradation in downstream tasks. Therefore, to address the significant heterogeneity between representations learned under different pre-training targets and data modalities, which makes integration extremely challenging, this embodiment proposes a cross-modal alignment (CMA) task. This task performs a unified spatial mapping on the diverse pre-training target representations to obtain an overall training result, reducing the differences between heterogeneous representations, thereby alleviating representation conflicts and promoting effective feature integration.

[0056] Specifically, based on the prior knowledge that the agent's trajectory closely fits the road geometry, an inherent semantic alignment exists between the trajectory mode and the map mode. Therefore, for the historical trajectory of each target agent, this embodiment constructs a local subgraph by extracting K lane segments near key path points. Subsequently, the pre-trained trajectory encoder and map encoder project B "trajectory-submap" pairs into a latent representation space, generating a representation of shape [B,2,D]. Finally, a discriminative objective function is used to maximize the similarity of positive sample pairs while suppressing the similarity of mismatched sample pairs (non-matching pairs), thereby projecting heterogeneous features into a unified embedding space.

[0057] Specifically, the trajectory prediction model is trained using the method described in this embodiment, and the comparison of the training results is shown in Figures 4(a) and 4(b), and Figures 5(a) and 5(b). Figures 4(a) and 5(a) represent the predicted trajectory without pre-training the model using the method described in this embodiment, and Figures 4(b) and 5(b) represent the predicted trajectory after pre-training the model using the method described in this embodiment. In these figures, green trajectories represent predicted trajectories, blue trajectories represent historical trajectories, and red trajectories represent true trajectories.

[0058] Furthermore, this embodiment of the invention also provides a self-supervised pre-training system for trajectory prediction, used to implement the self-supervised pre-training method for trajectory prediction described in this embodiment, such as... Figure 6 As shown, the system includes: The model building module is used to build a trajectory prediction model and acquire historical traffic-participating agent data and road network data and input them into the constructed trajectory prediction model. The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder and an interactor. The historical traffic-participating agent data includes the historical trajectory data of the target agent and neighboring agents. The trajectory encoder training module is used to randomly occlude historical trajectory data over time and input it into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. The trajectory encoder is trained with the goal of minimizing reconstruction loss, and the trained trajectory encoder is used to generate agent trajectory features of historical trajectory data. The map encoder training module is used to randomly arrange road network data and input it into the map encoder of the trajectory prediction model to encode and recover the processed road network data. The map encoder is trained with the goal of minimizing the recovery loss, and the trained map encoder is used to generate map features of the road network data. The interactor training module is used to segment the trajectory features of the agent to obtain a mask tensor. Combining the mask tensor and map features, the interactor is used to perform trajectory-road interaction encoding and recovery. The interactor is trained with the goal of minimizing the interaction objective function, and the trained interactor is used to generate interaction features of the agent trajectory features and map features. The prediction output module is used to perform trajectory prediction calculations based on interaction features using the decoder, generate predicted trajectories and their confidence scores, and complete the self-supervised pre-training of the trajectory prediction model.

[0059] The various modules or mechanisms of the system are mainly used to implement the various steps of the above method embodiments, and will not be described in detail here.

[0060] In summary, the self-supervised pre-training method and system for trajectory prediction proposed in this embodiment achieves the following technical effects: A prediction-oriented pre-training framework (POP) is proposed, which tailors the pre-training design to the specific target of trajectory prediction, thereby narrowing the gap between pre-training and prediction target caused by the task-independent nature of traditional self-supervised pre-training. Ultimately, this achieves performance improvement and significantly enhances the model's generalization ability to unknown scenarios. This invention introduces Masked Trajectory Modeling (MTM) based on historical data reconstruction. By reconstructing the masked trajectory points, it models state-time dependencies, thereby learning the inherent kinematic laws to ensure the physical feasibility of the predicted trajectory. Furthermore, addressing the problem of pattern ambiguity in multimodal prediction leading to trajectory collapse towards unrealistic averages, this invention proposes Motion Pattern Discrimination (MPD). By enhancing the consistency of trajectory features within the same motion pattern and reducing the similarity between trajectory features of different motion patterns, it strengthens the ability to discriminate diverse motion patterns, ensuring the physical feasibility of the predicted trajectory. The Road Puzzle (RJP) task is proposed. By restoring the correct order of scrambled lane segments, the model's understanding of topological clues such as lane direction and connectivity is enhanced, enabling the model to effectively capture the structure of the road network, thereby providing spatial constraints for trajectory prediction and ensuring that the predicted trajectory always remains within the feasible area. Interaction modeling is formulated as a conditional generation problem, and Masked Interaction Modeling (MIM) is proposed. By recovering the masked agent information under the conditions of the scene context (and vice versa), this mechanism enables the learning of complex interaction dependencies, allowing the model to capture the bidirectional interaction effects between the agent and the scene, so as to ensure that predictions conform to social norms are made. To address the significant heterogeneity among representations learned under different pre-training objectives and data modalities, which leads to integration difficulties, a cross-modal alignment task (CMA) is proposed. This task maps diverse feature representations to a unified embedding space, mitigating the differences between different representations and thereby enhancing the synergy among multiple pre-training objectives, thus promoting the effective integration of diverse features.

[0061] It should be noted that, depending on the implementation needs, the various steps / components described in this application can be broken down into more steps / components, or two or more steps / components or parts of the operation of steps / components can be combined into new steps / components to achieve the purpose of this invention.

[0062] The order of the steps in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0063] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A self-supervised pre-training method for trajectory prediction, characterized in that, The method includes: A trajectory prediction model is constructed, and historical traffic participation agent data and road network data are acquired. The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder, and an interactor. The historical traffic participation agent data includes the historical trajectory data of the target agent and neighboring agents. Historical trajectory data is randomly occluded according to time and input into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. The trajectory encoder is trained with the goal of minimizing reconstruction loss, and the trained trajectory encoder is used to generate agent trajectory features of historical trajectory data. The road network data is randomly permuted and input into a map encoder of a trajectory prediction model to encode the processed road network data. A decoder then reconstructs the road network data, aiming to minimize the reconstruction loss. The map encoder is trained to generate map features of the road network data. Specifically, road network data reconstruction involves randomly permuting lane segments of the road network data at multiple levels, extracting the spatial structure and topological dependencies of the shuffled lane segments, encoding the map features of the lane segments, and using a decoder to predict the original permutation order of the road network data to reconstruct the encoded lane segments. These multiple levels include point-level and block-level. Point-level random permutation involves taking a road tensor from the road network data and randomly permuting it along the point dimension to obtain a shuffled tensor and corresponding permutation index, which is then encoded by the map encoder. Block-level random permutation involves taking a road tensor from the road network data, dividing it into multiple blocks to obtain a block-level representation, randomly permuting these blocks along the block dimension, and then encoding them by the map encoder. The historical trajectory data of the target agent and neighboring agents are filtered, and the filtered historical trajectory data is segmented and occluded to obtain a mask tensor. The mask tensor and map features are combined, and the trajectory-road interaction is encoded using an interactor. The occluded parts are restored by a decoder. The interactor is trained with the goal of minimizing the interaction objective function, and the trained interactor is used to generate interaction features of agent trajectory features and map features. After training is completed, the decoder is used to perform trajectory prediction calculations based on interaction features, generating predicted trajectories and their confidence scores.

2. The self-supervised pre-training method for trajectory prediction according to claim 1, characterized in that, The self-supervised model pre-training uses the sum of the regression loss and classification loss of the decoder for the predicted trajectory of the target agent, and the regression loss for the predicted trajectory of neighboring agents as the overall training objective of self-supervised pre-training. Specifically, the regression loss for the predicted trajectory of the target agent is calculated based on the predicted trajectory of the target agent that is closest to the true value and the true trajectory of the target agent; the regression loss for the predicted trajectory of neighboring agents is calculated based on the predicted trajectory of the neighboring agents that is closest to the true value and the true trajectory of the neighboring agents; and the classification loss for the target agent is calculated based on the probability distribution of the multimodal candidate trajectories of the target agent.

3. The self-supervised pre-training method for trajectory prediction according to claim 1, characterized in that, The reconstruction of historical trajectory data specifically utilizes learnable masks to randomly occlude segments of historical trajectory data. The occluded segments are then mapped into a high-dimensional representation by a trajectory encoder and input into the MLP prediction head. Based on the visible context, the position and motion attribute information of the occluded segments are reconstructed.

4. The self-supervised pre-training method for trajectory prediction according to claim 1, characterized in that, The self-supervised pre-training of the trajectory prediction model also performs motion pattern discrimination based on historical trajectory data, and further trains the trajectory encoder by minimizing the discrimination objective function. Specifically, the trajectory encoder outputs the trajectory features of each encoded trajectory, max pooling is applied to the encoded trajectory features to extract the salient motion representation of each sample, and K-means clustering is performed to divide them into different groups. Trajectories within the same group are assigned the same motion pattern label. The discrimination objective function is calculated based on the number of agents, the trajectory representation of each trajectory and its positive samples, and the number of positive samples corresponding to each trajectory. The positive samples corresponding to a trajectory are specifically trajectories with the same motion pattern label as that trajectory.

5. The self-supervised pre-training method for trajectory prediction according to claim 1, characterized in that, The mask tensor is specifically given a trajectory tensor based on the historical trajectory data of the target agent and neighboring agents after filtering. It is divided into head segment and tail segment along the time dimension, and the tail trajectory of the target agent and the head trajectory of the neighboring agents are masked to obtain the mask tensor.

6. The self-supervised pre-training method for trajectory prediction according to claim 5, characterized in that, The historical trajectory data of the target agent and neighboring agents are filtered through an interactive evaluation mechanism. The interactive evaluation mechanism uses a uniform Kalman filter as the motion baseline to predict the trajectory of the historical trajectory data of the target agent and neighboring agents, and calculates the error between the actual trajectory of the target agent and the generated predicted value. When the error is greater than a certain threshold, the historical trajectory data is used as the data sample that passes the screening; otherwise, the sample is filtered.

7. The self-supervised pre-training method for trajectory prediction according to claim 1, characterized in that, The self-supervised pre-training of the trajectory prediction model also extracts fragments of historical trajectory data to construct local subgraphs, and uses the trained map encoder to generate local subgraph features. These features are then uniformly embedded and projected with the agent trajectory features generated by the trained trajectory encoder to maximize the similarity matrix of the projections for training the trajectory encoder and map encoder.

8. A self-supervised pre-training system for trajectory prediction, characterized in that, The system includes: The model building module is used to build a trajectory prediction model and acquire historical traffic-participating agent data and road network data and input them into the constructed trajectory prediction model. The trajectory prediction model includes an encoder and a decoder. The encoder includes a trajectory encoder, a map encoder and an interactor. The historical traffic-participating agent data includes the historical trajectory data of the target agent and neighboring agents. The trajectory encoder training module is used to randomly occlude historical trajectory data over time and input it into the trajectory encoder of the trajectory prediction model to reconstruct trajectory state attributes. The trajectory encoder is trained with the goal of minimizing reconstruction loss, and the trained trajectory encoder is used to generate agent trajectory features of historical trajectory data. The map encoder training module is used to randomly permutate road network data and input it into the map encoder of the trajectory prediction model to encode the processed road network data. The decoder then performs road network data recovery, aiming to minimize recovery loss. The trained map encoder is used to generate map features of the road network data. Specifically, road network data recovery involves randomly permuting lane segments of the road network data at multiple levels, extracting the spatial structure and topological dependencies of the shuffled lane segments, encoding the map features of the lane segments, and using the decoder to predict the original permutation order of the road network data to recover the encoded lane segments. These multiple levels include point level and block level. Point-level random permutation involves taking a given road tensor of the road network data and randomly permuting it along the point dimension to obtain a shuffled tensor and corresponding permutation index, which is then encoded by the map encoder. Block-level random permutation involves taking a given road tensor of the road network data, dividing it into multiple blocks to obtain a block-level representation, randomly permuting these blocks along the block dimension, and then encoding them by the map encoder. The interaction training module is used to filter the historical trajectory data of the target agent and neighboring agents, and to segment and occlude the filtered historical trajectory data to obtain a mask tensor. Combining the mask tensor and map features, the interaction module is used to perform trajectory-road interaction encoding, and the decoder is used to restore the occluded parts. The interaction module is trained with the goal of minimizing the interaction objective function, and the trained interaction module is used to generate interaction features of agent trajectory features and map features. The prediction output module is used to perform trajectory prediction calculations based on interaction features using the decoder after training, and to generate the predicted trajectory and its confidence score.

Citation Information

Patent Citations

  • Neural network architecture training method for traffic participant motion prediction

    CN118036664A

  • Multi-target tracking method based on long and short term trajectory association

    CN120747166A