Vehicle track prediction method and device based on dynamic attention adaptive coding, and electronic equipment
Through the dynamic attention adaptive coding method, the problem of insufficient feature coding in vehicle trajectory prediction is solved, and efficient and accurate vehicle trajectory prediction is achieved, which is suitable for autonomous driving and intelligent transportation systems.
Patent Information
- Application Number
- CN202510761568.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-16
AI Technical Summary
Existing vehicle trajectory prediction methods have difficulty effectively encoding heterogeneous features such as vehicle trajectories and lane lines in complex traffic scenarios, resulting in information loss, insufficient prediction accuracy and robustness.
A method based on dynamic attention adaptive coding is adopted to process vehicle trajectory and lane line data through a lightweight attention adaptive coding module, including a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer and a dynamic temperature modulation unit, to generate highly discriminative spatiotemporal feature embeddings, which are combined with temporal and spatial attention modules for feature refinement, and finally generate a multimodal predicted trajectory through a decoder.
It achieves efficient, accurate and lightweight vehicle trajectory prediction, improves feature extraction efficiency and quality, and enhances prediction accuracy and robustness. It is suitable for vehicle platforms with limited computing resources and supports autonomous driving and intelligent transportation systems.
Smart Images

Figure CN120654884A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of intelligent transportation systems and autonomous driving technologies, and specifically relates to a vehicle trajectory prediction method, device and electronic equipment based on dynamic attention adaptive coding. Background Art
[0002] With the continuous development of intelligent transportation and autonomous driving technologies, vehicle trajectory prediction has become a key technology for ensuring driving safety and improving traffic efficiency. Accurate vehicle trajectory prediction can help autonomous vehicles plan their driving paths in advance and avoid collisions, while also helping traffic management systems optimize traffic flow.
[0003] Existing vehicle trajectory prediction methods currently face numerous challenges when processing raw trajectory and lane data. Firstly, feature extraction efficiency is low, failing to fully exploit the valuable information in the data, making it difficult for prediction models to learn key characteristics of vehicle movement. Secondly, existing methods struggle to maintain both prediction accuracy and model lightweightness. While overly complex models may improve accuracy, they incur high computational overhead, making them difficult to deploy on resource-constrained in-vehicle platforms or edge computing devices. Furthermore, lightweight models often suffer from insufficient feature extraction capabilities, leading to reduced prediction accuracy. Furthermore, existing solutions employ a spatial attention-first architecture to enhance spatiotemporal attention. This drawback stems from premature spatial integration, which neglects vehicle dynamics constraints. This proposed solution utilizes a temporal-first architecture to first capture vehicle kinematics and then integrate road semantic spatial constraints, ensuring that trajectories conform to physical rules and traffic regulations. Furthermore, existing methods lack sufficient discrimination of key features, failing to effectively distinguish between important and noisy characteristics of vehicle movement in different scenarios. This directly impacts the performance of subsequent prediction modules, making the accuracy and robustness of vehicle trajectory prediction insufficient for practical applications. Summary of the Invention
[0004] This invention aims to address the challenges of existing vehicle trajectory prediction methods in complex traffic scenarios. This method suffers from information loss, insufficient prediction accuracy, and insufficient robustness due to the difficulty in effectively encoding heterogeneous features such as vehicle trajectories and lane markings. This paper proposes a vehicle trajectory prediction method based on dynamic attention adaptive coding, achieving efficient, accurate, and lightweight vehicle trajectory prediction to meet the practical application needs of autonomous driving and intelligent transportation.
[0005] To achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0006] The present invention provides a vehicle trajectory prediction method based on dynamic attention adaptive coding, comprising the following steps:
[0007] Step 1: Obtain raw data, receive the input raw vehicle trajectory data and lane line data;
[0008] Step 2: Construct a lightweight attention adaptive encoding module, which includes a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit;
[0009] Step 3: Process the data through the lightweight attention adaptive encoding module. The original vehicle trajectory data and lane line data obtained in step 1 are input into the lightweight attention adaptive encoding module. After processing, the module outputs highly discriminative enhanced features, including vehicle node embedding, lane line node embedding, and relative position edge embedding.
[0010] Step 4: The vehicle node embedding, lane line node embedding, and relative position edge embedding output from step 3 are fed into the temporal attention module and spatial attention module, respectively, to capture the temporal dependencies of vehicles and the spatial interactions between vehicles and lane lines, and between vehicles, to obtain temporal feature embedding and spatial feature embedding, respectively.
[0011] Step 5: Add the temporal feature embedding and the spatial feature embedding obtained in step 4 to generate a spatiotemporal feature embedding. The spatiotemporal feature embedding is sequentially passed through the temporal attention module and the spatial attention module to further refine the embedded features and generate a spatiotemporal enhanced feature embedding.
[0012] Step 6: Embed the spatiotemporal enhanced features obtained in step 5 and generate a multimodal prediction trajectory through a decoder. The decoder structure includes a two-layer perceptron and a lightweight channel attention module.
[0013] In the above scheme, step 1 includes: obtaining original data: receiving input original vehicle trajectory data and lane line data; wherein, the original vehicle trajectory data includes the position coordinates, speed, and acceleration information of the target vehicle in the historical time period; the lane line data includes the position, shape, and adjacent relationship information between lane lines.
[0014] In the above scheme, in step 2, the lightweight attention adaptive encoding module includes the following connected in sequence:
[0015] The feature transformation layer based on a two-layer feedforward neural network receives the input feature vector, maps the input dimension to the hidden layer dimension through the first fully connected layer, transforms it through a nonlinear activation function, applies layer normalization to stabilize the feature distribution, then passes through a dropout layer to prevent overfitting, and finally maps the hidden layer dimension to the target output dimension through the second fully connected layer;
[0016] Residual connection structure: The output of the feature transformation layer based on the two-layer feedforward neural network is added to the original input feature vector; when the input dimension does not match the target output dimension, the original input feature vector is dimensionally aligned through linear transformation, and when the dimensions are consistent, an identity connection is directly performed;
[0017] Lightweight channel attention layer: receives the output feature vector of the residual connection structure and inputs it into a lightweight perceptron composed of two fully connected layers; wherein the first fully connected layer compresses the feature dimension to 1 / 4 of the original dimension, and after the ReLU activation function, the second fully connected layer restores it to the original dimension, and then generates a channel weight vector in the range of (0, 1) through the Sigmoid function; the channel weight vector is multiplied by the output feature vector of the residual connection structure channel by channel to achieve a channel weighting operation that enhances the weight of the key information channel and suppresses the weight of the noise feature channel;
[0018] Dynamic temperature modulation unit: includes a learnable global temperature parameter; based on the feature vector after the channel weighting operation, the global temperature parameter is applied to perform a scaling operation to adaptively adjust the sharpness of the feature distribution, increase the difference between similar features and widen the difference between dissimilar features, and improve the distinguishability of feature expression.
[0019] In the above scheme, step 3 includes the following steps:
[0020] The original vehicle trajectory data and lane line data are input into the lightweight attention adaptive encoding module, which outputs the following enhanced feature embedding:
[0021] Vehicle node embedding: A local polar coordinate system is used to construct a vehicle spatial representation, with the vehicle position as the coordinate origin and the driving direction as the positive axis. Multi-level feature fusion of vehicle state information is performed based on the lightweight attention adaptive coding module to generate a vehicle node embedding with spatiotemporal awareness.
[0022] Lane node embedding: Based on the multimodal features of the lane map, such as spatial position, length, directional attributes, and semantic information, a structured representation is constructed through topological connectivity. The lightweight attention adaptive encoding module is used to jointly encode lane geometry and topological relationships, outputting lane node embeddings that contain road structure semantics.
[0023] Relative position edge embedding: To decouple the spatial representation differences of different local coordinate systems, the relative spatiotemporal relationship between nodes is defined as edge features. The edge features include the Euclidean distance offset between nodes, the target node direction angle, the direction angle between nodes, and the temporal difference. The lightweight attention adaptive coding module is used to perform cross-coordinate system conversion encoding on the multidimensional edge features to generate relative position edge embeddings that represent the dynamic interaction relationship between nodes. Among them, the vehicle node embedding, lane line node embedding, and relative position edge embedding are all generated through relative spatiotemporal position encoding.
[0024] In the above scheme, step 4 includes the following steps:
[0025] Step 4.1: Based on the vehicle node embedding, lane line node embedding, and relative position edge embedding, construct an initial heterogeneous graph structure, where the nodes include the dynamic feature embedding of the vehicle and the static feature embedding of the lane line, and the edges are the relative position edge embeddings between nodes;
[0026] Step 4.2: Initialize k learnable query vectors for each vehicle at time t, where each query vector models a potential driving behavior mode;
[0027] Step 4.3: Temporal attention processing: For the target node h i ,implement:
[0028] Step 4.3.1: Based on the historical trajectory features within the time window I1, a multi-head graph attention mechanism is used to model temporal associations. The key and value are both constructed by concatenating the historical node embeddings and the corresponding edge embeddings within the time window I1 along the feature dimension.
[0029] Step 4.3.2: Weight the modeling time series association results of step 4.3.1 and aggregate them to the target node h i On the characteristics of;
[0030] Step 4.3.3: Perform channel weighting operation on the target node features obtained in step 4.3.2 to enhance the key feature channels;
[0031] Step 4.3.4: Pass the features after the channel weighting operation in step 4.3.3 through a feedforward neural network to generate a temporal feature embedding;
[0032] Step 4.4: Spatial attention processing: For the target node h i ,implement:
[0033] Step 4.4.1: Based on the initial heterogeneous graph structure, consider lane nodes within a radius R1 centered on the target vehicle;
[0034] Step 4.4.2: Calculate the multi-head attention score in layers; first calculate the interaction features between the vehicle and the lane line, where the key and value are the lane node features E within the radius R1 m and the corresponding edge feature E e Then, the interaction features between vehicles are calculated, where the key and value are composed of the node features E of other vehicles except the target vehicle within the radius R2. m and the corresponding edge feature E e The two multi-head attention scores are weighted and fused to generate the final spatial attention score.
[0035] Step 4.4.3: Add the attention score calculated in step 4.4.2 to the target node h i On the characteristics of;
[0036] Step 4.4.4: Perform channel weighting operation on the target node features obtained in step 4.4.3;
[0037] Step 4.4.5: Pass the target node features after the channel weighting operation in step 4.4.4 through the feedforward neural network layer to generate spatial feature embedding.
[0038] In the above scheme, step 5 includes the following steps:
[0039] Step 5.1: Sum the temporal feature embedding generated by the temporal attention module and the spatial feature embedding generated by the spatial attention module to obtain the merged spatiotemporal features;
[0040] Step 5.2: Input the merged spatiotemporal features into the temporal attention module and the spatial attention module in sequence for interactive fusion;
[0041] Step 5.3: The temporal attention module encodes the historical temporal features and generates a time-aware spatial embedding.
[0042] Step 5.4: The spatial attention module models the dynamic interactions between vehicles and between vehicles and lanes based on the temporally enhanced embeddings.
[0043] Step 5.5: The temporal attention module and the spatial attention module sequentially process the initial spatiotemporal feature embedding to form a time-first cascade architecture, achieve bidirectional deep coupling of spatiotemporal features, and generate the final spatiotemporal enhanced feature embedding.
[0044] In the above scheme, step 6 includes the following steps:
[0045] The spatiotemporal feature enhancement embedding is input into a decoder, and the decoder generates a future multimodal prediction trajectory;
[0046] The decoder includes a two-layer perceptron structure and a lightweight channel attention mechanism;
[0047] The two-layer perceptron structure is configured to: receive the spatiotemporal feature enhanced embedding, map the input dimension to the hidden layer dimension through a first fully connected layer, apply layer normalization to stabilize the feature distribution after a nonlinear activation function transformation, and prevent overfitting through a dropout layer; and then map the hidden layer dimension to the target output dimension through a second fully connected layer;
[0048] The lightweight channel attention mechanism is configured to: receive the output features of the two-layer perceptron structure and input them into a lightweight perceptron composed of two fully connected layers; wherein the first fully connected layer compresses the feature dimension to 1 / 4 of the original dimension, and restores it to the original dimension by the second fully connected layer after the ReLU activation function, and finally generates a channel weight vector in the range of (0, 1) through the Sigmoid function; and multiply the channel weight vector by the original feature channel by channel to achieve weighting of different feature channels;
[0049] The refined features after the nonlinear transformation are mapped to the future multimodal predicted trajectory space, and multiple possible future trajectories of the target vehicle are output.
[0050] The present invention provides a vehicle trajectory prediction device based on dynamic attention adaptive coding, comprising:
[0051] Data acquisition unit: used to receive input original vehicle trajectory data and lane line data;
[0052] A feature coding module construction unit is used to construct a lightweight attention adaptive coding module, which includes a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit;
[0053] Data processing unit: Processes data through the lightweight attention adaptive coding module, inputting the acquired raw vehicle trajectory data and lane line data into the lightweight attention adaptive coding module. After processing, the module outputs highly discriminative enhanced features, including vehicle node embedding, lane line node embedding, and relative position edge embedding;
[0054] Spatiotemporal attention processing unit: The vehicle node embedding, lane line node embedding, and relative position edge embedding are fed into the temporal attention module and spatial attention module, respectively, to capture the temporal dependencies of vehicles and the spatial interactions between vehicles and lane lines, and between vehicles, to obtain temporal feature embedding and spatial feature embedding.
[0055] The spatiotemporal feature enhancement unit adds the obtained temporal feature embedding to the spatial feature embedding to generate a spatiotemporal feature embedding. The spatiotemporal feature embedding is sequentially passed through the temporal attention module and the spatial attention module, prioritizing vehicle dynamics over interactive decision-making. This is different from the existing spatial-first processing flow and is used to further refine the embedded features to generate a spatiotemporal enhanced feature embedding.
[0056] Trajectory generation unit: The obtained spatiotemporal enhancement features are embedded and a multimodal predicted trajectory is generated through a decoder. The decoder structure includes a two-layer perceptron and a lightweight channel attention module.
[0057] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the vehicle trajectory prediction method based on dynamic attention adaptive coding is implemented.
[0058] The present invention also provides an electronic device, comprising a processor and a memory for storing processor executable instructions, wherein the processor is configured to execute the steps of the vehicle trajectory prediction method based on dynamic attention adaptive coding by executing the executable instructions.
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] 1. Efficient Feature Extraction: The innovative lightweight attention adaptive encoding module significantly improves the efficiency and quality of feature extraction from raw trajectory and lane data through a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit. This effectively enhances key features and improves feature discrimination, providing higher-quality input data for subsequent predictions.
[0061] 2. Lightweight design: This module is built based on a two-layer feedforward neural network. By adopting lightweight channel attention and an efficient residual structure, it significantly reduces computational overhead while ensuring high performance, achieving a balance between high model performance and low computational overhead, and meeting lightweight design requirements.
[0062] 3. Improved Prediction Accuracy: High-quality feature input lays a solid foundation for the subsequent attention mechanism and trajectory decoding. Through the synergistic effect of various modules, it can more accurately capture the temporal dependencies, spatial interactions, and common trajectory patterns of vehicle driving, ultimately effectively improving the overall accuracy and robustness of trajectory prediction.
[0063] 4. Deployment-friendly: Due to its lightweight characteristics, the vehicle trajectory prediction method and device of the present invention are easier to deploy on vehicle platforms or edge computing devices with limited computing resources, and can better serve autonomous driving decision systems and advanced driver assistance systems, and have good practical application value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 It is a schematic diagram of the overall framework of the present invention;
[0065] Figure 2 This is the architecture diagram of the lightweight attention adaptive encoding module in the present invention;
[0066] Figure 3 This is the architecture diagram of the temporal attention module of the present invention;
[0067] Figure 4 This is a diagram of the spatiotemporal attention and decoder architecture of the present invention. DETAILED DESCRIPTION
[0068] The following is a detailed description of the vehicle trajectory prediction method based on dynamic attention adaptive coding of the present invention in conjunction with specific embodiments, so as to better understand the technical solution and practical application of the present invention.
[0069] (1) Data collection and preparation
[0070] In practical applications, on-board sensors (such as GPS, inertial measurement units, and cameras) collect raw trajectory data of the target vehicle, including location coordinates (longitude and latitude), speed, acceleration, and other information over a certain historical period. Simultaneously, cameras or other road sensing devices acquire lane data, including its location, shape, and relationships between lanes. This collected data undergoes preprocessing, such as data cleaning and format conversion, to facilitate subsequent input into the prediction model.
[0071] (2) Constructing a lightweight attention adaptive encoding module
[0072] The feature transformation layer structure based on a two-layer feedforward neural network is implemented using a serialized structure. First, in the first fully connected layer, the input dimension is mapped from the initial dimension to the hidden layer dimension. Then, the SiLU activation function is used for nonlinear transformation. Then, layer normalization is applied to stabilize the hidden layer feature distribution. Then, the Dropout layer is used to prevent overfitting, where the Dropout rate is set to 0.1. Finally, the second fully connected layer is used to map the hidden layer dimension to the target output dimension.
[0073] Residual connection structure: After the output layer of the feature transformation layer, the residual connection structure adds the original input to the output of the feature transformation layer through a dimension adapter (residual_adapter). When the input and output dimensions do not match, a linear transformation is used to align the dimensions. When the dimensions are consistent, an identity connection is used to ensure smooth gradient propagation.
[0074] Lightweight Channel Attention: Embeds a computationally efficient channel attention mechanism. The feature vector after the residual connection structure is input into a lightweight perceptron consisting of two fully connected layers. The first layer compresses the dimension to 1 / 4, and the second layer restores the original dimension after ReLU activation. Finally, a Sigmoid function is used to generate channel weights in the range of (0, 1). Finally, the learned weights are multiplied by the original features channel by channel to achieve weighted weighting of different feature channels, enhancing the weight of key information channels and suppressing the weight of noisy feature channels.
[0075] Dynamic Temperature Modulation Unit: Utilizing dynamic temperature scaling technology, the temperature parameter is dynamically calculated based on the feature distribution of the input data. Global temperature scaling is achieved through a learnable temperature parameter, which is adaptively optimized during training. This parameter scales the feature vectors weighted by the lightweight channel attention structure to improve the discriminability of the feature distribution. This temperature parameter adjusts the probability distribution of the feature vectors and adaptively adjusts the sharpness of the feature distribution, making the differences between similar features more pronounced and the differences between dissimilar features more pronounced. This effectively improves the discriminability of feature representation and enables the model to more accurately focus on key spatiotemporal patterns.
[0076] (3) Data processing and feature extraction
[0077] The pre-processed raw vehicle trajectory data and lane line data are input into the constructed lightweight attention adaptive coding module. During the module training phase, the actual collected vehicle trajectory data is used as a label, and stochastic gradient descent (SGD) or other optimization algorithms are used to update the parameters in the module through the back-propagation algorithm, so that the module can continuously learn and optimize the feature extraction capability. The trained module processes the input data and outputs the vehicle node embedding, lane line node embedding, and relative position edge embedding after processing by the module. Vehicle node embedding: A local polar coordinate system is used to construct a vehicle spatial representation, with the vehicle position as the coordinate origin and the driving direction as the positive axis direction. Based on the lightweight attention adaptive coding module, multi-level feature fusion of vehicle state information is performed to generate a vehicle node embedding with spatiotemporal perception capabilities.
[0078] Lane Node Embedding: This approach constructs a structured representation of the lane map's multimodal features (spatial location, length, directional attributes, and semantic information) through topological connectivity relationships (adjacency and predecessor-successor associations). A lightweight residual attention module is used to jointly encode lane geometry and topological relationships, outputting lane node embeddings that incorporate the semantics of the road structure.
[0079] Relative position edge embedding: To decouple the spatial representation differences of different local coordinate systems, the relative spatiotemporal relationship between nodes is defined as an edge feature. Considering features such as the Euclidean distance offset between nodes, the direction angle of the target node, the direction angle between nodes, and the temporal difference, the above multi-dimensional edge features are converted and encoded across coordinate systems through a lightweight residual attention module to generate a relative position edge embedding that represents the dynamic interaction relationship between nodes.
[0080] The processing also includes the training process of the module, which adopts a supervised learning method, uses actual vehicle trajectory data as labels, and updates the module parameters through the back propagation algorithm, so that the module can better extract effective features.
[0081] 4. Spatial and temporal attention processing
[0082] Performing spatiotemporal attention processing: First, based on the generated vehicle node embeddings, lane line node embeddings, and relative position edge embeddings, an initial heterogeneous graph structure is defined. Nodes represent the dynamic feature embeddings of vehicles and the static feature embeddings of lane lines, and edges represent the relative position encoding embeddings between nodes. For each vehicle at time t, k learnable query vectors are initialized. The physical meaning of these vectors is that each query vector models a potential driving behavior modality, and different future trajectory pattern hypotheses are decoupled through an end-to-end learning mechanism.
[0083] The temporal attention module is composed of Transformer architecture and SE channel attention. First, for a target node h i Based on the historical trajectory features within time window I1, a multi-head graph attention mechanism is used to model temporal associations. Keys and values are constructed by concatenating historical node embeddings and edge embeddings along the feature dimension. The resulting attention scores are weighted and aggregated to the target node features, representing the contribution of historical behavior to the current prediction hypothesis. A channel-wise weighting operation is then performed on the target node features to enhance key feature channels. The output of the channel attention is then passed through a feedforward neural network to extract temporal attention features and generate temporal feature embeddings.
[0084] Similarly, the spatial attention module uses the Transformer architecture and SE channel attention. Based on the constructed heterogeneous graph, the multi-head attention score is calculated hierarchically; first, the interaction features between the vehicle and the lane line are calculated, where the key and value are the lane node features E within the radius R1. mand the corresponding edge feature E e Then, the interaction features between vehicles are calculated, where the key and value are composed of the node features E of other vehicles except the target vehicle within the radius R2. m and the corresponding edge feature E e The two multi-head attention scores are concatenated along the feature dimension. A weighted fusion is performed on the two multi-head attention scores to generate the final spatial attention score. The resulting attention score is weighted and aggregated to the target node feature, representing the contribution of spatial interactions to the current prediction hypothesis. A channel-wise weighting operation is then performed on the target node feature to enhance key feature channels. The output of the channel-wise attention is then passed through a feedforward neural network to generate a spatial feature embedding.
[0085] (V) Enhanced spatiotemporal features
[0086] The temporal attention module and the spatial attention module independently process input features, generating attention features for their respective dimensions (temporal and spatial). The outputs of these two modules are fused through a feature summation operation. Given the independence of the temporal and spatial features generated in the initial phase, the fused features are sequentially fed into the temporal and spatial attention modules for further processing. The temporal attention module first analyzes longitudinal dynamic features, including acceleration patterns (following / hard braking) and steering rate changes (lane change intention recognition). Road semantics are then injected into the spatial attention module in the latter phase. This prioritizes vehicle dynamics over interactive decision-making, distinguishing it from the spatial-first processing flow in existing technologies. The temporal attention module first encodes historical temporal features to generate a time-aware spatial embedding. The spatial attention module then models dynamic interactions between vehicles and between vehicles and lanes based on this temporally enhanced embedding. This time-first cascaded architecture ensures that spatial interaction modeling is based on a precise temporal context, enabling deep bidirectional coupling of temporal and spatial features. Finally, an enhanced embedding of temporal and spatial features is generated.
[0087] (6) Generate predicted trajectory
[0088] The enhanced spatiotemporal features are embedded in the decoder to generate future multimodal predicted trajectories. The enhanced spatiotemporal features are first embedded into a two-layer perceptron, which consists of two fully connected layers. The output of the two-layer perceptron is connected to a lightweight channel attention. The input is a lightweight perceptron consisting of two fully connected layers. The first layer compresses the dimension to 1 / 4, and the second layer restores the original dimension after ReLU activation. Finally, a sigmoid function is used to generate channel weights in the range of (0, 1). Finally, the learned weights are multiplied by the original features channel by channel to achieve weighted weighting of different feature channels. The refined input features are nonlinearly transformed and mapped to the future multimodal predicted trajectory space, outputting multiple possible future trajectories of the target vehicle.
[0089] After generating the predicted trajectory, the system also includes steps to screen and evaluate the generated future multimodal predicted trajectories. Based on preset evaluation metrics, such as the error between the predicted and actual trajectories and the rationality of the predicted trajectories, the optimal predicted trajectory is selected from multiple predicted trajectories as the final vehicle trajectory prediction result. Furthermore, the predicted trajectories can be visualized, graphically displaying the target vehicle's possible future travel trajectory, allowing users to intuitively understand the vehicle's driving trends.
[0090] In practical applications, the vehicle trajectory prediction method and device of the present invention can be deployed on an on-board computing platform or edge computing device to predict vehicle trajectories in real time, providing accurate vehicle trajectory information for autonomous driving decision systems and advanced driver assistance systems, ensuring driving safety and improving traffic efficiency.
[0091] The above are only representative embodiments of the present invention in many specific application scopes and do not constitute any limitation on the protection scope of the present invention. Any technical solutions formed by transformation or equivalent replacement fall within the scope of protection of the present invention.
[0092] Example 1
[0093] The vehicle trajectory prediction method based on dynamic attention adaptive coding of the present invention specifically includes the following steps:
[0094] Obtaining raw data: Receives raw vehicle trajectory data and lane line data. The raw vehicle trajectory data includes the target vehicle's position coordinates, speed, acceleration, and other information over a historical period. The lane line data includes information such as the position, shape, and adjacent relationships between lane lines.
[0095] Constructing a lightweight attention adaptive encoding module: This module is the core innovation of this invention and includes the following key technologies:
[0096] The feature transformation layer structure based on a two-layer feedforward neural network is implemented using a serialized structure. First, in the first fully connected layer, the input dimension is mapped from the initial dimension to the hidden layer dimension. Then, the SiLU activation function is used for nonlinear transformation. Then, layer normalization is applied to stabilize the hidden layer feature distribution. Then, the Dropout layer is used to prevent overfitting, where the Dropout rate is set to 0.1. Finally, the second fully connected layer is used to map the hidden layer dimension to the target output dimension.
[0097] Residual connection structure: After the output layer of the feature transformation layer, the residual connection structure adds the original input to the output of the feature transformation layer structure through a dimension adapter (residual_adapter). When the input and output dimensions do not match, a linear transformation is used to align the dimensions. When the dimensions are consistent, an identity connection is directly used to ensure smooth gradient propagation.
[0098] Lightweight Channel Attention: Embeds a computationally efficient channel attention mechanism. The feature vector after the residual connection structure is input into a lightweight perceptron consisting of two fully connected layers. The first layer compresses the dimension to 1 / 4, and the second layer restores the original dimension after ReLU activation. Finally, a Sigmoid function is used to generate channel weights in the range of (0, 1). Finally, the learned weights are multiplied by the original features channel by channel to achieve weighted weighting of different feature channels, enhancing the weight of key information channels and suppressing the weight of noisy feature channels.
[0099] Dynamic Temperature Modulation Unit: Utilizing dynamic temperature scaling technology, the temperature parameter is dynamically calculated based on the feature distribution of the input data. Global temperature scaling is achieved through a learnable temperature parameter, which is adaptively optimized during training. This parameter scales the feature vectors weighted by the lightweight channel attention structure to improve the discriminability of the feature distribution. This temperature parameter adjusts the probability distribution of the feature vectors and adaptively adjusts the sharpness of the feature distribution, making the differences between similar features more pronounced and the differences between dissimilar features more pronounced. This effectively improves the discriminability of feature representation and enables the model to more accurately focus on key spatiotemporal patterns.
[0100] Data processing through the lightweight attention adaptive coding module: The original vehicle trajectory data and lane line data are input into the constructed lightweight attention adaptive coding module. After processing, the module outputs vehicle node embedding, lane line node embedding, and relative position edge embedding, all of which are generated through relative spatiotemporal position encoding:
[0101] Vehicle Node Embedding: A local polar coordinate system is used to construct a spatial representation of the vehicle, with the vehicle's position as the origin and the direction of travel as the positive axis. A lightweight attention-adaptive encoding module is used to fuse multi-level features of vehicle state information to generate a spatiotemporal-aware vehicle node embedding.
[0102] Lane Node Embedding: This approach constructs a structured representation of the lane map's multimodal features (spatial location, length, directional attributes, and semantic information) through topological connectivity relationships (adjacency and predecessor-successor associations). A lightweight residual attention module is used to jointly encode lane geometry and topological relationships, outputting lane node embeddings that incorporate the semantics of the road structure.
[0103] Relative position edge embedding: To decouple the spatial representation differences of different local coordinate systems, the relative spatiotemporal relationship between nodes is defined as an edge feature. Considering features such as the Euclidean distance offset between nodes, the direction angle of the target node, the direction angle between nodes, and the temporal difference, the above multi-dimensional edge features are converted and encoded across coordinate systems through a lightweight residual attention module to generate a relative position edge embedding that represents the dynamic interaction relationship between nodes.
[0104] The processing also includes the training process of the module, which adopts a supervised learning method, uses actual vehicle trajectory data as labels, and updates the module parameters through the back propagation algorithm, so that the module can better extract effective features.
[0105] Performing spatiotemporal attention processing: First, based on the generated vehicle node embeddings, lane line node embeddings, and relative position edge embeddings, an initial heterogeneous graph structure is defined. Nodes represent the dynamic feature embeddings of vehicles and the static feature embeddings of lane lines, and edges represent the relative position encoding embeddings between nodes. For each vehicle at time t, k learnable query vectors are initialized. The physical meaning of these vectors is that each query vector models a potential driving behavior modality, and different future trajectory pattern hypotheses are decoupled through an end-to-end learning mechanism.
[0106] The temporal attention module is composed of Transformer architecture and SE channel attention. First, for a target node h i Based on the historical trajectory features within time window I1, a multi-head graph attention mechanism is used to model temporal associations. Keys and values are constructed by concatenating historical node embeddings and edge embeddings along the feature dimension. The resulting attention scores are weighted and aggregated to the target node features, representing the contribution of historical behavior to the current prediction hypothesis. A channel-wise weighting operation is then performed on the target node features to enhance key feature channels. The output of the channel attention is then passed through a feedforward neural network to extract temporal attention features and generate temporal feature embeddings.
[0107] Similarly, the spatial attention module uses the Transformer architecture and SE channel attention. Based on the constructed heterogeneous graph, the multi-head attention score is calculated hierarchically; first, the interaction features between the vehicle and the lane line are calculated, where the key and value are the lane node features E within the radius R1. m and the corresponding edge feature E e Then, the interaction features between vehicles are calculated, where the key and value are composed of the node features E of other vehicles except the target vehicle within the radius R2. m and the corresponding edge feature E eThe two multi-head attention scores are concatenated along the feature dimension. A weighted fusion is performed on the two multi-head attention scores to generate the final spatial attention score. The resulting attention score is weighted and aggregated to the target node feature, representing the contribution of spatial interactions to the current prediction hypothesis. A channel-wise weighting operation is then performed on the target node feature to enhance key feature channels. The output of the channel-wise attention is then passed through a feedforward neural network to generate a spatial feature embedding.
[0108] Temporal and spatial feature enhancement: The temporal and spatial attention modules independently process input features, generating attention features for their respective dimensions (temporal and spatial). The outputs of these two modules are fused through a feature summation operation. Given the independence of the temporal and spatial features generated in the initial phase, the fused features are sequentially fed into the temporal and spatial attention modules for further processing. The temporal attention module first analyzes longitudinal dynamic features, including acceleration patterns (following / hard braking) and steering rate changes (lane change intention recognition). Road semantics are then incorporated into the spatial attention module in the latter phase. This prioritizes vehicle dynamics over interactive decision-making, differing from the existing spatial-first processing flow. The temporal attention module first encodes historical temporal features to generate a time-aware spatial embedding. The spatial attention module then models dynamic interactions between vehicles and between vehicles and lanes based on this temporally enhanced embedding. This time-first cascaded architecture ensures that spatial interaction modeling is based on a precise temporal context, enabling deep bidirectional coupling of spatiotemporal features. Finally, an enhanced spatiotemporal feature embedding is generated.
[0109] Generate Predicted Trajectory: The enhanced spatiotemporal features are embedded into the decoder to generate the predicted trajectory of the future multimodal state. First, the enhanced spatiotemporal features are embedded into the input of a two-layer perceptron, which contains two fully connected layers. The output of the two-layer perceptron is connected to the lightweight channel attention. The input is a lightweight perceptron consisting of two fully connected layers. The first layer compresses the dimension to 1 / 4, and the second layer restores the original dimension after ReLU activation. Finally, a sigmoid function is used to generate channel weights in the range of (0, 1). Finally, the learned weights are multiplied by the original features channel by channel to achieve weighting of different feature channels. The refined features of the input are nonlinearly transformed and mapped to the future multimodal predicted trajectory space, outputting multiple possible future trajectories of the target vehicle.
[0110] After generating the predicted trajectory, the system also includes steps to screen and evaluate the generated future multimodal predicted trajectories. Based on preset evaluation metrics, such as the error between the predicted and actual trajectories and the rationality of the predicted trajectories, the optimal predicted trajectory is selected from multiple predicted trajectories as the final vehicle trajectory prediction result. Furthermore, the predicted trajectories can be visualized, graphically displaying the target vehicle's possible future travel trajectory, allowing users to intuitively understand the vehicle's driving trends.
[0111] Example 2
[0112] Based on the above method, the present invention also provides a vehicle trajectory prediction device based on dynamic attention adaptive coding, comprising:
[0113] Data acquisition unit: used to receive input original vehicle trajectory data and lane line data;
[0114] A feature coding module construction unit is used to construct a lightweight attention adaptive coding module, which includes a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit;
[0115] Data processing unit: Processes data through the lightweight attention adaptive coding module, inputting the acquired raw vehicle trajectory data and lane line data into the lightweight attention adaptive coding module. After processing, the module outputs highly discriminative enhanced features, including vehicle node embedding, lane line node embedding, and relative position edge embedding;
[0116] The spatiotemporal attention processing unit feeds the vehicle node embedding, lane line node embedding, and relative position edge embedding into the temporal attention module and spatial attention module, respectively. These modules capture the temporal dependencies of vehicles and the spatial interactions between vehicles and lane lines, as well as between vehicles themselves, to obtain temporal feature embedding and spatial feature embedding.
[0117] Spatiotemporal feature enhancement unit: The obtained temporal feature embedding is added to the spatial feature embedding to generate a spatiotemporal feature embedding, and the spatiotemporal feature embedding is sequentially passed through the temporal attention module and the spatial attention module to further refine the embedded features and generate a spatiotemporal enhanced feature embedding;
[0118] Trajectory generation unit: The obtained spatiotemporal enhancement features are embedded and a multimodal predicted trajectory is generated through a decoder. The decoder structure includes a two-layer perceptron and a lightweight channel attention module.
[0119] Example 3
[0120] In addition, the present invention also relates to a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned vehicle trajectory prediction method based on dynamic attention adaptive coding; and an electronic device comprising a processor and a memory for storing processor-executable instructions, the processor being configured to execute the steps of the above-mentioned vehicle trajectory prediction method based on dynamic attention adaptive coding by executing the executable instructions.
[0121] In order to facilitate those skilled in the art to better understand the technical concept of the present invention and the contribution of the present invention compared with the prior art, the relationship between the technical problem solved by the present invention, the technical solution, and the technical effects is further explained:
[0122] 1. This paper solves the problems of low efficiency in heterogeneous feature extraction and loss of key information by constructing a lightweight attention adaptive coding module, and improves the discriminability and robustness of feature expression.
[0123] Technical Approach: This invention introduces a lightweight attention-adaptive encoding module during the feature encoding stage. This module consists of a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit. The synergy of these key technologies enables efficient encoding of raw vehicle trajectory data and lane marking data.
[0124] Feature transformation layer structure based on a two-layer feedforward neural network: nonlinear transformation of input features is performed through two layers of fully connected networks and activation function layers to enhance the expressive power of the model;
[0125] Residual connection structure: By introducing residual connections, the gradient vanishing problem is alleviated and the stability of features is improved;
[0126] Lightweight channel attention layer: Through compression and restoration operations, feature channels are weighted to enhance the weight of key information;
[0127] Dynamic Temperature Modulation Unit: By introducing learnable parameters, it adaptively adjusts the sharpness of feature distribution and improves the distinction between key features.
[0128] Technical issues: Existing methods often have difficulty effectively extracting key features when processing heterogeneous data (such as vehicle trajectories and lane lines), resulting in information loss and poor model generalization ability.
[0129] Technical effect:
[0130] Through the lightweight attention adaptive encoding module, vehicle nodes, lane line nodes and relative position edges can be fused and encoded at multiple levels;
[0131] This module improves the feature expression capability while maintaining the lightweight characteristics of the model and avoiding excessive consumption of computing resources;
[0132] Dynamic temperature modulation technology enhances the discriminability of feature distribution, enabling the model to more accurately identify key spatiotemporal patterns;
[0133] The residual connection structure ensures stable transmission and fusion of features in different dimensions;
[0134] The final output vehicle node embedding, lane line node embedding, and relative position edge embedding are highly discriminative and robust, providing high-quality input for subsequent spatiotemporal attention processing.
[0135] 2. This paper solves the problem of insufficient modeling of temporal dependencies and spatial interactions in vehicle trajectory prediction by introducing a dual-dimensional time-space attention mechanism, thereby improving the model's spatiotemporal perception capabilities.
[0136] Technical means:
[0137] After feature encoding, the present invention introduces a temporal attention module and a spatial attention module to model the temporal dependency of vehicles and the spatial interaction between vehicles and lane lines, respectively.
[0138] Temporal Attention Module: Based on historical trajectory features, it uses multi-head graph attention mechanism and channel attention to model temporal associations;
[0139] Spatial attention module: Based on the heterogeneous graph structure, it considers the lane nodes centered on the target vehicle and other vehicle nodes to model the spatial interaction relationship;
[0140] Spatiotemporal feature enhancement mechanism: The outputs of the temporal and spatial attention modules are integrated, and bidirectional deep coupling of spatiotemporal features is achieved through cascading.
[0141] Technical issues:
[0142] Existing methods often only focus on a single dimension (such as time or space) when dealing with vehicle trajectory prediction, which makes it difficult to fully capture the dynamic behavior of vehicles in complex traffic scenarios.
[0143] Technical effect:
[0144] The temporal attention module can effectively capture the temporal dependencies of vehicles in their historical trajectories, improving the ability to model vehicle behavior patterns.
[0145] The spatial attention module can accurately model the interaction between the target vehicle and surrounding traffic participants and lane structures, enhancing the perception of complex scenes;
[0146] The spatiotemporal feature enhancement mechanism achieves deep coupling of spatiotemporal features by cascading temporal and spatial attention modules;
[0147] This mechanism ensures that spatial interaction modeling is based on accurate temporal context, improving the model's adaptability to complex traffic scenarios.
[0148] The final output spatiotemporal enhanced feature embedding has stronger semantic expression ability and prediction robustness, providing a more reliable input for trajectory decoding.
[0149] 3. This invention achieves diversified trajectory prediction by introducing a multimodal query-driven mechanism, solving the problem of single prediction results that cannot reflect various driving behavior patterns, and improving the generalization ability and practicality of the model.
[0150] Technical means:
[0151] Pattern query initialization: Generate k independent learnable pattern query vectors for each target vehicle, each vector corresponding to a potential driving behavior intention (such as turning, accelerating);
[0152] Spatiotemporal feature extraction: Temporal attention extracts historical motion features of each modal query, spatial attention models the interaction between each modal query and surrounding objects, and continuous spatiotemporal attention optimizes the collaborative expression of multimodal scene embeddings. Through this attention mechanism, k sets of decoupled spatiotemporal feature embeddings are output.
[0153] Multimodal trajectory generation: In the decoder stage, each set of embeddings is independently decoded. A two-layer perceptron and activation function are used for nonlinear transformations. Key feature channels are weighted using lightweight channel attention, and a single future trajectory is output. The k sets of decoded results are mapped to k physically feasible future trajectories.
[0154] Technical issues:
[0155] Existing methods often only output a single path when generating predicted trajectories, which makes it difficult to reflect the various possible driving behavior patterns of the vehicle.
[0156] Technical effect:
[0157] Through the multimodal trajectory query mechanism, the model can output multiple possible future trajectories, reflecting the potential path of the vehicle under different driving behaviors;
[0158] This mechanism improves the model's adaptability to complex traffic scenarios and enhances the diversity and rationality of prediction results;
[0159] Through channel weighting operations, the model can more accurately focus on key feature channels and improve the accuracy of predicted trajectories;
[0160] The final output multimodal prediction trajectory has higher practical value and can provide richer decision-making basis for the autonomous driving system.
[0161] 4. Through lightweight design, the present invention solves the problems of high model calculation overhead and difficulty in deployment on edge devices, thereby improving the practical application value of the system.
[0162] Technical means:
[0163] The present invention achieves lightweight design by the following means:
[0164] Module structure optimization: using a two-layer feedforward neural network, residual connections, and a lightweight channel attention mechanism to reduce redundant calculations;
[0165] Parameter sharing and compression: weighting features through the channel attention mechanism to reduce invalid calculations;
[0166] Dynamic temperature modulation: Improve model efficiency by adaptively adjusting feature distribution.
[0167] Technical issues:
[0168] Existing methods often sacrifice computational efficiency while pursuing high accuracy, making them difficult to deploy on resource-constrained vehicle platforms or edge devices.
[0169] Technical effect:
[0170] The present invention significantly reduces the computational overhead of the model through lightweight design;
[0171] While ensuring prediction accuracy, the feasibility of model deployment on edge devices is improved;
[0172] This design enables the present invention to be widely used in practical scenarios such as autonomous driving systems and intelligent traffic management systems;
[0173] By combining lightness and high efficiency, the present invention has good engineering implementation capabilities.
[0174] In summary
[0175] This invention achieves significant improvements in vehicle trajectory prediction through the following key technical means:
[0176] 1. Lightweight Attention Adaptive Encoding Module: Effectively extracts key information from heterogeneous data, improving the discriminability and robustness of feature representation;
[0177] 2. Temporal-spatial bimodal attention mechanism: Comprehensively models the temporal dependencies and spatial interactions of vehicles, improving the model's spatiotemporal perception capabilities.
[0178] 3. Multimodal trajectory query mechanism: Outputs multiple possible future trajectories, enhancing the generalization and practicality of the model;
[0179] 4. Lightweight design: Reduce computing overhead and improve the model's deployment capabilities on edge devices.
[0180] The synergistic effect of the above technical means enables the present invention to have higher prediction accuracy, stronger robustness and broader application prospects in complex traffic scenarios, and has significant technological progress and practical application value.
Claims
1. A vehicle trajectory prediction method based on dynamic attention adaptive coding, characterized in that: The following steps are involved: Step 1: Obtain raw data, receive the input raw vehicle trajectory data and lane line data; Step 2: Construct a lightweight attention adaptive encoding module, which includes a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit module; Step 3: Process the data through the lightweight attention adaptive encoding module. The original vehicle trajectory data and lane line data obtained in step 1 are input into the lightweight attention adaptive encoding module. After processing, the module outputs highly discriminative enhanced features, including vehicle node embedding, lane line node embedding, and relative position edge embedding. Step 4: The vehicle node embedding, lane line node embedding, and relative position edge embedding output from step 3 are fed into the temporal attention module and spatial attention module, respectively, to capture the temporal dependencies of vehicles and the spatial interactions between vehicles and lane lines, and between vehicles, to obtain temporal feature embedding and spatial feature embedding, respectively. Step 5: Add the temporal feature embedding and the spatial feature embedding obtained in step 4 to generate a spatiotemporal feature embedding. The spatiotemporal feature embedding is sequentially passed through the temporal attention module and the spatial attention module. The temporal attention module has a higher execution priority than the spatial attention module to further refine the embedded features and generate a spatiotemporal enhanced feature embedding. Step 6: Embed the spatiotemporal enhanced features obtained in step 5 and generate a multimodal prediction trajectory through a decoder. The decoder structure includes a two-layer perceptron and a lightweight channel attention module.
2. The method according to claim 1, characterized in that Step 1 includes: obtaining raw data: receiving input raw vehicle trajectory data and lane line data; wherein the raw vehicle trajectory data includes the position coordinates, speed, and acceleration information of the target vehicle within a historical time period; the lane line data includes the position, shape, and adjacent relationship information between lane lines.
3. The method according to claim 1, characterized in that In step 2, the lightweight attention adaptive encoding module includes the following connected in sequence: The feature transformation layer based on a two-layer feedforward neural network receives the input feature vector, maps the input dimension to the hidden layer dimension through the first fully connected layer, transforms it through a nonlinear activation function, applies layer normalization to stabilize the feature distribution, then passes through a dropout layer to prevent overfitting, and finally maps the hidden layer dimension to the target output dimension through the second fully connected layer; Residual connection structure: The output of the feature transformation layer structure is added to the original input feature vector. When the input dimension does not match the target output dimension, the original input feature vector is aligned through linear transformation. When the dimensions are consistent, an identity connection is directly performed. Lightweight channel attention layer: receives the output feature vector of the residual connection structure and inputs it into a lightweight perceptron composed of two fully connected layers; wherein the first fully connected layer compresses the feature dimension to 1 / 4 of the original dimension, and after the ReLU activation function, the second fully connected layer restores it to the original dimension, and then generates a channel weight vector in the range of (0,1) through the Sigmoid function; the channel weight vector is multiplied by the output feature vector of the residual connection structure channel by channel to achieve a channel weighting operation that enhances the weight of the key information channel and suppresses the weight of the noise feature channel; Dynamic temperature modulation unit: includes a learnable global temperature parameter; based on the feature vector after the channel weighting operation, the global temperature parameter is applied to perform a scaling operation to adaptively adjust the sharpness of the feature distribution, increase the difference between similar features and widen the difference between dissimilar features, and improve the distinguishability of feature expression.
4. The method according to claim 1, wherein Step 3 includes the following steps: The original vehicle trajectory data and lane line data are input into the lightweight attention adaptive encoding module, which outputs the following enhanced feature embedding: Vehicle node embedding: A local polar coordinate system is used to construct a vehicle spatial representation, with the vehicle position as the coordinate origin and the driving direction as the positive axis. Multi-level feature fusion of vehicle state information is performed based on the lightweight attention adaptive coding module to generate a vehicle node embedding with spatiotemporal awareness. Lane node embedding: Based on the multimodal features of the lane map, such as spatial position, length, directional attributes, and semantic information, a structured representation is constructed through topological connectivity. The lightweight attention adaptive encoding module is used to jointly encode lane geometry and topological relationships, outputting lane node embeddings that contain road structure semantics. Relative position edge embedding: To decouple the spatial representation differences of different local coordinate systems, the relative spatiotemporal relationship between nodes is defined as edge features. The edge features include the Euclidean distance offset between nodes, the target node direction angle, the direction angle between nodes, and the temporal difference. The lightweight attention adaptive coding module is used to perform cross-coordinate system conversion encoding on the multidimensional edge features to generate relative position edge embeddings that represent the dynamic interaction relationship between nodes. Among them, the vehicle node embedding, lane line node embedding, and relative position edge embedding are all generated through relative spatiotemporal position encoding.
5. The method according to claim 1, characterized in that Step 4 includes the following steps: Step 4.1: Based on the vehicle node embedding, lane line node embedding, and relative position edge embedding, construct an initial heterogeneous graph structure, where the nodes include the dynamic feature embedding of the vehicle and the static feature embedding of the lane line, and the edges are the relative position edge embeddings between nodes; Step 4.2: Initialize k learnable query vectors for each vehicle at time t, where each query vector models a potential driving behavior mode; Step 4.3: Temporal attention processing: For the target node ,implement: Step 4.3.1: Based on time window The historical trajectory features within the time window are modeled using a multi-head graph attention mechanism; where the key and value are both determined by the time window The historical node embeddings and the corresponding edge embeddings are constructed by splicing along the feature dimension; Step 4.3.2: Weighted aggregation of the modeling time series association results of step 4.3.1 to the target node On the characteristics of; Step 4.3.3: Perform channel weighting operation on the target node features obtained in step 4.3.2 to enhance the key feature channels; Step 4.3.4: Pass the features after the channel weighting operation in step 4.3.3 through a feedforward neural network to generate a temporal feature embedding; Step 4.4: Spatial attention processing: For the target node ,implement: Step 4.4.1: Based on the initial heterogeneous graph structure, with the target vehicle as the center and radius Lane nodes within; Step 4.4.2: Calculate the multi-head attention score in layers; first calculate the interaction features between the vehicle and the lane line, where the key and value are determined by the radius Lane node features within and the corresponding edge features Concatenate along the feature dimension; then calculate the interaction features between vehicles, where the keys and values are determined by the radius Other vehicle node features except the target vehicle within and the corresponding edge features Splicing along the characteristic dimension; Perform weighted fusion of the two multi-head attention scores to generate the final spatial attention score; Step 4.4.3: Add the attention score calculated in step 4.4.2 to the target node On the characteristics of; Step 4.4.4: Perform channel weighting operation on the target node features obtained in step 4.4.3; Step 4.4.5: Pass the target node features after the channel weighting operation in step 4.4.4 through the feedforward neural network layer to generate spatial feature embedding.
6. The method according to claim 1, characterized in that Step 5 includes the following steps: Step 5.1: Sum the temporal feature embedding generated by the temporal attention module and the spatial feature embedding generated by the spatial attention module to obtain the merged spatiotemporal features; Step 5.2: Input the merged spatiotemporal features into the temporal attention module and the spatial attention module in sequence for interactive fusion; Step 5.3: The temporal attention module encodes the historical temporal features and generates a time-aware spatial embedding. Step 5.4: The spatial attention module models the dynamic interactions between vehicles and between vehicles and lanes based on the temporally enhanced embeddings. Step 5.5: The temporal attention module and the spatial attention module sequentially process the initial spatiotemporal feature embedding to form a time-first cascade architecture, achieve bidirectional deep coupling of spatiotemporal features, and generate the final spatiotemporal enhanced feature embedding.
7. The method according to claim 1, characterized in that Step 6 includes the following steps: The spatiotemporal feature enhancement embedding is input into a decoder, and the decoder generates a future multimodal prediction trajectory; The decoder includes a two-layer perceptron structure and a lightweight channel attention mechanism; The two-layer perceptron structure is configured to: receive the spatiotemporal feature enhanced embedding, map the input dimension to the hidden layer dimension through a first fully connected layer, apply layer normalization to stabilize the feature distribution after a nonlinear activation function transformation, and prevent overfitting through a dropout layer; and then map the hidden layer dimension to the target output dimension through a second fully connected layer; The lightweight channel attention mechanism is configured to: receive the output features of the two-layer perceptron structure and input them into a lightweight perceptron composed of two fully connected layers; wherein the first fully connected layer compresses the feature dimension to 1 / 4 of the original dimension, and then restores it to the original dimension by the second fully connected layer after the ReLU activation function, and finally generates a channel weight vector in the range of (0, 1) through the Sigmoid function; and multiplies the channel weight vector by the original feature channel by channel to achieve weighting of different feature channels; The refined features after the nonlinear transformation are mapped to the future multimodal predicted trajectory space, and multiple possible future trajectories of the target vehicle are output.
8. A vehicle trajectory prediction device based on dynamic attention adaptive coding, characterized in that: include: Data acquisition unit: used to receive input original vehicle trajectory data and lane line data; A feature coding module construction unit is used to construct a lightweight attention adaptive coding module, which includes a feature transformation layer based on a two-layer feedforward neural network, a residual connection structure, a lightweight channel attention layer, and a dynamic temperature modulation unit; Data processing unit: Processes data through the lightweight attention adaptive coding module, inputting the acquired raw vehicle trajectory data and lane line data into the lightweight attention adaptive coding module. After processing, the module outputs highly discriminative enhanced features, including vehicle node embedding, lane line node embedding, and relative position edge embedding; The spatiotemporal attention processing unit feeds the vehicle node embedding, lane line node embedding, and relative position edge embedding into the temporal attention module and spatial attention module, respectively, to capture the temporal dependencies of vehicles and the spatial interactions between vehicles and lane lines, and between vehicles themselves, to obtain temporal feature embedding and spatial feature embedding, respectively. Spatiotemporal feature enhancement unit: The obtained temporal feature embedding is added to the spatial feature embedding to generate a spatiotemporal feature embedding, and the spatiotemporal feature embedding is sequentially passed through the temporal attention module and the spatial attention module to further refine the embedded features and generate a spatiotemporal enhanced feature embedding; Trajectory generation unit: The obtained spatiotemporal enhancement features are embedded and a multimodal predicted trajectory is generated through a decoder. The decoder structure includes a two-layer perceptron and a lightweight channel attention module.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a vehicle trajectory prediction method based on dynamic attention adaptive coding as described in any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: The invention comprises a processor and a memory for storing processor executable instructions, wherein the processor is configured to execute the steps of a vehicle trajectory prediction method based on dynamic attention adaptive coding according to any one of claims 1 to 7 by executing the executable instructions.