A vehicle trajectory deep learning prediction method considering physical constraints
By embedding a vehicle kinematics model with constant yaw rate and variable acceleration into a long short-term memory network, the problem of insufficient interpretability and reliability of deep learning-based vehicle trajectory prediction methods is solved, and long-term trajectory prediction with high interpretability and high reliability is achieved.
Patent Information
- Application Number
- CN202310272329.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-21
AI Technical Summary
Deep learning-based vehicle trajectory prediction methods have shortcomings in interpretability and reliability, especially in the long-term prediction time domain.
By combining constant yaw rate and variable acceleration vehicle kinematics models, a physically constrained long short-term memory network is established. By minimizing the loss function containing the mean square error term of the differential equation, the interpretability and reliability of trajectory prediction are enhanced.
While ensuring prediction accuracy, it enhances the interpretability of the trajectory prediction process and the reliability of the results, making it suitable for long-term prediction of vehicle trajectories and overcoming the shortcomings of traditional deep learning-based methods.
Smart Images

Figure CN116495007B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of vehicle trajectory prediction, and particularly relates to a vehicle trajectory deep learning prediction method considering physical constraints. BACKGROUND
[0002] Current automatic driving has become the focus of the automotive industry and academia. As a key core technology of automatic driving, automatic vehicles need to be able to accurately predict the motion trajectory of surrounding vehicles and other obstacles in the traffic scene, which is the premise of making reasonable decision planning. Therefore, it is of great theoretical and engineering significance to study the vehicle trajectory prediction method, which is the key to improving the level of automatic driving of vehicles.
[0003] The trajectory prediction problem can be described as: using the past state of traffic participants in a given scene to estimate their future state, which is essentially a series of time series processing. Current vehicle trajectory methods mainly include physical-based methods, traditional machine learning-based methods, reinforcement learning-based methods, and deep learning-based methods. The physical-based method has strong applicability, short computing time, and does not need to be trained, but the long-term prediction (> 3s) accuracy is poor; the traditional machine learning-based method has higher accuracy than the physical method, but the computing cost is also higher, and the generalization ability is poor; the deep learning-based method can evolve through learning, and the long-term prediction accuracy is high, but the training time is too long, the computing cost is extremely high, and it is more commonly used in decision, planning and control process. Compared with the first three trajectory prediction methods, the deep learning-based method has achieved a better balance in prediction time domain, prediction accuracy, computing cost, generalization ability and other performance indicators, so it is more widely used and is the mainstream research direction of current vehicle trajectory prediction. In particular, the method based on long short-term memory network has become a research hotspot in this field because it is good at processing time series and can avoid the problems of gradient disappearance and gradient explosion when the prediction step is large. Therefore, the application adopts long short-term memory network as the basic data model.
[0004] However, the deep learning-based method as a data-driven "black box" model inevitably has the shortcomings of poor explainability and low reliability. The physics-informed neural network (PINN) is a class of neural networks used to solve supervised learning tasks, which not only follows the distribution of training data samples, but also obeys the physical laws described by differential equations. Compared with pure data-driven neural network learning, PINN imposes physical information constraints during the training process, and can obtain a more explainable model through learning with embedded physical constraints. Therefore, the application establishes a constant yaw rate, variable acceleration vehicle kinematics model as the basic physical model on the basis of the classic constant steering speed and acceleration model.
[0005] In order to solve the problems of weak explainability and poor reliability of the vehicle trajectory prediction method based on deep learning, the application provides a vehicle trajectory deep learning prediction method considering physical constraints. On the basis of the classical constant steering speed and acceleration model, the constant yaw rate and variable acceleration vehicle kinematics model is established by considering the vehicle kinematics characteristics in the lane changing scene. Meanwhile, considering that the essence of the trajectory prediction problem is the processing of time series, and the gradient disappearance and gradient explosion problems of the deep network in long-term prediction should be avoided as much as possible, the long short-term memory network is selected as the basic data model. The constant yaw rate and variable acceleration vehicle kinematics model is embedded into the long short-term memory network as the physical constraint to build the physical constraint long short-term memory network. The simulation results show that the trajectory prediction method provided by the application is suitable for long-term prediction of vehicle trajectory, and compared with the traditional trajectory prediction method based on deep learning, the explainability of the prediction process and the reliability of the prediction result are enhanced under the premise of ensuring the prediction accuracy. SUMMARY
[0006] In order to solve the problems of weak explainability and poor reliability of the vehicle trajectory prediction method based on deep learning, the application provides a vehicle trajectory deep learning prediction method considering physical constraints. On the basis of the classical constant steering speed and acceleration model, the constant yaw rate and variable acceleration vehicle kinematics model is established by considering the vehicle kinematics characteristics in the lane changing scene. Meanwhile, considering that the essence of the trajectory prediction problem is the processing of time series, and the gradient disappearance and gradient explosion problems of the deep network in long-term prediction should be avoided as much as possible, the long short-term memory network is selected as the basic data model. The constant yaw rate and variable acceleration vehicle kinematics model is embedded into the long short-term memory network as the physical constraint to build the physical constraint long short-term memory network. The simulation results show that the trajectory prediction method provided by the application is suitable for long-term prediction of vehicle trajectory, and compared with the traditional trajectory prediction method based on deep learning, the explainability of the prediction process and the reliability of the prediction result are enhanced under the premise of ensuring the prediction accuracy.
[0007] The embodiment of the application is implemented in the following manner: a vehicle trajectory deep learning prediction method considering physical constraints comprises the following steps:
[0008] Step 1: establishing a vehicle kinematics model;
[0009] Step 2: building a long short-term memory network;
[0010] Step 3: building a physical constraint long short-term memory network and selecting network parameters to train the memory network;
[0011] Step 4: simulation results and comparative analysis.
[0012] As a further scheme of the application, the step 1 of establishing a vehicle kinematics model specifically comprises:
[0013] Based on the traditional constant steering speed and acceleration model, considering the vehicle kinematics characteristics in the lane changing scene, a constant yaw rate and variable acceleration vehicle kinematics model is established.
[0014] The vehicle speed and yaw angle satisfy the following relationship:
[0015] v(t) = v0 + a0t
[0016]
[0017] Where v0 and are the initial speed and initial yaw angle, a0 and ω0 are the current acceleration and yaw rate of the vehicle, respectively.
[0018] Therefore, in the Cartesian global coordinate system, the vehicle speed is decomposed into X and Y axes at time t, respectively, to obtain:
[0019]
[0020]
[0021] After obtaining the longitudinal velocity, the longitudinal and lateral displacement can be obtained by integrating the time:
[0022]
[0023]
[0024] Where M x and M y are related constant terms, and the specific expression is:
[0025]
[0026]
[0027] Where x0 and y0 are the initial lateral and longitudinal positions of the vehicle, and when ω0 = 0, the above formula is not established, at this time the vehicle does uniform acceleration straight line motion, the vehicle motion equation can be obtained as:
[0028]
[0029]
[0030] In the highway lane changing scene, the actual motion of the vehicle can be decomposed into lateral and longitudinal variable acceleration straight line motion, in addition, the physical information network is also suitable for solving problems of ordinary differential equations, formula (5) can be rewritten as:
[0031]
[0032]
[0033] where, v x0 and v y0 are the lateral and longitudinal speed of the vehicle at initial time, respectively;
[0034] If the mass center side slip angle of the vehicle is ignored, the lateral and longitudinal speed of the vehicle at time t can be calculated by the following formula:
[0035]
[0036]
[0037] where, q(t) is the vehicle heading angle at time t;
[0038] Formula (6) is the constant yaw rate and variable acceleration vehicle kinematics model.
[0039] As a further scheme of the present application, the step 2 of building the long short-term memory network specifically comprises:
[0040] S1, after establishing the CTRVA vehicle kinematics model, pre-processing the data set;
[0041] S2, building the long short-term memory network based on Python language.
[0042] As a further scheme of the present application, the step of pre-processing the data set after establishing the CTRVA vehicle kinematics model specifically comprises:
[0043] S1, using the first-order Savitzky Golay algorithm to smooth the speed data in the data set, and extracting the lane change data sample from the data set;
[0044] S2, sorting the vehicle data according to Vehicle_ID and Global_Time respectively, and dividing the data by vehicle, and arranging the data of a single vehicle in ascending order of time;
[0045] S3, excluding the vehicles entering and exiting the ramp, and searching for the vehicles with lane ID change, i.e. lane changing behavior, in the remaining data, and the point of Lane_ID change is the lane changing point;
[0046] S4, extracting 3.5s of data forward and backward from the lane changing point respectively, and ensuring that the vehicle is always in the original lane before the lane changing point and always in the target lane after the lane changing point, so as to eliminate the vehicles with continuous lane changing;
[0047] S5, calculating the lateral and longitudinal speed of the vehicle at each sampling point according to formula (7), and obtaining the vehicle lane changing data sample;
[0048] S6. Based on the specified sequence length set in the prediction time domain, the vehicle trajectory is divided using a sliding window algorithm.
[0049] As a further aspect of the present invention, the method of building a Long Short-Term Memory network based on the Python language specifically includes:
[0050] The input features of the current time step and the hidden state of the previous time step are used as the input of this memory cell, and the hidden state of the current time step is used as the output of this memory cell, which is also the input of the next memory cell.
[0051] Assuming the LSTM layer has h hidden units, a batch size of n, and k input features, then the input is... The hidden state of the previous time step is The input gate for the current time step is The Gate of Oblivion Output gate is Candidate memory element is C t ∈R n×h The hidden state is The calculation formula between them is:
[0052] I t =σ(X) t W xi +H t-1 W hi +b i )
[0053] F t =σ(X) t W xf +H t-1 W hf +b f )
[0054] O t =σ(X) t W xo +H t-1 W ho +b o )
[0055] C t =tanh(X) t W xc +H t-1 W hc +b c )
[0056] C t =F t C t-1 +I t C t
[0057] H t =O t tanh(C t (8)
[0058] Among them W xi W xf W xo W xc ∈R d×h and W hi W hf W ho W hc ∈R h×h b is the weight parameter. i B F b o , These are bias parameters;
[0059] Assuming the LSTM layer has h hidden units and the batch size is n, then the input to the first fully connected layer is...
[0060] Assuming the second fully connected layer has j linear units, and the total number of output features of the deep long short-term memory network is l, then its input is Y. t ∈R n×j The output is Z. t ∈R n×l The calculation formula is as follows:
[0061] Y t =σ(H t W d1 +b d1 )
[0062] Z t =σ(Y) t W d2 +b d2 (9)
[0063] Among them W d1 ∈R h×j W d2 ∈R j×l For weight parameters, This is the bias parameter.
[0064] As a further aspect of the present invention, step 3, which involves constructing a physically constrained long short-term memory network, specifically includes:
[0065] Based on the CTRVA vehicle kinematics model and LSTM network, a physically constrained long short-term memory network is constructed. From formula (6), we can obtain:
[0066]
[0067]
[0068] The loss function of the physically constrained LSTM network can be represented as
[0069] L=ω1L1+ω2L2+ω3L3 (11)
[0070] Wherein:
[0071]
[0072]
[0073]
[0074] L1, L2, L3 are the loss function of the predicted trajectory, the loss function of the predicted lateral displacement satisfying the kinematics constraint of the vehicle and the loss function of the predicted longitudinal velocity respectively;
[0075] T=(x,v y )and are the actual and predicted trajectory vectors respectively, N1, N2 are the number of trajectory points corresponding to the loss functions L1 and L2, L3 respectively, ω1, ω2 and ω3 are the weights of each loss function, x0, v x0 and v y0 are the lateral displacement, lateral velocity and longitudinal velocity corresponding to the historical trajectory points randomly sampled from the input vector respectively, and Δt is the time interval from the randomly sampled historical trajectory point to the corresponding predicted trajectory point.
[0076] As a further scheme of the present application, the step 3 of selecting network parameters, training the memory network, specifically comprising:
[0077] The physically constrained LSTM network, in a typical iteration, its training process is:
[0078] S1, forward propagation:
[0079] According to the physically constrained LSTM network built, a calculation graph is constructed;
[0080] The vector X(t,x,y,v x ,v y ) is input into the model to obtain the output vector and the loss function L is calculated, which can be obtained from formula (11):
[0081]
[0082] Wherein,
[0083] From formula (8) and (9), we can get:
[0084]
[0085]
[0086] Wherein:
[0087] X=(t,x,y,v x ,v y ,a)
[0088] W=(W xi ,W xf ,W xo ,W xc ,W hi ,W hf ,W ho ,W hc ,W d1 ,W d2 )
[0089] b=(b i ,b f ,b o ,b c ,b d1 ,b d2 )
[0090] Wherein, X, W, b are input, weight parameter and bias parameter of the deep network respectively;
[0091] S2, back propagation:
[0092] Calculate the derivative of the loss function on the model parameters, that is
[0093]
[0094]
[0095] According to the derived derivative, the model parameters W and b are constantly updated by using gradient descent method and the like, so that the loss function L reaches the minimum value;
[0096] The update formula of the weight parameter W and the bias parameter b is
[0097]
[0098] Wherein, h is a learning rate.
[0099] The vehicle trajectory deep learning prediction method considering physical constraints provided by the embodiment of the application has the following beneficial effects:
[0100] Different from traditional physical-based 'white-box' method and deep learning-based 'black-box' method, the vehicle trajectory deep learning prediction method considering physical constraints is a 'gray-box' method, since it embeds the car kinematic model, the method not only follows the distribution law of training samples, but also obeys the physical law described by differential equation, and can practically enhance the explainability of trajectory prediction process and the reliability of results;
[0101] Based on the advantages of deep learning network in the field of time series prediction, the deep learning method considering physical constraints still maintains high prediction accuracy in long prediction time domain, overcomes the shortcomings of traditional physical model-based method, expands the application scene of long-time domain trajectory prediction, and has great theoretical and practical significance. BRIEF DESCRIPTION OF DRAWINGS
[0102] Figure 1 It is a schematic diagram of the vehicle trajectory deep learning prediction method considering physical constraints;
[0103] Figure 2 It is a schematic diagram of the US101 data set collection area;
[0104] Figure 3 It is a structure diagram of the LSTM network memory unit;
[0105] Figure 4 It is a comparison diagram of the predicted lateral displacement and the actual lateral displacement of CTRA, LSTM and PC-LSTM;
[0106] Figure 5 It is a comparison diagram of the predicted longitudinal velocity and the actual longitudinal velocity of CTRA, LSTM and PC-LSTM. DETAILED DESCRIPTION
[0107] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application.
[0108] The specific implementation of the present application is described in detail below in combination with specific examples.
[0109] As shown in the embodiment of the present application, the vehicle trajectory deep learning prediction method considering physical constraints comprises the following steps: Figure 1
[0110] Step 1, establishing a car kinematic model;
[0111] Step 2, building a long short-term memory network;
[0112] Step 3, build a physical constraint long short-term memory network, select network parameters, and train the memory network;
[0113] Step 4, simulation results and comparative analysis.
[0114] In the embodiment of the application, the establishment of the automobile kinematic model in step 1 specifically comprises:
[0115] On the basis of the traditional constant steering speed and acceleration model, the automobile kinematic characteristics of the vehicle in the lane changing scene are considered, and a constant yaw rate, variable acceleration automobile kinematic model is established.
[0116] The CTRA model motion model assumes that the vehicle maintains constant acceleration and yaw rate during the motion process, thereby realizing the simplification of the trajectory prediction problem.
[0117] The speed and yaw angle of the vehicle satisfy the following relationship:
[0118] v(t)=v0+a0t
[0119]
[0120] Wherein, v0 and are the initial speed and initial yaw angle, a0 and ω0 are the current acceleration and yaw rate of the vehicle, respectively.
[0121] Therefore, in the Cartesian global coordinate system, the vehicle speed at time t is decomposed into X and Y axes, respectively, to obtain:
[0122]
[0123]
[0124] After obtaining the longitudinal velocity, the longitudinal and lateral displacements are obtained by integrating the longitudinal velocity with respect to time:
[0125]
[0126]
[0127] Wherein, M x and M y are related constant terms, and the specific expressions are:
[0128]
[0129]
[0130] Wherein, x0 and y0 are the initial longitudinal and lateral positions of the vehicle, and when ω0=0, the above formula is not established, at this time, the vehicle does uniform acceleration linear motion, and the vehicle motion equation can be obtained as:
[0131]
[0132]
[0133] In the highway lane-changing scene, the actual motion of the car can be decomposed into lateral and longitudinal variable acceleration straight line motion, in addition, the physical information network is also suitable for the solution of ordinary differential equation, and formula (5) can be rewritten as:
[0134]
[0135]
[0136] Where, v x0 and v y0 The lateral and longitudinal velocities of the vehicle at the initial time are respectively;
[0137] If the centroid side slip angle of the vehicle is ignored, the lateral and longitudinal velocities of the vehicle at t time can be calculated by the following formula:
[0138]
[0139]
[0140] Where, q(t) is the vehicle heading angle at t time;
[0141] Formula (6) is a constant yaw rate and variable acceleration vehicle kinematics model.
[0142] In the embodiment of the application, the long short-term memory network built in step 2 specifically comprises:
[0143] S1, after establishing the CTRVA vehicle kinematics model, the data set is preprocessed;
[0144] S2, a long short-term memory network is built based on Python language.
[0145] After establishing the CTRVA vehicle kinematics model, the data set is preprocessed. NGSIM is the most comprehensive and commonly used public data set in the field of automatic driving at present. The US101 data segment (hereinafter referred to as US101 data set) in the NGSIM data set is selected as the data set of the deep network.
[0146] The US101 data set is collected from a highway section about 640 meters long, which includes 5 main roads, 1 auxiliary lane, 1 entrance ramp and 1 exit ramp, as shown in Figure 2The digital camera recorded the accurate position information of the vehicle at intervals of 0.1 s and converted the video into vehicle trajectory data. The total duration of the data was 45 minutes, which was divided into three time periods: 7:50-8:05, 8:05-8:20 and 8:20-8:35. The US101 data set included vehicle information such as type, length, width, and trajectory information such as lateral position, longitudinal position, speed, acceleration, as shown in Table 1.
[0147] Table 1: US101 data set parameters
[0148]
[0149] In the embodiment of the application, after the CTRVA vehicle kinematic model is established, the data set is preprocessed, specifically including:
[0150] S1, a first-order Savitzky Golay algorithm is used to smooth the speed data in the data set, and lane change data samples are extracted from the data set;
[0151] S2, the vehicle data is sorted according to Vehicle_ID and Global_Time respectively, the data is blocked by vehicle, and the single vehicle data is arranged in ascending order of time;
[0152] S3, the samples with Lane_ID equal to 7 or 8 are screened out, the vehicles entering and exiting the ramp are excluded, and the vehicles with Lane_ID changing in the remaining data, i.e. lane changing behavior, are found. The point of Lane_ID change is the lane changing point;
[0153] S4, 3.5s of data is extracted from the lane changing point respectively forward and backward, and it is ensured that the vehicle is always in the original lane before the lane changing point and always in the target lane after the lane changing point, so as to eliminate the vehicles with continuous lane changing;
[0154] S5, the lateral and longitudinal speeds of the vehicle at each sampling point are calculated according to formula (7), and the vehicle lane changing data samples are obtained;
[0155] S6, finally, in order to improve the accuracy of the prediction result, before starting the model training, a specified sequence length is set according to the prediction time domain, and a sliding window algorithm is used to divide the vehicle trajectory.
[0156] In the application, the sampling window is set to 10, 20, 30, 40 and 50; the sampling frequency is consistent with the original US101 data set, which is 10MHz, i.e. 10 data points can be collected in 1s; the time step is 0.1s, i.e. there are 9, 19, 29, 39 and 49 overlapping sampling points in the adjacent two trajectory sequences.
[0157] In the embodiment of the present application, the long short-term memory network based on the Python language specifically comprises:
[0158] The long short-term memory (LSTM) network of the present application is built based on the Python language and is composed of a single-layer LSTM loop body containing 128 hidden layer nodes, a fully connected layer containing 128 nodes and a fully connected layer containing 64 nodes. The LSTM layer is a prediction layer for realizing trajectory prediction, and the two fully connected layers are output layers for outputting the predicted trajectory in the form of a vector.
[0159] The LSTM network is a time recurrent neural network which solves the problems of long-term information preservation and short-term input loss existing in general recurrent neural networks (RNN) and is suitable for processing time series and can avoid gradient disappearance and gradient explosion when the prediction step is large. The structure of a typical long short-term memory network is shown in Figure 3 The LSTM network introduces a memory cell for recording additional information, wherein a candidate memory cell is used to store the information of the current time step; at the same time, an output gate is designed to output entries from the memory cell, an input gate is designed to determine when to read data into the memory cell, and a forget gate is designed to reset the content in the memory cell.
[0160] The input feature of the current time step and the hidden state of the previous time step are taken as the input of the current memory cell, and the hidden state of the current time step is taken as the output of the current memory cell, i.e. the input of the next memory cell;
[0161] Suppose that the LSTM layer has h hidden units, the batch size is n, and the input feature number is k, then the input is The hidden state of the previous time step is The input gate of the current time step is The forget gate is The output gate is The candidate memory cell is C t ∈R n×h The hidden state is The calculation formula among them is:
[0162] I t =σ(X t W xi +H t-1 W hi +b i )
[0163] F t = σ(X t W xf + H t-1 W hf + b f )
[0164] O t = σ(X t W xo + H t-1 W ho + b o )
[0165] C t = tanh(X t W xc + H t-1 W hc + b c )
[0166] C t = F t C t-1 + I t C t
[0167] H t = O t tanh(C t ) (8)
[0168] where W xi , W xf , W xo , W xc ∈ R d×h and W hi , W hf , W ho , W hc ∈ R h×h are weight parameters, and b i , b f , b o , are bias parameters.
[0169] Linear neural network units are the most basic structure in neural networks, and a fully connected layer composed of several linear neural network units is often used as the output layer of a deep network in deep learning.
[0170] Assuming that the LSTM layer has h hidden units and the batch size is n, the input of the first fully connected layer is
[0171] Assuming that the second fully connected layer has j linear units and the overall output feature number of the deep long short-term memory network is l, the input of the second fully connected layer is Y t ∈ Rn×j , output is Z t ∈R n×l , calculate public as
[0172] Y t =σ(H t W d1 +b d1 )
[0173] Z t =σ(Y t W d2 +b d2 ) (9)
[0174] where W d1 ∈R h×j , W d2 ∈R j×l is a weight parameter, is a bias parameter.
[0175] Since the lateral span of the observation area of the US101 data set is only 20m, and the longitudinal span is more than 600m, in order to ensure the accuracy of the prediction, the vector X composed of time t, vehicle history lateral coordinate x, longitudinal coordinate y, lateral velocity v x , longitudinal velocity v y , acceleration a is taken as the input object, and the vector T composed of the predicted vehicle lateral coordinate and longitudinal velocity v y is taken as the output object.
[0176] In the embodiment of the application, the physical constraint long short-term memory network built in step 3 specifically comprises:
[0177] On the basis of the CTRVA automobile kinematics model and the LSTM network, a physical constraint long short-term memory network is built. The main structure and input and output forms of the latter are the same as those of the former, and the difference is that the loss function of the physical constraint network proposed by the application is improved.
[0178] On the basis of the CTRVA automobile kinematics model and the LSTM network, a physical constraint long short-term memory network is built, which can be obtained from formula (6):
[0179]
[0180]
[0181] Then the loss function of the physical constraint long short-term memory network can be represented as
[0182] L=ω1L1+ω2L2+ω3L3 (11)
[0183] wherein:
[0184]
[0185]
[0186]
[0187] L1, L2, L3 are loss functions of the predicted trajectory, the predicted lateral displacement loss function and the predicted longitudinal velocity loss function satisfying the kinematic constraints of the automobile respectively;
[0188] T = (x, v y ) and are the actual and predicted trajectory vectors respectively, N1, N2 are the number of trajectory points corresponding to the loss functions L1 and L2, L3 respectively, ω1, ω2 and ω3 are the weights of each loss function respectively, x0, v x0 and v y0 are the lateral displacement, lateral velocity and longitudinal velocity corresponding to the historical trajectory points randomly sampled from the input vector respectively, and Δt is the time interval from the randomly sampled historical trajectory point to the corresponding predicted trajectory point.
[0189] In the embodiment of the application, the network parameters selected in step 3 are used to train the memory network, specifically including:
[0190] The training of the deep network is a process of continuous iteration, and each iteration includes two links of forward propagation and backward propagation. For the physical constraint deep network model proposed in the application, in a typical iteration, the training process is as follows:
[0191] S1, forward propagation:
[0192] According to the built physical constraint long short-term memory network, a calculation graph is constructed;
[0193] The vector X(t, x, y, v x , v y ) is input into the model to obtain the output vector and calculate the loss function L, which can be obtained from formula (11):
[0194]
[0195] Wherein,
[0196] And from formulas (8) and (9), we have:
[0197]
[0198]
[0199] wherein:
[0200] X = (t, x, y, v x y a)
[0201] W = (W xi xf xo xc hi hf ho hc d1 d2 )
[0202] b = (b i f o c d1 d2 )
[0203] wherein X, W, b are input, weight parameter and bias parameter of the deep network respectively;
[0204] S2, back propagation:
[0205] derivative of the loss function with respect to the model parameters, i.e.
[0206]
[0207]
[0208] According to the derived derivative, the model parameters W and b are constantly updated by using gradient descent method and other methods, so that the loss function L reaches the minimum value;
[0209] The update formula of the weight parameter W and the bias parameter b is
[0210]
[0211] wherein h is the learning rate.
[0212] When the number of iterations is large enough, the minimum value of the loss function L will tend to zero, and according to formula (11), when L→0, there is L i →0 (i = 1, 2, 3), that is, the predicted trajectory approximately satisfies the vehicle kinematics equation in formula (10).
[0213] In the present application, 1200 trajectory data are extracted, and the ratio of training set to test set is 8:2. The physical constraint long short-term memory network model is trained by using the stochastic gradient descent method, the learning rate is 0.005, the batch-size is 32, the epoch is 50, the loss function weights are ω1=0.8, ω2=0.1 and ω3=0.1 respectively, and the related parameters of the optimal network are completed and saved after iteration. The optimal model parameters are read, and the test set data is input to obtain the prediction result.
[0214] Simulation result analysis
[0215] Under the prediction time domain of 1s, 2s, 3s, 4s and 5s, the prediction results of the constant yaw rate, variable acceleration (CTRA), long short-term memory (LSTM) network and physical constraint long short-term memory (PC-LSTM) network model of the 1001th sample are visualized and output, as shown in Figure 4 and Figure 5 The average root mean square error of the three models under different prediction time domains is calculated, as shown in Table 2 and Table 3.
[0216] Table 2: Average root mean square error of lateral displacement predicted by CTRA, LSTM and PC-LSTM models
[0217]
[0218] Table 3: Average root mean square error of longitudinal velocity predicted by CTRA, LSTM and PC-LSTM models
[0219]
[0220] From the simulation results, it can be seen that the method based on the CTRA vehicle kinematics model has high accuracy in short time domain prediction, and its performance is better than that based on deep learning. However, with the increase of prediction time domain, the LSTM and PC-LSTM network models gradually show their own advantages, and overall, the prediction error of longitudinal velocity is lower than that of lateral displacement. Especially the PC-LSTM model, under the premise of higher prediction accuracy than the LSTM model, it meets the physical constraints of vehicle kinematics, improves the explainability of the prediction process and the reliability of the prediction result. This shows that the vehicle trajectory prediction method based on the PC-LSTM network proposed in the present application has strong theoretical innovation and high practical application value.
[0221] The above only describes the preferred embodiments of the present application and does not limit the present application. Any modification, equivalent replacement and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A vehicle trajectory deep learning prediction method considering physical constraints, characterized in that, The vehicle trajectory deep learning prediction method considering physical constraints comprises the following steps: Step 1, establishing an automobile kinematics model; Step 2, building a long short-term memory network; Step 3, building a physical constraint long short-term memory network and selecting network parameters to train the memory network; Step 4, simulation results and comparative analysis; In step 1, the automobile kinematics model is established in detail as follows: On the basis of the traditional constant steering speed and acceleration model, the automobile kinematics characteristics of the vehicle in the lane changing scene are considered, and a constant yaw rate, variable acceleration automobile kinematics model is established; The speed and yaw angle of the vehicle satisfy the following relationship: (1) wherein, and are the initial speed and initial yaw angle, respectively, and are the current acceleration and yaw rate of the vehicle, respectively; Therefore, in the Cartesian global coordinate system Vehicle speed at different times The axis is decomposed to obtain: (2) After obtaining the longitudinal speed, the lateral and longitudinal displacements are obtained by integrating the speed with respect to time: (3) wherein and are relevant constant terms, the specific expression being: (4) wherein and is the initial lateral and longitudinal position of the vehicle, when The above equation is not valid when the vehicle is moving in a straight line with constant acceleration, in which case the equation of motion of the vehicle is given by: (5) In the highway lane changing scene, the actual motion of the vehicle can be decomposed into lateral and longitudinal variable acceleration straight line motion, and the physical information network is also suitable for solving problems of ordinary differential equations, so formula (5) can be rewritten as: (6) wherein, and Vxand Vyare the lateral and longitudinal speed of the vehicle at the initial time instant, respectively. If the vehicle's mass center side slip angle is ignored, then The lateral and longitudinal velocities of the vehicle at time t can be calculated by the following equations: (7) Formula (6) is the constant yaw rate, variable acceleration automobile kinematics model; In step 2, the long short-term memory network is built in detail as follows: S1, after establishing the CTRVA automobile kinematics model, the data set is preprocessed; S2, a long short-term memory network is built based on Python language; In step 3, the physical constraint long short-term memory network is built in detail as follows: On the basis of the CTRVA automobile kinematics model and the LSTM network, the physical constraint long short-term memory network is built, and from formula (6), it can be obtained that (10) The loss function of the physical constraint long short-term memory network can be represented as (11) Wherein: L1, L2 and L3 are respectively the loss function of the predicted trajectory, the predicted lateral displacement loss function satisfying the automobile kinematics constraint and the predicted longitudinal speed loss function; and are the actual and predicted trajectory vectors, respectively, , are the loss functions and , are the corresponding numbers of trajectory points, , and are the weights of each loss function, , and are the lateral displacement, lateral velocity and longitudinal velocity of the randomly sampled historical trajectory points from the input vector, respectively, is the time interval from the randomly sampled historical trajectory point to the corresponding predicted trajectory point. 2.The method of claim 1, wherein, After establishing the CTRVA automobile kinematics model, the data set is preprocessed in detail as follows: S1, the first-order Savitzky Golay algorithm is used to smooth the speed data in the data set, and the lane changing data samples are extracted from the data set; S2, the vehicle data is sorted according to Vehicle_ID and Global_Time respectively, the data is blocked according to the vehicle, and the single vehicle data is arranged in ascending order of time; S3, the vehicles entering and leaving the ramp are excluded, and the vehicles with lane ID change, i.e. lane changing behavior, are found in the remaining data, and the lane ID change point is the lane changing point; S4, 3.5s of data is extracted from the lane changing point respectively forward and backward, and it is ensured that the vehicle is always in the original lane before the lane changing point and always in the target lane after the lane changing point, so as to eliminate the vehicles with continuous lane changing; S5, the lateral and longitudinal speeds of the vehicle at each sampling point are calculated according to formula (7), and the vehicle lane changing data samples are obtained; S6, a specified sequence length is set according to the prediction time domain, and a sliding window algorithm is used to divide the vehicle trajectory. 3.The method of claim 2, wherein, The long short-term memory network built based on Python language is built in detail as follows: The input features of the current time step and the hidden state of the previous time step are taken as the input of the memory cell, and the hidden state of the current time step is taken as the output of the memory cell, i.e. the input of the next memory cell; Assume that the LSTM layer has hidden units, the batch size is , and the number of input features is , then the input is , the hidden state of the previous time step is , the input gate of the current time step is , the forget gate is , the output gate is , the candidate memory cell is , and the hidden state is , and the calculation formula is (8) wherein , , , and , , , is a weight parameter, , , , is a bias parameter; Assuming the LSTM layer has hidden units, and the batch size is , then the input to the first fully connected layer is ; Assume that the second fully connected layer has linear units, the overall output feature number of the deep long short-term memory network is , the input is , the output is , and the calculation formula is (9) wherein , is a weight parameter, , is a bias parameter. 4.The method of claim 1, wherein, The memory network is trained by selecting network parameters as described in step 3, and specifically includes: The training process of the physical constraint long short-term memory network in a typical iteration is as follows: S1, forward propagation: A calculation graph is constructed according to the physical constraint long short-term memory network built; The vector inputting the physical constraint long short-term memory network to obtain an output vector and calculating a loss function According to formula (11), the following is obtained: (12) wherein , ; It can be obtained from formulas (8) and (9) as follows: (13) Wherein: Wherein, X, W and b are respectively the input, weight parameter and bias parameter of the deep network; S2, back propagation: The derivative of the loss function with respect to the model parameters is calculated, that is (14) According to the derived derivative, the model parameters are constantly updated using the gradient descent method and Let the loss function Take the minimum value; weight parameters and bias parameters The update formula is (15) wherein, is the learning rate.
Citation Information
Patent Citations
Vehicle collision avoidance dynamic safety path planning method based on accurate trajectory prediction
CN112109704A
Vehicle track prediction method based on memory network and encoder-decoder model
CN113313941A