Traffic Accident Prediction Method
By combining the combined prediction method of system identification and LSTM models, linear and nonlinear information is used to solve the problem of insufficient traffic accident prediction accuracy in the existing technology, achieving higher prediction accuracy and better performance.
Patent Information
- Application Number
- CN202211433359.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-16
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-11-16
AI Technical Summary
Existing traffic accident prediction methods are difficult to achieve high-precision prediction in all situations and cannot accurately predict accidents in complex traffic flows.
A traffic accident prediction method based on system identification and LSTM is adopted. By combining different prediction methods, the linear and nonlinear information of the system identification model and the long short-term memory network model are used, and through linear weighting, residual connection and pipeline-type combination optimization methods, the system improves the efficiency of traffic accident prediction. Prediction accuracy.
Compared with individual models, the combined prediction method improved the prediction accuracy by 4.45% to 24.89%. In particular, the method based on system identification and LSTM pipeline type performed the best, with an F1 score of 0.86, significantly improving the accuracy of traffic accident prediction.
Smart Images

Figure CN116110219B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic accident prediction, and in particular to a traffic accident prediction method. Background Art
[0002] The prediction of traffic accidents is the key task of road traffic management. Timely and accurate predictions can enable relevant departments to provide road emergency services in advance, alleviate traffic congestion, and improve road commuting efficiency.
[0003] At present, experts and scholars at home and abroad have conducted extensive research on the prediction of traffic accidents and have achieved certain research results. Ma Cong uses a nonlinear negative binomial regression model to analyze the factors that may cause accidents; Su Liang uses the gray theory method to find the relationship between traffic flow data, combining quantitative and qualitative methods to predict whether an accident will occur in the future; Wang Qiang uses the average weakening buffer operator to improve the gray model and improve the prediction accuracy of the traditional gray model when the traffic flow sequence fluctuates greatly; Lv Xiaofu uses the regression analysis method to establish a functional relationship between the number of future traffic accidents and related traffic variables; Zhang Yanyan uses the ARIMA prediction model to predict water traffic accidents based on the statistical correlation of the traffic flow sequence itself; Li Juan uses the BP neural network to establish a traffic accident model; Zhang Zhihao uses the LSTM neural network, and the prediction has obvious advantages over the traditional BP neural network prediction effect; Zhang Yifei uses a combined model to make full use of the characteristics of the ARIMA model and the BP model to predict ship traffic accidents.
[0004] Summarizing the current research status of scholars, current methods cannot complete high-precision prediction tasks in all cases. Summary of the invention
[0005] The purpose of the present invention is to solve the above-mentioned technical problems and provide a traffic accident prediction method. The present invention combines a traffic accident prediction method based on system identification or a traffic accident prediction method based on LSTM or the above two prediction methods in different ways, and performs prediction comparison. The results show that the above different methods can improve the prediction ability of road traffic accidents. The present invention has higher prediction accuracy than the existing methods.
[0006] The technical solution adopted by the present invention to solve the above technical problems is: a traffic accident prediction method based on system identification, comprising the following steps:
[0007] Step 1: Input the random factors R(t) that affect the predicted accident;
[0008] Step 2: Set the hour interval span and the day interval span. The historical speed of the hour interval is represented by HV(t), and the historical speed of the day interval is represented by DV(t).
[0009] Step 3: Predict the probability of an accident using the following formula:
[0010] The input and output of the system at time t are represented by u(t) and y(t) respectively. The discrete time input and output linear equation is
[0011] y(t)+a1y(t-1)+…+a n y(tn a )=b1u(t-1)+…+b m u(tn m ),
[0012] where n a is the hour interval span, n m is the daily interval span, u(t) is the input of the system at time t, y(t) is the output of the system at time t, a n is the linear parameter, b m is a linear parameter;
[0013] Transform the above equation into
[0014] y(t)=-a1y(t-1)-…-a n y(tn a )+b1u(t-1)+…+b m u(tn m ),
[0015] Introducing the input vector n(t) and parameter vector θ,
[0016] φ(t)=[-y(t-1),…,-y(tn a ),u(t-1),…,u(tn m )] T ,
[0017] θ=[a1,…,a n ,b1,…,b m ] T ,
[0018] Where n(t) is the input vector, θ is the parameter vector, and T is the transposed symbol;
[0019] Therefore, the system structure for predicting whether a traffic accident will occur in the future is expressed as
[0020]
[0021] Where PV(t) is the predicted probability of an accident, HV(tn a ) is the historical speed at hourly intervals; and is the linear parameter of the nth hourly interval / daily interval; n b is the nth day interval; DV(tn b ) is the historical speed of the daily interval; c1 is the random term parameter; R(t) is the random term;
[0022] Step 4: Determine the hour interval span and the day interval span through the experimental method, compare each set of predicted results with the actual experimental data, and obtain the absolute error;
[0023] Step 5: Repeat steps 2 to 4 until the hourly interval span and the daily interval span reach the set threshold, and select the calculation method that minimizes the absolute error between the hourly interval span and the daily interval span.
[0024] Preferably, the hour interval spans n a Set to 2 to 24, the day interval span n b Settings range from 1 to 14.
[0025] As a preference, an evaluation method for evaluating the prediction results is also included, which specifically includes the following contents:
[0026] Calculate the prediction accuracy. The calculation formula of accuracy is as follows:
[0027]
[0028] Among them, TP means that the label is positive and the predicted value is also positive; FP means that the label is false, but the predicted value is positive;
[0029] Calculate the recall rate recall. The calculation formula of recall is as follows:
[0030]
[0031] Among them, FN means that the label is positive, but the predicted value is false;
[0032] The calculation of F1 is used to evaluate the prediction results. The evaluation calculation formula is as follows:
[0033]
[0034] Among them, precision is the accuracy of the prediction, which indicates the ability of the model not to identify negative samples as positive samples; recall is the recall rate, which indicates the ability of the model to identify positive samples. The label refers to the true value of the prediction. The positive or false of the label indicates whether an accident actually occurred, and the positive or false of the label is judged according to the predicted value.
[0035] A traffic accident prediction method based on LSTM, including a forget gate for deciding whether to discard information from the network, an input gate for deciding to store information, and an output gate for deciding the current network output.
[0036] The calculation method of the forget gate is as follows: the current input x t and the hidden state h of the previous output t-1 After the activation function σ, decide whether to keep the previous memory unit c t-1 , and its calculation formula is as follows:
[0037] f t =σ(W f ·[h t-1 ,x t ]);
[0038] where x t is the current input, h t-1 is the hidden state of the previous output, σ is the activation function, c t-1 is the previous memory unit, W f is the neural network parameter, f t is the hidden layer output;
[0039] The input gate is calculated as follows: the activation function σ and the hyperbolic tangent function are used to create an update value, which is the previous memory cell c t-1 Updated to c t , and its calculation formula is as follows:
[0040] i t =σ(W i ·[h t-1 ,x t ]);
[0041] c t =f t ·c t-1 +i t ·(tanh(W c ·[h t-1 ,x t ]));
[0042] where i t , W i , W c All are neural network parameters;
[0043] The output gate is calculated as follows:
[0044] o t =σ(W o ·[h t-1 ,x t ]);
[0045] ht =o t ·tanh(c t );
[0046] Where σ is the Sigmoid function, W is the parameter matrix, o t is the LSTM output layer value, h t is the predicted value. The calculation method of F1 can be used to calculate the predicted value h t 's evaluation.
[0047] A traffic accident prediction method based on system identification and LSTM residual combination includes the following steps:
[0048] Step 1: Execute steps 1 to 4 of the traffic accident prediction method based on system identification to determine n a and n b , starting from the initialization values of the two, each pair of n a and n b The difference between the predicted value and the true value is used as the current input x t And input into the LSTM-based traffic accident prediction method;
[0049] Step 2: When the maximum number of training times is reached or the error requirement is met, the outputs of the traffic accident prediction method based on system identification and the traffic accident prediction method based on LSTM are combined to obtain the predicted value, and the F1 score is calculated;
[0050] Step 3: Increase n respectively a and n b , repeat steps 1 and 2 until n a and n b Reach the pre-set threshold and find the maximum F1 value.
[0051] A traffic accident prediction method based on system identification and LSTM linear weighted combination includes the following steps:
[0052] Step A: Set each pair of n a and n b Execute steps 1 to 5 of the traffic accident prediction method based on system identification and evaluate the F1 value to determine the optimal n a and n b Obtain the optimal value prediction value of the corresponding traffic accident prediction method based on system identification as the output value x1;
[0053] The LSTM-based traffic accident prediction method is trained and the F1 value is evaluated. When the maximum number of training times is reached or the error requirement is met, the optimal prediction value is obtained as the output value x2;
[0054] Step B: If there is a certain relationship between whether the accident occurs y and the output value x1 and the output value x2, the formula for the final prediction value of the linear weighted combination is:
[0055] p=ax1+bx2
[0056]
[0057] Among them, a and b are linear parameters, p is the output value of the linear equation, and y is the final predicted value;
[0058] Step C: After obtaining the weighted sum p, divide the value by the threshold, and then output the final prediction result and the F1 value score of the model. threshold represents the threshold.
[0059] A traffic accident prediction method based on system identification and LSTM pipeline includes the following steps:
[0060] Step a: After processing the traffic data, input the data into the LSTM-based traffic accident prediction method to obtain the LSTM prediction value;
[0061] Step b: The obtained predicted value is processed and input into the traffic accident prediction method based on system identification as u(t). a and n b The predicted value will be segmented by a threshold, and then the predicted value after threshold segmentation and the label will be evaluated by F1 value. a ×n b After the iteration, record the best F1 value;
[0062] Step c: Repeat steps a and b until all the preset epochs are trained and the optimal n is found. a and n b , output the predicted value under the optimal model.
[0063] The accident prediction value of LSTM is added as a characteristic factor of the system identification method to the training data at the corresponding time of the system identification method. This input writing method is to use LSTM's feature extraction ability for data, and the predicted value is actually a result of the comprehensive training data characteristics. The LSTM prediction value is not numerically processed, but only the data format and data dimension are changed. The purpose is to make the time of the LSTM prediction value correspond to the time of the training data in the system identification to ensure that there is no time mismatch error.
[0064] The present invention has the following beneficial effects:
[0065] 1. The present invention combines the traffic accident prediction method based on system identification and the traffic accident prediction method based on LSTM in different ways, and makes prediction comparisons. The results show that the above different methods can improve the prediction ability of road traffic accidents, and the present invention has higher prediction accuracy than the existing methods. Among them, the traffic accident prediction method based on system identification and LSTM pipeline performs best, and its performance is improved by 4.45% to 24.89% compared with other models.
[0066] 2. The present invention can make full use of the system identification model and the long-short-term memory artificial neural network model to extract linear and nonlinear information in complex traffic flows. The optimal prediction model is obtained by comparing three different combination optimization methods: linear weighting, residual connection and pipeline. Experiments and analysis based on real data sets obtained on Wenzhou Expressway show that compared with the single model prediction method, the model combination prediction method has higher prediction accuracy; the pipeline combination prediction result is the best among the model combination methods, and its F1 value score can reach 0.86, which is 4.45% to 24.89% higher than the F1 score of system identification, long-short-term memory artificial neural network model, linear weighted combination model and residual connection combination model. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flow chart of the traffic accident prediction method based on system identification of the present invention.
[0068] Figure 2 This is a schematic diagram of the LSTM structure.
[0069] Figure 3 This is a flow chart of the traffic accident prediction method based on the combination of system identification and LSTM residual.
[0070] Figure 4 It is a flow chart of the traffic accident prediction method based on system identification and LSTM linear weighted combination.
[0071] Figure 5 This is a flow chart of the traffic accident prediction method based on system identification and LSTM pipeline. DETAILED DESCRIPTION
[0072] The present invention is further described below in conjunction with the accompanying drawings and implementation modes.
[0073] Example 1
[0074] like Figure 1 As shown, the present invention provides a traffic accident prediction method based on system identification.
[0075] The input and output at time t are represented by u(t) and y(t) respectively. The discrete time input and output linear equation is
[0076] y(t)+a1y(t-1)+…+a n y(tn a )
[0077] =b1u(t-1)+…+b m u(tn m );
[0078] Where n a is the hour interval span, n m is the daily interval span, u(t) is the input of the system at time t, y(t) is the output of the system at time t, a n is the linear parameter, b m is a linear parameter;
[0079] Can be converted into
[0080] y(t)=-a1y(t-1)-…-a n y(tn a )+b1u(t-1)+…+b m u(tn m );
[0081] Then we introduce the input vector n(t) and parameter vector θ,
[0082] φ(t)=[-y(t-1),…,-y(tn a ),u(t-1),…,u(tn m )] T ;
[0083] θ=[a1,…,a n ,b1,…,b m ] T ;
[0084] n(t) is the input vector, θ is the parameter vector, and T is the transposed symbol;
[0085] The traffic accident prediction is not only related to the historical traffic speed at hourly intervals and daily intervals, but also to other factors of prediction. In this embodiment, the historical speed at hourly intervals is represented by HV(t), and the historical speed at daily intervals is represented by DV(t). R(t) is a random factor that affects the occurrence of the predicted accident, which refers to the date factor. Therefore, the system structure for predicting whether an accident will occur in the future can be described as:
[0086]
[0087] Where PV(t) is the predicted probability of an accident, HV(tn a ) is the historical speed at hourly intervals; and is the linear parameter of the nth hourly interval / daily interval; n b is the nth day interval; DV(tn b ) is the historical speed of daily intervals; c1 is the random term parameter; R(t) is the random term.
[0088] Hour interval span n a Set to 2 to 24, the day interval span n b Settings range from 1 to 14.
[0089] In order to determine the basic structure of the system, the hourly interval span and the daily interval span are determined by experimental methods. The results of each group of predictions are compared with the actual experimental data to obtain the absolute error until the hourly and daily spans reach the set thresholds. The model with the smallest absolute error is selected, that is, the system sequential structure and parameters are obtained, and a traffic accident prediction method based on system identification is established as an SI model.
[0090] This embodiment uses the F1 score, a commonly used indicator in classification tasks, to evaluate the model prediction results. The specific description of F1 score is as follows:
[0091]
[0092] Among them, precision represents the accuracy of the prediction, which means the ability of the model not to identify negative samples as positive samples. Recall represents the ability of the model to identify positive samples.
[0093] The F1 score is the harmonic mean of the two. The higher the F1 value, the better the model prediction effect.
[0094] Example 2
[0095] like Figure 2 As shown, the present invention provides a traffic accident prediction method based on LSTM, including a forget gate for deciding whether to discard information from the network, an input gate for deciding to store information, and an output gate for deciding the current network output.
[0096] The calculation method of the forget gate is as follows: the current input x t and the hidden state h of the previous output t-1 After the activation function σ, decide whether to keep the previous memory unit c t-1 , and its calculation formula is as follows:
[0097] f t =σ(W f ·[h t-1 ,x t ]);
[0098] where x t is the current input, h t-1 is the hidden state of the previous output, σ is the activation function, c t-1 is the previous memory unit, W f is the neural network parameter, f t is the hidden layer output;
[0099] The input gate is calculated as follows: the activation function σ and the hyperbolic tangent function are used to create an update value, which is the previous memory cell c t-1 Updated to c t , and its calculation formula is as follows:
[0100] i t =σ(W i ·[h t-1 ,x t ]);
[0101] c t =f t ·c t-1 +i t ·(tanh(W c ·[h t-1 ,x t ]));
[0102] where i t , W i , W c All are neural network parameters;
[0103] The output gate is calculated as follows:
[0104] o t =σ(W o ·[h t-1 ,x t ]);
[0105] h t =o t ·tanh(c t );
[0106] Where σ is the Sigmoid function, W is the parameter matrix, o t is the LSTM output layer value.
[0107] Example 3
[0108] like Figure 3 As shown, the present invention provides a traffic accident prediction method based on LSTM, which uses the SI model to extract the linear information of the high-speed traffic flow sequence, and converts the sorted input sequence data T t Input into the SI model to obtain the traffic accident prediction value p for the corresponding road section prediction period SI, the accident prediction error is expressed as e, that is, e = y label -p SI The prediction error includes the influence of sudden factors such as bad weather and road maintenance. The LSTM neural network is used to extract the nonlinear information of the high-speed traffic flow sequence and obtain the prediction result p LSTM , that is, the residual association prediction model based on SI-LSTM is obtained.
[0109] First, the structure of the SI model is determined to complete the initialization. The system structure for predicting whether an accident will occur is composed of the historical speed at hourly intervals represented by HV(t), the historical speed at daily intervals represented by DV(t), and R(t), which is the date factor affecting the predicted accident.
[0110] Secondly, determine the order n and m of the model. The overall idea is to iteratively adjust until the model accuracy reaches the maximum. After determining the structure of the system, it is necessary to determine the hour interval n required for system prediction. a and day interval n b In order to determine the length range of n a and n b , starting from the initialization values of the two, each pair of n a and n b That is, corresponding to a temporary SI system, the difference between the predicted value and the true value is used as the label of the LSTM neural network to train the neural network. When the maximum number of training times is reached or the error requirement is met, the output of SI and LSTM is combined to obtain the predicted value, and the F1 score is calculated to indicate the accuracy of the system. Then increase n a and n b , iteratively search for the maximum F1 value until n a and n b Reaching a pre-set threshold, thus determining n a and n b And the neural network parameters to get the final model.
[0111] The traffic data used in this embodiment comes from 56 different radar points on Wenzhou Expressway, which contains the average speed of vehicles passing through the road section, the number of vehicles passing through, and accident information. The data set is divided into a training set and a test set in a ratio of 3:1. The detailed statistics of the data set are shown in Table 1.
[0112] Table 1 Dataset details
[0113]
[0114] The experimental results are shown in Table 2.
[0115] Table 2 Prediction results of residual concatenation model
[0116]
[0117] In the experiment, the experimental data used were radar recording data from different months. The data of radar G15K1788M300L were traffic data and accident data in September 2020. The data processing was to record the average vehicle speed and cumulative number of accidents every 30 minutes. After statistics, the proportion of road accidents recorded by the radar during this period was 0.232; in a 30-day time span and under the same data processing method, the proportion of road section data accidents recorded by radar G15K1768M400Q was 0.257, and the recording time was from August 1 to 30, 2020; the proportion of road section data accidents recorded by radar G15K1763M550L was 0.578, and the recording time was from February 1 to March 3, 2021; the proportion of road section data accidents recorded by radar G15K1772M100L was 0.142, and the recording time was from September 10 to October 10, 2020.
[0118] As can be seen from Table 2, the performance of the three models is different on different radar data. Compared with the use of LSTM alone and the system identification model alone, the residual joint model performs slightly better than the single model only in the radar data with ID G15K1772M100L. In other cases, the F1 evaluation result of the residual joint model is similar to that of SI. This result can be attributed to the Figure 3 The reason is analyzed in the process structure diagram. When training the SI model, each pair of n a and n b The predicted value of the temporary SI is obtained, and the residual value obtained by doing the difference between the predicted value and the true label is used as the label of the LSTM, so that the value obtained by LSTM training is small or even negative. Then the prediction results of the two models are added and combined, and the result obtained will be closer to the predicted result of SI. Therefore, the result obtained by doing F1 value evaluation on the predicted result after threshold segmentation and the true label is close to the F1 value score of SI.
[0119] Example 4
[0120] like Figure 4 As shown, the present invention is a traffic accident prediction method based on LSTM, which analyzes whether a traffic accident occurs on a road section by linear weighting two single models and then compares them with a set threshold to make a prediction. The basic process of linear weighted combination is: t (t=1,2,…,m) is the traffic flow data sequence input to the system identification SI and LSTM model. Assuming that there is a certain relationship between whether an accident occurs y and the output value of SI x1 and the output value of LSTM x2, the final prediction value of the linear weighted combination prediction model based on SI-LSTM is
[0121] p = ax1 + bx2;
[0122]
[0123] Among them, a and b are linear parameters, p is the output value of the linear equation, and y is the final predicted value;
[0124] Calculate the weights a, b and threshold of the SI model and LSTM neural network prediction values in the SI-LSTM weighted model. See the SI-LSTM weighted model for traffic accident prediction process. Figure 4 .
[0125] After processing the traffic data, the data is input into the SI model and LSTM model for training, the parameters of the SI model are initialized, and the hour interval n of the SI model is set. a Set to the range of 2 to 24, and the day interval is n b Set it to the range of 1 to 14, and then start the iterative operation. a and n b The F1 value will be evaluated to determine the optimal n a and n b Obtain the corresponding SI model optimal value prediction value; while initializing the SI model, initialize the LSTM model parameters, set the hidden layer size to 128, the LSTM layer to 3 layers, the dropout to 0.2, add a linear layer, add a sigmoid activation function after the linear layer, the optimizer used is Adam, and the learning rate is set to 0.001, and then start model training. In the experiment, LSTM was trained for 800 epochs. In order to improve the training speed, the F1 value of the model is not evaluated once for each epoch, but an F1 value evaluation is performed every 5 epochs to obtain the optimal LSTM model, and the prediction value under the optimal model is saved. Then, the optimal prediction value of SI and the optimal prediction value of LSTM are calculated by the least squares method, and then the predicted optimal values of the two models are added according to the weights. After obtaining the weighted sum value, the value is segmented by the threshold. The threshold segmentation method used in this experiment is the maximum inter-class variance method, and then the final prediction result and the F1 value score of the model are output.
[0126] The experimental results are shown in Table 3.
[0127] Table 3 Prediction results of SI-LSTM weighted model
[0128]
[0129] As can be seen from Table 3, when the radar ID is G15K1763M550L and G15K1772M100L, the LSTM-SI weighted model performs better than the LSTM, SI and LSTM-SI residual models. However, when the radar ID is G15K1788M300L, the performance of the weighted model is worse than that of the LSTM. When the ID is G15K1768M400Q, the performance of the weighted model is worse than that of the other three models. The main reason for this performance degradation can be analyzed. Figure 4 It is known that after training the SI model and the LSTM model respectively, the optimal model and the predicted value under the optimal model are saved. The traffic data at the corresponding time presents a single linear or nonlinear feature. The joint model of linear and nonlinear may add disturbance factors, thereby increasing the proportion of incorrect prediction values of the weighted model compared with the single model, resulting in the deterioration of the performance of the final weighted model.
[0130] Example 5
[0131] like Figure 5 As shown, the present invention provides a traffic accident prediction method based on LSTM, which uses the LSTM model to extract nonlinear information in the traffic flow sequence, and then inputs the extracted nonlinear information into the SI model in a pipeline-like manner, using the output of the previous model as an input factor of the next model. The basic process of the pipeline prediction method is: t (t=1,2,…,m) is the traffic flow data sequence input to the LSTM model. The output x1 and T t The component X is input into the SI model to obtain the predicted value p, and the p value is compared with the set threshold to output y. The final predicted value of the pipeline prediction model based on SI-LSTM is
[0132] p = αX;
[0133]
[0134] After processing the traffic data, the data was input into the initialized LSTM neural network for training. The LSTM hidden layer size was set to 128, the LSTM layer was set to 3 layers, the dropout was set to 0.2, a linear layer was added, and a sigmoid activation function was added after the linear layer. The optimizer used was Adam, and the learning rate was set to 0.001. A prediction was made every 5 epochs of training. After obtaining the predicted value of LSTM, it was used as a feature data of the SI model. At the same time, the processed data was input into the initialized SI model, and the hour interval n of the SI model was set. a Set to the range of 2 to 24, and the day interval is n bSet A to a range of 1 to 14, and then start iterating. a and n b The predicted value of SI will be thresholded once, and then the predicted value after threshold segmentation and the label will be evaluated by F1 value. a ×n b After the iteration, record the best F1 value, and then train the next 5 epochs of LSTM to output the predicted value as the feature value of SI. Repeat the above SI training, threshold segmentation and evaluation until all 800 epochs of LSTM are trained, and then find the optimal n a and n b , and then output the predicted value under the optimal model.
[0135] The experimental results are shown in Table 4.
[0136] Table 4 Prediction results of pipeline model
[0137]
[0138]
[0139] As can be seen from Table 4, the performance of the pipeline model is significantly better than other models. In the experiment of the road data recorded by the radar G15K1788M300L, the F1 value score of the model can reach 0.863, which is 24.35% higher than the SI model alone and 24.89% higher than the LSTM-SI residual model. Experiments on the data recorded by the other three radars also show that the accident prediction ability of the pipeline model is the best, and all can reach an F1 score of 0.80 or above.
[0140] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0141] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A traffic accident prediction method based on system identification, characterized in that: The following steps are involved: Step 1: Input the random factors R(t) that affect the predicted accident; Step 2: Set the hour interval span and the day interval span. The historical speed of the hour interval is represented by HV(t), and the historical speed of the day interval is represented by DV(t). Step 3: Predict the probability of an accident using the following formula: The input and output of the system at time t are represented by u(t) and y(t) respectively. The discrete time input and output linear equation is y(t)+a1y(t-1)+…+a n y(t-n a )=b1u(t-1)+…+b m u(t-n m ); where n a is the hour interval span, n m is the daily interval span, u(t) is the input of the system at time t, y(t) is the output of the system at time t, a n is the linear parameter, b m is a linear parameter; Transform the above equation into y(t)=-a1y(t-1)-…-a n y(t-n a )+b1u(t-1)+…+b m u(t-n m ); Introducing the input vector n(t) and parameter vector θ, φ(t)=[-y(t-1),…,-y(t-n a ),u(t-1),…,u(t-n m )] T ; θ=[a1,…,a n ,b1,…,b m ] T ; n(t) is the input vector, θ is the parameter vector, and T is the transposed symbol; Therefore, the system structure for predicting whether a traffic accident will occur in the future is expressed as Where PV(t) is the predicted probability of an accident, HV(tn a ) is the historical speed at hourly intervals; and is the linear parameter of the nth hourly interval / daily interval; n b is the nth day interval; DV(tn b ) is the historical speed of the daily interval; c1 is the random term parameter; R(t) is the random term; Step 4: Determine the hour interval span and the day interval span through the experimental method, compare each set of predicted results with the actual experimental data, and obtain the absolute error; Step 5: Repeat steps 2 to 4 until the hourly interval span and the daily interval span reach the set threshold, and select the calculation method that minimizes the absolute error between the hourly interval span and the daily interval span.
2. The traffic accident prediction method based on system identification according to claim 1, characterized in that: Hour interval span n a Set to 2 to 24, the day interval span n b Settings range from 1 to 14.
3. The traffic accident prediction method based on system identification according to claim 1, characterized in that: It also includes an evaluation method for evaluating the prediction results, which specifically includes the following contents: Calculate the prediction accuracy. The calculation formula of accuracy is as follows: Among them, TP means that the label is positive and the predicted value is also positive; FP means that the label is false, but the predicted value is positive; Calculate the recall rate recall. The calculation formula of recall is as follows: Among them, FN means that the label is positive, but the predicted value is false; The calculation of F1 is used to evaluate the prediction results. The evaluation calculation formula is as follows:
4. A traffic accident prediction method based on system identification and LSTM residual, characterized by: The following steps are involved: Step 1: Execute steps 1 to 4 of the traffic accident prediction method based on system identification as claimed in claim 1 to determine n a and n b , starting from the initialization values of the two, each pair of n a and n b The difference between the predicted value and the true value is used as the current input x t And input into the LSTM-based traffic accident prediction method, which includes a forget gate that determines whether to discard information from the network, an input gate that determines the storage information, and an output gate that determines the current network output. The calculation method of the forget gate is as follows: the current input x t and the hidden state h of the previous output t-1 After the activation function σ, decide whether to keep the previous memory unit c t-1 , and its calculation formula is as follows: f t =σ(W f ·[h t-1 ,x t ]); where x t is the current input, h t-1 is the hidden state of the previous output, σ is the activation function, c t-1 is the previous memory unit, W f is the neural network parameter, f t is the hidden layer output; The input gate is calculated as follows: the activation function σ and the hyperbolic tangent function are used to create an update value, which is the previous memory cell c t-1 Updated to c t , and its calculation formula is as follows: I t =σ(W i ·[h t-1 ,x t ]); c t =f t ·c t-1 +i t ·(tanh(W c ·[h t-1 ,x t ])); where i t , W i , W c All are neural network parameters; The output gate is calculated as follows: the t =σ(W o ·[h t-1 ,x t ]); h t =o t ·tanh(c t ); Where σ is the Sigmoid function, W is the parameter matrix, o t Output layer value of LSTM; Step 2: When the maximum number of training times is reached or the error requirement is met, the outputs of the traffic accident prediction method based on system identification and the traffic accident prediction method based on LSTM are combined to obtain the predicted value, and the F1 score is calculated; Step 3: Increase n respectively a and n b , repeat steps 1 and 2 until n a and n b Reach the pre-set threshold and find the maximum F1 value.
5. A traffic accident prediction method based on system identification and LSTM linear weighted combination, characterized by: The following steps are involved: Step A: Set each pair of n a and n b Execute steps 1 to 5 of the traffic accident prediction method based on system identification described in claim 1 and evaluate the F1 value to determine the optimal n a and n b Obtain the optimal value prediction value of the corresponding traffic accident prediction method based on system identification as the output value x1; The traffic accident prediction method based on LSTM is trained and the F1 value is evaluated. When the maximum number of training times is reached or the error requirement is met, the optimal prediction value is obtained as the output value x2. The traffic accident prediction method based on LSTM includes a forget gate that determines whether to discard information from the network, an input gate that determines the storage information, and an output gate that determines the current network output. The calculation method of the forget gate is as follows: the current input x t and the hidden state h of the previous output t-1 After the activation function σ, decide whether to keep the previous memory unit c t-1 , and its calculation formula is as follows: f t =σ(W f ·[h t-1 ,x t ]); where x t is the current input, h t-1 is the hidden state of the previous output, σ is the activation function, c t-1 is the previous memory unit, W f is the neural network parameter, f t is the hidden layer output; The input gate is calculated as follows: the activation function σ and the hyperbolic tangent function are used to create an update value, which is the previous memory cell c t-1 Updated to c t , and its calculation formula is as follows: I t =σ(W i ·[h t-1 ,x t ]); c t =f t ·c t-1 +i t ·(tanh(W c ·[h t-1 ,x t ])); where i t , W i , W c All are neural network parameters; The output gate is calculated as follows: the t =σ(W o ·[h t-1 ,x t ]); h t =o t ·tanh(c t ); Where σ is the Sigmoid function, W is the parameter matrix, o t Output layer value of LSTM; Step B: If there is a certain relationship between whether the accident occurs y and the output value x1 and the output value x2, the formula for the final prediction value of the linear weighted combination is: p=ax1+bx2 Among them, a and b are linear parameters, p is the output value of the linear equation, and y is the final predicted value; Step C: After obtaining the weighted sum value p, divide the value by the threshold, and then output the final prediction result and the F1 value score of the model.
6. A traffic accident prediction method based on system identification and LSTM pipeline, characterized by: The following steps are involved: Step a: After processing the traffic data, the data is input into the LSTM-based traffic accident prediction method to obtain the LSTM prediction value. The LSTM-based traffic accident prediction method includes a forget gate that determines whether to discard information from the network, an input gate that determines the storage information, and an output gate that determines the current network output. The calculation method of the forget gate is as follows: the current input x t and the hidden state h of the previous output t-1 After the activation function σ, decide whether to keep the previous memory unit c t-1 , and its calculation formula is as follows: f t =σ(W f ·[h t-1 ,x t ]); where x t is the current input, h t-1 is the hidden state of the previous output, σ is the activation function, c t-1 is the previous memory unit, W f is the neural network parameter, f t is the hidden layer output; The input gate is calculated as follows: the activation function σ and the hyperbolic tangent function are used to create an update value, which is the previous memory cell c t-1 Updated to c t , and its calculation formula is as follows: I t =σ(W i ·[h t-1 ,x t ]); c t =f t ·c t-1 +i t ·(tanh(W c ·[h t-1 ,x t ])); where i t , W i , W c All are neural network parameters; The output gate is calculated as follows: the t =σ(W o ·[h t-1 ,x t ]); h t =o t ·tanh(c t ); Where σ is the Sigmoid function, W is the parameter matrix, o t Output layer value of LSTM; Step b: Process the obtained predicted value as u(t) and input it into the traffic accident prediction method based on system identification as claimed in claim 1. a and n b The predicted value will be segmented by a threshold, and then the predicted value after threshold segmentation and the label will be evaluated by F1 value. a ×n b After the iteration, record the best F1 value; Step c: Repeat steps a and b until all the preset epochs are trained and the optimal n is found. a and n b , output the predicted value under the optimal model.
Citation Information
Patent Citations
Risk evaluation model-based traffic accident happening probability acquiring method and system
CN106355883A
City region traffic accident risk prediction method
CN109993970A
Cited By
Intelligent traffic accident prediction and emergency response system and method based on vehicle-mounted data
CN119721395A
Intelligent traffic accident prediction and emergency response system and method based on vehicle-mounted data
CN119721395B
Satellite-ground linkage wide-area urban road intelligent agent emergency monitoring method and system
CN121747308A
