Model optimization method and device based on cs-lstm vehicle behavior prediction and storage medium

By introducing a random forest model and attention mechanism into the CS-LSTM model, and combining the historical information of the target vehicle and neighboring vehicles for encoding and decoding, the prediction of vehicle lane-changing behavior is optimized, solving the prediction quality problem caused by data imbalance in the existing technology and improving the accuracy of vehicle trajectory prediction.

CN116304688BActive Publication Date: 2026-06-19CHONGQING CHANGAN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING CHANGAN TECH CO LTD
Filing Date
2023-02-27
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing CS-LSTM-based vehicle trajectory prediction methods lack balanced datasets in lane-changing scenarios, making it difficult to guarantee the quality of predicted trajectories.

Method used

A random forest model is added to the CS-LSTM model. By acquiring real vehicle datasets, CS-LSTM and random forest models are constructed. Historical information of the target vehicle and neighboring vehicles is used for encoding and decoding. By combining attention mechanism and CNN encoding, a binary Gaussian distributed trajectory is generated, and post-processing is performed to optimize the model.

Benefits of technology

It improves the accuracy of predicting vehicle lane-changing behavior and enhances the model's precision in predicting vehicle trajectories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304688B_ABST
    Figure CN116304688B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of vehicle technology, specifically relating to a model optimization method, apparatus, and storage medium for vehicle behavior prediction based on CS-LSTM. The method includes: acquiring a real-vehicle dataset; acquiring a CS-LSTM dataset and a Random Forest dataset based on the real-vehicle dataset; constructing a CS-LSTM model and a Random Forest model; inputting the CS-LSTM dataset into the CS-LSTM model to obtain CS-LSTM prediction results; inputting the Random Forest dataset into the Random Forest model to obtain Random Forest prediction results; inputting the Random Forest prediction results into the CS-LSTM model and performing post-processing to optimize the CS-LSTM model. The objective is to optimize the prediction of lateral behavior by adding a Random Forest model to the CS-LSTM model to predict vehicle lane-changing behavior, and to improve the accuracy of prediction by incorporating this model into the CS-LSTM model encoding and post-processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of vehicle technology, specifically relating to a model optimization method, device, and storage medium based on CS-LSTM vehicle behavior prediction. Background Technology

[0002] Currently, deep learning is commonly used in academia to predict vehicle trajectories, and this method is gradually being applied to the field of automotive engineering. Among them, LSTM and its variants have shown superior performance in predicting time-series features such as vehicle trajectories. For example, the CS-LSTM network model combines traditional LSTM networks and CNNs to encode the target vehicle and the interaction information between the target vehicle and the vehicles around it, thereby predicting the future trajectory of the target vehicle. However, deep learning requires a large amount of data and takes a long time to train network models. Moreover, for scenarios involving lane changes, there is a lack of a large number of balanced datasets to train the model. Random forests in machine learning can solve this problem of lack of balanced data.

[0003] Chinese patent CN111079590A discloses a method for predicting the behavior of surrounding vehicles in autonomous vehicles. The solution mentions a method combining LSTM and random forest, which is effective in predicting future trajectories in lane-changing scenarios. However, the above method mainly uses a simple combination of LSTM and random forest to predict lane-changing behavior, and then uses curve fitting to generate the predicted vehicle trajectory. The quality of the predicted trajectory is difficult to guarantee. Summary of the Invention

[0004] The purpose of this invention is to provide a model optimization method, device, and storage medium for vehicle behavior prediction based on CS-LSTM. By adding a random forest model to the CS-LSTM model, the prediction of vehicle lane-changing behavior is made and incorporated into the encoding and post-processing of the CS-LSTM model, thereby optimizing the prediction of lateral behavior of the CS-LSTM model and improving the accuracy of the prediction.

[0005] To achieve the above-mentioned technical objectives, the technical solution adopted by the present invention is as follows:

[0006] Firstly, this application provides a model optimization method for vehicle behavior prediction based on CS-LSTM, the method comprising,

[0007] Obtain the real vehicle dataset, and then obtain the CS-LSTM dataset and RF dataset based on the real vehicle dataset;

[0008] Build a CS-LSTM model and a random forest model. Input the CS-LSTM dataset into the CS-LSTM model to obtain the prediction results of the CS-LSTM model. Input the RF dataset into the random forest model to obtain the prediction results of the random forest model.

[0009] The prediction results of the random forest model are input into the CS-LSTM model and post-processed to optimize the CS-LSTM model.

[0010] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0011] When acquiring the real vehicle dataset, features of all surrounding vehicles are obtained;

[0012] Based on the characteristics of all surrounding vehicles, obtain the target vehicle's historical trajectory features, neighboring vehicles' historical trajectory features, and lane information.

[0013] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0014] When building the CS-LSTM model, the CS-LSTM model is divided into a target vehicle historical information encoding module, a target vehicle and neighboring vehicle interaction information encoding module, and a decoding module;

[0015] When building the random forest model, multiple decision trees are built, and the C4.5 algorithm is used to construct the decision trees. Each decision tree uses the bootstrap sampling method.

[0016] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0017] The target vehicle's historical trajectory features are processed by the target vehicle's historical information encoding module to extract the target vehicle's historical position data structure tensor. The target vehicle's historical position includes longitudinal position and lateral position. The longitudinal position and lateral position are input into the LSTM network for encoding.

[0018] During the encoding process of the LSTM network, an attention mechanism is introduced, and a fully connected network is added to receive the output of the LSTM network, thereby obtaining the target vehicle's lateral behavior classification vector and the target vehicle's longitudinal behavior classification vector.

[0019] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0020] The target vehicle and neighboring vehicle interaction information encoding module processes the historical trajectory features of the target vehicle and the historical trajectory features of the neighboring vehicles, and uses CNN encoding and neighboring vehicle interaction information. The historical trajectory features of the target vehicle are the historical position tensors of the target vehicle and the historical trajectory features of the neighboring vehicles are the historical position tensors of the neighboring vehicles.

[0021] The CNN encodes the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor, and then concatenates the encoded results of the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor.

[0022] The trajectory is generated by decoding through an LSTM network and then by passing through two softmax layers in the decoding module to decode the lateral and longitudinal behaviors, thereby obtaining the predicted future position of the target vehicle.

[0023] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0024] When building the decision tree, a training sample set is constructed by the target vehicle's historical lateral position, the target vehicle's historical longitudinal position, the lateral behavior classification vector, and the longitudinal behavior classification vector. The attribute set of the training sample set is A, and the attributes of the attribute set A are 0, 1, and 2, where 0 represents going straight, 1 represents changing lanes to the right, and 2 represents changing lanes to the left.

[0025] The Random Forest model prediction results are obtained by training the RF dataset and lane information using the training sample set.

[0026] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0027] When the RF dataset is input into the random forest model, the random forest model reads the RF dataset and lane information, obtains the classification result of the random forest model, and generates the random forest model label.

[0028] In conjunction with the first aspect, in some alternative implementations, the method further includes,

[0029] When the prediction results of the random forest model are input into the CS-LSTM model and post-processed, in the encoding stage of the CS-LSTM model, the prediction results of the random forest model are compared with the lateral behavior classification of the CS-LSTM model. According to the set threshold, the results greater than the threshold are selected as the final results input into the encoder.

[0030] Alternatively, after decoding the CS-LSTM model, the prediction results of the random forest model are compared with the CS-LSTM lateral behavior prediction results. The results greater than a threshold are selected and used together with the CS-LSTM model's predicted longitudinal behavior to generate a trajectory selection index value, thus obtaining the final predicted trajectory.

[0031] Secondly, this application also provides a model optimization device based on CS-LSTM vehicle behavior prediction, the device comprising,

[0032] The data acquisition module is used to acquire a real vehicle dataset, and to acquire a CS-LSTM dataset and an RF dataset based on the real vehicle dataset;

[0033] The processing module is used to build a CS-LSTM model and a random forest model. The CS-LSTM dataset is input into the CS-LSTM model to obtain the CS-LSTM model prediction results, and the RF dataset is input into the random forest model to obtain the random forest model prediction results.

[0034] The optimization module is used to input the prediction results of the random forest model into the CS-LSTM model and perform post-processing to optimize the CS-LSTM model.

[0035] Thirdly, this application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described above.

[0036] The invention employing the above technical solution has the following advantages:

[0037] By dividing the CS-LSTM model into a target vehicle historical information encoding module, a target vehicle and neighbor vehicle interaction information encoding module, and a decoding module during its construction, and inputting the acquired CS-LSTM dataset into the CS-LSTM model, the prediction results of the CS-LSTM model can be obtained. Then, by building a random forest model and inputting the acquired RF dataset into the random forest model, the prediction results can be obtained. The prediction results obtained from the random forest model are then input into the CS-LSTM model encoder and post-processing to optimize the CS-LSTM model, thereby improving the accuracy of the CS-LSTM model's predictions. Attached Figure Description

[0038] This application can be further illustrated by the non-limiting embodiments given in the accompanying drawings;

[0039] Figure 1 One of the flowcharts of the method provided in the embodiments of this application;

[0040] Figure 2 A second schematic flowchart illustrating the method provided in this application embodiment;

[0041] Figure 3 The third schematic flowchart of the method provided in the embodiments of this application;

[0042] Figure 4 The fourth schematic flowchart of the method provided in the embodiments of this application;

[0043] Figure 5 Fifth flowchart illustrating the method provided in the embodiments of this application;

[0044] Figure 6 A block diagram of the system provided in the embodiments of this application;

[0045] The symbols for the main components are explained below:

[0046] Device 200, data acquisition module 210, processing module 220, optimization module 230. Detailed Implementation

[0047] The present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that similar or identical parts are referred to by the same reference numerals in the drawings or description. Implementations not shown or described in the drawings are forms known to those skilled in the art. In the description of this application, terms such as "first" and "second" are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0048] Please refer to the attached document. Figure 1 As shown in the embodiments of this application, a model optimization method based on CS-LSTM vehicle behavior prediction is provided. The method includes:

[0049] Step 110: Obtain the real vehicle dataset, and obtain the CS-LSTM dataset and RF dataset based on the real vehicle dataset;

[0050] Step 120: Build the CS-LSTM model and the Random Forest model. Input the CS-LSTM dataset into the CS-LSTM model to obtain the CS-LSTM model prediction results. Input the RF dataset into the Random Forest model to obtain the Random Forest model prediction results.

[0051] Step 130: Input the prediction results of the random forest model into the CS-LSTM model and perform post-processing to optimize the CS-LSTM model.

[0052] Through the above implementation methods, inputting the CS-LSTM dataset into the CS-LSTM model can yield predicted trajectories, longitudinal behavior, and lateral behavior. Inputting the RF dataset into the Random Forest model can yield predicted lateral lane-changing behavior. Inputting the lateral lane-changing behavior predicted by the Random Forest model into the CS-LSTM model encoder and post-processing allows for optimization of the CS-LSTM model based on the results obtained, thereby effectively improving the accuracy of CS-LSTM model predictions.

[0053] As an optional implementation, the method may further include,

[0054] When acquiring the real vehicle dataset, features of all surrounding vehicles are obtained;

[0055] Based on the characteristics of all surrounding vehicles, obtain the target vehicle's historical trajectory features, neighboring vehicles' historical trajectory features, and lane information.

[0056] In this embodiment, features of all surrounding vehicles are extracted from the acquired real vehicle dataset, and a trajectory sequence traj with a length of 41 frames is generated for each vehicle based on 0.2s sampling, with a total duration of 8.2s. The 16th frame is set as the current time t. The vehicles are then filtered according to the horizontal and vertical distance thresholds at time t to select the target vehicles that need to be predicted. The historical trajectory features of the target vehicles, the historical trajectory features of neighboring vehicles, and lane information are extracted.

[0057] Understandably, historical trajectory features include lateral and longitudinal positions in the Frenet coordinate system, meaning that the lateral and longitudinal positions of the target vehicle, as well as the lateral and longitudinal positions of neighboring vehicles, can be extracted.

[0058] As an optional implementation, the method may further include,

[0059] When building the CS-LSTM model, the CS-LSTM model is divided into a target vehicle historical information encoding module, a target vehicle and neighboring vehicle interaction information encoding module, and a decoding module;

[0060] When building the random forest model, multiple decision trees are built, and the C4.5 algorithm is used to construct the decision trees. Each decision tree uses the bootstrap sampling method.

[0061] Understandably, when building a cs-lstm model under the PyTorch architecture, by dividing the cs-lstm model into a target vehicle history information encoding module, a target vehicle and neighbor vehicle interaction information encoding module, and a decoding module, it is possible to train and encode the target vehicle history information and neighbor vehicle history information in the cs-lstm dataset, and then use the decoding module to parse out the encoded target vehicle behavior.

[0062] In this embodiment, a random forest is constructed using the RandomForestClassifier class in the sklearn package and trained using the fit class model to obtain a trained random forest model, which is a collection of multiple decision trees.

[0063] Understandably, when the total number of training samples from real vehicle data is N, each decision tree uses the bootstrap sampling method, randomly selecting n samples with replacement from these N training samples as the training samples for that decision tree, thus giving the forest a certain degree of randomness. By using the C4.5 algorithm to construct the decision tree, the splitting attribute of the decision tree can be selected.

[0064] As an optional implementation, the method may further include,

[0065] The target vehicle's historical trajectory features are processed by the target vehicle's historical information encoding module to extract the target vehicle's historical position data structure tensor. The target vehicle's historical position includes longitudinal position and lateral position. The longitudinal position and lateral position are input into the LSTM network for encoding.

[0066] During the encoding process of the LSTM network, an attention mechanism is introduced, and a fully connected network is added to receive the output of the LSTM network, thereby obtaining the target vehicle's lateral behavior classification vector and the target vehicle's longitudinal behavior classification vector.

[0067] In this embodiment, when processing the historical trajectory features of the target vehicle through the target vehicle historical information encoding module, the historical position data structure tensor of the target vehicle in the previous 3.2 seconds is extracted. The tensor is (time_step, batch_size, features_num), where features_num is the number of features extracted.

[0068] Understandably, since the target vehicle's historical position includes both longitudinal and lateral positions, the target vehicle's historical lateral and longitudinal positions are input into the LSTM network for encoding. When encoding in the LSTM network, the target vehicle's lateral behavior classification vector can be calculated based on the lateral position at the start and end of the target vehicle's trajectory.

[0069] Wherein, the trajectory sequence traj = [x i ,y i ], where x represents the horizontal position and y represents the vertical position, and the coordinate system is positive on the left and negative on the right, the calculated code can be represented as:

[0070] ifx 41 -x 16 >3.5:

[0071] x' = [0,0,1], representing a left lane change.

[0072] ifx 41 -x 16 <-3.5:

[0073] x' = [0,1,0], representing a right lane change.

[0074] else:

[0075] x' = [1,0,0], representing a straight line;

[0076] Among them, 3.5 is the distance threshold, which is generally the lane width.

[0077] The longitudinal behavior classification vector of the target vehicle can be calculated based on the instantaneous velocity v12 and the average velocity of the target vehicle in the previous 1 second time frame.

[0078] ifavg_v12-16<0.8*v12:

[0079] y' = [0,1], representing deceleration.

[0080] else:

[0081] y' = [1, 0], representing no deceleration

[0082] Divide the lane into a 13*3 grid, starting from the target car's position [0,0]. Assign neighboring cars to the grid according to their horizontal and vertical positions. Set the grid with neighboring cars to 1 and the other grids to 0 to obtain the mask.

[0083] Understandably, introducing an attention mechanism can improve prediction accuracy. By adding a fully connected network, the output of the LSTM network is converted into a one-dimensional vector, thus making the output dimension the same as that of CS-LSTM.

[0084] As an optional implementation, the method may further include,

[0085] The target vehicle and neighboring vehicle interaction information encoding module processes the historical trajectory features of the target vehicle and the historical trajectory features of the neighboring vehicles, and uses CNN encoding and neighboring vehicle interaction information. The historical trajectory features of the target vehicle are the historical position tensors of the target vehicle and the historical trajectory features of the neighboring vehicles are the historical position tensors of the neighboring vehicles.

[0086] The CNN encodes the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor, and then concatenates the encoded results of the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor.

[0087] The trajectory is generated by decoding through an LSTM network and then by passing through two softmax layers in the decoding module to decode the lateral and longitudinal behaviors, thereby obtaining the predicted future position of the target vehicle.

[0088] Understandably, when processing the historical trajectory features of the target vehicle and neighboring vehicles through the target vehicle and neighboring vehicle interaction information encoding module, the main process involves extracting the historical position data tensor of the target vehicle and neighboring vehicles from the previous 3.2 seconds. The tensor is (time_step, batch_size*nbrs_num, features_num), where nbrs_num is the number of neighboring vehicles. The historical position tensors of the target vehicle and neighboring vehicles are encoded using CNN to obtain the historical position encoding results of the target vehicle and neighboring vehicles from the previous 3.2 seconds.

[0089] The two encoding results are concatenated, and the concatenated result is decoded through an LSTM network to generate a binary Gaussian distributed trajectory. Then, through two softmax layers in the decoding module, the lateral and longitudinal behaviors are decoded respectively, thus obtaining 6 predicted trajectories, 1 longitudinal behavior, and 1 lateral behavior predicted by the CS-LSTM model, and finally obtaining the predicted position of the target vehicle in the next 5 seconds.

[0090] As an optional implementation, the method may further include,

[0091] When building the decision tree, a training sample set is constructed by the target vehicle's historical lateral position, the target vehicle's historical longitudinal position, the lateral behavior classification vector, and the longitudinal behavior classification vector. The attribute set of the training sample set is A, and the attributes of the attribute set A are 0, 1, and 2, where 0 represents going straight, 1 represents changing lanes to the right, and 2 represents changing lanes to the left.

[0092] The Random Forest model prediction results are obtained by training the RF dataset and lane information using the training sample set.

[0093] Understandably, the target vehicle's historical lateral position in 16 frames, the target vehicle's historical longitudinal position in 16 frames, the lateral behavior classification one-hot vector, and the longitudinal behavior classification one-hot vector are used as the training sample set for the decision tree, which is the RF dataset. The attribute set of the training sample set is set as A. Through training the random forest model, the attributes of attribute set A are obtained as 0, 1, and 2, where 0 represents going straight, 1 represents right lane change, and 2 represents left lane change, thus obtaining the prediction results of the random forest model for lane change behavior.

[0094] Understandably, the RF dataset contains the target vehicle's historical trajectory lateral position x, historical trajectory longitudinal position y, target vehicle lateral behavior classification lat_ind (scalar), and target vehicle longitudinal behavior classification lon_ind (scalar). Among them, [x,y] can be extracted from the target vehicle's historical trajectory. For x', if the value of indx at a certain index position is 1, then lat_ind = indx. For y', if the value of ind at a certain index position is 1, then lat_indy = indy.

[0095] As an optional implementation, the method may further include,

[0096] When the RF dataset is input into the random forest model, the random forest model reads the RF dataset and lane information, obtains the classification result of the random forest model, and generates the random forest model label.

[0097] Understandably, when using a random forest model to read RF datasets and lane information, there are two methods to generate labels. The first is to directly determine whether a vehicle is changing lanes—whether to the left or right—by observing whether the target vehicle is in different lanes in the current and future frames, given the left, right, and current lane numbers. The second is to obtain the position of the centerline or lane edge of the target vehicle's current lane, use the lane width as a distance threshold, and determine whether the vehicle's future trajectory exceeds the lane's lateral position relative to the current frame to determine if it is changing lanes. This results in a random forest model classification of 0, 1, and 2, where 0 represents going straight, 1 represents changing right, and 2 represents changing left.

[0098] As an optional implementation, the method may further include,

[0099] When the prediction results of the random forest model are input into the CS-LSTM model and post-processed, in the encoding stage of the CS-LSTM model, the prediction results of the random forest model are compared with the lateral behavior classification of the CS-LSTM model. According to the set threshold, the results greater than the threshold are selected as the final results input into the encoder.

[0100] Alternatively, after decoding the CS-LSTM model, the prediction results of the random forest model are compared with the CS-LSTM lateral behavior prediction results. The results greater than a threshold are selected and used together with the CS-LSTM model's predicted longitudinal behavior to generate a trajectory selection index value, thus obtaining the final predicted trajectory.

[0101] Understandably, features are trained using the CS-LSTM model:

[0102] cs-lstm_features=(hist,nbrs_hist,mask,lat,lon),

[0103] Where, hist is the historical trajectory sequence of the target vehicle for 16 frames; nbrs_hist is the historical trajectory sequence of all neighboring vehicles in the current frame; mask is a position mask obtained based on a road grid of [13,3] for the positions of neighboring vehicles; lat is the encoding vector for lateral behavior; and lon is the encoding vector for longitudinal behavior.

[0104] Training features of the random forest model:

[0105] RF_features=(y_hist+x_hist+lat+lon),

[0106] The feature sets of the CS-LSTM model and the Random Forest model are bound to the target vehicle IDs and added to a dictionary called targets_labels:{target_id:[cs-lstm_features,RF_features]}.

[0107] Finally, the random forest model is trained using RF_features to obtain lane change behavior prediction results. The results and lat behavior are logically optimized and added to the LSTM model encoding. Then, the CS-LSTM model is trained using cs-lstm_features to obtain predicted trajectories and lateral and longitudinal behavior predictions. The lane change results of the random forest model and the lateral and longitudinal behavior prediction results are logically optimized and added to the model post-processing. The trajectory selection index is obtained using the lat and lon results, and then the final predicted trajectory is obtained.

[0108] Understandably, when making the logically optimal choice, the maximum probability value of the lateral behavior obtained by judging the CS-LSTM model, the random forest model, and the optimized CS-LSTM model is greater than 0.85. In this way, the lateral result predicted by the CS-LSTM model or the lateral result predicted by the random forest model is selected, and then the CS-LSTM model is optimized.

[0109] Please refer to the attached document. Figure 2-5 The following section elaborates on a model optimization method for vehicle behavior prediction based on CS-LSTM:

[0110] S1. Obtain the real vehicle dataset. Extract the features of all surrounding vehicles from the real vehicle dataset. Based on 0.2s sampling, generate a trajectory sequence traj with a trajectory length of 41 frames for each vehicle, with a total duration of 8.2s. Set the 16th frame as the current time t. Then, filter the vehicles according to the horizontal and vertical distance thresholds at time t to select the target vehicles that need to be predicted. Extract the historical trajectory features of the target vehicles, the historical trajectory features of neighboring vehicles, and lane information.

[0111] S2. The cs-lstm model built under the PyTorch architecture is divided into a target vehicle historical information encoding module, a target vehicle and neighboring vehicle interaction information encoding module, and a decoding module.

[0112] S201. Extract the historical position data structure tensor of the target vehicle in the previous 3.2 seconds through the target vehicle historical information encoding module. Input the historical lateral and longitudinal positions of the target vehicle into the LSTM network for encoding. When encoding in the LSTM network, the lateral behavior classification vector of the target vehicle can be calculated based on the lateral position at the start and end of the target vehicle trajectory. The longitudinal behavior classification vector of the target vehicle can be calculated based on the instantaneous velocity v12 and the average velocity of the target vehicle in the previous 1 second time frame. Divide the lane into a 13*3 grid. With the target vehicle position as the starting position [0,0], the neighboring vehicles are assigned to the grid according to their lateral and longitudinal positions. The grid with neighboring vehicles is set to 1, and the other grids are set to 0 to obtain the neighboring vehicle mask.

[0113] S202. Extract the historical position data structure tensor of the target vehicle and neighboring vehicles in the previous 3.2 seconds through the target vehicle and neighboring vehicle interaction information encoding module, and encode the historical position tensor of the target vehicle and the neighboring vehicle through CNN to obtain the historical position encoding result of the target vehicle in 3.2 seconds and the historical position encoding result of the neighboring vehicle in 3.2 seconds.

[0114] S203. The two encoded results are concatenated. The concatenated result is decoded through an LSTM network to generate a binary Gaussian distributed trajectory. Then, through two softmax layers in the decoding module, the lateral and longitudinal behaviors are decoded respectively, thereby obtaining 6 predicted trajectories, 1 longitudinal behavior, and 1 lateral behavior predicted by the CS-LSTM model, and thus obtaining the predicted position of the target vehicle in the next 5 seconds.

[0115] S3. Construct a random forest using the RandomForestClassifier class in the sklearn package and train it using the fit class model to obtain the trained random forest model.

[0116] S301. Read the RF dataset and lane information using the random forest model, generate random forest model labels, and obtain the classification results of the random forest model;

[0117] S4. When inputting the prediction results of the random forest model into the CS-LSTM model and performing post-processing, in the encoding stage of the CS-LSTM model, the prediction results of the random forest model are compared with the lateral behavior classification of the CS-LSTM model, and the result with a probability value greater than 0.85 is selected as the final result input into the encoder.

[0118] Alternatively, after decoding the CS-LSTM model, the RF classification results can be compared with the CS-LSTM lateral behavior prediction results. Results with a probability value greater than 0.85 can be selected together with the CS-LSTM predicted longitudinal behavior to generate a trajectory selection index value, thus obtaining the final predicted trajectory.

[0119] Based on the above implementation method, by dividing the CS-LSTM model into a target vehicle historical information encoding module, a target vehicle and neighbor vehicle interaction information encoding module, and a decoding module when building the CS-LSTM model, the obtained CS-LSTM dataset can be input into the CS-LSTM model to obtain the CS-LSTM model prediction results. Then, by building a random forest model and inputting the obtained RF dataset into the random forest model to obtain the prediction results, the prediction results obtained from the random forest model can be input into the CS-LSTM model encoder and post-processing to optimize the CS-LSTM model and improve the accuracy of the CS-LSTM model prediction.

[0120] Please refer to the attached document. Figure 6 This application also discloses a model optimization device based on CS-LSTM vehicle behavior prediction. The optimization device 200 includes at least one software functional module that can be stored in a storage module or embedded in an operating system (OS) in the form of software or firmware. Examples include the software functional modules and computer programs included in the optimization device 200.

[0121] The optimization device 200 may include a data acquisition module 210, a processing module 220, and an optimization module 230. The functions of each unit may be as follows:

[0122] Data acquisition module 210 is used to acquire a real vehicle dataset and to acquire a CS-LSTM dataset and an RF dataset based on the real vehicle dataset;

[0123] Processing module 220 is used to build a CS-LSTM model and a random forest model. It inputs the CS-LSTM dataset into the CS-LSTM model to obtain the CS-LSTM model prediction results, and inputs the RF dataset into the random forest model to obtain the random forest model prediction results.

[0124] The optimization module 230 is used to input the prediction results of the random forest model into the CS-LSTM model and perform post-processing to optimize the CS-LSTM model.

[0125] The data acquisition module 210 collects the CS-LSTM dataset and the RF dataset from the real vehicle dataset. The CS-LSTM dataset is input into the CS-LSTM model to obtain the CS-LSTM model prediction results. The RF dataset is input into the Random Forest model to obtain the Random Forest model prediction results. The Random Forest model prediction results are then input into the CS-LSTM model and post-processed to optimize the CS-LSTM model, thereby improving the accuracy of the predictions.

[0126] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the methods described in the above embodiments.

[0127] Based on the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by hardware or by using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause a computer device (such as a personal computer, braking device, or network device, etc.) to execute the methods described in the various implementation scenarios of this application.

[0128] In summary, this application provides a model optimization method, apparatus, and storage medium for vehicle behavior prediction based on CS-LSTM. In this solution, when building the CS-LSTM model, it is divided into a target vehicle historical information encoding module, a target vehicle and neighboring vehicle interaction information encoding module, and a decoding module. The acquired CS-LSTM dataset is input into the CS-LSTM model to obtain prediction results. Then, a random forest model is built, and the acquired RF dataset is input into the random forest model to obtain prediction results. The prediction results from the random forest model are then input into the CS-LSTM model encoder and post-processing to optimize the CS-LSTM model, thereby improving the accuracy of CS-LSTM predictions.

[0129] In the embodiments provided in this application, it should be understood that the disclosed apparatus, systems, and methods can also be implemented in other ways. The apparatus, systems, and methods embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0130] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A model optimization method based on cs-LSTM vehicle behavior prediction, characterized in that: The method includes, Obtain the real vehicle dataset, and then obtain the CS-LSTM dataset and RF dataset based on the real vehicle dataset; When acquiring the real vehicle dataset, the process includes: acquiring the features of all surrounding vehicles; and acquiring the historical trajectory features of the target vehicle, the historical trajectory features of neighboring vehicles, and lane information based on the features of all surrounding vehicles, wherein the historical position of the target vehicle includes longitudinal position and lateral position. Build a CS-LSTM model and a random forest model. Input the CS-LSTM dataset into the CS-LSTM model to obtain the prediction results of the CS-LSTM model. Input the RF dataset into the random forest model to obtain the prediction results of the random forest model. The prediction results of the random forest model are input into the CS-LSTM model and post-processed to optimize the CS-LSTM model. When the prediction results of the random forest model are input into the CS-LSTM model and post-processed, in the encoding stage of the CS-LSTM model, the prediction results of the random forest model are compared with the lateral behavior classification of the CS-LSTM model. According to the set threshold, the results greater than the threshold are selected as the final results input into the encoder. Alternatively, after decoding the CS-LSTM model, the prediction results of the random forest model are compared with the CS-LSTM lateral behavior prediction results. The results greater than a threshold are selected and used together with the CS-LSTM model's predicted longitudinal behavior to generate a trajectory selection index value, thus obtaining the final predicted trajectory.

2. The method of claim 1, wherein: The method also includes, When building the CS-LSTM model, the CS-LSTM model is divided into a target vehicle historical information encoding module, a target vehicle and neighboring vehicle interaction information encoding module, and a decoding module; When building the random forest model, multiple decision trees are built, and the C4.5 algorithm is used to construct the decision trees. Each decision tree uses the bootstrap sampling method.

3. The method of claim 2, wherein: The method also includes, The target vehicle's historical trajectory features are processed by the target vehicle's historical information encoding module, and the target vehicle's historical position data structure tensor is extracted. The longitudinal and lateral positions in the target vehicle's historical position are then input into the LSTM network for encoding. During the encoding process of the LSTM network, an attention mechanism is introduced, and a fully connected network is added to receive the output of the LSTM network, thereby obtaining the target vehicle's lateral behavior classification vector and the target vehicle's longitudinal behavior classification vector.

4. The method of claim 2, wherein: The method also includes, The target vehicle and neighboring vehicle interaction information encoding module processes the historical trajectory features of the target vehicle and the historical trajectory features of the neighboring vehicles, and uses CNN encoding and neighboring vehicle interaction information. The historical trajectory features of the target vehicle are the historical position tensors of the target vehicle and the historical trajectory features of the neighboring vehicles are the historical position tensors of the neighboring vehicles. The CNN encodes the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor, and then concatenates the encoded results of the target vehicle's historical position tensor and the neighboring vehicle's historical position tensor. The trajectory is generated by decoding through an LSTM network and then by passing through two softmax layers in the decoding module to decode the lateral behavior classification and the longitudinal behavior classification, thereby obtaining the predicted future position of the target vehicle.

5. The method of claim 2, wherein: The method also includes, When building the decision tree, a training sample set is constructed by the target vehicle's historical lateral position, the target vehicle's historical longitudinal position, the lateral behavior classification vector, and the longitudinal behavior classification vector. The attribute set of the training sample set is A, and the attributes of the attribute set A are 0, 1, and 2, where 0 represents going straight, 1 represents changing lanes to the right, and 2 represents changing lanes to the left. The Random Forest model prediction results are obtained by training the RF dataset and lane information using the training sample set.

6. The method of claim 2, wherein: The method also includes, When the RF dataset is input into the random forest model, the random forest model reads the RF dataset and lane information, obtains the classification result of the random forest model, and generates the random forest model label.

7. The model optimization apparatus based on cs-lstm vehicle behavior prediction, characterized in that, The apparatus comprising, using the method according to any one of claims 1-6, The data acquisition module is used to acquire a real vehicle dataset, and to acquire a CS-LSTM dataset and an RF dataset based on the real vehicle dataset; The processing module is used to build a CS-LSTM model and a random forest model. The CS-LSTM dataset is input into the CS-LSTM model to obtain the CS-LSTM model prediction results, and the RF dataset is input into the random forest model to obtain the random forest model prediction results. The optimization module is used to input the prediction results of the random forest model into the CS-LSTM model and perform post-processing to optimize the CS-LSTM model.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-6.