A lightweight trajectory prediction method and system for autonomous driving
By designing a single-agent trajectory encoding and multi-agent interaction module, and utilizing the decoupling method of spatial and temporal features, the problem of reliance on high-precision maps is solved, enabling efficient and accurate trajectory prediction in autonomous driving and improving the applicability and accuracy of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-03-10
AI Technical Summary
Existing trajectory prediction methods based on high-precision maps are costly to collect and maintain, have limited coverage, and are difficult to achieve accurate trajectory prediction in areas lacking high-precision maps, thus affecting the commercialization of autonomous driving.
By employing a single-agent trajectory encoding module and a multi-agent interaction module, and extracting features through a spatial encoder and a temporal encoder, combined with a cross-attention mechanism and a bidirectional dynamic modeling module of SGNN and Mamba, the accuracy of trajectory prediction is improved, avoiding dependence on high-precision maps.
In the absence of high-precision maps, efficient and accurate trajectory prediction was achieved, improving the generalization ability and robustness of the trajectory prediction model and reducing the dependence on map information.
Smart Images

Figure CN121019624B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of autonomous driving technology, and specifically relates to a lightweight trajectory prediction method and system for autonomous driving. Background Technology
[0002] Trajectory prediction is one of the core technologies in autonomous driving systems. Its core task is to accurately predict the trajectory of surrounding road users, such as vehicles, pedestrians, and non-motorized vehicles, within the next 3-5 seconds by analyzing their historical movement states. This capability directly affects the decision-making and planning quality and driving safety of autonomous vehicles. In real-world road environments, the behavior of road users is often highly uncertain and interactive, making trajectory prediction one of the most challenging aspects of the autonomous driving technology stack.
[0003] In the field of autonomous driving, publicly available solutions generally employ prediction methods based on high-precision maps. These methods, by integrating the rich semantic information (such as lane topology and traffic rules) provided by high-precision maps, can indeed achieve relatively accurate trajectory prediction. However, these methods have three significant limitations: First, the acquisition and maintenance of high-precision maps are costly and have limited coverage; second, map information may not be updated in a timely manner in construction areas or in the event of sudden accidents; and third, a large number of areas globally still lack high-precision map data support. These limitations make map-based methods difficult to meet the needs of large-scale commercial deployment of autonomous driving. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention proposes a lightweight trajectory prediction method and system for autonomous driving. It consists of a single-agent trajectory encoding module and a multi-agent interaction module, enabling accurate trajectory prediction during autonomous driving without using map information.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] A lightweight trajectory prediction method for autonomous driving includes the following steps:
[0007] Obtain the historical trajectory coordinates of multiple intelligent agents in the target scene, and perform coordinate system normalization processing with the position of the target intelligent agent at the end of the historical time window as the anchor point, converting the absolute coordinates into relative displacement with the anchor point as the origin.
[0008] The relative displacement is input to a parallel spatial encoder and a time encoder to extract the spatial and temporal features of each agent.
[0009] The spatial and temporal features are used to capture the spatial interaction relationships between different agents at the same time through spatial interaction; the spatial and temporal features are used to capture the temporal interaction relationships between agents at different time steps through temporal interaction; and the spatial and temporal interaction relationships are fused using a cross-attention mechanism to output the fused interaction features.
[0010] The fused interaction features are decoded by a decoder to generate multiple predicted trajectories for each agent at future time points and their corresponding probability distributions.
[0011] This invention also proposes a lightweight trajectory prediction system for autonomous driving, including a preprocessing module, a feature extraction module, a fusion module, and a prediction module;
[0012] The preprocessing module is used to obtain the historical trajectory coordinates of multiple agents in the target scene, and to perform coordinate system normalization processing with the position of the target agent at the end of the historical time window as the anchor point, converting the absolute coordinates into relative displacement with the anchor point as the origin.
[0013] The feature extraction module is used to input the relative displacement to the parallel spatial encoder and temporal encoder respectively, and extract the spatial features and temporal features of each agent respectively;
[0014] The fusion module is used to capture the spatial interaction relationship between different agents at the same time through spatial interaction of the spatial features and temporal features; capture the temporal interaction relationship between agents at different time steps through temporal interaction of the spatial features and temporal features; and use a cross-attention mechanism to fuse the spatial interaction relationship and temporal interaction relationship, and output the fused interaction feature.
[0015] The prediction module is used to decode the fused interaction features using a decoder to generate multiple predicted trajectories for each agent at future moments and their corresponding probability distributions.
[0016] The effects described in the invention are merely those of the embodiments, and not all the effects of the invention. One of the above technical solutions has the following advantages or beneficial effects:
[0017] This invention proposes a lightweight trajectory prediction method and system for autonomous driving, belonging to the field of autonomous driving technology. The method includes the following steps: acquiring the historical trajectory coordinates of multiple agents in a target scene; performing coordinate system normalization processing using the position of the target agent at the end of the historical time window as the anchor point, converting absolute coordinates into relative displacements with the anchor point as the origin; inputting the relative displacements into parallel spatial encoders and temporal encoders to extract spatial and temporal features of each agent; capturing the spatial interaction relationships between different agents at the same time through spatial interaction; capturing the temporal interaction relationships between agents at different time steps through temporal interaction; fusing the spatial and temporal interaction relationships using a cross-attention mechanism to output fused interaction features; and decoding the fused interaction features to generate multiple predicted trajectories for each agent at future times and their corresponding probability distributions. Based on this method, a lightweight trajectory prediction system for autonomous driving is also proposed. This invention consists of a single-agent trajectory encoding module and a multi-agent interaction module, enabling accurate trajectory prediction during autonomous driving without using map information. Attached Figure Description
[0018] Figure 1 This is a network architecture for a lightweight trajectory prediction method for autonomous driving proposed in Embodiment 1 of the present invention;
[0019] Figure 2 This is a flowchart of a lightweight trajectory prediction method for autonomous driving proposed in Embodiment 1 of the present invention;
[0020] Figure 3 This is an architecture diagram of the single-agent trajectory encoding module proposed in Embodiment 1 of the present invention;
[0021] Figure 4 This is an architecture diagram of the multi-agent interaction module proposed in Embodiment 1 of the present invention;
[0022] Figure 5 This is a schematic diagram of a lightweight trajectory prediction system for autonomous driving proposed in Embodiment 2 of the present invention. Detailed Implementation
[0023] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure of the invention, components and arrangements of specific examples are described below. Furthermore, reference numerals and / or letters may be repeated in different examples. This repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. It should be noted that the components illustrated in the drawings are not necessarily drawn to scale. Descriptions of well-known components, processing techniques, and processes are omitted in this invention to avoid unnecessarily limiting the invention.
[0024] Example 1
[0025] The present invention, in embodiment 1, proposes a lightweight trajectory prediction method for autonomous driving, which addresses the technical problems in the prior art of ensuring the accuracy and generalization ability of the trajectory prediction model when autonomous driving lacks high-precision map guidance; and how to make full use of historical trajectory information to achieve efficient trajectory prediction with few parameters in complex multi-agent interaction scenarios.
[0026] This invention presents a trajectory prediction framework that decouples time and space, as well as single-agent and multi-agent approaches. This framework enables the model to learn and understand surrounding vehicle information more fully and comprehensively in autonomous driving scenarios where map information is lacking, thus compensating for the impact of the lack of map information on the trajectory prediction model.
[0027] Figure 1 This is a network architecture for a lightweight trajectory prediction method for autonomous driving proposed in Embodiment 1 of the present invention. The architecture aims to efficiently extract and interact features between single agents and multiple agents without relying on high-precision maps, and accurately complete trajectory prediction.
[0028] based on Figure 1 The given network architecture, Figure 2 A flowchart of a lightweight trajectory prediction method for autonomous driving proposed in Embodiment 1 of the present invention is provided;
[0029] In step S200, the historical trajectory coordinates of multiple intelligent agents in the target scene are obtained, and the coordinate system is normalized using the position of the target intelligent agent at the end of the historical time window as the anchor point, converting the absolute coordinates into relative displacement with the anchor point as the origin.
[0030] The coordinate system normalization process includes: calculating the direction vector of the last segment of the target agent's historical trajectory, and aligning the historical trajectories of all agents in the scene with the direction vector through rotation to achieve rotation invariance normalization of the trajectory data.
[0031] The trajectory coordinates are vectorized, and displacement rather than two-dimensional coordinates are used as input; the position of the target agent at the end of the historical time window is set as the anchor point, and its last trajectory segment... Used as a reference vector for a local region. All local vectors are rotated relative to the direction of the reference vector. Alignment is used to achieve normalization. This method abandons absolute positions and instead uses relative positions to construct representations, thereby reducing the differences between different scenes:
[0032] ;
[0033] in Focusing only on agents observable at t=0, for historical time windows Vehicles not detected within the area will be processed via... The markers are processed;
[0034] In the formula above, For the index of the intelligent agent; For time step index; For intelligent agents At time step The displacement vector; For intelligent agents At time step absolute coordinates; For intelligent agents At time step The displacement vector; Used to instruct intelligent agents At time step Whether it was successfully observed, =1 indicates that the agent exists and the data is valid at this time step; =0 indicates that the agent was not detected at this time; For each intelligent agent At each time step Its final eigenvector is composed of the displacement vector. and Existence Mask A new vector formed by concatenation; This is the set of trajectory representations after normalization.
[0035] In step S210, the relative displacement is input to the parallel spatial encoder and temporal encoder respectively to extract the spatial features and temporal features of each agent. Figure 3 This is an architecture diagram of the single-agent trajectory encoding module proposed in Embodiment 1 of the present invention;
[0036] In this application, through a spatial encoder and a temporal encoder, this module captures the trajectory features of each agent in both spatial and temporal dimensions. The spatial component is used to extract the positional attributes of a single agent at a specific observation time step, while the temporal component focuses on understanding its dynamic evolution over historical time periods. This module takes input state information... After processing, it is input into a multilayer perceptron (MLP), which encodes the spatial and temporal dimensions respectively.
[0037] Each dimension is processed through an independent multi-head attention layer, focusing on explicit spatial features to learn which agents should be prioritized. Specifically, spatial features... The spatial encoder employs an attention mechanism to extract spatial features from each agent. Each attention head... Defined as:
[0038] ;
[0039] In the formula, Spatial features; for The query matrix of a linear mapping; for The key matrix of a linear mapping; for The value matrix of a linear mapping; This is the scaling factor;
[0040] The outputs of all attention points are concatenated and linearly transformed to generate the final spatial features. for:
[0041]
[0042] In the formula, For the number of heads; This is the first weight matrix; This is the first bias.
[0043] To efficiently capture temporal dependencies, we employ a Linformer-based temporal coding module. This method utilizes low-rank projections as an approximate attention mechanism, significantly reducing computational complexity while maintaining expressive power. Spatial coding focuses on modeling relationships between fixed sets of agents, while temporal coding prioritizes handling the dynamic characteristics of sequences. This difference makes Linformer an ideal choice for balancing performance and efficiency in temporal coding tasks.
[0044] The temporal encoder uses a Linformer-based temporal coding module to learn the temporal relationships between agent states at different time steps, with each attention head... Defined as:
[0045] ;
[0046] In the formula, It is a time-series feature; for The query matrix of a linear mapping; for The key matrix of a linear mapping; for The value matrix of a linear mapping; This is the first low-rank projection matrix that can be learned; It is a learnable second low-rank projection matrix;
[0047] The outputs of all attention points are concatenated and linearly transformed to generate the final time feature. :
[0048] ;
[0049] In the formula, This is the second weight matrix; This is the second bias.
[0050] Finally, the encoded temporal and spatial features of the single agent are fused together.
[0051] .
[0052] In step S220, the spatial features and temporal features are used to capture the spatial interaction relationship between different agents at the same time through spatial interaction; the spatial features and temporal features are used to capture the temporal interaction relationship between agents at different time steps through temporal interaction; and the spatial interaction relationship and temporal interaction relationship are fused using a cross-attention mechanism to output the fused interaction features. Figure 4 This is an architecture diagram of the multi-agent interaction module proposed in Embodiment 1 of the present invention;
[0053] The feature interaction module is responsible for modeling the relationships between different agents and is the core component for achieving generalization and robustness in trajectory prediction for real-world scenarios. This invention proposes a spatial interaction modeling module based on SGNN (sub-isovariant graph neural network) to perform structured propagation and aggregation of position, velocity, and behavioral patterns between different agents at the same time. Furthermore, by introducing a BiMamba bidirectional dynamic modeling module, the dynamic effects between agents at historical and future time steps can be effectively captured, uncovering the temporal influence of causality and collaboration. After completing feature interactions between agents along both spatial and temporal lines, a high-order fusion is performed in the spatiotemporal domain using a Cross-Attention mechanism, fully coupling spatial structural dependencies with temporal causal relationships. The overall interaction process is based on a lightweight design, ensuring both high-speed inference and powerful multi-agent collaborative modeling capabilities. Actual testing showed that it maintained stable output accuracy even without high-precision map input. Ablation experiments were also conducted to verify its performance.
[0054] The design of a spatial interaction module based on SGNN (Subequivariant Graph Neural Network) is used to further extract the interaction relationships between all agents. The process of capturing the spatial interaction relationships between different agents at the same time through spatial interaction includes:
[0055] intelligent agent and intelligent agents The reference frame is obtained through vector Parameterization; where Represents intelligent agents To intelligent agents The initial direction vector;
[0056] When the message comes from the agent Transmitted to the intelligent agent At that time, MLP is used to generate paired embeddings. In its first The definition of a layer is:
[0057] ;
[0058] in, For the first Layered intelligent agents Hidden embedding; For the first Layered intelligent agents Hidden embedding; As initial node features; through aggregation All incoming messages, node Update its status:
[0059] ;
[0060] For the first Layered intelligent agents Hidden embedding;
[0061] go through After layer message passing, each node obtains the final embedding. After batch normalization and Gaussian error linear unit activation function processing, the output layer generates the embedded representation of the target agent. .
[0062] To model the temporal relationships among multiple agents in a scenario, we employ bidirectional Mamba to enhance state consistency across time steps. Compared to attention-based methods, Mamba is specifically designed for sequence modeling, and its bidirectional scanning mechanism (forward and backward) enables the model to simultaneously integrate historical trajectories and future behavior predictions, which is crucial for dynamic interactive environments.
[0063] The process of capturing the temporal interaction relationship between agents at different time steps through the spatial features and temporal features includes: using the Mamba bidirectional scanning mechanism to simultaneously fuse historical trajectories and future behavior predictions, wherein the forward SSM operation is represented by Mamba_F and the backward SSM operation is represented by Mamba_B.
[0064] ;
[0065] in, This indicates a reversal of time; The feature output represents the single agent encoding; Gate_f is the sigmoid gate function for the forward SSM operation; Gate_b is the sigmoid gate function for the backward SSM operation. Process sequences in normal chronological order to capture historical dependencies; Process the sequence according to the reversed chronological order to capture future dependencies; The hidden state output sequence obtained after the forward Mamba layer processes the input sequence; This is the hidden state output sequence obtained after processing the input sequence by the Mamba layer. These are the weight parameters for the fully connected layer; These are the bias parameters for the fully connected layer; This represents the time interaction relationship of the bidirectional scan output.
[0066] To integrate temporal and spatial features, a cross-attention mechanism is employed to jointly model spatiotemporal dependencies. This method significantly improves task performance in complex scenarios through a flexible context-sensitive mechanism for spatiotemporal inference.
[0067] , , ;
[0068] ; ; ;
[0069] ; ;
[0070] The final result is:
[0071] in, A linear transformation weight matrix for generating queries from spatial features Ŝ; A linear transformation weight matrix for generating query keys from spatial features Ŝ; This is a linear transformation weight matrix for generating values from spatial feature Ŝ; To start from time series features Generate the linear transformation weight matrix for the query; To start from time series features The linear transformation weight matrix for generating the bond; To start from time series features The linear transformation weight matrix that generates the values; To query based on spatial features; To query based on time-series features; The key is based on time sequence characteristics; The value is based on the time series characteristics; For keys based on spatial characteristics; Values based on spatial characteristics; This is the scaling factor; Attention characteristics from space to time; Attention characteristics from time to space; This is the final fusion feature.
[0072] In step S230, the fused interaction features are decoded by a decoder to generate multiple predicted trajectories for each agent at future moments and their corresponding probability distributions.
[0073] Feature decoding and prediction are the output and decision-making basis of the entire model. This module uses the global interaction features obtained from the previous step as input and generates multiple possible trajectory states for each agent through a highly efficient and lightweight multimodal trajectory decoder. Specifically, the decoder allows the model to output corresponding multimodal trajectory branches for each possible future scenario, effectively capturing multiple evolutionary trends in uncertain real-time environments such as autonomous driving. Furthermore, this module supports adding confidence assessments to each output branch, facilitating further selection by subsequent planning or decision-making systems based on different risks and probabilities. The outputs of each branch can be dynamically combined with historical detection / observation results and vehicle state information to form a re-time-series perception and prediction closed loop. After multiple rounds of real-vehicle and simulation verification, this decoding structure demonstrates extremely high real-time performance and prediction accuracy, and can still robustly handle changing traffic environments even without high-precision maps, greatly expanding the practical applicability of trajectory prediction models.
[0074] The decoder maps interactive features to future trajectory coordinates through a multilayer perceptron (MLP) regression head, and calculates the modal probability distribution of multiple trajectories through another MLP classification head with a softmax function.
[0075] The fused features are mapped back to the coordinate system using an MLP regression head, and the probability distribution of different motion modes of each agent is calculated using an MLP with softmax.
[0076] ;
[0077] The loss function consists of regression loss and classification loss:
[0078]
[0079] in, Features of fusion; It is a multilayer perceptron; Represents the coordinates of the predicted future trajectory; This is the output of the second MLP; For classification loss; For regression loss; Total loss; The number of intelligent agents; The time step for future predictions; The number of motion patterns; The predicted probability of the target trajectory; The probability of predicting the trajectory; It is the probability density function; Let be the variance of the Gaussian distribution.
[0080] Embodiment 1 of this invention proposes a lightweight trajectory prediction method for autonomous driving. Through the decoupling design of single-agent feature modules and multi-agent interaction modules, as well as temporal and spatial features, it improves the ability of autonomous driving trajectory prediction to utilize features from map vehicle trajectory data. This compensates for the lack of information features caused by missing road information in map-free environments and mitigates the significant performance degradation of trajectory prediction when high-precision map information is unavailable. When using this invention for autonomous driving trajectory prediction, only the historical trajectory information of the vehicles involved in the traffic needs to be input to obtain high-precision future trajectory prediction results.
[0081] Example 2
[0082] Based on the lightweight trajectory prediction method for autonomous driving proposed in Embodiment 1 of this invention, Embodiment 2 of this invention also proposes a lightweight trajectory prediction system for autonomous driving. Figure 5 This is a schematic diagram of a lightweight trajectory prediction system for autonomous driving proposed in Embodiment 2 of the present invention; the system includes a preprocessing module, a feature extraction module, a fusion module, and a prediction module;
[0083] The preprocessing module is used to obtain the historical trajectory coordinates of multiple agents in the target scene, and to perform coordinate system normalization processing with the position of the target agent at the end of the historical time window as the anchor point, converting the absolute coordinates into relative displacement with the anchor point as the origin.
[0084] The feature extraction module is used to input the relative displacement into the parallel spatial encoder and temporal encoder respectively, and extract the spatial features and temporal features of each agent respectively;
[0085] The fusion module is used to capture the spatial interaction relationship between different agents at the same time through spatial interaction of the spatial features and temporal features; capture the temporal interaction relationship between agents at different time steps through temporal interaction of the spatial features and temporal features; and use the cross-attention mechanism to fuse the spatial interaction relationship and temporal interaction relationship, and output the fused interaction feature.
[0086] The prediction module is used to decode the fused interaction features through a decoder to generate multiple predicted trajectories for each agent at future moments and their corresponding probability distributions.
[0087] The preprocessing module includes the following processes: the coordinate system normalization process includes: calculating the direction vector of the last historical trajectory of the target agent, and aligning the historical trajectories of all agents in the scene with the direction vector through rotation, so as to achieve rotation invariance normalization of the trajectory data.
[0088] The feature extraction module's execution process includes: the spatial encoder employs a multi-head self-attention mechanism to extract spatial features from each agent, with each attention head... Defined as:
[0089] ;
[0090] In the formula, Spatial features; for The query matrix of a linear mapping; for The key matrix of a linear mapping; for The value matrix of a linear mapping; This is the scaling factor;
[0091] The outputs of all attention points are concatenated and linearly transformed to generate the final spatial features. for:
[0092]
[0093] In the formula, For the number of heads; This is the first weight matrix; This is the first bias.
[0094] The temporal encoder uses a Linformer-based temporal coding module to learn the temporal relationships between agent states at different time steps, with each attention head... Defined as:
[0095] ;
[0096] In the formula, It is a time-series feature; for The query matrix of a linear mapping; for The key matrix of a linear mapping; for The value matrix of a linear mapping; This is the first low-rank projection matrix that can be learned; It is a learnable second low-rank projection matrix;
[0097] The outputs of all attention points are concatenated and linearly transformed to generate the final time feature. :
[0098] ;
[0099] In the formula, This is the second weight matrix; This is the second bias.
[0100] The process of capturing spatial interaction relationships between different agents at the same moment through spatial interaction, which combines spatial and temporal features, includes:
[0101] intelligent agent and intelligent agents The reference frame is obtained through vector Parameterization; where Represents intelligent agents To intelligent agents The initial direction vector;
[0102] When the message comes from the agent Transmitted to the intelligent agent At that time, MLP is used to generate paired embeddings. In its first The definition of a layer is:
[0103] ;
[0104] in, For the first Layered intelligent agents Hidden embedding; For the first Layered intelligent agents Hidden embedding; As initial node features; through aggregation All incoming messages, node Update its status:
[0105] ;
[0106] For the first Layered intelligent agents Hidden embedding;
[0107] go through After layer message passing, each node obtains the final embedding. After batch normalization and Gaussian error linear unit activation function processing, the output layer generates the embedded representation of the target agent. .
[0108] The process of capturing the temporal interaction relationship between agents at different time steps through temporal interaction of spatial features and temporal features includes: using the Mamba bidirectional scanning mechanism to simultaneously fuse historical trajectories and future behavior predictions, where the forward SSM operation is represented by Mamba_F and the backward SSM operation is represented by Mamba_B.
[0109] ;
[0110] in, This indicates a reversal of time; The feature output represents the single agent encoding; Gate_f is the sigmoid gate function for the forward SSM operation; Gate_b is the sigmoid gate function for the backward SSM operation. Process sequences in normal chronological order to capture historical dependencies; Process the sequence according to the reversed chronological order to capture future dependencies; The hidden state output sequence obtained after the forward Mamba layer processes the input sequence; This is the hidden state output sequence obtained after processing the input sequence by the Mamba layer. These are the weight parameters for the fully connected layer; These are the bias parameters for the fully connected layer; This represents the time interaction relationship of the bidirectional scan output.
[0111] The process of fusing spatial and temporal interaction relationships using a cross-attention mechanism and outputting the fused interaction features includes:
[0112] , , ;
[0113] ; ; ;
[0114] ; ;
[0115] The final result is:
[0116] in, A linear transformation weight matrix for generating queries from spatial features Ŝ; A linear transformation weight matrix for generating query keys from spatial features Ŝ; This is a linear transformation weight matrix for generating values from spatial feature Ŝ; To start from time series features Generate the linear transformation weight matrix for the query; To start from time series features The linear transformation weight matrix for generating the bond; To start from time series features The linear transformation weight matrix that generates the values; To query based on spatial features; To query based on time-series features; The key is based on time sequence characteristics; The value is based on the time series characteristics; For keys based on spatial characteristics; Values based on spatial characteristics; This is the scaling factor; Attention characteristics from space to time; Attention characteristics from time to space; This is the final fusion feature.
[0117] The process executed by the fusion module includes: the decoder maps interactive features to future trajectory coordinates through a multilayer perceptron (MLP) regression head, and calculates the modal probability distribution of multiple trajectories through another MLP classification head with a softmax function.
[0118] The process of decoding the fused interaction features to generate multiple predicted trajectories for each agent at future time points and their corresponding probability distributions includes: mapping the fused features back to the coordinate system using an MLP regression head, and calculating the probability distributions of different motion modes for each agent using an MLP with softmax.
[0119] ;
[0120] The loss function consists of regression loss and classification loss:
[0121]
[0122] in, Features of fusion; It is a multilayer perceptron; Represents the coordinates of the predicted future trajectory; This is the output of the second MLP; For classification loss; For regression loss; Total loss; The number of intelligent agents; The time step for future predictions; The number of motion patterns; The predicted probability of the target trajectory; The probability of predicting the trajectory; It is the probability density function; Let be the variance of the Gaussian distribution.
[0123] Embodiment 2 of this invention proposes a lightweight trajectory prediction system for autonomous driving. Through the decoupling design of single-agent feature modules and multi-agent interaction modules, as well as temporal and spatial features, it improves the ability of trajectory prediction to utilize features from map vehicle trajectory data. This compensates for the lack of information features caused by missing road information in map-free environments during autonomous driving, and mitigates the significant performance degradation of trajectory prediction when high-precision map information is unavailable. When using this invention for trajectory prediction, only the historical trajectory information of the vehicles involved in the traffic needs to be input to obtain high-precision future trajectory prediction results.
[0124] The description of the lightweight trajectory prediction system for autonomous driving provided in Embodiment 2 of this application can be found in the detailed description of the corresponding part in the lightweight trajectory prediction method for autonomous driving provided in Embodiment 1 of this application, and will not be repeated here.
[0125] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.
[0126] While specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art can make other modifications or variations based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A lightweight trajectory prediction method for automatic driving, characterized by, The single-agent trajectory encoding module and the multi-agent interaction module are used to realize accurate trajectory prediction without using map information during automatic driving, including the following steps: The historical trajectory coordinates of multiple agents in a target scene are obtained, and the coordinates are normalized with the position of a target agent at the end of a historical time window as an anchor point to convert absolute coordinates into relative displacement amounts with the anchor point as an origin; the coordinate normalization process includes: calculating a direction vector of the last historical trajectory of the target agent, and aligning the historical trajectories of all agents in the scene with the direction vector to realize rotation invariance normalization of the trajectory data; The relative displacement amounts are respectively input into parallel spatial encoders and time encoders to extract spatial features and time sequence features of each agent; The spatial features and the time sequence features are used to capture spatial interaction relationships between different agents at the same time through spatial interaction, and to capture time interaction relationships between agents at different time steps through time sequence interaction; and a cross-attention mechanism is used to fuse the spatial interaction relationships and the time interaction relationships to output fused interaction features; the process of capturing the spatial interaction relationships between different agents at the same time through spatial interaction includes: agent and agent reference frame is parameterized by a vector where represents the initial direction vector of the agent to the agent When a message is passed from an agent to an agent , a pair-wise embedding is generated using an MLP , defined at the first layer as: ; wherein, is the layer agent's hidden embedding; is the layer agent's hidden embedding; as initial node features; by aggregating all incoming messages, the node updates its state: ; for the first layer agent hidden embedding; After the layer message passing, each node obtains the final embedding After the layer message passing, each node obtains the final embedding After the layer message passing, each node obtains the final embedding ; The process of fusing the spatial interaction relationships and the time interaction relationships through the cross-attention mechanism includes: , , ; ; ; ; ; ; Finally, we obtain: wherein, is a linear transformation weight matrix for generating queries from spatial features is a linear transformation weight matrix for generating keys from spatial features is a linear transformation weight matrix for generating values from spatial features is a linear transformation weight matrix for generating query keys from spatial features is a linear transformation weight matrix for generating keys from spatial features is a linear transformation weight matrix for generating values from spatial features is a linear transformation weight matrix for generating queries from temporal features is a linear transformation weight matrix for generating keys from temporal features is a linear transformation weight matrix for generating values from temporal features is a linear transformation weight matrix for generating query keys from temporal features is a linear transformation weight matrix for generating keys from temporal features is a linear transformation weight matrix for generating values from temporal features is a query with spatial features is a query with temporal features is a key with temporal features is a value with temporal features is a key with spatial features is a value with spatial features is a scaling factor is a spatial-to-temporal attention feature is a temporal-to-spatial attention feature is a final fused feature The fused interaction features are decoded by a decoder to generate multiple predicted trajectories of each agent at a future time and corresponding probability distributions; The process of capturing the time interaction relationships between agents at different time steps through time sequence interaction includes: using a Mamba bidirectional scanning mechanism to simultaneously fuse historical trajectories and future behavior prediction, wherein a forward SSM operation is represented by Mamba_F, and a backward SSM operation is represented by Mamba_B; ; wherein, denotes time reversal; represents the feature output of the single-agent encoding; Gate_f is the Sigmoid gating function for the forward SSM operation; Gate_b is the Sigmoid gating function for the backward SSM operation; process the sequence in normal time order, capturing historical dependencies; process the sequence in reversed time order, capturing future dependencies; is the hidden state output sequence obtained after processing the input sequence for the forward Mamba layer; is the hidden state output sequence obtained after processing the input sequence for the backward Mamba layer; is the weight parameter of the fully connected layer; is the bias parameter of the fully connected layer; is the time interaction relationship of the bidirectional scan output.
2. The method of claim 1, wherein, The spatial encoder adopts a multi-head self-attention mechanism to extract spatial features of each agent, and each attention head is defined as: ; wherein is a spatial feature; is is a query matrix of the linear mapping; is is a key matrix of the linear mapping; is is a value matrix of the linear mapping; is a scaling factor; All outputs of attention heads are concatenated and linearly transformed to generate the final spatial feature is: wherein is the number of attention heads; is the first weight matrix; is the first bias.
3. The method of claim 1, wherein, The time encoder adopts a Linformer-based time sequence encoding module to learn the time sequence relationship between the agent states at different time steps, and each attention head is defined as: ; wherein is a timing feature; is is a query matrix of the linear mapping; is is a key matrix of the linear mapping; is is a value matrix of the linear mapping; is a first learnable low-rank projection matrix; is a second learnable low-rank projection matrix; all the outputs of the attention heads are concatenated and linearly transformed to generate the final temporal feature : ; In the formula, is a second weight matrix; is a second bias.
4. The method of claim 1, wherein, The decoder maps the interaction features to future trajectory coordinates through a multi-layer perceptron (MLP) regression head, and calculates the modal probability distribution of multiple trajectories through another MLP classification head with a Softmax function.
5. The method of claim 4, wherein, The process of decoding the fused interaction features to generate multiple predicted trajectories of each agent at a future time and corresponding probability distributions includes: mapping the fused features back to a coordinate system through an MLP regression head, and calculating the probability distribution of different motion modes of each agent through an MLP with softmax: ; The loss function is composed of a regression loss and a classification loss: wherein, is a fused feature; is a multi-layer perceptron; represents predicted future trajectory coordinates; is an output of a second MLP; is a classification loss; is a regression loss; is a total loss; is a number of agents; is a time step of future prediction; is a number of motion patterns; is a prediction probability of a target trajectory; is a probability of a predicted trajectory; is a probability density function; is a variance of a Gaussian distribution.
6. A lightweight trajectory prediction system for autonomous driving, configured to perform the lightweight trajectory prediction method for autonomous driving according to any one of claims 1 to 5. The system includes a preprocessing module, a feature extraction module, a fusion module, and a prediction module; The preprocessing module is used to obtain historical trajectory coordinates of multiple agents in a target scene, and to normalize the coordinates with a position of a target agent at an end of a historical time window as an anchor point to convert absolute coordinates into relative displacement amounts with the anchor point as an origin; The feature extraction module is used to input the relative displacement amounts into parallel spatial encoders and time encoders to extract spatial features and time sequence features of each agent; The spatial features and the time sequence features are used to capture spatial interaction relationships between different agents at the same time through spatial interaction, and to capture time interaction relationships between agents at different time steps through time sequence interaction; and a cross-attention mechanism is used to fuse the spatial interaction relationships and the time interaction relationships to output fused interaction features; the process of capturing the spatial interaction relationships between different agents at the same time through spatial interaction includes: The process of fusing the spatial interaction relationships and the time interaction relationships through the cross-attention mechanism includes: The fused interaction features are decoded by a decoder to generate multiple predicted trajectories of each agent at a future time and corresponding probability distributions; The process of capturing the time interaction relationships between agents at different time steps through time sequence interaction includes: using a Mamba bidirectional scanning mechanism to simultaneously fuse historical trajectories and future behavior prediction, wherein a forward SSM operation is represented by Mamba_F, and a backward SSM operation is represented by Mamba_B; The decoder maps the interaction features to future trajectory coordinates through a multi-layer perceptron (MLP) regression head, and calculates the modal probability distribution of multiple trajectories through another MLP classification head with a Softmax function. The process of decoding the fused interaction features to generate multiple predicted trajectories of each agent at a future time and corresponding probability distributions includes: mapping the fused features back to a coordinate system through an MLP regression head, and calculating the probability distribution of different motion modes of each agent through an MLP with softmax: The loss function is composed of a regression loss and a classification loss: The fusion module is configured to capture spatial interaction relationships between different agents at the same time through spatial interaction of the spatial features and the temporal features; capture temporal interaction relationships between the agents at different time steps through temporal interaction of the spatial features and the temporal features; and fuse the spatial interaction relationships and the temporal interaction relationships by using a cross-attention mechanism, and output fused interaction features. The prediction module is configured to decode the fused interaction features by using a decoder to generate a plurality of predicted trajectories of each agent at a future time and a corresponding probability distribution.