Automobile following speed control method and system based on preceding automobile speed prediction
Technical Field
The invention relates to the field of intelligent traffic, in particular to an automobile following speed control method and system based on preceding automobile speed prediction.
Background
In the following situation of the automobile, because the following automobile needs to keep the speed change and the safe following distance running which are more consistent with those of the front automobile, ideally, a driver of the rear automobile can predict and estimate the short-term speed of the front automobile in a future period more accurately, and can control the speed of the rear automobile according to the speed and the state of the front automobile. However, the current vehicle-mounted sensor and the global positioning system or the geographic information system can only provide the current speed of the front vehicle and other current driving states and partial environmental information, and the variation trend of the driving speed of the front vehicle cannot be estimated. If the future speed of the front vehicle is not predicted, the change trend of the driving speed of the front vehicle cannot be known, the rear vehicle cannot have sufficient driving decision time, errors in control decision can be caused, driving safety and driving comfort are seriously affected, and energy waste can be caused by behaviors brought by unreasonable driving strategies.
Disclosure of Invention
The invention provides a method and a system for controlling the car following speed based on the prediction of the speed of the front car, aiming at the existing problems, a group of efficient characteristics are selected through a characteristic selection scheme based on mutual information, the efficient characteristics are input into a front car speed prediction model to predict the speed of the front car, and the prediction result is input into a following control system to control the speed. The method and the system provided by the invention improve the safety and driving comfort of the following vehicle and reduce the energy consumption, compared with the prior automobile following control, the method and the system not only have simple sources of prediction information and only need common speed and environmental information, but also have good prediction effect. Meanwhile, the driving behavior of the following vehicle can be continuously adjusted through the PID control based on the speed following.
The technical scheme of the invention is as follows:
in one aspect, a vehicle following speed control system based on a prediction of a preceding vehicle speed, comprising:
the data preprocessing module is used for preprocessing the original acquired data of the front vehicle and extracting characteristics, wherein the original acquired data of the front vehicle comprises speed data of the front vehicle, traffic signal data and road condition data; each feature contains N data collected uniformly over a sampling interval T;
features contained in the raw acquisition data: acceleration in the direction of the X, Y, Z axis of the vehicle, kalman filter value of acceleration in the direction X, Y, Z, altitude, longitude, latitude, pitch, yaw, roll, remaining time of possible rear-end collision, road width, body angle, vehicle angle with respect to curvature of lane, number of currently detected vehicles, distance to preceding vehicle, lane detection state, current number of lanes, speed type, speed, time;
wherein the lane detection state comprises calibration, being initialized, not detected, or running; the speed types comprise a speed greater than a set speed and a speed less than or equal to the set speed;
the characteristic selection module is used for outputting the selected characteristics to the front vehicle speed prediction module according to preset characteristic selection rules according to the characteristics preprocessed by the data preprocessing module;
the front vehicle speed prediction module is used for training a front vehicle speed prediction model according to the selected characteristics output by the characteristic selection module and the front vehicle speed after the set interval time, and outputting a predicted value of the speed of the front vehicle in the future time period;
the rear vehicle speed following control module is used for adjusting and controlling a rear vehicle speed target by taking the safe distance as a control target according to the predicted value of the speed of the front vehicle in the future time period;
the preset feature selection rule is that greedy search is carried out from a set F of features to be selected, the searched features are sequentially added into a set A of target features, and features to which data in the set A belong serve as selected features; the candidate feature set F comprises preceding vehicle speed data, traffic signal data and road condition data, the initial element contained in the target feature set A is the preceding vehicle speed, and the target feature selection standard is the feature with the minimum sum SMI of mutual information values of all elements in the candidate feature set F and the target feature set A.
Further, the greedy search from the set F of the features to be selected means that SMIs of each candidate feature in the set F of the features to be selected and each feature in the set a of the target features are sequentially calculated, and the maximum SMI and the current maximum SMI are selected*To carry outComparing, if the selected maximum SMI is greater than the current maximum SMI*Then the feature f corresponding to the selected maximum SMI is selectedkIs added to A while f is addedkRemove from F and get the current maximum SMI*Update the value of to the selected maximum SMI; the operation is circulated again until each feature in the F and each feature in the A calculate mutual information values; wherein the current maximum SMI*Is 0.
Furthermore, the selected features used for training the preceding vehicle speed prediction model are firstly encoded by the encoder and then decoded by the decoder to be used as input data during the training of the preceding vehicle speed prediction model.
The selected features are the target features, the target features are further encoded and decoded, the encoder compresses the input tensor of the target features into a fixed-dimension vector, and then the decoder reads the vector and converts the vector into a corresponding tensor. In this way, not only is the useful information in the tensor preserved, but the size of the tensor is changed.
Since the target characteristic data is data collected from a vehicle Global Positioning System (GPS), peripheral sensors and a Geographic Information System (GIS). However, the dimensions of the features are not consistent due to different sampling frequencies of various sensors, and the sensors are not suitable for being directly input into a neural network for training. Current processing methods often employ selecting the same sampling frequency, clipping or padding data at different sampling frequencies. The cutting results in a reduction of valid data and a loss of important information in the data. Padding artificially adds information that may introduce noise and erroneous data. Therefore, both cropping and padding may affect the integrity or accuracy of the original data, and therefore the sequence-to-sequence framework proposed in this application, which refers to the structural framework between the encoder and decoder, is adopted to solve this problem.
Further, the encoder comprises a convolutional neural network and an LSTM neural network stacked by linear, wherein the convolutional neural network is composed of one convolutional layer and one pooling layer, and the LSTM neural network is composed of one LSTM layer and one Dropout layer;
the convolution layer in the convolutional neural network is a 1-dimensional convolution layer, the number of convolution kernels is set to be 32, the size of the convolution kernel/the length of a convolution window is set to be 7, filling parameters are set to be same, the shape of an input tensor is set to be (n,1), and n is the number of selected features; the activation function is set to relu, the expression of the relu function: y ═ max (0, x); the pooling layer is a 1-dimensional maximum pooling layer, and the size of a pooling window is set to be 5;
the output dimension of the LSTM layer in the LSTM neural network is set to be 32, the Dropout rate of the Dropout layer is set to be 0.2, and the optimizer is set to be rmsprop.
Further, the decoder is composed of an LSTM layer and two fully-connected layers, wherein the output dimension of the LSTM layer is set to 32; the output dimension of the first fully-connected layer is set to 32 and the activation function is set to relu, and the output dimension of the second fully-connected layer is 1 without using the activation function.
Further, the front vehicle speed prediction model is obtained by training a deep neural network, wherein the deep neural network comprises three linearly stacked fully-connected layers, an optimizer is set to rmsprop, and a loss function is set to mse;
wherein s isreal、spredictionThe real value and the predicted value of the speed are respectively, and m is the number of the predicted time points.
Further, the rear vehicle speed control module comprises a transfer function and a PID controller;
wherein the transfer function is a first order transfer function characterizing the following velocity.
Further, the data preprocessing module comprises:
the data cleaning submodule is used for removing and replacing the abnormal value and the missing value of the input data;
the data normalization submodule is used for carrying out normalization and standardized transformation on the data cleaned by the data cleaning submodule;
and the data preparation submodule is used for dividing the data output by the data normalization submodule into a training set, a verification set and a test set.
The data cleaning submodule is used for screening the characteristics corresponding to the original collected data, and extracting the characteristics which are irrelevant, repeated or have very small data quantity to obtain available characteristics;
the data normalization submodule is used for interpolating the features with the missing amount lower than 1/3 by adopting an interpolation method and supplementing feature data; wherein the standardization treatment adopts a z-score standardization treatment mode;
in another aspect, a method for controlling a follow-up speed of a vehicle based on a prediction of a speed of a preceding vehicle, includes:
step S1: preprocessing the original collected data of the front vehicle and extracting characteristic data; the original collected data of the front vehicle comprises front vehicle speed data, traffic signal data and road condition data; each feature contains N data collected uniformly over a sampling interval T;
step S2: selecting features according to a preset feature selection rule to obtain selected features;
step S3: training a front vehicle speed prediction model by using the selected characteristics and the front vehicle speed after the set interval time, and outputting a predicted value of the speed of the front vehicle in a future time period by using the front vehicle speed prediction model;
step S4: inputting the predicted speed of the front vehicle, and controlling the speed of the rear vehicle by taking the safe distance as a control target;
the preset feature selection rule is that greedy search is carried out from a set F of features to be selected, the searched features are sequentially added into a set A of target features, and features to which data in the set A belong serve as selection features; the candidate feature set F comprises preceding vehicle speed data, traffic signal data and road condition data, the initial element contained in the target feature set A is the preceding vehicle speed, and the target feature selection standard is the feature with the minimum sum of mutual information values of the elements in the candidate feature set F and the elements in the target feature set A.
Further, the front vehicle speed prediction model is obtained by training a deep neural network, wherein the deep neural network comprises three linearly stacked fully-connected layers, an optimizer is set to rmsprop, and a loss function is set to mse;
wherein s isreal、spredictionRespectively representing the real value and the predicted value of the speed, wherein m is the number of predicted time points;
the rear vehicle speed control controls a first order transfer function that characterizes the following speed based on PID.
Advantageous effects
According to the automobile following speed control system and method based on the preceding vehicle speed prediction, a group of efficient features are selected through a feature selection scheme based on mutual information, the efficient features are input into a preceding vehicle speed prediction model to predict the speed of the preceding vehicle, and a prediction result is input into a following speed control system to control the speed. Compared with the prior automobile following control, the method has the advantages that the source of the prediction information is simple, and the prediction effect is good. Meanwhile, the driving behavior of the following vehicle can be continuously adjusted through PID control based on speed following, and errors in control decision are reduced.
Drawings
Fig. 1 is a schematic structural diagram of a following speed control system of an automobile based on a preceding vehicle speed prediction according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a data preprocessing module of a vehicle following speed control system based on a prediction of a preceding vehicle speed according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a feature selection module of a vehicle following speed control system based on a prediction of a preceding vehicle speed according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a rear vehicle speed control module of a vehicle following speed control system based on a prediction of a front vehicle speed according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a preceding vehicle speed prediction module of a following speed control system of an automobile based on preceding vehicle speed prediction according to an embodiment of the present invention;
fig. 6 is a schematic flow chart of a method for controlling a following speed of an automobile based on a prediction of a speed of a preceding automobile according to a second embodiment of the present invention.
Detailed Description
In order to facilitate a better understanding of the present invention, reference will now be made to the following examples.
Example one
Fig. 1 is a schematic structural diagram of an automobile following speed control system based on preceding vehicle speed prediction according to an embodiment of the present invention, including:
the data preprocessing module 100 is configured to preprocess original collected data of a preceding vehicle and extract features, where the original collected data of the preceding vehicle includes speed data of the preceding vehicle, traffic signal data, and road condition data; each feature contains N data collected uniformly over a sampling interval T;
features contained in the raw acquisition data: acceleration in the direction of the X, Y, Z axis of the vehicle, kalman filter value of acceleration in the direction X, Y, Z, altitude, longitude, latitude, pitch, yaw, roll, remaining time of possible rear-end collision, road width, body angle, vehicle angle with respect to curvature of lane, number of currently detected vehicles, distance to preceding vehicle, lane detection state, current number of lanes, speed type, speed, time;
wherein the lane detection state comprises calibration, being initialized, not detected, or running; the speed types comprise a speed greater than a set speed and a speed less than or equal to the set speed;
the feature selection module 200 is used for outputting the selected features to the forward speed prediction module according to the pre-processed features of the data pre-processing module and the preset feature selection rule;
the front vehicle speed prediction module 300 is used for training a front vehicle speed prediction model according to the selected characteristics output by the characteristic selection module and the front vehicle speed after the set interval time, and outputting a predicted value of the speed of the front vehicle in the future time period;
the rear vehicle speed following control module 400 is used for adjusting and controlling the rear vehicle speed target by taking the safe distance as a control target according to the predicted value of the speed of the front vehicle in the future time period;
the preset feature selection rule is that greedy search is carried out from a set F of features to be selected, the searched features are sequentially added into a set A of target features, and features to which data in the set A belong serve as selected features; the candidate feature set F comprises preceding vehicle speed data, traffic signal data and road condition data, the initial element contained in the target feature set A is the preceding vehicle speed, and the target feature selection standard is the feature with the minimum sum of mutual information values of the elements in the candidate feature set F and the elements in the target feature set A.
In this example, the effective range for speed prediction is future speeds within 50s, at least 10 minutes of historical data (sampling frequency up to 10hz) is needed, and the range of speeds in the data sample is 60-120km/h, i.e. after 10 minutes, the speed within 50s is predicted using data with a sampling interval of 10 minutes.
Specifically, the data preprocessing module includes a data cleaning sub-module, a data normalization sub-module and a data preparation sub-module, as shown in fig. 2, in the first embodiment, the data cleaning sub-module is configured to remove and replace an abnormal value and a missing value of input data, for the abnormal value, the data amount is large or the influence of the characteristic on a target characteristic is small, a mode of removing an entire column of characteristics is adopted, otherwise, a mode of replacing by a mean value is adopted, for the missing value, an individual missing value is replaced and filled by a mean value and upper and lower quartiles, and a non-individual missing value is filled by polynomial interpolation; the data normalization submodule is used for carrying out normalization and standardization transformation on the data cleaned by the data cleaning submodule, and carrying out z-score normalization processing after the data is cleaned; and the data preparation submodule is used for dividing the data output by the data normalization submodule into a training set, a verification set and a test set. And dividing the data set into a training set, a verification set and a test set according to the time sequence, wherein the training set is used for model training, the verification set is used for model parameter adjustment, and the test set is used for testing the model effect.
After data preprocessing, feature selection is performed on the data, as shown in fig. 3, performing greedy search from the set F of features to be selected means that SMIs of each candidate feature in the set F of features to be selected and each feature in the set a of target features are sequentially calculated, and the maximum SMI and the current maximum SMI are selected*Comparing, if the selected maximum SMI is greater than the current maximum SMI*Then the feature f corresponding to the selected maximum SMI is selectedkIs added to A while f is addedkRemove from F and get the current maximum SMI*Update the value of to the selected maximum SMI; the operation is circulated again until each feature in the F and each feature in the A calculate mutual information values; wherein the current maximum SMI*Is 0
The mutual information calculation mode is as follows:
wherein, F and a are respectively a certain feature in the candidate feature set F and a certain feature in the target feature set A, and I (F, a) is a mutual information value between F and a. f. ofi,ajThe ith sampling value and the jth sampling value in the sampling time interval T are respectively f and a, and m and n are respectively the number of the f sampling value and the a sampling value.
First, all features (including velocity features) are normalized at 0-1 and calculated, the median of each feature after normalization. The normalized value is 1 or more for the median and the others are 0. Thereby changing the distribution form of the characteristic data into a binomial distribution.
The total number of the samples after the pretreatment is set as r, hkRepresents the number of samples where a-k.
Calculating a joint distribution probability value:
calculating a probability value:
substituting the mutual information value expression to calculate the mutual information value.
The network structure of the preceding vehicle speed prediction module is shown in fig. 4, and the model front end adopts a sequence-to-sequence neural network framework which is composed of an encoder and a decoder. The encoder compresses the input sequence into a fixed length vector, and the decoder decodes the target sequence from the entire vector. A hybrid network of a convolutional neural network and a long and short term memory neural network is used as an encoder, wherein the convolutional neural network is used for preprocessing an input vector, important information is extracted from the convolutional neural network through a convolution and downsampling principle and is used for inputting of a long and short term memory neural network layer, and the long and short term memory neural network layer processes tensors from the convolutional neural network at each time step.
The selected characteristics used for training the front vehicle speed prediction model are firstly coded by the coder and then decoded by the decoder to be used as input data during the training of the front vehicle speed prediction model.
The encoder comprises a convolutional neural network and an LSTM neural network which are linearly stacked, wherein the convolutional neural network consists of a convolutional layer and a pooling layer, and the LSTM neural network consists of an LSTM layer and a Dropout layer;
the convolution layer in the convolutional neural network is a 1-dimensional convolution layer, the number of convolution kernels is set to be 32, the size of the convolution kernel/the length of a convolution window is set to be 7, filling parameters are set to be same, the shape of an input tensor is set to be (n,1), and n is the number of selected features; the activation function is set to relu, the expression of the relu function: y ═ max (0, x); the pooling layer is a 1-dimensional maximum pooling layer, and the size of a pooling window is set to be 5;
the output dimension of the LSTM layer in the LSTM neural network is set to be 32, the Dropout rate of the Dropout layer is set to be 0.2, and the optimizer is set to be rmsprop.
The decoder consists of an LSTM layer and two fully-connected layers, wherein the output dimension of the LSTM layer is set to be 32; the output dimension of the first fully-connected layer is set to 32 and the activation function is set to relu, and the output dimension of the second fully-connected layer is 1 without using the activation function.
The front vehicle speed prediction model is obtained by training a deep neural network, wherein the deep neural network comprises three linearly stacked fully-connected layers, an optimizer is set to rmsprop, and a loss function is set to mse;
wherein s isreal、spredictionThe real value and the predicted value of the speed are respectively, and m is the number of the predicted time points.
The frame of the rear vehicle following speed control model is shown in fig. 5, the input of the control network is a predicted speed value of a front vehicle, the rear vehicle model is simplified into a first-order inertia transfer function, and the control is carried out through a unit speed feedback double closed loop structure. The controller adopts a PID controller to carry out speed following control, and realizes the no-difference tracking of the speed. And (4) parameter identification and adjustment are carried out in an MATLAB simulation environment, and the step response curve is adjusted to be optimal based on prior knowledge. And adjusting the proportional part coefficient according to the set safe distance deviation. Initializing a larger integration time constant randomly, then gradually reducing the constant until the system oscillates, reversely increasing Ti until the system oscillates, and setting the integration time constant of the PID to be 150-180% of the current value by adopting the integration time constant at the moment. The differential is 30% of the non-oscillatory time, as determined by the method of determining the integration time constant.
In summary, according to the automobile following speed control system based on the preceding vehicle speed prediction provided by the invention, a group of efficient features are selected through a feature selection scheme based on mutual information, the efficient features are input into a preceding vehicle speed prediction model to predict the preceding vehicle speed, and a prediction result is input into a following speed control system to control the speed. Compared with the prior automobile following control, the method has the advantages that the source of the prediction information is simple, and the prediction effect is good. Meanwhile, the driving behavior of the following vehicle can be continuously adjusted through PID control based on speed following, and errors in control decision are reduced.
Example two
Figure 6 is a flow chart diagram of a method of controlling the car's follow-up speed with prediction of the speed of the preceding car,
step S1: preprocessing the original collected data of the front vehicle and extracting characteristic data; the original collected data of the front vehicle comprises front vehicle speed data, traffic signal data and road condition data; each feature contains N data collected uniformly over a sampling interval T;
step S2: selecting features according to a preset feature selection rule to obtain selected features;
step S3: training a front vehicle speed prediction model by using the selected characteristics and the front vehicle speed after the set interval time, and outputting a predicted value of the speed of the front vehicle in a future time period by using the front vehicle speed prediction model;
step S4: inputting the predicted speed of the front vehicle, and controlling the speed of the rear vehicle by taking the safe distance as a control target;
the preset feature selection rule is that greedy search is carried out from a set F of features to be selected, the searched features are sequentially added into a set A of target features, and features to which data in the set A belong serve as selection features; the candidate feature set F comprises preceding vehicle speed data, traffic signal data and road condition data, the initial element contained in the target feature set A is the preceding vehicle speed, and the target feature selection standard is the feature with the minimum sum of mutual information values of the elements in the candidate feature set F and the elements in the target feature set A.
The front vehicle speed prediction model is obtained by training a deep neural network, wherein the deep neural network comprises three linearly stacked fully-connected layers, an optimizer is set to rmsprop, and a loss function is set to mse;
wherein s isreal、spredictionRespectively representing the real value and the predicted value of the speed, wherein m is the number of predicted time points;
the rear vehicle speed control controls a first order transfer function that characterizes the following speed based on PID.
For details and description of the implementation of each step in the above method embodiment, reference may be made to the description of the corresponding part of the specific working principle of each module in the above apparatus embodiment, and details are not described here again.
In summary, according to the automobile following speed control method based on the preceding vehicle speed prediction provided by the invention, a group of efficient features are selected through a feature selection scheme based on mutual information, the efficient features are input into a preceding vehicle speed prediction model to predict the preceding vehicle speed, and a prediction result is input into a following speed control system to control the speed. Compared with the prior automobile following control, the method has the advantages that the source of the prediction information is simple, and the prediction effect is good. Meanwhile, the driving behavior of the following vehicle can be continuously adjusted through PID control based on speed following, and errors in control decision are reduced.
The above description is only exemplary of the present invention and should not be taken as limiting the invention, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.