Secondary spatio-temporal modeling and adaptive prediction method for driving trajectory in complex traffic environment
By constructing a vehicle potential energy field model and performing high-order dynamic analysis in complex traffic environments, and combining it with the Informer neural network, the problem of insufficient physical constraints and adaptability in trajectory prediction in existing technologies is solved, achieving high-precision trajectory prediction and meeting the safety requirements of high-level autonomous driving.
Patent Information
- Application Number
- CN202611351299.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-02
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies lack physical constraints in trajectory prediction under complex traffic environments, cannot effectively distinguish the driver control stage, and have insufficient generalization ability in high-intensity risk areas. They also cannot adapt to different road traffic complexities, resulting in poor physical interpretability of prediction results and failing to meet the safety requirements of high-level autonomous driving.
A secondary spatiotemporal modeling and adaptive prediction method for driving trajectories in complex traffic environments is adopted. A vehicle potential energy field model is constructed through molecular potential field theory, and high-order dynamic analysis is performed by combining Lagrange and Hamiltonian quantities. Informer neural network is used for feature fusion, and physical consistency constraints and adaptive attention mechanisms are introduced to achieve accurate prediction of complex traffic scenarios.
It achieves high-precision trajectory prediction in complex traffic environments, reduces error indicators such as MSE and RMSE, meets the physical compliance requirements for safety decisions in high-level autonomous driving, adapts to different traffic complexities, and improves the generalization ability of scenarios.
Smart Images

Figure CN123159101A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle route planning technology, specifically to a method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments. Background Technology
[0002] With the development of V2X and intelligent driving technologies, trajectory prediction is a core module for vehicle safety decision-making. Existing technologies are divided into two routes: pure data-driven and physical dynamics, but both have obvious defects.
[0003] Data-driven models, such as CNN, LSTM, Informer, and DenseTNT, excel at uncovering long-term motion patterns, boast high computational efficiency, and can fit massive amounts of driving data. However, these models rely solely on raw observations such as coordinates and velocity, lacking prior constraints on motion physics. In complex interaction scenarios like intersections, ramp merging, and multi-vehicle following, they are prone to generating trajectories that violate dynamic laws such as conservation of mechanical energy and safe distances between vehicles. This results in poor physical interpretability of the predictions, making it difficult to meet the safety requirements of high-level autonomous driving.
[0004] Traditional physical dynamics methods rely on the principle of least action, Lennard-Jones molecular potential, and Lagrange mechanics to quantify vehicle interactions and energy changes, outputting trajectories that conform to physical rules. However, these models have weak generalization capabilities, only suitable for simple driving conditions with uniform speed and following, and cannot characterize nonlinear behaviors such as frequent starts and stops, lane changes, and multi-vehicle interactions on urban roads. Furthermore, they lack the ability to mine temporal features and cannot capture the evolutionary patterns of driver control in different stages.
[0005] Existing conventional spatiotemporal analysis only conducts first-order statistical analysis of kinetic energy and momentum, which can only characterize the surface features of instantaneous motion and has significant shortcomings: First, it cannot decouple higher-order dynamic interaction information, cannot extract interpretable physical features such as Lagrange quantities, Hamiltonian quantities, and action quantities, and has difficulty distinguishing the differentiated motion laws of the three stages of driver adaptation, cruising, and predictive deceleration; Second, traditional vehicle potential fields do not combine vehicle speed to correct for safe distances, do not distinguish longitudinal and lateral potential energy intensities, and quantify long-distance vehicle-to-vehicle interactions with distortion; Third, physical spatiotemporal features and temporal networks are simply spliced and fused, lacking an adaptive coupling mechanism, and the advantages of physical priors and data-driven approaches cannot be coordinated.
[0006] Meanwhile, existing solutions for complex urban road networks still have engineering challenges: they lack feature enhancement mechanisms for high-impact risk hotspots such as intersections and ramps; they rely solely on numerical error assessment models such as MSE and RMSE, lacking physical consistency evaluation standards for mechanical energy and impact constraints; and their network hyperparameters remain fixed, failing to adapt to varying road traffic complexities and exhibiting insufficient scenario generalization capabilities. To address these challenges, we propose a secondary spatiotemporal modeling and adaptive prediction method for driving trajectories in complex traffic environments. Summary of the Invention
[0007] To address the aforementioned technical issues, this technical solution provides a secondary spatiotemporal modeling and adaptive prediction method for driving trajectories in complex traffic environments. This solution resolves the problems of: lack of feature enhancement mechanisms for high-impact risk hotspots such as intersections and ramps; reliance solely on numerical error assessment models such as MSE and RMSE, lack of physical consistency evaluation standards for mechanical energy and impact constraints; and fixed network hyperparameters, which cannot adapt to different road traffic complexities and have insufficient scenario generalization capabilities.
[0008] To achieve the above objectives, the technical solution adopted in this invention is: a method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments, wherein the prediction steps are as follows:
[0009] Step S1: Obtain the driving trajectory data of the target vehicle in a complex traffic environment, and perform data cleaning and missing value processing on the driving trajectory data to obtain preprocessed trajectory data;
[0010] Step S2: Based on the preprocessed trajectory data, calculate the vehicle's kinetic energy and momentum, perform spatial dimension analysis on the kinetic energy and temporal dimension analysis on the momentum, and obtain a spatiotemporal analysis feature.
[0011] Step S3: Based on molecular potential field theory, construct a vehicle potential energy field model with required safety distance and dispersion coefficient, and calculate the interaction potential energy between vehicles according to the actual distance between the target vehicle and surrounding vehicles.
[0012] Step S4: Based on the kinetic energy and the interaction potential energy, construct the Lagrange quantity and the Hamiltonian, calculate the action quantity, perform spatial dimension analysis on the Lagrange quantity and temporal dimension analysis on the Hamiltonian, and obtain the secondary spatiotemporal analysis characteristics.
[0013] Step S5: Construct a physical feature tensor by combining the primary spatiotemporal analysis features and the secondary spatiotemporal analysis features. Input the physical feature tensor into an Informer neural network. Perform hierarchical fusion of the physical feature tensor and temporal dependency features through the Informer neural network to output the future trajectory prediction result of the target vehicle.
[0014] Preferably, in step S1, the data cleaning includes removing speed and acceleration data that exceed reasonable ranges based on the physical constraints of vehicle driving, and using box plots to identify and remove outliers; the missing value handling includes: when the number of sampling points corresponding to the missing duration does not exceed a preset threshold, using Lagrange interpolation to supplement them; when the number of missing sampling points exceeds the preset threshold, they are determined to be invalid data and are removed entirely.
[0015] Preferably, in step S2, the temporal distribution of momentum is analyzed using the kernel density estimation method. The vehicle's trajectory is divided into multiple continuous segments, and the density estimate of momentum data within each segment is calculated using the Gaussian kernel function. The evolution of momentum distribution from bimodal to unimodal and then back to bimodal distribution is analyzed through the change in the density curve shape. The spatial dimension analysis of kinetic energy includes removing transient data during the vehicle's acceleration phase, dividing the driving cycle into multiple stages, and revealing the evolutionary pattern of kinetic energy distribution from conservative to adaptive and then to proficient through a kinetic energy time heatmap.
[0016] Preferably, in step S3, the required safe distance is calculated based on the following vehicle speed using the following formula:
[0017]
[0018] in, To maintain a safe distance, For driver reaction time, The reciprocal of twice the maximum deceleration of the following vehicle. For the vehicle's real-time speed;
[0019] The vehicle potential energy field model adopts the Lennard-Jones potential function with a dispersion coefficient, and the formula is as follows:
[0020]
[0021] in, This refers to the potential energy generated by the interaction between vehicles. For the potential well depth, This refers to the actual distance between vehicles. is the dispersion coefficient.
[0022] Preferably, in step S3, the vehicle potential energy field model further includes a lateral potential energy adjustment coefficient c. This lateral adjustment coefficient c is set based on the angle between the line connecting the two vehicles and the longitudinal direction of the road. The adjusted potential energy formula is:
[0023]
[0024] Here, 'c' is used to reduce the lateral potential energy intensity, thereby minimizing the impact of lane disturbances on longitudinal following behavior.
[0025] Preferably, in step S4, the formula for calculating the Lagrange quantity is:
[0026]
[0027] in, Let m be the vehicle mass, and let m be the Lagrange quantity. The spatial dimension analysis of the Lagrange quantity includes extracting the kinetic energy space segment, analyzing the correspondence between the fluctuation of the Lagrange quantity and the spatial abrupt change of the potential energy term, and identifying the spatial phase transition of driving behavior by the change of potential field gradient when the vehicle enters the intersection conflict domain.
[0028] Preferably, in step S4, the formula for calculating the Hamiltonian is:
[0029]
[0030] Wherein, H is the Hamiltonian; the temporal dimension analysis of the Hamiltonian includes extracting momentum time segments, analyzing the correlation between the distribution characteristics of the Hamiltonian over time and the momentum kernel density distribution, and identifying the switching between the cognitive adaptation and active prediction stages of driving behavior through the distribution pattern of the Hamiltonian.
[0031] Preferably, in step S4, the action quantity S is defined as the integral of the Lagrange quantity over time. Based on Hamilton's principle, the action quantity of real motion takes an extreme value, i.e., δS=0. The action quantity is converted from the Lagrange form to the Hamiltonian form, so that the variables of the action quantity are converted from generalized coordinates and generalized velocity to generalized coordinates and generalized momentum.
[0032] Preferably, in step S5, the probabilistic sparse self-attention mechanism of the Informer neural network incorporates the coupling effect of kinetic energy and momentum, and the attention sparsity score... The calculation formula is:
[0033]
[0034] in, For the first A query vector, For the first A key vector, and The first The and the first Kinetic energy characteristics at each location, and The first The and the first Momentum characteristics at each location, and For a single spatiotemporal analysis weight parameter, The dimension of the key vector. Given the sequence length; only the first few sequences with the highest sparsity scores are retained. Each query vector participates in the attention calculation.
[0035] Preferably, in step S5, the Informer neural network further includes the following improvements:
[0036] A spatiotemporal feature adaptation layer is added before the sequence compression layer to concatenate and fuse the temporal location encoding with the spatial location encoding based on Euclidean distance, so that the input features have both temporal and spatial location information.
[0037] The Hamiltonian and Lagrange features are embedded in the cross-attention of the decoder, and the mean of the Hamiltonian and Lagrange and the kinetic gradient are introduced as physical bias terms in the attention score of the cross-attention, thereby enhancing the decoder's ability to perceive the physical features of driving behavior.
[0038] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0039] This invention proposes to construct a speed-adaptive Lennard-Jones vehicle potential energy field, introducing dispersion coefficients and longitudinal / lateral potential energy adjustment coefficients to accurately quantify the attraction and repulsion interactions among multiple vehicles. Through secondary spatiotemporal analysis, it extracts physically interpretable features such as kinetic energy, momentum, Lagrangian quantities, Hamiltonian quantities, and action quantities. Simultaneously, a physical consistency constraint term is added to the model's loss function to regulate the prediction output based on the principles of mechanical energy conservation and minimum action. Compared to purely data-driven models such as CNN, native Informer, and DenseTNT, this invention significantly reduces MSE, RMSE, and MAE errors, effectively avoiding prediction results that violate dynamic laws, such as sudden speed changes, unreasonable vehicle spacing, and non-conservation of mechanical energy, thus meeting the physical compliance requirements for high-order autonomous driving safety decisions.
[0040] This invention distinguishes between primary spatiotemporal basic motion analysis and secondary spatiotemporal higher-order dynamic analysis. It relies on kernel density estimation and thermograms to complete the mining of kinetic energy and momentum surface features, and then combines analytical mechanics to achieve the extraction of potential energy and action quantity higher-order features. With the help of DBSCAN density clustering, it automatically identifies action quantity hotspot risk areas such as intersections and ramps and performs feature enhancement, fully reproducing the three-stage dynamic evolution characteristics of the driver: "adaptation and probing - stable cruising - predictive deceleration".
[0041] This invention improves the Informer sparse attention mechanism by embedding spatiotemporal physical features into attention score calculation, implementing an adaptive attention sampling strategy in the design phase, and compressing redundant temporal information using stacked sequence distillation layers. The decoder introduces Lagrange and Hamiltonian energy features through cross-attention, establishing a complete coupled link of "physical feature embedding - adaptive attention extraction - driving phase perception decoding - physical loss constraint".
[0042] This invention innovatively constructs a Physical Consistency Score (PCS) to quantify the degree of matching between the predicted trajectory and vehicle dynamics, overcoming the shortcomings of existing technologies that rely solely on numerical error assessment and cannot determine the physical feasibility of the trajectory. Simultaneously, it completes model hyperparameter grid optimization, determining the optimal combination of physical embedding dimension, number of attention heads, hotspot enhancement coefficients, etc., eliminating the need for repeated manual parameter tuning. It can adaptively match roads with different traffic complexities, reducing engineering deployment and debugging costs, and providing reliable technical support for connected vehicle trajectory prediction and active hazard avoidance modules. Attached Figure Description
[0043] Figure 1 This is a flowchart of the steps of the present invention;
[0044] Figure 2 This is a schematic diagram of the system architecture of the present invention;
[0045] Figure 3 This is a structural diagram of the Informer of the present invention. Detailed Implementation
[0046] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0047] Reference Figure 1 This invention provides a method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments. The prediction steps include steps S1 to S5. The technical solution of this invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Step S1: Acquisition and Preprocessing of Driving Trajectory Data
[0049] In step S1, the driving trajectory data of the target vehicle in a complex traffic environment is obtained, and the driving trajectory data is cleaned and missing value processing is performed to obtain preprocessed trajectory data.
[0050] Specifically, this embodiment uses a multi-user, multi-machine interactive driving simulator to collect driving trajectory data. The simulator hardware uses a Logitech G27 combined with a Playseat Evolution steering wheel and seat set, providing the driver with complete operating facilities such as a steering wheel, brake pedal, and accelerator. A three-dimensional driving environment is constructed using FORUM8's UC-win / Road software, performing detailed GIS data modeling of the road network in the city center, recreating road geometry, traffic organization, and dynamic traffic flow characteristics. Typical urban road scenarios are selected, including three road types: urban arterial roads, secondary arterial roads, and expressways, to cover driving behavior characteristics under different traffic complexities. The experiment recruited 52 drivers, including 30 men and 22 women, aged between 18 and 59 years old, with driving experience ranging from 0.5 to 32 years, covering both novice and experienced drivers to ensure data diversity and representativeness.
[0051] The driving trajectory data includes real-time vehicle position coordinates, speed, acceleration, headway, lane number, and other information, with a sampling frequency of 10Hz. Due to factors such as equipment signal fluctuations and abnormal driver operation during simulated driving, the raw data inevitably contains outliers and missing items that exceed reasonable ranges, requiring data cleaning and missing value processing.
[0052] Data cleaning consists of two stages:
[0053] The first phase involves eliminating speed and acceleration data that exceed reasonable ranges based on the physical constraints of vehicle movement. Specifically, the speed limit is set at 1.2 times the road speed limit, and the acceleration limit is set at... The lower limit is Sampling points outside the above range are considered as sensor malfunctions or non-real driving behavior and are therefore excluded.
[0054] In the second stage, box plots were used to identify and remove outliers. The first quartile was calculated for both velocity and acceleration data. Third and quartiles and interquartile range It will fall Data points outside the specified intervals are identified as outliers and removed. The box plot method detects anomalies based on the statistical distribution characteristics of the data, without assuming that the data follows a specific distribution, making it suitable for identifying non-Gaussian distributed outliers in driving data.
[0055] Missing value handling employs a hierarchical strategy:
[0056] When the number of sampling points corresponding to the missing duration does not exceed a preset threshold, Lagrange interpolation is used for supplementation. In this embodiment, the preset threshold is set to 3 sampling points, corresponding to a missing duration of 0.3 seconds. The core idea of Lagrange interpolation is to construct a polynomial using known data points and then use this polynomial to interpolate and estimate the missing location. For the missing location... The estimated value at that location is obtained using the interpolation formula:
[0057]
[0058] in, For missing positions Interpolation estimate at point, The number of known data points to be used in the interpolation. and The first The values of the independent and dependent variables for each known data point. For the first The independent variable values of the known data points. Lagrange interpolation can accurately restore the data trend when the number of missing points is small, and is suitable for supplementing short-term missing data.
[0059] When the number of missing sampling points exceeds the preset threshold, the data is deemed invalid and removed entirely because it is difficult to accurately reconstruct the actual driving state through interpolation, thus avoiding the introduction of additional errors through manual filling.
[0060] Reference Figure 2 The data preprocessing layer includes a trajectory data acquisition module, a physical constraint cleaning module, a box plot outlier detection module, and a missing value processing module. These modules are executed in sequence to output preprocessed trajectory data.
[0061] Step S2: Spatiotemporal Analysis
[0062] In step S2, based on the preprocessed trajectory data, the vehicle's kinetic energy and momentum are calculated, and the kinetic energy is analyzed in a spatial dimension and the momentum is analyzed in a temporal dimension to obtain a spatiotemporal analysis feature.
[0063] Vehicle kinetic energy and momentum calculation
[0064] Vehicle kinetic energy reflects the kinetic energy state of a vehicle in a spatial dimension and is a scalar physical quantity describing the vehicle's motion behavior. The formula for calculating vehicle kinetic energy is:
[0065]
[0066] in, For vehicle kinetic energy, For vehicle quality, This represents the vehicle's real-time speed.
[0067] Vehicle momentum reflects the vehicle's inertia over time and is a vector physical quantity describing the vehicle's motion behavior. The formula for calculating vehicle momentum is:
[0068]
[0069] in, For vehicle momentum, For vehicle quality, This represents the vehicle's real-time speed.
[0070] Kinetic energy and momentum characterize vehicle motion from two dimensions, space and time, respectively. However, relying solely on raw statistical values is insufficient to reveal the dynamic evolution of driving behavior. Therefore, further kernel density estimation and heatmap analysis are needed.
[0071] Time dimension analysis of momentum
[0072] The temporal distribution of the momentum was analyzed using kernel density estimation. Kernel density estimation is a non-parametric testing method that describes the distribution of data through continuous density curves, and can intuitively show the dynamic evolution characteristics of vehicle momentum over time.
[0073] The vehicle's trajectory is divided into multiple continuous segments according to its time distribution. In this embodiment, it is divided into five continuous segments, each corresponding to a different stage of the driving process. A Gaussian kernel function is used to calculate the density estimate of the momentum data within each segment. The expression for the Gaussian kernel function is:
[0074]
[0075] in, For Gaussian kernel function, These are standardized variables.
[0076] The formula for calculating the nuclear density estimate is:
[0077]
[0078] in, For the sample size, For bandwidth (smoothing parameter). For the points where density estimates are to be calculated, For the first One sample point, In order to be in Density estimate at [location]. Bandwidth. The choice of bandwidth affects the smoothness of the density curve. In this embodiment, the Silverman rule of thumb is used to determine the optimal bandwidth.
[0079] The evolution of momentum distribution was analyzed by examining changes in the density curve morphology: In the initial stage of driving, the driver is in a cognitive adaptation phase to the unfamiliar road environment, and the momentum distribution exhibits a bimodal distribution, reflecting the driver's unstable operation of frequent acceleration and deceleration. As the driving distance increases, the driver gradually adapts to the road environment, and the momentum distribution evolves into a unimodal distribution, reflecting the driver entering a stable cruising state. In the later stage of driving, the driver develops active predictive ability, and the momentum distribution reverts to a bimodal distribution, but the distance between the two peaks converges to 50% of the previous period, indicating that the range of speed changes has narrowed and become more regular. Therefore, the momentum distribution exhibits an evolutionary pattern from a bimodal distribution to a unimodal distribution and then back to a bimodal distribution.
[0080] Spatial dimension analysis of kinetic energy
[0081] The spatial dimension analysis of the kinetic energy includes: after removing transient data during the vehicle start-up and acceleration phase, dividing the driving cycle into multiple phases, and revealing the evolution pattern of kinetic energy distribution through a kinetic energy time-heatmap.
[0082] Specifically, firstly, transient data from the first 10 seconds of acceleration in the driving cycle are removed. During this phase, the vehicle accelerates from a standstill to normal speed, resulting in drastic changes in kinetic energy, but this is a non-steady-state process and does not reflect the driver's control characteristics. Then, the driving cycle is divided into four stages, and a kinetic energy-time heatmap is plotted with time as the horizontal axis and spatial location as the vertical axis. Different colors in the heatmap correspond to different kinetic energy intensity ranges, with red representing high kinetic energy areas and blue representing low kinetic energy areas.
[0083] The kinetic energy time-space heatmap reveals the evolutionary pattern of kinetic energy distribution from conservative to adaptive to skilled: In the conservative stage, the kinetic energy distribution exhibits high dispersion and large fluctuations, corresponding to the driver's cautious response to unfamiliar environments; in the adaptive stage, the kinetic energy distribution gradually converges, and the fluctuations decrease, corresponding to the driver's basic adaptation to the road environment; in the skilled stage, the kinetic energy distribution tends to be stable and concentrated, corresponding to the driver forming a stable control strategy. The spatiotemporal analysis characteristics include momentum kernel density distribution characteristics and kinetic energy heatmap characteristics.
[0084] Reference Figure 2 The first spatiotemporal analysis layer includes a kinetic energy calculation module, a momentum calculation module, a kernel density estimation module, and a kinetic energy heatmap module. The kinetic energy calculation module and the momentum calculation module calculate the vehicle's kinetic energy and momentum based on the preprocessed trajectory data, respectively. The kernel density estimation module analyzes the temporal distribution of momentum, and the kinetic energy heatmap module performs a visual analysis of the spatial distribution of kinetic energy.
[0085] Step S3: Modeling the vehicle potential energy field
[0086] In step S3, based on molecular potential field theory, a vehicle potential energy field model is constructed using the required safety distance and dispersion coefficient, and the interaction potential energy between vehicles is calculated based on the actual distance between the target vehicle and surrounding vehicles.
[0087] Introduced by molecular potential field theory
[0088] Drawing on molecular potential field theory, other vehicles on the road are considered as field sources, and an interaction potential function between vehicles is defined. The molecular potential field affects objects within its range, and the degree of influence varies with the position of the objects. This characteristic is highly similar to the dynamic interaction behavior between vehicles: vehicles always maintain a specific distance while moving, neither too close nor too far, similar to the interaction relationship between molecules.
[0089] Molecular interaction potentials unify the expression of attraction and repulsion, which is superior to potential field models that express the attractive and repulsive terms separately. The general form of the molecular interaction potential function is:
[0090]
[0091] in, The velocity function is the required safe distance. This refers to the actual distance between vehicles. , For potential energy related parameters, , For the power exponent parameter.
[0092] In urban traffic flow, , , , This allows us to obtain a vehicle potential energy expression in the form of a Lennard-Jones potential function.
[0093] Calculation of required safe distance
[0094] In car-following, the following vehicle typically does not lag behind the vehicle in front for an extended period, but also does not get too close, to ensure safe driving. The required safe following distance aims to ensure that even if the vehicle in front brakes suddenly, the following vehicle has sufficient reaction time and braking distance to avoid an accident.
[0095] The speed of the following vehicle minus the distance between the front and rear of the vehicle is expressed as:
[0096]
[0097] in, For the distance between the front of the car, For vehicle length, For driver reaction time, The reciprocal of twice the maximum deceleration of the following vehicle. This represents the vehicle's real-time speed.
[0098] Speed-vehicle spacing (i.e., required safe distance) is the distance between vehicle heads minus the vehicle length:
[0099]
[0100] in, To maintain a safe distance, For driver reaction time, The reciprocal of twice the maximum deceleration of the following vehicle. This represents the vehicle's real-time speed.
[0101] Required safe distance It is a quadratic function of speed, increasing with vehicle speed, which aligns with the practical driving experience that requires a greater safety distance when driving at high speeds.
[0102] Lennard-Jones potential function with introduction of dispersion coefficient
[0103] The vehicle potential energy field model adopts the Lennard-Jones potential function with a dispersion coefficient, and the formula is as follows:
[0104]
[0105] in, This refers to the potential energy generated by the interaction between vehicles. For the potential well depth, This refers to the actual distance between vehicles. To maintain a safe distance, is the dispersion coefficient.
[0106] in, This is a term representing the repulsive effect. When the distance between vehicles is less than the required safe distance, this term increases sharply, reflecting the repulsive effect caused by the vehicles being too close together. As an attraction term, this term decreases slowly when the distance between vehicles exceeds the required safe distance, reflecting the attraction effect between vehicles in maintaining a reasonable following distance.
[0107] Introducing the dispersion coefficient The purpose is to address the issue that, when calculating potential energy data, the gradient of potential energy decreases excessively as the distance between vehicles increases, resulting in a shorter effective range that only covers nearby vehicles. Adding a dispersion coefficient addresses this. This allows the potential energy to change more smoothly as the distance between vehicles increases, and it can be transmitted to a greater distance, thus more accurately depicting the interaction between vehicles at long distances.
[0108] According to the defined balance distance When the relative distance between vehicles is The potential energy generated is at its minimum when the distance between the vehicle and the target vehicle is zero. As the relative distance changes, the potential energy gradually increases. The potential field strength at any position on the potential field plane changes with the distance from the target vehicle. Within a safe distance range, the potential field strength gradually increases as the distance decreases, reaching its maximum value when approaching the target vehicle.
[0109] Lateral potential energy adjustment coefficient
[0110] When calculating lateral potential energy, since vehicles primarily follow longitudinally, the mutual influence in the lateral direction is relatively small, and the speed difference between adjacent vehicles has a relatively limited impact on potential energy. Therefore, the lateral potential field strength needs to be appropriately reduced to ensure that the model reasonably reflects actual driving conditions and the lateral influence between vehicles.
[0111] The vehicle potential energy field model also includes a lateral potential energy adjustment coefficient. The lateral adjustment coefficient The angle is set based on the angle between the line connecting the two vehicles and the longitudinal direction of the road. When the direction of the line connecting the two vehicles is the same as the longitudinal direction of the road (i.e., following each other), the angle is... , The value is 1, and the lateral potential energy intensity is equal to the longitudinal potential energy intensity; when the line connecting the two vehicles is perpendicular to the longitudinal direction of the road (i.e., driving side by side), the included angle is... , When the value is less than 1, the transverse potential energy intensity is appropriately reduced.
[0112] The adjusted potential energy formula is:
[0113]
[0114] in, Used to reduce lateral potential energy intensity, thereby minimizing the impact of lane disturbances on longitudinal following behavior. Coefficient The range of values is The specific value is determined based on the angle between the line connecting the two vehicles and the longitudinal direction of the road.
[0115] Reference Figure 2 The potential energy field modeling layer includes a required safe distance calculation module, an LJ potential function construction module, and a lateral adjustment coefficient module. The required safe distance calculation module calculates the required safe distance based on vehicle speed, the LJ potential function construction module calculates the interaction potential energy between vehicles based on the Lennard-Jones potential function and the dispersion coefficient, and the lateral adjustment coefficient module adjusts the lateral potential energy intensity based on the angle between vehicles.
[0116] Step S4: Secondary Spatiotemporal Analysis
[0117] In step S4, based on the kinetic energy and the interaction potential energy, the Lagrange quantity and Hamiltonian are constructed, and the action quantity is calculated. The spatial dimension of the Lagrange quantity is analyzed, and the temporal dimension of the Hamiltonian is analyzed to obtain the secondary spatiotemporal analysis characteristics.
[0118] First-order analysis (single-stage spatiotemporal analysis) can only describe the basic kinematic relationships of the system and instantaneous changes in momentum and kinetic energy, but it cannot capture higher-order dynamic behaviors and key effects in complex engineering scenarios. Therefore, based on the Lagrange principle and the vehicle's potential energy, a Lagrangian quantity is constructed, and its characteristics in the second-order spatial dimension are analyzed based on the first-order kinetic-time coupling analysis; similarly, based on the Hamiltonian principle and the vehicle's potential energy, a Hamiltonian quantity is constructed, and its characteristics in the second-order time dimension are analyzed based on the first-order momentum-space coupling analysis.
[0119] Lagrange Dawn Calculation and Spatial Dimension Analysis
[0120] The Lagrange quantity is a core concept in analytic mechanics, a scalar function describing the dynamics of a physical system, typically expressed as the difference between the system's kinetic and potential energy. In this invention, the formula for calculating the Lagrange quantity is:
[0121]
[0122] in, For Lagrange units, For vehicle quality, For the vehicle's real-time speed, This is the horizontal potential energy adjustment coefficient. For the potential well depth, To maintain a safe distance, This refers to the actual distance between vehicles. The dispersion factor. The kinetic energy term in the Lagrange. The potential energy term reflects the kinetic energy of a vehicle. It reflects the potential energy of the interaction between vehicles.
[0123] For those with Generalized coordinates and the corresponding generalized velocity For a system, the Lagrange can be expressed as:
[0124]
[0125] in, For the first A generalized coordinate system For the first A generalized speed, For time.
[0126] The spatial dimension analysis of the Lagrange quantity includes: extracting the kinetic energy spatial segment and analyzing the correspondence between Lagrange quantity fluctuations and potential energy term spatial abrupt changes. When vehicles enter the intersection conflict domain, the actual distance between vehicles... Rapid changes lead to spatial abrupt changes in the potential energy term, resulting in significant fluctuations in the Lagrange quantity. Spatial phase transitions in driving behavior can be identified by changes in the potential field gradient—that is, the process by which a driver switches from a stable following state to an active avoidance or lane-changing state. The physical essence of spatial phase transitions is that changes in the direction of the potential energy field gradient drive a qualitative change in the vehicle's motion state. The spatial distribution characteristics of the Lagrange quantity fluctuations provide quantitative criteria for identifying spatial turning points in driving behavior.
[0127] Hamiltonian computation and time dimension analysis
[0128] The Hamiltonian is introduced through the Legendre transformation of the Lagrange, converting the variables from generalized coordinates and generalized velocity to generalized coordinates and generalized momentum. The formula for calculating the Hamiltonian is:
[0129]
[0130] in, For Hamiltonian, For vehicle quality, For the vehicle's real-time speed, This is the horizontal potential energy adjustment coefficient. For the potential well depth, To maintain a safe distance, This refers to the actual distance between vehicles. The dispersion coefficient is used. In the Hamiltonian, the kinetic energy term and the potential energy term are combined additively to represent the total mechanical energy of the system.
[0131] The Legendre transformation relationship between Hamiltonians and Lagrangers is as follows:
[0132]
[0133] in, For the first A generalized momentum, For the first A generalized speed, For a Lagrange quantity. For a single generalized coordinate:
[0134]
[0135] in, For vehicle momentum, For the vehicle's real-time speed, For Lagrange quantities.
[0136] The temporal dimension analysis of the Hamiltonian includes: extracting momentum time segments and analyzing the correlation between the distribution characteristics of the Hamiltonian over time and the momentum kernel density distribution. In the early stages of driving, the Hamiltonian distribution exhibits high volatility, corresponding to the driver's cognitive learning process in an unfamiliar environment; in the middle stages of driving, the Hamiltonian distribution tends towards a unimodal structure, corresponding to the stable cruising state after the driver's information processing ability improves; in the later stages of driving, the Hamiltonian distribution exhibits a bimodal structure, corresponding to the stage transition after the driver's proactive prediction ability enhances. The distribution pattern of the Hamiltonian identifies the cognitive adaptation and proactive prediction stage transitions in driving behavior.
[0137] Action Calculation
[0138] The amount of action Defined as the integral of the Lagrange over time, its expression is:
[0139]
[0140] in, For action, For Lagrange units, For generalized coordinates, For generalized speed, For time, and These are the upper and lower limits of the integral.
[0141] Based on Hamilton's principle, the action of real motion takes extreme values, that is:
[0142]
[0143] in, This is the variation of the action. Hamilton's principle states that among all possible paths of motion, the path that the system actually follows maximizes (usually minimizes) the action. In the context of vehicle driving, this means that when a driver operates a vehicle, its trajectory physically approximates the path of minimum action, i.e., completing the intended driving task with minimal energy consumption.
[0144] The action is converted from Lagrange form to Hamiltonian form. Through the Legendre transformation, the generalized momentum is defined as:
[0145]
[0146] in, For the first A generalized momentum, For Lagrange units, For the first A generalized speed.
[0147] Hamiltonian is defined as:
[0148]
[0149] in, For generalized coordinates, For generalized momentum, For time.
[0150] The Lagrange can be derived from the definition of the Hamiltonian:
[0151]
[0152] Substituting the above equation into the definition of action, we can transform the action from Lagrangian to Hamiltonian form, changing the variables of the action from generalized coordinates and generalized velocity to generalized coordinates and generalized momentum. The transformed expression for action is consistent with the canonical equations and is the standard expression for action in Hamiltonian mechanics. Therefore, the action curves calculated from the Lagrangian and Hamiltonian quantities are the same.
[0153] Hotspot region identification based on DBSCAN density clustering
[0154] To further extract the spatial distribution patterns of secondary spatiotemporal analysis features, the DBSCAN density clustering algorithm was used to perform cluster analysis on vehicle Lagrange quantity data, dividing it into multiple core clusters, and extracting hotspot regions of Lagrange quantities in the early, middle and late stages of driving.
[0155] In the early stages of driving, the Lagrange diurnal hotspot clustering results exhibit significant dispersion and low clustering. The number of clusters can reach 8 to 12, with a loose spatial distribution. The density of core points within each cluster is only 30% to 40% of that in the middle stages of driving, with no obvious concentrated core areas. Approximately 35% of the low-density hotspots are distributed as isolated points, with distances between them generally exceeding 50 meters. These scattered hotspots are mainly concentrated at locations with significant environmental changes, such as road entrances, initial intersections, and lane merging points. During this stage, drivers are just entering the scenario and have not yet established an effective understanding of the road geometry, traffic flow distribution, and traffic control facilities. Their cognitive load is high, and their operational behavior is primarily exploratory. The momentum distribution in this stage exhibits a broad bimodal structure, with a kinetic energy fluctuation standard deviation as high as 45 kJ, providing spatiotemporal corroboration with the dispersion of the Lagrange diurnal hotspots.
[0156] During the mid-stage of driving, Lagrange daily traffic hotspot clustering exhibits a complex characteristic of coexistence of core clusters and independent hotspots. This stage forms 3 to 5 high-density core clusters, with the density of core points within each cluster increasing 2 to 3 times compared to the previous stage, and the spatial influence range of these core clusters significantly expanding. Simultaneously, there are 4 to 6 independent hotspot areas detached from the main clusters. These core clusters primarily correspond to complex road condition nodes such as intersections, lane merging areas, and ramp entrances / exits on urban roads. These areas have high vehicle interaction intensity, requiring drivers to adjust their speed and distance in real time to avoid risks, resulting in significantly higher Lagrange daily traffic volumes compared to other road sections.
[0157] In the later stages of driving, the Lagrange daily energy hotspot clustering exhibited significant characteristics of equalization and dispersion. The number of clusters decreased to 2 to 3, and the density differences between clusters narrowed, with the ratio of maximum to minimum density dropping below 1.2, and no obvious high-density core areas. Hotspot areas were no longer limited to specific road condition nodes but broadly covered the entire driving segment, and the intensity of the energy tended to level off. Drivers had developed stable control strategies, were able to anticipate changes in road conditions, and their actions were smooth and consistent. Even when facing complex scenarios such as intersections and curves, they could achieve a smooth transition of energy through advance deceleration and smooth steering.
[0158] The hotspot risk areas identified by DBSCAN clustering provide spatial guidance for subsequent feature enhancement of the Informer neural network, enabling the model to allocate higher attention weights to high-action-risk areas such as intersections and ramps. Secondary spatiotemporal analysis features include Lagrangian quantities, Hamiltonian quantities, actions and their spatiotemporal distribution characteristics, and hotspot region clustering features.
[0159] Reference Figure 2 The second-order spatiotemporal analysis layer includes a Lagrange quantity calculation module, a Hamiltonian calculation module, and an action quantity calculation module. Each module extracts the features of the second-order spatiotemporal analysis based on kinetic energy, momentum, and interaction potential energy.
[0160] Step S5: Informer Neural Network Prediction
[0161] In step S5, a physical feature tensor is constructed by combining the primary spatiotemporal analysis features and the secondary spatiotemporal analysis features. The physical feature tensor is then input into an Informer neural network. The Informer neural network performs hierarchical fusion of the physical feature tensor and the temporal dependency features to output the future trajectory prediction result of the target vehicle.
[0162] Construction of physical feature tensors
[0163] A physical feature tensor is constructed by concatenating and fusing primary spatiotemporal analysis features (momentum kernel density distribution features, kinetic energy heatmap features) with secondary spatiotemporal analysis features (Lagrange quantity, Hamiltonian, action quantity and its spatiotemporal distribution features, hotspot region clustering features). This physical feature tensor simultaneously contains first-order kinematic features and higher-order dynamic features, providing the Informer neural network with deeper physical information beyond the original observations. For example, the slope of the integral curve of the action quantity reflects the optimization trend of driving behavior, the energy state partitioning of the Hamiltonian indicates the switching of driving stages, and the gradient change of kinetic energy reflects the influence of the road environment.
[0164] Informer neural network architecture
[0165] Informer is an improved neural network model based on the Transformer architecture, specifically designed for long-sequence time series prediction tasks. Its core innovations lie in its probabilistic sparse self-attention mechanism and self-attention distillation technique, combined with a generative decoder that directly outputs multi-step prediction results. While maintaining the ability to model temporal dependencies, it significantly improves the efficiency and prediction accuracy of long-sequence processing.
[0166] This invention improves the Informer neural network in the following ways: it incorporates the coupling effect of kinetic energy and momentum into the probabilistic sparse self-attention mechanism; it adds a spatiotemporal feature adaptation layer before the sequence compression layer; it embeds the physical bias of Hamiltonian and Lagrange quantity into the cross attention of the decoder; and it adds a physical constraint loss function.
[0167] Reference Figure 3 The Informer neural network structure of this invention includes an input layer, an encoder (3 layers stacked), a decoder (2 layers stacked), and an output layer.
[0168] Improved probabilistic sparse self-attention mechanism
[0169] The probabilistic sparse self-attention mechanism of the Informer neural network incorporates the coupling effect of kinetic energy and momentum, resulting in an attention sparsity score. The calculation formula is:
[0170]
[0171] in, For the first A query vector, For the first A key vector, The key matrix consists of all key vectors. and The first The and the first Kinetic energy characteristics at each location, and The first The and the first Momentum characteristics at each location, and These are the weight parameters for a single spatiotemporal analysis (determined through training). The dimension of the key vector. The sequence length is given.
[0172] Sparsity score It consists of two parts: the first part is the query vector. With all key vectors The maximum value of the dot product, with additional kinetic coupling terms. and momentum coupling term The second part is the mean of the corresponding terms. The difference between the two measures the... The sparsity of the attention distribution of a query vector to key vectors: the larger the difference, the stronger the attention of the query vector to only a few key vectors, which is an "active" query vector; the smaller the difference, the more evenly the attention of the query vector to all key vectors is distributed, which is a "lazy" query vector.
[0173] Only retain the top scorers in sparsity Each query vector participates in the attention calculation, where , Determined through grid search, a typical value of 3 is achieved. This mechanism reduces the computational complexity of attention from... Reduce to Meanwhile, the kinetic-momentum coupling term ensures that physical features participate in the calculation of attention weights, so that the model considers not only data similarity but also the consistency of the vehicle's physical state when selecting important attention pairs.
[0174] The multi-head attention output is:
[0175]
[0176] in, For querying the matrix, The key matrix, For value matrices, For the output of each attention head, For the number of attention heads, This is to output the projection weight matrix. In this embodiment, the model dimensions are... Attention count Optimal effect at the time, per head dimension ,in The dimension of the key vector. The dimension of the value vector.
[0177] Spatiotemporal Feature Adaptation Layer
[0178] A spatiotemporal feature adaptation layer is added before the sequence compression layer to concatenate and fuse the temporal location encoding with the spatial location encoding based on Euclidean distance, so that the input features have both temporal and spatial location information.
[0179] The output expression of the spatiotemporal feature adaptation layer is:
[0180]
[0181] in, For the first The input features of the layer This is a one-dimensional convolution operation (with a kernel size of 3 and using the same padding mode). Encoding for time location, Encoding spatial location, For splicing operations, For time information, This refers to spatial information.
[0182] Time position encoding A sine-cosine coding scheme is used to inject temporal location information into the input features. Spatial location coding. The Gaussian kernel encoding method based on Euclidean distance is used to inject spatial location information into the input features. Through the spatiotemporal feature adaptation layer, the input features carry both temporal and spatial location information, overcoming the problem of missing spatial information caused by the native Informer using only temporal location encoding.
[0183] Sequential compressed distillation layer
[0184] The sequence compression distillation layer achieves sequence length compression through one-dimensional convolution and max pooling. The output sequence length of each distillation layer is compressed to the length of the input. (Distillation factor) The expression is:
[0185]
[0186] in, For the first Input of each distillation layer For one-dimensional convolution operations (kernel size) Step size equals distillation factor (The number of output channels is the same as the number of input channels). To correct the linear activation function, This is a max pooling operation.
[0187] Stacking After layer distillation, the sequence length is from Compress to ,Right now Sequence compression distillation effectively reduces redundant temporal information, lowers the computational cost of subsequent layers, and preserves key feature information.
[0188] Decoder cross-attention physical bias
[0189] The Hamiltonian and Lagrange features are embedded in the cross-attention of the decoder, and the mean of the Hamiltonian and Lagrange and the kinetic gradient are introduced as physical bias terms in the attention score of the cross-attention, thereby enhancing the decoder's ability to perceive the physical features of driving behavior.
[0190] Decoder The cross-attention of a layer is calculated as follows:
[0191]
[0192] in, This is the output (query matrix) of the layer above the decoder. and These are the final outputs of the encoder (key matrix and value matrix), respectively. In time Rear driving distance The mean Hamiltonian at that location, In time Rear driving distance Lagrange mean at the location, For the kinetic energy gradient, The dimension of the key vector. This represents the distance traveled.
[0193] Physical bias term The introduction of this approach allows cross-attention to consider not only data-driven similarity matching when calculating the association between the decoder and encoder, but also the physical state of the vehicle's motion: the mean of the Hamiltonian and Lagrange quantities reflects the total and net energy states of the vehicle at that spatiotemporal location, while the kinetic gradient reflects the changing trend of the vehicle's motion energy. When the physical state of the predicted location is similar to that of the historical observation location, the attention weight increases, making the model pay more attention to time segments with consistent physical states.
[0194] Physical constraint loss function
[0195] A physical consistency constraint term is added to the model loss function to regulate the predicted output based on the principles of mechanical energy conservation and minimum action. The total loss function is:
[0196]
[0197] in, For mean square error loss, For physical constraint loss, The weight for physical constraint loss is 0.3 (the optimal value in this embodiment is 0.3).
[0198] Physical constraint losses include three items:
[0199] Mechanical energy conservation constraint: Calculate the mechanical energy of the predicted trajectory The mechanical energy deviation from the actual trajectory;
[0200] Action constraint: Calculate the deviation between the action of the predicted trajectory and the action of the actual trajectory;
[0201] Momentum-Hamiltonian correlation constraint: Calculate the deviation between the momentum and Hamiltonian correlation of the predicted trajectory and the actual trajectory.
[0202] Physical constraint loss ensures that the predicted trajectory generated by the model is not only numerically close to the real trajectory, but also physically satisfies the conservation of mechanical energy, the principle of minimum action, and the momentum-Hamiltonian correlation law, effectively avoiding numerically accurate but physically unreasonable prediction results.
[0203] Stage-adaptive attention sampling strategy
[0204] Based on the driving stage features identified by DBSCAN clustering (dispersed in the early stage, concentrated in the middle stage, and balanced in the later stage), an adaptive attention sampling strategy is designed to dynamically adjust the attention sampling rate. The lower limit of the sampling rate is dynamically adjusted between 0.1 and 0.3: In the early stage of driving, due to the high uncertainty of driving behavior and the dispersed hotspots of Lagrange quantities, a lower sampling rate lower limit (0.1) is adopted to retain more query vectors for attention calculation in order to capture dispersed motion features; in the later stage of driving, driving behavior tends to be stable, and a higher sampling rate lower limit (0.2 to 0.3) is adopted to reduce redundant attention calculations and improve inference efficiency.
[0205] For high-impact risk hotspots such as intersections and ramps identified by DBSCAN clustering, a hotspot enhancement coefficient (the optimal value in this embodiment is 1.3) is set to enhance the attention weights within the hotspot areas, enabling the model to allocate a higher degree of attention to key interaction nodes.
[0206] Reference Figure 2 The prediction output layer includes a spatiotemporal feature adaptation module, a probabilistic sparse self-attention module, a cross-attention bias module, and a trajectory prediction output module. (Refer to...) Figure 3 The Informer neural network structure, from input to output, is as follows: physical feature tensor input layer → spatiotemporal feature adaptation layer → probabilistic sparse self-attention layer → sequence compression distillation layer → decoder self-attention layer → cross-attention embedding Hamiltonian and Lagrange physical bias layer → linear projection output layer.
[0207] Evaluation index system
[0208] To comprehensively evaluate the predictive performance of the method of this invention, a multi-dimensional evaluation system including numerical error index and physical consistency index is established.
[0209] Mean Squared Error (MSE)
[0210] Mean square error is calculated as the mean of the sum of squares of the coordinate differences between the predicted trajectory and the actual trajectory.
[0211]
[0212] in, To predict sequence length, and For the first Predicted coordinates of each sampling point and For the first The true coordinates of each sampling point. This indicator is sensitive to large errors and can effectively reflect the overall deviation of the model's predictions.
[0213] Mean Absolute Error (MAE)
[0214] Mean Absolute Error (MAO) is the average of the absolute differences between predicted and actual values.
[0215]
[0216] in, To predict sequence length, and For the first Predicted coordinates of each sampling point and For the first The true coordinates of each sampling point. This indicator is more robust to outliers and can intuitively reflect the average deviation of trajectory prediction.
[0217] Root Mean Square Error (RMSE)
[0218] The root mean square error is the square root of the root mean square error.
[0219]
[0220] in, To predict sequence length, and For the first Predicted coordinates of each sampling point and For the first The true coordinates of each sampling point. Their units are consistent with the trajectory coordinates, providing a more intuitive representation of the magnitude of typical prediction errors.
[0221] Physical Consistency Score (PCS)
[0222] Based on the physical laws of driving behavior revealed by the secondary spatiotemporal analysis of this invention, a physical consistency score is constructed to evaluate the physical rationality of the predicted trajectory:
[0223]
[0224] in, To predict the mechanical energy deviation between the predicted trajectory and the actual trajectory, For the action amount deviation, The momentum-Hamiltonian correlation deviation, , , These are the weighting coefficients. , , These represent the maximum mechanical energy, maximum action, and maximum momentum-Hamiltonian correlation values for the corresponding datasets. The PCS value range is... The closer the value is to 1, the more the predicted trajectory conforms to physical laws, effectively making up for the shortcomings of traditional indicators that only focus on numerical errors and ignore physical rationality.
[0225] In this embodiment, the core objective of trajectory prediction is to predict the vehicle's trajectory within the next 10 seconds, corresponding to the output of continuous trajectory within 10 seconds. shaft and The axis coordinate sequence is sampled at a frequency of 10Hz. All the above evaluation metrics are calculated based on this 10-second prediction window.
[0226] Hyperparameter optimization
[0227] To ensure optimal model performance, optimization experiments were conducted on the model's core hyperparameters. Single-factor optimization experiments were performed on six core hyperparameters:
[0228] Physical feature embedding dimensions: 64, 128, and 256 dimensions were tested. The results show that when the physical feature embedding dimension is 128, the RMSE is 0.342 and the PCS is 0.928, which is the best performance. Too small a dimension (64) leads to insufficient expression of physical features, while too large a dimension (256) introduces redundant information and increases computational overhead.
[0229] Attention head count: Tested with 4, 8, and 16 attention heads. The results show that when the number of attention heads is 8, the RMSE is 0.341 and the PCS is 0.929, which is the best performance.
[0230] Lower limit of stage sampling rate: Tested at three lower limits of 0.1, 0.2, and 0.3. The results show that when the lower limit of stage sampling rate is 0.1, the RMSE is 0.340 and the PCS is 0.930, which is the best performance.
[0231] Hotspot enhancement factor: Tested with factors of 1.1, 1.3, and 1.5. The results show that when the hotspot enhancement factor is 1.3, the RMSE is 0.339 and the PCS is 0.931, indicating the best performance.
[0232] Physical constraint loss weights: tests were conducted with weights of 0.2, 0.3, and 0.4. The results show that when the physical constraint loss weight is 0.3, the PCS is 0.930, achieving a superior level in terms of physical consistency.
[0233] Dropout rate: Tested at three ratios: 0.1, 0.2, and 0.3. The results show that when the dropout rate is 0.1, the RMSE is 0.338 and the PCS is 0.932, resulting in the best performance.
[0234] Through multi-parameter combination verification, the optimal parameter combination was finally determined to be: physical feature embedding dimension 128, number of attention heads 8, lower limit of stage sampling rate 0.1, hotspot region enhancement coefficient 1.3, physical constraint loss weight 0.3, and dropout rate 0.1. Under this combination, the RMSE is 0.339 and the PCS is 0.932.
[0235] The final determined values for the Phys-DSA-Informer encoder are 3 layers, the decoder has 2 layers, the attention heads are 8, and the model dimensions are [missing information]. Feedforward network dimension The stage-adaptive attention sampling rate is dynamically adjusted from 0.1 to 0.3, the physical feature embedding dimension is 128, and the dropout rate is 0.1. The dataset is... The dataset was divided into training (70%), validation (20%), and test (10%) sets. All models used the same number of training epochs (200 epochs), batch size (64), and optimizer (Adam, initial learning rate). ).
[0236] Comparative experiment
[0237] To fully verify the superiority of the method of this invention, the following five typical models were selected as benchmarks for comparison:
[0238] CNN: Classic Convolutional Neural Network, kernel size The system has 3 convolutional layers with kernel numbers of 32, 64, and 128 respectively, and pooling layers of [missing information]. Max pooling was used, with two fully connected layers containing 256 and 128 neurons respectively. The activation function was ReLU, and the dropout rate was 0.2.
[0239] LSTM: Long Short-Term Memory Network, with 2 LSTM layers, 128 neurons in each hidden layer, bidirectional LSTM, tanh activation function, recursive dropout rate of 0.2, and 64 neurons in the fully connected layer.
[0240] CNN-LSTM: The CNN part is configured the same as the CNN part above, and the LSTM part is configured the same as the LSTM part above. The CNN feature output dimension and the LSTM input dimension are matched to 128.
[0241] Informer: A native model without incorporating secondary spatiotemporal analysis features and structural optimization; encoder layers: 3; decoder layers: 2; attention heads: 8; model dimensions: [not specified]. Feedforward network dimension The sparse attention sampling rate is 0.2, and the dropout rate is 0.1.
[0242] DenseTNT: An anchorless end-to-end trajectory prediction model with ResNet-18 feature extraction network, 100 candidate trajectories, 64 trajectory decoding dimensions, 4 attention heads, a dropout rate of 0.1, and a 3-layer fully connected trajectory scoring network.
[0243] The results of the comparative experiment show that:
[0244] In the scenario of urban main roads (Beijing Road), the method of this invention (Phys-DSA-Informer) has an MSE of 0.132, a MAE of 0.266, an RMSE of 0.363, and a PCS of 0.883. Compared with CNN, the MSE is reduced by 65.4% and the PCS is increased by 41.7%. Compared with the native Informer, the MSE is reduced by 48.0% and the PCS is increased by 25.2%. Compared with DenseTNT, the MSE is reduced by 19.5% and the PCS is increased by 6.8%.
[0245] In the secondary arterial road (Xincun Road) scenario, the method of this invention has an MSE of 0.105, a MAE of 0.245, an RMSE of 0.324, and a PCS of 0.904, which is the best performance among the three scenarios. Compared with DenseTNT, the MSE is reduced by 21.1% and the PCS is increased by 7.0%.
[0246] In the expressway (Changguo Expressway) scenario, the MSE of the method of this invention is 0.167, MAE is 0.283, RMSE is 0.409, and PCS is 0.868. It has the largest error among the three scenarios but is still the best. No physically absurd prediction results were found. Compared with DenseTNT, the MSE is reduced by 15.2% and the PCS is improved by 7.7%.
[0247] The method of this invention exhibits performance differences of less than 5% across three scenarios, demonstrating excellent scene generalization ability. Traditional models (CNN, LSTM, CNN-LSTM) all suffer from core defects such as poor scene adaptability or insufficient physical plausibility, and are only suitable for simple, low-perturbation scenarios. While Informer solves the efficiency problem of long sequence prediction, it lacks the ability to mine essential driving features. DenseTNT outperforms traditional models, but its ability to focus on key information in complex interactive scenarios still has room for improvement. The method of this invention achieves high-precision and highly physically consistent predictions in complex dynamic scenarios through deep coupling of physical mechanisms and data-driven approaches.
[0248] ablation experiment
[0249] To verify the effectiveness of each optimization module, an ablation experiment was designed based on the complete model, setting up the complete model and four ablation models:
[0250] The complete model M0 integrates all optimization modules, including spatiotemporal-physical fusion feature embedding, stage-adaptive attention mechanism, driving stage perception decoder, and physical constraint loss.
[0251] Ablation Model M1: This model removes the spatiotemporal-physical fusion feature embeddings and uses only the original motion features (coordinates, velocity, acceleration) as input. The MSE increases by 65% compared to M0, and the PCS decreases from 0.932 to 0.851, demonstrating the core value of the spatiotemporal-physical fusion features. The momentum-time evolution and kinetic energy spatial distribution characteristics revealed by the first spatiotemporal analysis, as well as the physical quantities such as the Lagrange quantity, Hamiltonian, and action quantity extracted by the second analysis, are strongly correlated with driving behavior. Removing these features and relying solely on the original motion data makes it difficult to capture the inherent logic and physical essence of driving behavior.
[0252] Ablation model M2: The physical constraint loss is removed, and only MSE is used as the loss function. The MSE decreases slightly by about 3% compared to M0, but the PCS drops sharply from 0.932 to 0.876. The physical constraint loss uses the concepts of energy conservation and action to ensure that the predicted trajectory meets physical common sense. After removing it, the model only considers numerical errors and not physical rationality, resulting in a significant decrease in the PCS index.
[0253] Ablation model M3: Simultaneously removing the spatiotemporal-physical fusion feature embedding and stage-adaptive attention mechanism, it adopts the original motion feature input and the native ProbSparse self-attention mechanism. MSE increases by 200% compared to M0, while PCS drops to 0.723, making it the ablation model with the most severe performance degradation. These two elements constitute the core coupling link between model feature input and feature extraction; their removal results in the model losing deep feature support and accurate feature extraction capabilities, leading to a precipitous drop in all metrics.
[0254] Ablation model M4: Simultaneously removes the perception decoder and physical constraint loss during the driving phase, using the original Informer decoder and a single MSE loss function. MSE increases by 102% compared to M0, while PCS decreases by 12.6%. These two constitute the key coupled link between feature decoding and output constraints. Removing them simultaneously makes the model unable to adapt to the phased changes in driving behavior and also loses the constraints of physical laws.
[0255] Ablation experiments show that the four optimization modules proposed in this invention do not exist independently, but rather form a complete coupled link of "feature embedding - attention calculation - decoding adaptation - loss constraint". Spatiotemporal-physical fusion features provide rich information for the model, stage-adaptive attention accurately extracts important dependencies, driving stage perception decoder matches behavioral changes, and physical constraint loss ensures physical rationality. The modules are integrated to achieve high-precision and high-generalization prediction results.
[0256] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention.
Claims
1. A method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments, characterized in that, The prediction steps are as follows: Step S1: Obtain the driving trajectory data of the target vehicle in a complex traffic environment, and perform data cleaning and missing value processing on the driving trajectory data to obtain preprocessed trajectory data; Step S2: Based on the preprocessed trajectory data, calculate the vehicle's kinetic energy and momentum, perform spatial dimension analysis on the kinetic energy and temporal dimension analysis on the momentum, and obtain a spatiotemporal analysis feature. Step S3: Based on molecular potential field theory, construct a vehicle potential energy field model with required safety distance and dispersion coefficient, and calculate the interaction potential energy between vehicles according to the actual distance between the target vehicle and surrounding vehicles. Step S4: Based on the kinetic energy and the interaction potential energy, construct the Lagrange quantity and the Hamiltonian, calculate the action quantity, perform spatial dimension analysis on the Lagrange quantity and temporal dimension analysis on the Hamiltonian, and obtain the secondary spatiotemporal analysis characteristics. Step S5: Construct a physical feature tensor by combining the primary spatiotemporal analysis features and the secondary spatiotemporal analysis features. Input the physical feature tensor into an Informer neural network. Perform hierarchical fusion of the physical feature tensor and temporal dependency features through the Informer neural network to output the future trajectory prediction result of the target vehicle.
2. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S1, the data cleaning includes removing speed and acceleration data that exceed reasonable ranges based on the physical constraints of vehicle driving, and using box plots to identify and remove outliers. The missing value processing includes: when the number of sampling points corresponding to the missing duration does not exceed a preset threshold, Lagrange interpolation is used to supplement them; When the number of missing sampling points exceeds the preset threshold, the data is determined to be invalid and is removed entirely.
3. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S2, the temporal distribution of momentum is analyzed using the kernel density estimation method. The vehicle trajectory is divided into multiple continuous segments, and the density estimate of momentum data in each segment is calculated using the Gaussian kernel function. The evolution of momentum distribution from bimodal to unimodal and then back to bimodal distribution is analyzed by the change in density curve shape. The spatial dimension analysis of kinetic energy includes removing transient data during the vehicle's acceleration phase, dividing the driving cycle into multiple stages, and revealing the evolution of kinetic energy distribution from conservative to adaptive and then to proficient through a kinetic energy time heatmap.
4. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S3, the required safe distance is calculated based on the following vehicle speed using the following formula: in, To maintain a safe distance, For driver reaction time, The reciprocal of twice the maximum deceleration of the following vehicle. For the vehicle's real-time speed; The vehicle potential energy field model adopts the Lennard-Jones potential function with a dispersion coefficient, and the formula is as follows: in, This refers to the potential energy generated by the interaction between vehicles. For the potential well depth, This refers to the actual distance between vehicles. is the dispersion coefficient.
5. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S3, the vehicle potential energy field model further includes a lateral potential energy adjustment coefficient c. This lateral adjustment coefficient c is set based on the angle between the line connecting the two vehicles and the longitudinal direction of the road. The adjusted potential energy formula is: Here, 'c' is used to reduce the lateral potential energy intensity in order to reduce the impact of lane disturbances on longitudinal following behavior.
6. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S4, the formula for calculating the Lagrange quantity is: in, Let m be the vehicle mass, and let m be the Lagrange quantity. The spatial dimension analysis of the Lagrange quantity includes extracting the kinetic energy space segment, analyzing the correspondence between the fluctuation of the Lagrange quantity and the spatial abrupt change of the potential energy term, and identifying the spatial phase transition of driving behavior by the change of potential field gradient when the vehicle enters the intersection conflict domain.
7. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments according to claim 1, characterized in that, In step S4, the formula for calculating the Hamiltonian is: Wherein, H is the Hamiltonian; the temporal dimension analysis of the Hamiltonian includes extracting momentum time segments, analyzing the correlation between the distribution characteristics of the Hamiltonian over time and the momentum kernel density distribution, and identifying the switching between the cognitive adaptation and active prediction stages of driving behavior through the distribution pattern of the Hamiltonian.
8. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S4, the action S is defined as the integral of the Lagrange quantity over time. Based on Hamilton's principle, the action of real motion takes an extreme value, i.e., δS=0. The action is converted from the Lagrange form to the Hamiltonian form, so that the variables of the action are converted from generalized coordinates and generalized velocity to generalized coordinates and generalized momentum.
9. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectory in complex traffic environments according to claim 1, characterized in that: In step S5, the probabilistic sparse self-attention mechanism of the Informer neural network incorporates the coupling effect of kinetic energy and momentum, and the attention sparsity score... The calculation formula is: in, For the first A query vector, For the first A key vector, and The first The and the first Kinetic energy characteristics at each location, and The first The and the first Momentum characteristics at each location, and For a single spatiotemporal analysis weight parameter, The dimension of the key vector. Given the sequence length; only the first few sequences with the highest sparsity scores are retained. Each query vector participates in the attention calculation.
10. The method for secondary spatiotemporal modeling and adaptive prediction of driving trajectories in complex traffic environments according to claim 1, characterized in that, In step S5, the Informer neural network further includes the following improvements: A spatiotemporal feature adaptation layer is added before the sequence compression layer to concatenate and fuse the temporal location encoding with the spatial location encoding based on Euclidean distance, so that the input features have both temporal and spatial location information. The Hamiltonian and Lagrange features are embedded in the cross-attention of the decoder, and the mean of the Hamiltonian and Lagrange and the kinetic gradient are introduced as physical bias terms in the attention score of the cross-attention, thereby enhancing the decoder's ability to perceive the physical features of driving behavior.
