Intersection vehicle following behavior learning and data enhancement method

By combining generative adversarial networks and long-term memory networks, using high-altitude video data to capture vehicle trajectory characteristics, the problem of difficulty in generating complex traffic flow scenarios in the existing technology is solved, high-quality simulation data generation is achieved, and the accuracy of traffic research is improved and data reliability.

CN119169842AInactive Publication Date: 2024-12-20TONGJI UNIV

Patent Information

Application Number
CN202411313420.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-20
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing GAN-based follow-up model is difficult to generate rear vehicle trajectories corresponding to a single front vehicle, and it is impossible to effectively simulate complex traffic flow scenarios, especially in the case of scarce data, which cannot generate high-quality simulated data.

Method used

Using the method of learning and data enhancement of vehicle follow-up behavior at the intersection based on generative confrontation and long-term memory networks, the vehicle trajectory is obtained through high-altitude intersection monitoring video data, and combined with LSTM and GAN models, the individual timing changes of vehicle follow-up behavior are captured. and overall uncertainty distribution characteristics, generate simulation data that is highly consistent with the actual vehicle trajectory.

Benefits of technology

It realizes the generation of continuous traffic data, improves simulation accuracy, is suitable for intersection scenarios with limited data, supplements the shortcomings of existing data, is suitable for traffic research and digital twin applications, and improves the quality and reliability of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169842A_ABST
    Figure CN119169842A_ABST
Patent Text Reader

Abstract

The invention relates to an intersection vehicle following behavior learning and data enhancement method. The method comprises the following steps: acquiring high-altitude intersection monitoring video data; accurately identifying a vehicle target in the video data based on a target identification algorithm; matching and extracting the identified trajectory data of each vehicle based on a trajectory tracking algorithm, and obtaining real vehicle trajectory data of the continuous traffic flow at the intersection; and learning real vehicle trajectory data of continuous traffic flow based on a generative adversarial network model combined with a long-short-term memory network, capturing individual time sequence change characteristics and overall uncertainty distribution characteristics of vehicle following behaviors, and synthesizing intersection following trajectory data with consistent characteristics. Compared with the prior art, a large amount of vehicle following behavior trajectory data consistent with real data characteristics can be generated through trajectory data learning in the target intersection, and effective data supply is provided for intersection control strategy accelerated deduction through the data enhancement mode; the method is one of important bases for realizing traffic digital twinning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of traffic information, and in particular to a method for learning and data enhancement of vehicle following behavior at an intersection based on generative adversarial and long short-term memory networks. Background Art

[0002] The analysis of vehicle trajectories at intersections is of great significance in improving traffic control performance. However, due to the low penetration rate of connected vehicles and visual occlusion problems, obtaining complete and sufficient trajectory data remains a challenge, especially in car-following scenarios. A common approach to dealing with missing data is to use car-following models to patch or enhance existing data. Car-following models are used to describe the interactions and driving behaviors between vehicles, but traditional models are based on physical rules and simplified assumptions, cannot accurately reflect complex driving behaviors and dynamic traffic environments, and lack adaptive learning capabilities.

[0003] With the development of artificial intelligence technology, data-driven traffic trajectory generation methods have emerged. These methods can capture complex nonlinear relationships that are difficult to reveal with traditional models, and use machine learning and deep learning techniques to learn driving behavior characteristics, thereby generating car-following trajectories with similar data characteristics. Long short-term memory networks (LSTMs) are particularly suitable for modeling vehicle dynamic dependencies due to their advantages in processing time series data. The generator and discriminator of generative adversarial networks (GANs) can generate highly realistic vehicle trajectory data. Combining these two methods can effectively solve the problem of missing data. However, most of the existing GAN-based car-following models can only generate the trajectory of the following vehicle corresponding to a single leading vehicle, and have not yet solved the problem of generating simulated traffic flows in continuous space and time. Although some GAN models are used to generate urban traffic trajectories, the generated data is discretely distributed over a long time span, which is not suitable for microscopic traffic simulation and digital twin applications. Summary of the invention

[0004] The purpose of this invention is to provide a method for learning and data enhancement of intersection vehicle following behavior based on generative adversarial and long short-term memory networks, and to establish a continuous following trajectory generation model for intersection traffic. The model can not only meet the basic constraints of vehicle dynamics, but also capture the characteristics and uncertainty of following behavior, thereby generating simulated data that is highly consistent with the actual vehicle trajectory.

[0005] The purpose of the present invention can be achieved by the following technical solutions:

[0006] A method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks comprises the following steps:

[0007] S1, obtain high-altitude intersection monitoring video data;

[0008] S2, accurately identifies vehicle targets in video data based on target recognition algorithms;

[0009] S3, matching and extracting the trajectory data of each identified vehicle based on the trajectory tracking algorithm to obtain the real vehicle trajectory data of the continuous traffic flow at the intersection;

[0010] S4, based on the generative adversarial network model combined with the long short-term memory network, the real vehicle trajectory data of continuous traffic flow is learned to capture the individual temporal variation characteristics and overall uncertainty distribution characteristics of vehicle following behavior, and synthesize intersection following trajectory data with consistent characteristics, wherein the overall uncertainty distribution characteristics include mean and variance.

[0011] Specifically, S2 uses an improved YOLOv5 OBB model trained with open source to perform vehicle target recognition on high-altitude intersection monitoring video data. The recognition formula is defined as follows:

[0012] set(x t ,y t )=OBB(I t )

[0013] Among them, I t is the picture frame at time t in the video, OBB represents the target recognition model, set(x t ,y t ) is the vehicle coordinate set in the corresponding image frame.

[0014] The S3 comprises the following steps:

[0015] S31, detect the position coordinates (x i ,y i ), and save the vehicle position coordinates to initialize the trajectory data T = {(x1, y1), (x2, y2), …, (x M ,y M )}, where M is the number of frames; the initial trajectory is established by numbering the vehicle coordinates in the first frame file, where the trajectory number is determined by the Euclidean distance of the vehicle from the center point;

[0016] S32, creating a list to store three consecutive frames of trajectory data L = {T1, T2, T3}, using the DBSCAN clustering algorithm to cluster the trajectories and determine the average position coordinates of the vehicle;

[0017] S33, assigning vehicle IDs and tracking vehicle position changes in consecutive frames to achieve stable tracking of vehicle trajectories;

[0018] S34, based on the I / O conservation principle, construct a neighboring area trajectory tracking algorithm to identify and match frame skipping vehicles through the balance of vehicle flow to ensure the continuity of trajectory tracking. The I / O conservation principle is to match vehicles entering and leaving adjacent areas;

[0019] S35, adding the unmatched trajectories to the unstable trajectory set, and updating the difficult-to-identify trajectory set according to the matching situation, generating new vehicle trajectories by demarcating the new vehicle generation area and using the ray method, and numbering them;

[0020] S36, use the cv2 module to automate the tracking process, integrate vehicle ID, time t, coordinate position (x, y) and lane information, and build an intersection vehicle flow trajectory database (Database = {VehicleID, t, (x, y), Lane}).

[0021] The specific steps of S32 are as follows:

[0022] S321, define the parameters of the DBSCAN algorithm, including the neighborhood radius ε and the minimum number of neighborhood points;

[0023] S322, clustering T using the DBSCAN algorithm and assigning vehicle coordinates to different clusters;

[0024] S323, for each cluster, calculate the average position coordinates of all points in it:

[0025]

[0026] Among them, p i is the position coordinate of the i-th point in the cluster, and k is the number of points in the cluster.

[0027] The specific steps of S33 are as follows:

[0028] S331, Vehicle ID Assignment: Assign a unique ID to each vehicle i , in order to accurately track and identify vehicles in consecutive frames;

[0029] S332, key feature matching algorithm: using the key feature matching algorithm to match the vehicle positions in the continuous frames, wherein the key feature matching algorithm performs preliminary matching of the point set to the trajectory set by calculating the distance function;

[0030] S333, threshold setting: in order to improve the accuracy of matching, a threshold is set to filter the matching results. When the distance calculated by the distance function is less than the threshold, that is, d(V,T)<threshold, the point set is matched with the trajectory set, where d represents the distance function, V represents the point set, and T represents the trajectory set;

[0031] S334, first-come-first-match principle: For unmatched trajectories, the first-come-first-match principle is adopted, that is, the unmatched trajectories are matched with the previous trajectories according to the order of appearance of the vehicles;

[0032] S335, predicting trajectory position: For unmatched trajectories, use the Kalman filter or constant speed model to predict the trajectory with a time difference of t to determine the lower limit position of the vehicle, and add the unmatched trajectory to the unstable trajectory set, and update the difficult-to-identify trajectory set according to the matching situation, where:

[0033] The formula for prediction using the Kalman filter is: t =F·X t-1 +B·U t +w t , where X t represents the state vector of the vehicle at time t, F represents the state transfer matrix, B represents the control input matrix, U t represents the control input vector, w t represents process noise;

[0034] The formula for prediction using the constant speed model is: t =X t-1 +V·Δt, where X t represents the position vector of the vehicle at time t, V represents the speed of the vehicle, and Δt represents the time difference;

[0035] S336, predicting the upper limit position in combination with the free-flow speed model: predicting the possible position of the vehicle in the next frame according to the running speed of the vehicle and the free-flow speed model.

[0036] The specific steps of S34 are as follows:

[0037] S341, dividing the four directions of the identified area into lanes of different parts, defining each lane as numbered l, where l∈[1,L], and L is the total number of lanes;

[0038] S342, and divide the lane into an initial area, K middle areas and a tail area according to the order in which the vehicles enter, and define each area as numbered k, where k∈[1,K+2], k=1 represents the initial area, k=K+2 represents the tail area, and the K value depends on the vehicle speed, the lane length, and the accuracy of the recognition model;

[0039] S343, at the initial time t=0, the number of vehicles in the initial area of ​​lane l is expressed as: S[l,1,0], and at each time step t, the number of vehicles in area k of lane l is expressed as: S[l,k,t];

[0040] S344, identify the lane and area where a vehicle is located when skipping frames, and search the next area to see if there is an unmatched vehicle. If so, add the same ID to both, that is, when a skipped vehicle i is detected in area k of lane l at time step t, record its position: P[i,l,k,t]; at the next time step t+1, check whether there is an unmatched vehicle in the next area k+1: P[j,l,k+1,t+1], if there is an unmatched vehicle j, match vehicles i and j, add the same ID to them: M[i]=M[j]=ID, and update the number of matched vehicles:

[0041] S[l,k,t+1]=S[l,k,t]-S[l,k+1,t+1]=S[l,k+1,t]+1.

[0042] The S4 comprises the following steps:

[0043] S41, constructing a generative adversarial network GAN, wherein the generative adversarial network includes a generator and a discriminator, which are used to generate and discriminate new vehicle trajectory data through mutual competition; integrating a long short-term memory network LSTM into the GAN framework to capture and generate trajectory data with temporal coherence;

[0044] S42, define loss functions for the generator and discriminator;

[0045] S43, standardize the real vehicle trajectory data obtained in S3 to eliminate the influence of different dimensions and magnitudes, group the data and extract features according to vehicle IDs, and construct a training data set and a test data set;

[0046] S44, based on the loss function defined in S42, iteratively optimizes the generator and discriminator through adversarial training;

[0047] S45, perform trajectory synthesis on the test data set: load the test data set, fill it with zeros to reach the predetermined maximum sequence length, add random noise to increase the diversity of the generated data, ensure that the data has the correct shape, input the processed test data set into the trained generative adversarial network model, and generate intersection following trajectory data with consistent features.

[0048] The loss function of the discriminator adopts binary cross entropy loss (L BCE ) is defined as follows:

[0049]

[0050] Where N is the number of trajectory samples, y i is the true label of the i-th sample, is the probability that the i-th sample is judged to be true;

[0051] Define the loss function TrajLoss for the generator, which includes the binary cross entropy loss L BCE , the mean square error loss L of each output index MSE and mean square error L MSD Loss is used to ensure the similarity between the generated trajectory and the true trajectory in terms of mean and variance distribution. The loss function TrajLoss of the generator is defined as follows:

[0052]

[0053]

[0054] Among them, α, β, γ are the weights of the corresponding loss terms.

[0055] The generator learns the relationship between five car-following behavior characteristic variables and their time series, wherein the five car-following behavior characteristic variables are the speed of the following vehicle, the acceleration of the following vehicle, the distance between the following vehicle and the stop line, the headway, and the relative speed. The generator outputs the learning result of the variable of the distance between the following vehicle and the stop line through LSTM, and then restores and calculates the remaining four variables through this variable, specifically including the following steps:

[0056] S401, receives the standardized time series data values ​​of the five feature variables, as well as random noise and mask at the input layer:

[0057] X=[v f ,a f ,d stop ,s h ,Δv,z noise ,m mask ]

[0058] Among them, v f represents the speed of the following vehicle, a f represents the acceleration of the following vehicle, d stop Indicates the distance between the following vehicle and the stop line, s h represents the headway, Δv represents the relative speed, z noise represents random noise, m mask Represents a mask;

[0059] S402, in the embedding layer, a multilayer perceptron is used to embed the five feature variables respectively to obtain a 64-dimensional high-dimensional vector, and all the vectors are connected with random noise:

[0060]

[0061] e Δv =φ Δv (Δv; W Δv )

[0062]

[0063] in, φ Δv They represent the MLPs of embedded speed, acceleration, distance to the stop line, headway, and relative speed, respectively. W Δv The weight matrices corresponding to the five feature variables respectively, E represents the connection between all embedded features and random noise;

[0064] S403, a dense layer is used in the feature fusion layer, and the rectified linear unit activation function is adopted to fuse all vectors into a 100-dimensional vector; then, through two dense layers processed by time steps, the 100-dimensional vector is transformed into 256-dimensional and 128-dimensional vectors in turn, and global nonlinear and linear transformations are performed to achieve feature fusion:

[0065] f1=ReLU(W1·E+b2)

[0066] f2=ReLU(W2·f1+b2)

[0067] f3=ReLU(W3·f2+b3)

[0068] Among them, W i represents the weight matrix of the ith dense layer, b i represents the bias vector of the ith dense layer, f i represents the output of the i-th dense layer;

[0069] S404, in the LSTM modeling layer, a sequence with a specific time step is used as input, and a sequence with the same time step as the output is generated through the many-to-many LSTM modeling layer, and 128 units are set to capture the dynamic characteristics of the vehicle trajectory data in the time series:

[0070] H = LSTM(F; W lstm )

[0071] Among them, F represents the fusion features of all trajectory points, that is, F = [f0,f1,…,f maxlength-1 ], H is the output sequence of the LSTM model, that is, H = [h0,h1,…,h maxlength-1 ], each h is a 100-dimensional feature vector containing five feature variables of a generated trajectory point, maxlength represents the sequence length, W lstm is the weight matrix of the LSTM model;

[0072] S405, the synthetic vehicle trajectory data output by the LSTM modeling layer is decoded in the regression output layer: a dense regression layer with one unit is used to decode through the tanh hyperbolic tangent function to generate a time series vector of the headway:

[0073] output t =tanh(W dense ·h t ; b dense )

[0074] Among them, output t Represents the output layer d stop The decoding result in time series, h t Represents the output of each variable of the LSTM unit in time series, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer;

[0075] S406, further restore and calculate the other four car-following behavior characteristic variables of the vehicle:

[0076] The output of the generator is d stop Perform inverse normalization and then use d stop The complete sequence value in time series is used as the core indicator to calculate the vehicle's v speed and a acc , the calculation process is as follows:

[0077]

[0078] Among them, d stop,norm is the normalized distance from the stop line, is the standard deviation of the original distance data, is the average value of the original distance data;

[0079]

[0080] Among them, V f (t) represents the speed of the following vehicle at time t, and Δt is the time step;

[0081]

[0082] Among them, a f (t) represents the acceleration of the i-th vehicle at time t;

[0083] s h (t) = d stop (t,i-1)-d stop (t,i)

[0084] Δv(t)=v f (t,i-1)-v f (t,i)

[0085] Among them, s h (t) and Δv(t) represent the distance and relative speed between the preceding vehicle i-1 and the following vehicle i at time t, respectively. stop (t,i) and v f (t,i) represents the distance and speed from vehicle i to the stop line at time t.

[0086] The discriminator structure is similar to the generator, but the input does not require random noise, and the LSTM modeling layer is a many-to-one structure, and the output scalar is a probability value for distinguishing the authenticity of the data, which specifically includes the following steps:

[0087] S407, receiving the time series data values ​​of five characteristic variables including the speed of the following vehicle, the acceleration of the following vehicle, the distance between the following vehicle and the stop line, the headway, and the relative speed at the input layer. The discriminator only takes the trajectory data as input and does not need random noise:

[0088] X′=[v f ,a f ,d stop ,s h ,Δv,m mask ]

[0089] Among them, v f represents the speed of the following vehicle, a f represents the acceleration of the following vehicle, d stop Indicates the distance between the following vehicle and the stop line, s h represents the headway between vehicles, Δv represents the relative speed, m mask Represents a mask;

[0090] S408, in the embedding layer, a multilayer perceptron is used to embed the five feature variables respectively, to obtain a 64-dimensional high-dimensional vector, and all the vectors are connected:

[0091]

[0092] Among them, E′ represents the connection of all embedded features;

[0093] S409, a dense layer is used in the feature fusion layer, and a rectified linear unit activation function is used to fuse all vectors into a 100-dimensional vector; then, two dense layers are used for time step processing to transform the 100-dimensional vector into 256-dimensional and 128-dimensional vectors in sequence, and global nonlinear and linear transformations are performed to achieve feature fusion;

[0094] S410, in the LSTM modeling layer, the sequence of specific time steps is taken as input, and a scalar is generated through the many-to-one LSTM modeling layer, and 128 units are set to capture the dynamic characteristics of the vehicle trajectory data on the time series.

[0095] h=LSTM(F′;W lstm )

[0096] Where F′ represents the fusion features of all trajectory points obtained in step S409, h is the output scalar of the LSTM model, and W lstm is the weight matrix of the LSTM model;

[0097] S411, in the output layer, the scalar output from the LSTM modeling layer is processed, and a unit dense layer with a Sigmoid activation function is used to perform binary classification on the scalar output to distinguish whether the data is real or synthetic, and the output is a probability value, indicating the possibility that the data is real data:

[0098] O d =σ(W dense ·h; b dense )

[0099] Among them, O d is the final output of the discriminator, indicating the probability that the trajectory data is the real data, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer.

[0100] Compared with the prior art, the present invention has the following beneficial effects:

[0101] (1) Generate continuous following traffic flow data and improve simulation accuracy: Based on the LSTM-TrajGAN architecture, the present invention can learn to generate continuous following traffic flow trajectory data, rather than the traditional independent trajectory generation based only on fixed front-rear vehicle pairs. This method can capture the uncertainty distribution of the characteristic variables of following vehicle behavior in multiple time segments, thereby generating simulated data that is highly similar to real traffic flow. This feature provides a large amount of high-quality data for traffic research, simulation applications, and model verification, significantly improving the accuracy and reliability of simulation.

[0102] (2) Applicable to intersection scenarios with limited data and enhanced digital twin applications: The method of the present invention is particularly suitable for intersection scenarios where data is scarce. By generating a large amount of high-quality simulation data, it effectively supplements the insufficiency of existing data. At the same time, the technical solution can also be extended to digital twin applications, enhancing its applicability in the field of complex traffic research and having a wider application prospect.

[0103] (3) Wide applicability: The present invention is not only applicable to intersection scenarios, but can also be extended to various complex traffic scenarios, such as highways, urban main roads, etc. In scenarios where data is scarce, the method can also perform data enhancement by generating high-quality simulation data to supplement the deficiencies of existing data. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] Figure 1 is a flow chart of the method of the present invention;

[0105] Figure 2 An example of a visualization effect of vehicle target recognition at an intersection in one embodiment;

[0106] Figure 3 An example of visualization effect of vehicle trajectory tracking at an intersection in an embodiment;

[0107] Figure 4 Schematic diagram of the generative adversarial network model structure of the present invention, where (a) is the generator structure and (b) is the discriminator structure. DETAILED DESCRIPTION

[0108] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0109] This embodiment provides a method for learning and enhancing vehicle following behavior at an intersection based on generative adversarial and long short-term memory networks. Taking a certain intersection as an example, the general steps from data collection to application of this learning method are shown. Figure 1 As shown, the method comprises the following steps:

[0110] S1, using drone aerial photography to monitor fixed points above the intersection to collect high-altitude intersection monitoring video data containing continuous trajectory data of vehicle flow.

[0111] Data-driven methods require high-precision continuous vehicle trajectory data. However, existing perception technologies (such as lidar, ground cameras) are often affected by occlusion and other problems when collecting trajectory data at intersections, resulting in data loss. In recent years, aerial video technology has been increasingly used in traffic monitoring, including monitoring equipment installed on buildings, traffic management dome cameras, and drone aerial photography. Compared with ground sensors, aerial videos have a wider viewing angle and coverage range, and are particularly suitable for complex traffic scenes. Therefore, the present invention develops a trajectory tracking and extraction method for aerial videos to provide a high-quality data basis for subsequent model training.

[0112] S11, first of all, we chose the DJI Mavic3T industry series drone equipped with an RTK positioning module. This drone has a high-resolution camera, stable flight performance, and can work stably under normal weather conditions, making it suitable for high-altitude video monitoring of intersections. In order to ensure the accuracy and continuity of data collection, the drone was configured and debugged, and video recording and data transmission were set up.

[0113] S12, a certain intersection was selected as the monitoring area. The intersection is a two-way single-lane intersection, which is conducive to extracting and processing trajectory data. The center of the intersection was selected as the bird's-eye view monitoring point. After multiple adjustments to the flight altitude to compare the video viewing angle range and clarity, 300 meters was selected as the monitoring altitude. Through field investigation and pre-testing, the optimal take-off point and flight path for the appropriate drone were selected, so that the drone can automatically cruise to the preset monitoring point and fine-tune the angle to ensure that the entire intersection area and the approximately 150-meter lane can be covered to obtain clear video data.

[0114] S13, during the data collection process, the drone was used to conduct high-altitude video monitoring of the selected intersection according to the pre-planned flight path and schedule. In order to ensure the diversity and richness of the data, multiple flights were conducted in three different time periods (morning peak, flat peak, and evening peak), and the duration of each flight was about 30 minutes. During the flight, the drone's camera captured video at a fixed angle and height to ensure the stability and consistency of the video data.

[0115] S14, after each video data collection is completed, it is backed up to the hard disk and uploaded to the cloud network disk, and the data is classified and renamed to facilitate subsequent data batch processing.

[0116] S2, accurately identifies vehicle targets in video data based on target recognition algorithms.

[0117] This embodiment uses the open source trained improved YOLOv5 OBB model to perform vehicle target recognition on the high-altitude intersection monitoring video data. The recognition formula is defined as follows:

[0118] set[x t ,y t )=OBB(I t ) (1)

[0119] Among them, I t is the picture frame at time t in the video, OBB represents the target recognition model, set(x t ,y t ) is the vehicle coordinate set in the corresponding image frame.

[0120] The recognition result in this embodiment is as follows Figure 2shown.

[0121] S3, based on the trajectory tracking algorithm, matches and extracts the trajectory data of each identified vehicle to obtain the real vehicle trajectory data of the continuous traffic flow at the intersection.

[0122] Specifically, S3 includes the following steps:

[0123] S31, detect the position coordinates (x i ,y i ), and save the vehicle position coordinates to initialize the trajectory data T = {(x1, y1), (x2, y2), …, (x M ,y M )}, where M is the number of frames; the initial trajectory is established by numbering the vehicle coordinates in the first frame file, where the trajectory number is determined by the Euclidean distance of the vehicle from the center point.

[0124] S32, create a list to store three consecutive frames of trajectory data L = {T1, T2, T3}, and use the DBSCAN clustering algorithm to cluster the trajectory. The core idea of ​​the DBSCAN algorithm is to determine the average position coordinates of the vehicle based on density clustering to enhance the robustness of trajectory tracking. The specific steps are as follows:

[0125] S321, define the parameters of the DBSCAN algorithm, including the neighborhood radius ε and the minimum number of neighborhood points;

[0126] S322, clustering T using the DBSCAN algorithm and assigning vehicle coordinates to different clusters;

[0127] S323, for each cluster, calculate the average position coordinates of all points in it:

[0128] Among them, P i is the position coordinate of the i-th point in the cluster, and k is the number of points in the cluster.

[0129] S33, assigning vehicle IDs and tracking vehicle position changes in consecutive frames to achieve stable and accurate tracking of vehicle trajectories. The specific steps are as follows:

[0130] S331, Vehicle ID Assignment: Assign a unique ID to each vehicle i , in order to accurately track and identify vehicles in consecutive frames.

[0131] S332, key feature matching algorithm: Use the key feature matching algorithm to match the vehicle positions in the continuous frames, wherein the key feature matching algorithm performs preliminary matching of the point set to the trajectory set by calculating the distance function.

[0132] S333, threshold setting: In order to improve the accuracy of matching, a threshold is set to filter the matching results. When the distance calculated by the distance function is less than the threshold, that is, d(V,T) < threshold, the point set is matched with the trajectory set, where d represents the distance function, V represents the point set, and T represents the trajectory set.

[0133] S334, first-come-first-match principle: For unmatched trajectories, the first-come-first-match principle is adopted, that is, the unmatched trajectories are matched with the previous trajectories according to the order in which the vehicles appear.

[0134] S335, predicting trajectory position: For unmatched trajectories, use the Kalman filter or constant speed model to predict the trajectory with a time difference of t to determine the lower limit position of the vehicle, and add the unmatched trajectory to the unstable trajectory set, and update the difficult-to-identify trajectory set according to the matching situation, where:

[0135] The formula for prediction using the Kalman filter is:

[0136] X t =F·X t-1 +B·U t +w t (2)

[0137] Where X t represents the state vector of the vehicle at time t, F represents the state transfer matrix, B represents the control input matrix, U t represents the control input vector, w t represents process noise.

[0138] The formula for prediction using the constant speed model is:

[0139] X t =X t-1 +V·Δt (3)

[0140] Where X t represents the position vector of the vehicle at time t, V represents the speed of the vehicle, and Δt represents the time difference.

[0141] S336, predicting the upper limit position in combination with the free-flow speed model: predicting the possible position of the vehicle in the next frame according to the running speed of the vehicle and the free-flow speed model.

[0142] Combining the above methods, a stable matching relationship can be established to achieve accurate tracking of the vehicle trajectory. In this way, even if there are unmatched trajectories in consecutive frames, the vehicle's position can be determined through prediction and modeling, and the continuity and stability of the trajectory can be maintained. These methods provide a reliable solution for trajectory tracking, so that the position changes of the vehicle in consecutive frames can be accurately tracked and recorded.

[0143] S34, in order to solve the frame skipping problem caused by external conditions such as lighting conditions and small vehicle pixels, that is, the phenomenon that a certain vehicle is suddenly no longer recognized in a certain frame and then re-recognized after a period of time, this embodiment uses the I / O conservation principle (matching vehicles entering and leaving adjacent areas) as the principle to construct a neighboring area trajectory tracking algorithm, identify and match frame skipping vehicles through the balance of vehicle flow, and ensure the continuity of trajectory tracking; the specific steps are as follows:

[0144] S341, divide the four directions of the identified area into lanes of different parts, and define each lane as numbered l, where l∈[1,L], and L is the total number of lanes.

[0145] S342, and divide the lane into an initial area, K middle areas and a tail area according to the order in which the vehicles enter, and define the number of each area as k, where k∈[1,K+2], k=1 represents the initial area, k=K+2 represents the tail area, and the K value depends on the vehicle speed, lane length, and the accuracy of the recognition model.

[0146] S343, at the initial time t=0, the number of vehicles in the initial area of ​​lane l is expressed as: S[l,1,0], and at each time step t, the number of vehicles in area k of lane l is expressed as: S[l,k,t].

[0147] S344, identify the lane and area where a vehicle is located when skipping frames, and search the next area to see if there are any unmatched vehicles. If so, add the same ID to both. That is, when a skipped vehicle i is detected in area k of lane l at time step t, record its position: P[i,l,k,t]; at the next time step t+1, check whether there are any unmatched vehicles in the next area k+1: P[j,l,k+1,t+1]. If there is any unmatched vehicle j, match vehicles i and j, add the same ID to them: M[i]=M[j]=ID, and update the number of matched vehicles:

[0148] S[l,k,t+1]=S[l,k,t]-S[l,k+1,t+1]=S[l,k+1,t]+1(4)

[0149] S35, adding the unmatched trajectories to the unstable trajectory set, and updating the difficult-to-identify trajectory set according to the matching situation, generating new vehicle trajectories by delineating the new vehicle generation area and using the ray method, and numbering them.

[0150] S36, uses the cv2 module to automate the tracking process to ensure efficiency and stability, integrates vehicle ID, time t, coordinate position (x, y) and lane information, and builds an intersection traffic trajectory database (Database = {VehicleID, t, (x, y), Lane}) to provide data support for vehicle behavior analysis.

[0151] S37, uses the cv2 module to visualize the tracking results, providing an intuitive reference for target recognition and trajectory tracking effects. The constructed database uses the csv file format to ensure data accuracy and consistency.

[0152] It should be noted that the above formula is only a simplified description of the process, and the specific mathematical model and algorithm details will be adjusted and improved according to actual needs. For more detailed and precise formula and algorithm descriptions, you can refer to relevant research papers or have further discussions with experts in the professional field.

[0153] The trajectory tracking results in this embodiment are as follows Figure 3 shown.

[0154] S4, based on the generative adversarial network model combined with long short-term memory network, learns the real vehicle trajectory data of continuous traffic flow, captures the individual temporal change characteristics and overall uncertainty distribution characteristics of vehicle following behavior, and synthesizes intersection following trajectory data with consistent characteristics, where the overall uncertainty distribution characteristics include mean and variance.

[0155] Specifically, S4 includes the following steps:

[0156] S41, constructing a generative adversarial network GAN, which includes a generator and a discriminator, which are used to generate and discriminate new vehicle trajectory data through mutual competition; the adversarial training process of the generator and the discriminator can produce high-quality synthetic data, which is suitable for the feature learning of vehicle following behavior in the present invention. Integrate the long short-term memory network LSTM into the GAN framework to enhance the model's processing ability for time series vehicle behavior data; the LSTM network can capture and generate trajectory data with temporal coherence, which is crucial for the simulation and synthesis of vehicle following trajectory data.

[0157] The processed trajectory training set data is input into the LSTM-TrajGAN vehicle behavior learning model based on generative adversarial and long short-term memory network for training, which can learn vehicle behavior characteristics and output high-quality simulation data: the training data is first input into the designed trajectory generator to learn the relationship between the five following behavior characteristic variables and their time series, and the LSTM outputs the learning result of only the variable of the distance from the following vehicle to the stop line, and then this variable is used to restore and calculate the other four variables. The five following behavior characteristic variables are the speed of the following vehicle, the acceleration of the following vehicle, the distance from the following vehicle to the stop line, the head distance, and the relative speed. Figure 4 (a), specifically comprising the following steps:

[0158] S401, receives the standardized time series data values ​​of the five feature variables, as well as random noise and mask at the input layer:

[0159] X=[v f ,a f ,d stop ,s h ,Δv,z noise ,m mask ] (5)

[0160] Among them, v f represents the speed of the following vehicle, a f represents the acceleration of the following vehicle, d stop Indicates the distance between the following vehicle and the stop line, s h represents the headway, Δv represents the relative speed, z noise represents random noise, m mask Indicates a mask.

[0161] S402, in the embedding layer, multilayer perceptrons (MLPs) are used to embed the five feature variables respectively to obtain 64-dimensional high-dimensional vectors, and all vectors are connected with random noise:

[0162]

[0163] e Δv =φ Δv (Δv; W Δv ) (10)

[0164]

[0165] in, φ Δv They represent the MLPs of embedded speed, acceleration, distance to the stop line, headway, and relative speed, respectively. W ΔvThe weight matrices corresponding to the five feature variables respectively, E represents the connection between all embedded features and random noise.

[0166] S403, a dense layer is used in the feature fusion layer, and the rectified linear unit (ReLU) activation function is adopted to fuse all vectors into a 100-dimensional vector; then, through two dense layers processed time step by time step, the 100-dimensional vector is transformed into 256-dimensional and 128-dimensional vectors in turn, and global nonlinear and linear transformations are performed to achieve feature fusion.

[0167] f1=ReLU(W1·E+b2) (12)

[0168] f2=ReLU(W2·f1+b2) (13)

[0169] f3=ReLU(W3·f2+b3) (14)

[0170] Among them, W i represents the weight matrix of the ith dense layer, b i represents the bias vector of the ith dense layer, f i represents the output of the ith dense layer.

[0171] S404, taking a sequence of a specific time step as input in the LSTM modeling layer, generating a sequence with the same time step as the output through the many-to-many LSTM modeling layer, and setting 128 units to capture the dynamic characteristics of the vehicle trajectory data in the time series.

[0172] H = LSTM(F; W lstm ) (15)

[0173] Wherein, F represents the fusion features of all trajectory points obtained in step S403, that is, F = [f0, f1, ..., f maxlength-1 ], H is the output sequence of the LSTM model, that is, H = [h0,h1,…,h maxlength-1 ], each h is a 100-dimensional feature vector containing five feature variables of a generated trajectory point, maxlength represents the sequence length, W lstm is the weight matrix of the LSTM model.

[0174] S405, the synthetic vehicle trajectory data output by the LSTM modeling layer is decoded in the regression output layer: a dense regression layer with one unit is used to decode through the tanh hyperbolic tangent function to generate a time series vector of the headway:

[0175] output t =tanh(Wdense ·h t ; b dense ) (16)

[0176] Among them, output t Represents the output layer d stop The decoding result in time series, h t Represents the output of each variable of the LSTM unit in time series, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer.

[0177] S406, further restore and calculate the other four car-following behavior characteristic variables of the vehicle:

[0178] The output of the generator is d stop Perform inverse normalization and then use d stop The complete sequence value in time series is used as the core indicator to calculate the vehicle's v speed and a acc , the calculation process is as follows:

[0179]

[0180] Among them, d stop,norm is the normalized distance from the stop line, is the standard deviation of the original distance data, is the average value of the original distance data.

[0181]

[0182] Among them, V f (t) represents the speed of the following vehicle at time t, and Δt is the time step.

[0183]

[0184] Among them, a f (t) represents the acceleration of the i-th vehicle at time t.

[0185] s h (t) = d stop (t,i-1)-d stop (t,i) (20)

[0186] Δv(t)=v f (t,i-1)-v f (t,i) (21)

[0187] Among them, s h (t) and Δv(t) represent the distance and relative speed between the preceding vehicle i-1 and the following vehicle i at time t, respectively.stop (t,i) and v f (t,i) represents the distance and speed from vehicle i to the stop line at time t.

[0188] The generated trajectory and the real trajectory output by the generator will be input into the constructed trajectory discriminator to discriminate the authenticity. The discriminator structure is similar to the generator, but the input does not require random noise, and the LSTM modeling layer is a many-to-one structure. The output scalar is a probability value used to distinguish the authenticity of the data, such as Figure 4 (b), specifically comprising the following steps:

[0189] S407, receiving the time series data values ​​of five characteristic variables including the speed of the following vehicle, the acceleration of the following vehicle, the distance between the following vehicle and the stop line, the headway, and the relative speed at the input layer. The discriminator only takes the trajectory data as input and does not need random noise:

[0190] X′=[v f ,a f ,d stop ,s h ,Δv,m mask ](twenty two)

[0191] Among them, v f represents the speed of the following vehicle, a f represents the following vehicle acceleration, s stop Indicates the distance between the following vehicle and the stop line, s h represents the headway between vehicles, Δv represents the relative speed, m mask Indicates a mask.

[0192] S408, in the embedding layer, a multilayer perceptron is used to embed the five feature variables respectively, to obtain a 64-dimensional high-dimensional vector, and all the vectors are connected:

[0193]

[0194] Among them, E′ represents the concatenation of all embedded features without random noise compared to the generator.

[0195] S409, a dense layer is used in the feature fusion layer, and the rectified linear unit activation function is adopted to fuse all vectors into a 100-dimensional vector; then, through two dense layers processed time step by time, the 100-dimensional vector is transformed into 256-dimensional and 128-dimensional vectors in turn, and global nonlinear and linear transformations are performed to achieve feature fusion.

[0196] This step is consistent with the feature fusion step of the generator, and will not be repeated here in this embodiment.

[0197] S410, in the LSTM modeling layer, the sequence of specific time steps is taken as input, and a scalar is generated through the many-to-one LSTM modeling layer, and 128 units are set to capture the dynamic characteristics of the vehicle trajectory data on the time series.

[0198] h=LSTM(F′;W lstm ) (twenty four)

[0199] Where F′ represents the fusion features of all trajectory points obtained in step S409, h is the output scalar of the LSTM model, and W lstm is the weight matrix of the LSTM model.

[0200] S411, in the output layer, the scalar output from the LSTM modeling layer is processed, and a unit dense layer with a Sigmoid activation function is used to perform binary classification on the scalar output to distinguish whether the data is real or synthetic, and the output is a probability value, indicating the possibility that the data is real data:

[0201] O d =σ(W dense ·h; b dense ) (25)

[0202] Among them, O d is the final output of the discriminator, indicating the probability that the trajectory data is the real data, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer.

[0203] The discriminator improves the quality of the data generated by the generator by continuously optimizing its parameters to improve its ability to distinguish between real data and generated data.

[0204] S42, define the loss function for the generator and the discriminator.

[0205] The loss function of the discriminator adopts binary cross entropy loss (L BCE ) is defined as follows:

[0206]

[0207] Where N is the number of trajectory samples, y i is the true label of the i-th sample, is the probability that the i-th sample is judged to be true.

[0208] Define the loss function TrajLoss for the generator, which includes the binary cross entropy loss L BCE , the mean square error loss L of each output index MSE and mean square error L MSDloss to ensure that the generated trajectory is similar to the true trajectory in terms of mean and variance distribution.

[0209] The loss function TrajLoss of the generator is defined as follows:

[0210]

[0211]

[0212]

[0213] Among them, α, β, γ are the weights of the corresponding loss terms.

[0214] S43, Dataset construction

[0215] This embodiment screened 4,500 vehicles with data duration greater than 10 seconds and less than 70 seconds that passed the entrance lane stop line in multiple consecutive time periods, and obtained a data set of 661,158 time steps. Since the learning of the following trajectory focuses on the following variables between the leading and trailing vehicles, the calculation of the loss function needs to calculate the headway and relative speed based on the sequential relationship between the vehicles. Therefore, the vehicle data in the training set and the test set must be arranged in chronological order and cannot be randomly sampled. According to the ratio of 4:1, the first 3,600 vehicles (529,910 time steps) are used as the training set, and the remaining 900 vehicles are used as the test set, and then preprocessed.

[0216] The real vehicle trajectory data obtained by S3 is standardized to eliminate the influence of different dimensions and magnitudes, and the data is grouped and features are extracted according to the vehicle ID to construct the training data set and the test data set. The standardization formula is as follows:

[0217]

[0218] Among them, x is the original data, μ is the mean, and σ is the standard deviation.

[0219] The data is grouped according to the unique identifier (Vehicle ID), and features are extracted and encoded for each group of data. The specific steps are as follows:

[0220] ① Group the data of each vehicle.

[0221] ②Extract and transform the features of each group of data.

[0222] ③Add a mask column to identify valid data.

[0223] Convert the processed data from CSV format to NPY format. NPY is a binary format file that has faster reading and writing speeds and higher storage efficiency when processing large-scale data sets.

[0224] S44, based on the loss function defined in S42, iteratively optimizes the generator and discriminator through adversarial training.

[0225] First, real trajectory data is randomly sampled from the training dataset and a considerable amount of synthetic data is generated, which lays the foundation for the training cycle. The discriminator then evaluates both sets of data and updates its parameters through backpropagation to accurately distinguish between real data and synthetic data, thereby calculating the classification loss. At the same time, the generator uses feedback from the updated discriminator to evaluate the synthetic data, calculate its loss, and adjust its parameters to improve the data quality, with the goal of more effectively fooling the discriminator. This iterative optimization continues until the data produced by the generator can fool the discriminator with a high degree of reliability, thereby stabilizing the discriminator's ability to distinguish. This process ensures the training progress of the system through specific initialization and algorithmic steps.

[0226] initialization:

[0227] With parameter θ g Initialize the generator G.

[0228] With parameter θ d Initialize the discriminator D.

[0229] Set the learning rate η and other hyperparameters.

[0230] The training algorithm is shown in Table 1.

[0231] Table 1

[0232]

[0233]

[0234] The model is trained using the Adam optimizer, and the learning rate and hyperparameters are set and dynamically adjusted to optimize the model performance; in this embodiment, the learning rate is set to 0.001 and the hyperparameters are set to 0.5. During adversarial training, the generator receives real trajectories and random noise as input to generate synthetic trajectories. The discriminator attempts to distinguish between real trajectories and synthetic trajectories generated by the generator. The training data is standardized and padded to meet the input requirements of the model. During the training process, the loss values ​​of the generator and the discriminator are recorded in real time for monitoring model performance and subsequent analysis.

[0235] S45, perform trajectory synthesis on the test data set: load the test data set, fill it with zeros to reach the predetermined maximum sequence length, add random noise to increase the diversity of the generated data, reflect the uncertainty in the car-following trajectory data, and ensure that the data has the correct shape. Input the processed test data set into the trained generative adversarial network model to generate intersection car-following trajectory data with consistent features.

[0236] The specific steps include:

[0237] S451, model loading: By loading the trained generator weights, the model can generate synthetic trajectories based on the input noise and part of the real data.

[0238] S452, prediction generation: The generator receives the preprocessed data as input and generates a series of synthetic trajectory attributes. These attributes are then processed and combined to form a complete synthetic trajectory dataset.

[0239] S453, post-processing: mainly denormalization and data type conversion. The denormalization process converts the generated standardized data back to the original data scale to ensure the usability of the synthetic data in practical applications. At the same time, the data type conversion ensures the consistency and accuracy of the data set.

[0240] S454, Save: Merge the synthesized trajectory data with fixed values ​​(vehicle number, direction, time series, length of the leading vehicle, etc.) and save as a CSV file.

[0241] The present invention relates to a method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks, and in order to obtain high-precision continuous trajectory data of vehicle flow, a trajectory tracking and extraction algorithm is proposed for aerial videos, which can be popularized and used in various aerial video processing applications. The core LSTM-TrajGAN model of the present invention learns and generates continuous following vehicle flow in a large number of time slices, which is theoretically suitable for providing data enhancement technology in intersection scenarios with insufficient data, and provides a large amount of generated data for simulation and research. The present invention takes into account the limitations of intersection data acquisition, and has the advantages of strong practicality, wide applicability, and high quality of generated data.

[0242] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks, characterized in that: The following steps are involved: S1, obtain high-altitude intersection monitoring video data; S2, accurately identifies vehicle targets in video data based on target recognition algorithms; S3, matching and extracting the trajectory data of each identified vehicle based on the trajectory tracking algorithm to obtain the real vehicle trajectory data of the continuous traffic flow at the intersection; S4, based on the generative adversarial network model combined with the long short-term memory network, the real vehicle trajectory data of continuous traffic flow is learned to capture the individual temporal variation characteristics and overall uncertainty distribution characteristics of vehicle following behavior, and synthesize intersection following trajectory data with consistent characteristics, wherein the overall uncertainty distribution characteristics include mean and variance.

2. The method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 1, characterized in that: Specifically, S2 uses an improved YOLOv5OBB model trained with open source to perform vehicle target recognition on high-altitude intersection monitoring video data. The recognition formula is defined as follows: set(x t ,y t )=OBB(I t ) Among them, I t is the picture frame at time t in the video, OBB represents the target recognition model, set(x t ,y t ) is the vehicle coordinate set in the corresponding image frame.

3. The method for learning and enhancing vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 1, characterized in that: The S3 comprises the following steps: S31, detect the position coordinates (x i ,y i ), and save the vehicle position coordinates to initialize the trajectory data T = {(x1, y1), (x2, y2), …, (x M ,y M )}, where M is the number of frames; the initial trajectory is established by numbering the vehicle coordinates in the first frame file, where the trajectory number is determined by the Euclidean distance of the vehicle from the center point; S32, creating a list to store three consecutive frames of trajectory data L = {T1, T2, T3}, using the DBSCAN clustering algorithm to cluster the trajectories and determine the average position coordinates of the vehicle; S33, assigning vehicle IDs and tracking vehicle position changes in consecutive frames to achieve stable tracking of vehicle trajectories; S34, based on the I / O conservation principle, construct a neighboring area trajectory tracking algorithm to identify and match frame skipping vehicles through the balance of vehicle flow to ensure the continuity of trajectory tracking. The I / O conservation principle is to match vehicles entering and leaving adjacent areas; S35, adding the unmatched trajectories to the unstable trajectory set, and updating the difficult-to-identify trajectory set according to the matching situation, generating new vehicle trajectories by demarcating the new vehicle generation area and using the ray method, and numbering them; S36, use the cv2 module to automate the tracking process, integrate vehicle ID, time t, coordinate position (x, y) and lane information, and build an intersection vehicle flow trajectory database (Database = {VehicleID, t, (x, y), Lane}).

4. The method for learning and enhancing vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 3, characterized in that: The specific steps of S32 are as follows: S321, define the parameters of the DBSCAN algorithm, including the neighborhood radius ε and the minimum number of neighborhood points; S322, clustering T using the DBSCAN algorithm and assigning vehicle coordinates to different clusters; S323, for each cluster, calculate the average position coordinates of all points in it: Among them, p i is the position coordinate of the i-th point in the cluster, and k is the number of points in the cluster.

5. The method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 3, characterized in that: The specific steps of S33 are as follows: S331, Vehicle ID Assignment: Assign a unique ID to each vehicle i , in order to accurately track and identify vehicles in consecutive frames; S332, key feature matching algorithm: using the key feature matching algorithm to match the vehicle positions in the continuous frames, wherein the key feature matching algorithm performs preliminary matching of the point set to the trajectory set by calculating the distance function; S333, threshold setting: in order to improve the accuracy of matching, a threshold is set to filter the matching results. When the distance calculated by the distance function is less than the threshold, that is, d(V,T) < the threshold, the point set is matched with the trajectory set, where d represents the distance function, V represents the point set, and T represents the trajectory set; S334, first-come-first-match principle: For unmatched trajectories, the first-come-first-match principle is adopted, that is, the unmatched trajectories are matched with the previous trajectories according to the order of appearance of the vehicles; S335, predicting trajectory position: For unmatched trajectories, use the Kalman filter or constant speed model to predict the trajectory with a time difference of t to determine the lower limit position of the vehicle, and add the unmatched trajectory to the unstable trajectory set, and update the difficult-to-identify trajectory set according to the matching situation, where: The formula for prediction using the Kalman filter is: t =F·X t-1 +B·U t +W t , where X t represents the state vector of the vehicle at time t, F represents the state transfer matrix, B represents the control input matrix, U t represents the control input vector, w t represents process noise; The formula for prediction using the constant speed model is: t =X t-1 +V·Δt, where X t represents the position vector of the vehicle at time t, V represents the speed of the vehicle, and Δt represents the time difference; S336, predicting the upper limit position in combination with the free-flow speed model: predicting the possible position of the vehicle in the next frame according to the running speed of the vehicle and the free-flow speed model.

6. The method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 3, characterized in that: The specific steps of S34 are as follows: S341, dividing the four directions of the identified area into lanes of different parts, defining each lane as numbered l, where l∈[1,L], and L is the total number of lanes; S342, and divide the lane into an initial area, K middle areas and a tail area according to the order in which the vehicles enter, and define each area as numbered k, where k∈[1,K+2], k=1 represents the initial area, k=K+2 represents the tail area, and the K value depends on the vehicle speed, the lane length, and the accuracy of the recognition model; S343, at the initial time t=0, the number of vehicles in the initial area of ​​lane l is expressed as: S[l,1,0], and at each time step t, the number of vehicles in area k of lane l is expressed as: S[l,k,t]; S344, identify the lane and area where a vehicle is located when skipping frames, and search the next area to see if there is an unmatched vehicle. If so, add the same ID to both, that is, when a skipped vehicle i is detected in area k of lane l at time step t, record its position: P[i,l,k,t]; at the next time step t+1, check whether there is an unmatched vehicle in the next area k+1: P[j,l,k+1,t+1], if there is an unmatched vehicle j, match vehicles i and j, add the same ID to them: M[i]=M[j]=ID, and update the number of matched vehicles: S[l,k,t+1]=S[l,k,t]-S[l,k+1,t+1]=S[l,k+1,t]+1.

7. The method for learning and enhancing vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 1, characterized in that: The S4 comprises the following steps: S41, constructing a generative adversarial network GAN, wherein the generative adversarial network includes a generator and a discriminator, which are used to generate and discriminate new vehicle trajectory data through mutual competition; integrating a long short-term memory network LSTM into the GAN framework to capture and generate trajectory data with temporal coherence; S42, define loss functions for the generator and discriminator; S43, standardize the real vehicle trajectory data obtained in S3 to eliminate the influence of different dimensions and magnitudes, group the data and extract features according to vehicle IDs, and construct a training data set and a test data set; S44, based on the loss function defined in S42, iteratively optimizes the generator and discriminator through adversarial training; S45, perform trajectory synthesis on the test data set: load the test data set, fill it with zeros to reach the predetermined maximum sequence length, add random noise to increase the diversity of the generated data, ensure that the data has the correct shape, input the processed test data set into the trained generative adversarial network model, and generate intersection following trajectory data with consistent features.

8. The method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 7, characterized in that: The loss function of the discriminator adopts binary cross entropy loss (L BCE ) is defined as follows: Where N is the number of trajectory samples, y i is the true label of the i-th sample, is the probability that the i-th sample is judged to be true; Define the loss function TrajLoss for the generator, which includes the binary cross entropy loss L BCE , the mean square error loss L of each output index MSE and mean square error L MSD Loss is used to ensure the similarity between the generated trajectory and the true trajectory in terms of mean and variance distribution. The loss function TrajLoss of the generator is defined as follows: Among them, α, β, γ are the weights of the corresponding loss terms.

9. The method for learning and enhancing vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 7, characterized in that: The generator learns the relationship between five car-following behavior characteristic variables and their time series, wherein the five car-following behavior characteristic variables are the speed of the following vehicle, the acceleration of the following vehicle, the distance between the following vehicle and the stop line, the headway, and the relative speed. The generator outputs the learning result of the variable of the distance between the following vehicle and the stop line through LSTM, and then restores and calculates the remaining four variables through this variable, specifically including the following steps: S401, receives the standardized time series data values ​​of the five feature variables, as well as random noise and mask at the input layer: X=[v f ,a f ,d stop ,s h ,Δv,z noise ,m mask ] Among them, v f represents the speed of the following vehicle, a f represents the acceleration of the following vehicle, d stop Indicates the distance between the following vehicle and the stop line, s h represents the headway, Δv represents the relative speed, z noise represents random noise, m mask Represents a mask; S402, in the embedding layer, a multilayer perceptron is used to embed the five feature variables respectively to obtain a 64-dimensional high-dimensional vector, and all the vectors are connected with random noise: e Δv =φ Δv (Δv;W Δv ) in, φ Δv They represent the MLPs of embedded speed, acceleration, distance to the stop line, headway, and relative speed, respectively. W Δv The weight matrices corresponding to the five feature variables respectively, E represents the connection between all embedded features and random noise; S403, a dense layer is used in the feature fusion layer, and the rectified linear unit activation function is adopted to fuse all vectors into a 100-dimensional vector; then, through two dense layers processed by time steps, the 100-dimensional vector is transformed into 256-dimensional and 128-dimensional vectors in turn, and global nonlinear and linear transformations are performed to achieve feature fusion: f1=ReLU(W1·E+b2) f2=ReLU(W2·f1+b2) f3=ReLU(W3·f2+b3) Among them, W i represents the weight matrix of the ith dense layer, b i represents the bias vector of the ith dense layer, f i represents the output of the i-th dense layer; S404, in the LSTM modeling layer, a sequence with a specific time step is used as input, and a sequence with the same time step as the output is generated through the many-to-many LSTM modeling layer, and 128 units are set to capture the dynamic characteristics of the vehicle trajectory data in the time series: H=LSTM(F;W lstm ) Among them, F represents the fusion features of all trajectory points, that is, F = [f0,f1,…,f maxlength-1 ], H is the output sequence of the LSTM model, that is, H = [h0,h1,…,h maxlength-1 ], each h is a 100-dimensional feature vector containing five feature variables of a generated trajectory point, maxlength represents the sequence length, W lstm is the weight matrix of the LSTM model; S405, the synthetic vehicle trajectory data output by the LSTM modeling layer is decoded in the regression output layer: a dense regression layer with one unit is used to decode through the tanh hyperbolic tangent function to generate a time series vector of the headway: output t =tanh(W dense ·h t ;b dense ) Among them, output t Represents the output layer d stop The decoding result in time series, h t Represents the output of each variable of the LSTM unit in time series, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer; S406, further restore and calculate the other four car-following behavior characteristic variables of the vehicle: The output of the generator is d stop Perform inverse normalization and then use d stop The complete sequence value in time series is used as the core indicator to calculate the vehicle's v speed and a acc , the calculation process is as follows: Among them, d stop,norm is the normalized distance from the stop line, is the standard deviation of the original distance data, is the average value of the original distance data; Among them, V f (t) represents the speed of the following vehicle at time t, and Δt is the time step; Among them, a f (t) represents the acceleration of the i-th vehicle at time t; s h (t)=d stop (t,i-1)-d stop (t,i) Δv(t)=v f (t,i-1)-v f (t,i) Among them, s h (t) and Δv(t) represent the distance and relative speed between the preceding vehicle i-1 and the following vehicle i at time t, respectively. stop (t,i) and v f (t,i) represents the distance and speed from vehicle i to the stop line at time t.

10. The method for learning and data enhancement of vehicle following behavior at intersections based on generative adversarial and long short-term memory networks according to claim 7, characterized in that: The discriminator structure is similar to the generator, but the input does not require random noise, and the LSTM modeling layer is a many-to-one structure, and the output scalar is a probability value for distinguishing the authenticity of the data, which specifically includes the following steps: S407, receiving the time series data values ​​of five characteristic variables including the speed of the following vehicle, the acceleration of the following vehicle, the distance between the following vehicle and the stop line, the headway, and the relative speed at the input layer. The discriminator only takes the trajectory data as input and does not need random noise: X′=[v f ,a f ,d stop ,s h ,Δv,m mask ] Among them, v f represents the speed of the following vehicle, a f represents the acceleration of the following vehicle, d stop Indicates the distance between the following vehicle and the stop line, s h represents the headway between vehicles, Δv represents the relative speed, m mask Represents a mask; S408, in the embedding layer, a multilayer perceptron is used to embed the five feature variables respectively, to obtain a 64-dimensional high-dimensional vector, and all the vectors are connected: Among them, E′ represents the connection of all embedded features; S409, a dense layer is used in the feature fusion layer, and a rectified linear unit activation function is used to fuse all vectors into a 100-dimensional vector; then, two dense layers are used for time step processing to transform the 100-dimensional vector into 256-dimensional and 128-dimensional vectors in sequence, and global nonlinear and linear transformations are performed to achieve feature fusion; S410, in the LSTM modeling layer, takes the sequence of specific time steps as input, generates a scalar through the many-to-one LSTM modeling layer, and sets 128 units to capture the dynamic characteristics of vehicle trajectory data in the time series: h=LSTM(F′;W lstm ) Where F′ represents the fusion features of all trajectory points obtained in step S409, h is the output scalar of the LSTM model, and W lstm is the weight matrix of the LSTM model; S411, in the output layer, the scalar output from the LSTM modeling layer is processed, and a unit dense layer with a Sigmoid activation function is used to perform binary classification on the scalar output to distinguish whether the data is real or synthetic, and the output is a probability value, indicating the possibility that the data is real data: The d =σ(W dense ·h;b dense ) Among them, O d is the final output of the discriminator, indicating the probability that the trajectory data is the real data, W dense represents the dense layer weight matrix, b dense Represents the bias vector of the dense layer.

Citation Information

Patent Citations

  • Generative adversarial network model and vehicle trajectory prediction method using same

    CN111931902A

  • Expressway vehicle behavior and trajectory prediction method based on vehicle and unmanned aerial vehicle cooperation

    CN112347993A

  • Robustness enhancement method of vehicle trajectory prediction deep learning model

    CN115358302A

  • Transform-WGAN-based vehicle following behavior modeling method

    CN115630683A

  • Expressway traffic accident identification method based on vehicle bypassing and overtaking

    CN117671967A

Cited By

  • Traffic flow prediction method and device, computer equipment and storage medium

    CN119495194A