A traffic volume prediction method and system considering traffic accident classification

By combining traffic accident duration-based classification with random forest and BP neural network models, the problem of insufficient traffic volume prediction caused by traffic accident heterogeneity is solved, achieving accurate traffic volume prediction and decision support.

CN116311899BActive Publication Date: 2026-03-24WUHAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-31
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing traffic volume prediction methods struggle to account for the heterogeneity of traffic accidents, resulting in insufficient prediction accuracy and applicability, and failing to effectively support the decision-making of traffic management departments.

Method used

Based on the duration of traffic accidents, a historical traffic accident feature table and a traffic volume dataset for classification are established. A traffic accident classification model is constructed using the random forest method, and a BP neural network is used for traffic volume prediction. The classification establishes a traffic volume prediction model to reduce the impact of accident heterogeneity.

Benefits of technology

It enables accurate identification and prediction of the impact level of traffic accidents, improves the accuracy and applicability of traffic volume forecasting, and can provide timely and effective decision support for traffic management departments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116311899B_ABST
    Figure CN116311899B_ABST
Patent Text Reader

Abstract

The application relates to a traffic volume prediction method and system under accidents considering traffic accident classification, which comprises the following steps: based on the duration of traffic accidents, classifying the accidents, establishing a historical traffic accident feature table and a classified traffic volume data set; based on the historical traffic accident feature table, adopting a random forest method to construct a traffic accident classification model; classifying to establish a traffic volume prediction model under accidents, inputting the classified traffic volume data set into the traffic volume prediction model under accidents for training and testing, and then predicting target traffic volume time series data to obtain a target traffic volume prediction result under accidents considering traffic accident classification. Considering that the influence of traffic accidents on traffic is different, the accidents are divided into several different categories based on the duration of the accidents, traffic volume prediction models are respectively established, the accidents are classified according to their influence characteristics, the corresponding prediction models are used for prediction, and the influence of the heterogeneity of the accidents on traffic volume prediction is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the urban road traffic volume prediction analysis technical field, and particularly relates to a traffic volume prediction method and system considering traffic accident classification under accidents. BACKGROUND

[0002] With the development of China's economy, the increasing demand for transportation, followed by the frequent traffic accidents, not only caused great loss of life and property, but also brought certain impact on the operation of urban traffic system, causing traffic congestion, even traffic interruption. Therefore, quickly and accurately predicting the traffic flow changes of the accident road section, providing decision support for traffic management department traffic relief, to reduce or even avoid the traffic congestion, secondary accidents and other subsequent losses caused by traffic accidents has important theoretical significance and practical value.

[0003] The traffic volume prediction methods currently applied in various aspects mainly include linear, nonlinear and combined models. These methods have good effects in medium and long-term prediction applications, but the traffic volume under accidents has the characteristics of nonlinearity, suddenness and occasionalness. If only time series or spatial factors are considered without considering the influence attributes of accidents, the single prediction method is difficult to meet the applicability of traffic volume prediction under accidents. Most of the existing traffic flow prediction methods under accidents are to analyze the potential relationship between the traffic volume sequences before and after the accidents by taking all the accident data as a set, but due to the heterogeneity of traffic accidents, the model constructed by the traditional method weakens the difference in the influence degree of different accidents on the traffic volume change trend, and there are still deficiencies in prediction accuracy and applicability. SUMMARY

[0004] The technical problem to be solved by the present application is to provide a traffic volume prediction method and system under accidents considering traffic accident classification in view of the above-mentioned deficiencies of the prior art.

[0005] The technical solution of the present application to solve the above technical problem is as follows: a traffic volume prediction method under accidents considering traffic accident classification, comprising the following steps:

[0006] Based on the accident classification based on the duration of traffic accidents, a historical traffic accident feature table and a classified traffic volume data set are established;

[0007] A traffic accident classification model is constructed based on the historical traffic accident feature table by using a random forest method;

[0008] A traffic volume prediction model under accidents is established by classification, and the classified traffic volume data set is input into the traffic volume prediction model under accidents for training and testing;

[0009] The target traffic volume time series data is input into the traffic volume prediction model of the corresponding category after training and testing to predict the traffic volume under the traffic accident, and the target traffic volume prediction result considering the classification of the traffic accident is obtained.

[0010] The traffic volume prediction method considering the classification of the traffic accident has the advantages that the influence of the traffic accident on the traffic is different, the traffic accident is divided into several different categories based on the duration of the traffic accident, the traffic volume prediction model is established for each category, the prediction model of the corresponding category is used for prediction after the accident is classified according to the influence characteristics, the influence of the heterogeneity of the traffic accident on the traffic volume prediction is reduced, and timely and accurate decision support can be provided for the traffic management department.

[0011] On the basis of the above technical solution, the application can also be improved as follows:

[0012] Further, the accident classification based on the duration of the traffic accident, the establishment of the historical traffic accident feature table and the classified traffic volume time series set specifically includes the following steps:

[0013] According to the loop data, the traffic volume time series data of the corresponding time of each accident is obtained, denoted as Q;

[0014] According to the loop data, the traffic volume time series data of the same place and the same time without traffic accidents is obtained, denoted as Q * ;

[0015] According to the traffic volume time series data Q and the traffic volume time series data Q * The duration T of each accident is obtained;

[0016] According to the duration T of each accident, the traffic accident is divided into multiple accident categories;

[0017] According to the accident categories, the loop data is processed to obtain the traffic volume data set B under the accident;

[0018] The traffic accident alarm information is preprocessed to obtain the attribute value and attribute category of the accident, and the historical traffic accident feature table D is determined according to the historical traffic accident feature table D, wherein the accident feature table includes time attribute, space attribute, accident itself attribute and weather attribute.

[0019] The above further scheme has the advantages that the traffic volume time series data of the corresponding time of each accident and the traffic volume time series data of the same place and the same time without traffic accidents are obtained through the loop data, so that the duration T of each accident can be accurately determined, and the traffic accident can be accurately divided into multiple accident categories.

[0020] Further: the traffic accident classification model is constructed by using the random forest method based on the historical traffic accident feature table, and the construction specifically includes the following steps:

[0021] According to the historical traffic accident feature table D, a first training set and a first test set are divided;

[0022] The bootstrap random sampling method is used to sample K times from the first training set, and each time an accident sample in the first training set is extracted to obtain K training samples;

[0023] From all M accident features in the historical traffic accident feature table, m (m < M) accident features are randomly extracted, and K base decision trees are generated according to the training samples and the extracted m accident features, and a random forest traffic accident classification model is constructed;

[0024] The feature values in the first test set are input into the random forest traffic accident classification model, and the parameters of the random forest traffic accident classification model are adjusted to obtain a final random forest traffic accident classification model.

[0025] The above further scheme has the beneficial effects that: by dividing the historical traffic accident feature table D and sampling training samples according to the first training set after division, base decision trees can be generated according to the training samples and the accident features sampled from the historical traffic accident feature table, and a random forest traffic accident classification model can be constructed to classify traffic accidents and determine the category to which the traffic accident belongs.

[0026] Further: the traffic accident classification establishes a traffic volume prediction model under the traffic accident, and the classified traffic volume data set is input into the traffic volume prediction model under the traffic accident for training and testing, which specifically includes the following steps:

[0027] According to the traffic volume data set B, a second training set and a second test set of each category are divided;

[0028] The traffic volume time series data in the second training set is normalized and mapped to the interval [0, 1], and the expression is:

[0029] q′=(q-q min ) / (q max -q min )

[0030] In the formula, q′ is the normalized traffic volume time series data; q is the traffic volume time series data of the second training set; q min is the minimum value of the traffic volume time series data in the second training set; q max is the maximum value of the traffic volume time series data in the second training set;

[0031] Traffic volume prediction models under traffic accidents are established by category, and the normalized traffic volume time series data in the second training set is used as input to train the BP neural network, resulting in multiple corresponding traffic volume prediction models based on the BP neural network.

[0032] The second test set in each of the traffic volume datasets B is used as the input to the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

[0033] The beneficial effects of the above-mentioned further scheme are: by dividing the traffic volume dataset B, the traffic volume time series data in the second training set can be normalized and then used to train the BP neural network to obtain multiple traffic volume prediction models based on the BP neural network. The traffic volume time series data in the second test set can be tested, and the parameters of the traffic volume prediction model under traffic accidents can be corrected to ensure the accuracy of the prediction results and facilitate the accurate acquisition of the corresponding prediction results.

[0034] Furthermore, the traffic volume prediction method under accident classification that considers traffic accident categories also includes the following steps:

[0035] A traffic volume prediction model for accidents without considering accident classification is established, and the traffic volume sequence of historical accidents is used as input for training and testing to obtain the corresponding traffic flow prediction model for accidents without considering accident classification.

[0036] Input the target traffic volume time series data into the accident traffic volume prediction model that does not consider traffic accident classification to obtain the target traffic volume prediction result for the accident without considering traffic accident classification.

[0037] The prediction results of target traffic volume under accidents considering traffic accident classification are compared with the prediction results of target traffic volume under accidents not considering traffic accident classification, and the effectiveness of the prediction is evaluated based on the error results of the two.

[0038] The beneficial effects of the above-mentioned further scheme are as follows: by establishing a traffic volume prediction model for accidents without considering traffic accident classification, and predicting the time series data of the target traffic volume, the prediction results of the target traffic volume under accidents without considering traffic accident classification are obtained. Then, the errors between the prediction results of the target traffic volume under accidents considering traffic accident classification and the prediction results of the target traffic volume under accidents without considering traffic accident classification are compared with the actual traffic volume values. The effectiveness of the prediction is compared based on the magnitude of the errors, and the prediction results are verified to ensure the accuracy and scientific nature of the prediction method.

[0039] The present invention also provides a traffic volume prediction system under accident considering traffic accident classification, including a data processing module, a traffic accident classification module and a traffic volume prediction module;

[0040] The data processing module is used for accident classification based on the duration of traffic accidents, and to build a historical traffic accident feature table and a traffic volume dataset for classification.

[0041] The traffic accident classification module is used to construct a traffic accident classification model based on the historical traffic accident feature table using the random forest method.

[0042] The traffic volume prediction module is used to classify and establish traffic volume prediction models under traffic accidents, and input the classified traffic volume dataset into the traffic volume prediction models under traffic accidents for training and testing.

[0043] The traffic volume prediction module is also used to input the target traffic volume time series data into the traffic volume prediction model for the corresponding category of traffic accidents after training and testing, and to obtain the target traffic volume prediction result under the accident considering the traffic accident classification.

[0044] The present invention provides a traffic volume prediction system for accidents that considers accident classification. Taking into account the different levels of impact of traffic accidents on traffic, the system divides accidents into several different categories based on the duration of the accidents and establishes traffic volume prediction models for each category. This system classifies accidents according to their impact characteristics and uses the prediction models for the corresponding categories to make predictions, thereby reducing the impact of traffic accident heterogeneity on traffic volume prediction and providing timely and accurate decision support for traffic management departments.

[0045] Based on the above technical solution, the present invention can be further improved as follows:

[0046] Further: The specific implementation of the data processing module in establishing a historical traffic accident feature table and a classified traffic volume dataset based on the duration of traffic accidents is as follows:

[0047] Based on the checkpoint data, obtain the traffic volume time series data corresponding to the time of each accident location, denoted as Q;

[0048] Based on checkpoint data, obtain time series data of traffic volume at the same location and time where no traffic accidents occurred, denoted as Q. * ;

[0049] Based on traffic volume time series data Q and traffic volume time series data Q * Obtain the duration T of each accident;

[0050] Traffic accidents are categorized into multiple accident types based on the duration T of each accident.

[0051] The checkpoint data is processed according to the accident category to obtain the traffic volume dataset B under the accident category.

[0052] The traffic accident alarm information is preprocessed to obtain the attribute values ​​and attribute categories of the accident, and the historical traffic accident feature table D is determined according to the above. The accident feature table includes time attributes, spatial attributes, accident-related attributes and weather attributes.

[0053] The beneficial effect of the above-mentioned further scheme is that by obtaining the traffic volume time series data of the road segment where each accident occurred and the traffic volume time series data of the same location and time where no traffic accident occurred, the traffic volume time series data of the road segment where each accident occurred can be obtained through the checkpoint data, so as to accurately determine the accident duration T of each accident, thereby conveniently and accurately classifying traffic accidents into multiple accident categories.

[0054] Further: The specific implementation of the traffic accident classification module, which constructs a traffic accident classification model based on the historical traffic accident feature table using the random forest method, is as follows:

[0055] The first training set and the first test set are divided according to the historical traffic accident feature table D;

[0056] The bootstrap random sampling method with replacement is used to sample the first training set K times. Each time, an accident sample is extracted from the first training set to obtain K training samples.

[0057] From all M accident features in the historical traffic accident feature table, m (m < M) accident features are randomly selected. Based on the training samples and the selected m accident features, K base decision trees are generated respectively, and a random forest traffic accident classification model is constructed.

[0058] The feature values ​​from the first test set are input into the random forest traffic accident classification model, and the parameters of the random forest traffic accident classification model are adjusted to obtain the final random forest traffic accident classification model.

[0059] The beneficial effect of the above-mentioned further scheme is that by dividing the historical traffic accident feature table D and sampling training samples based on the first training set after the division, a base decision tree can be generated based on the training samples and the accident features sampled from the historical traffic accident feature table, thereby constructing a random forest traffic accident classification model to classify traffic accidents and determine the category to which the traffic accident belongs.

[0060] Further: The traffic volume prediction module classifies and establishes traffic volume prediction models under traffic accidents, and the specific implementation of inputting the classified traffic volume dataset into the traffic volume prediction models under traffic accidents for training and testing is as follows:

[0061] The traffic volume dataset B is divided into a second training set and a second test set for each category.

[0062] The traffic volume time series data in the second training set are normalized and mapped to the interval [0, 1], as expressed by:

[0063] q′=(qq min ) / (q max -q min )

[0064] In the formula, q′ represents the normalized traffic volume time series data; q represents the traffic volume time series data of the second training set; q min The minimum value of traffic volume time series data in the second training set; q max The maximum value of the traffic volume time series data in the second training set;

[0065] Traffic volume prediction models under traffic accidents are established by category, and the normalized traffic volume time series data in the second training set is used as input to train the BP neural network, resulting in multiple corresponding traffic volume prediction models based on the BP neural network.

[0066] The second test set in each of the traffic volume datasets B is used as the input to the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

[0067] The beneficial effects of the above-mentioned further scheme are: by dividing the traffic volume dataset B, the traffic volume time series data in the second training set can be normalized and then used to train the BP neural network to obtain multiple traffic volume prediction models based on the BP neural network. The traffic volume time series data in the second test set can be tested, and the parameters of the traffic volume prediction model under traffic accidents can be corrected to ensure the accuracy of the prediction results and facilitate the accurate acquisition of the corresponding prediction results.

[0068] The present invention also provides a readable storage medium including a traffic volume prediction method program for accidents considering traffic accident classification, wherein when the traffic volume prediction method program for accidents considering traffic accident classification is executed by a processor, the steps of the method are implemented. Attached Figure Description

[0069] Figure 1 This is a flowchart illustrating a traffic volume prediction method under accident conditions that considers traffic accident classification, according to an embodiment of the present invention.

[0070] Figure 2 This is the original data processing flow according to an embodiment of the present invention;

[0071] Figure 3 This is a comparison diagram of the traffic volume prediction process under an accident considering traffic accident classification and the traffic volume prediction process under an accident not considering traffic accident classification, according to an embodiment of the present invention.

[0072] Figure 4 This is a comparison chart of traffic volume prediction results under accidents considering traffic accident classification and traffic volume prediction results without considering traffic accident classification, according to an embodiment of the present invention.

[0073] Figure 5 This is a comparison chart of the traffic volume prediction error under an accident considering traffic accident classification and the traffic volume prediction error under an accident not considering traffic accident classification, according to an embodiment of the present invention.

[0074] Figure 6 This is a schematic diagram of the structure of a traffic volume prediction system under accident classification, according to an embodiment of the present invention. Detailed Implementation

[0075] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.

[0076] like Figure 1 As shown, a traffic volume prediction method considering traffic accident classification includes the following steps:

[0077] S1: Accident classification based on the duration of traffic accidents, establishing a historical traffic accident feature table and a traffic volume dataset for classification;

[0078] S2: Based on the historical traffic accident feature table, a traffic accident classification model is constructed using the random forest method;

[0079] S3: Classify and establish a traffic volume prediction model under traffic accidents, and input the classified traffic volume dataset into the traffic volume prediction model under traffic accidents for training and testing;

[0080] S4: Input the target traffic volume time series data into the traffic volume prediction model for the corresponding category of traffic accident after training and testing, and make predictions to obtain the target traffic volume prediction results considering the traffic accident classification.

[0081] The present invention provides a traffic volume prediction method for accidents that considers accident classification. Taking into account the different levels of impact of traffic accidents on traffic, and based on the duration of traffic accidents, accidents are divided into several different categories and traffic volume prediction models are established for each category. This method enables the prediction of traffic volume by classifying accidents according to their impact characteristics and using the prediction model of the corresponding category, thereby reducing the impact of traffic accident heterogeneity on traffic volume prediction and providing timely and accurate decision support for traffic management departments.

[0082] In one or more embodiments of the present invention, the step of establishing a historical traffic accident feature table and a traffic volume time series set based on the duration of traffic accidents specifically includes the following steps:

[0083] S11: Obtain the traffic volume time series data for each accident location based on the checkpoint data, denoted as Q;

[0084] Here, in the embodiment of the present invention, the time span is 1 hour before the accident and 1 hour after the accident, with a time interval of 2 minutes. That is, the traffic volume time series of each accident includes 60 values, Q = {q1, q2, q3, ..., q...} 60}, where q1 is the traffic volume from 60 to 58 minutes before the accident, q2 is the traffic volume from 58 to 56 minutes before the accident, and q 31 q represents the traffic volume 0-2 minutes after the accident. 32 This refers to traffic volume 2-4 minutes after the accident, and so on.

[0085] S12: Obtain time-series traffic volume data for the same location and time where no traffic accidents occurred, based on checkpoint data, denoted as Q. * ,

[0086] S13: Based on traffic volume time series data Q and traffic volume time series data Q * Obtain the duration T of each accident;

[0087] Here, for each accident, Q and Q' are... * Compare using Q * For reference, let t be the time when the flow rate stabilizes after the accident. s If the time of the accident is t0, then the duration of the accident is T, where T = t0. s -t0.

[0088] S14: Traffic accidents are classified into multiple accident categories based on the duration T of each accident;

[0089] In embodiments of the present invention, traffic accidents are divided into four categories: short-term accidents (T≤15), medium-term accidents (15<T≤30), medium-to-long-term accidents (30<T≤45), and long-term accidents (T>45), which are denoted as 1, 2, 3, and 4, respectively.

[0090] S15: Process the checkpoint data according to the accident categories to obtain the traffic volume dataset B under the accident category; where B: {Q1, Q2, ..., Q4}, Q1 to Q4 are the time series sets of traffic volume under accident categories 1-4, respectively. Taking Q1 as an example, Q1 is a list of size i1×60, where i1 is the number of traffic accidents of category 1, as shown in the formula:

[0091]

[0092] S16: Preprocess the traffic accident alarm information to obtain the attribute values ​​and attribute categories of the accident, and determine the historical traffic accident feature table D according to the above, wherein the accident feature table includes time attributes, spatial attributes, accident-related attributes and weather attributes.

[0093] Here, for traffic accident alarm information, records with incomplete or incorrect information are removed, retaining only complete data related to the traffic accident. The compiled accident attributes include 11 attributes: time (whether it occurred on a weekday, during peak hours, or late at night), space (whether it occurred on a main road, at an intersection, and on the number of lanes), accident-related attributes (whether it involved large vehicles, multiple vehicles, whether the vehicles were moved, and whether an ambulance was needed), and weather (hourly rainfall). The values ​​for each attribute are as follows:

[0094] Table 1 Traffic Accident Attributes

[0095]

[0096] Note: 0 = No; 1 = Yes; hourly rainfall is measured in mm / h.

[0097] The feature vector of each traffic accident is d = (X1, X2, X3, ..., X...). 11 ,Y), where X1~X 11 The 11 attribute values ​​represent the accident; Y represents the category to which the accident belongs. The resulting accident feature table is D = [d1, d2, d3, ..., d...]. N ], where N is the total number of historical traffic accidents.

[0098] By using checkpoint data, we can obtain the traffic volume time series data for the road segment where each accident occurred and the traffic volume time series data for the same location at the same time when no traffic accident occurred, so as to accurately determine the duration T of each accident and thus conveniently and accurately classify traffic accidents into multiple accident categories.

[0099] In one or more embodiments of the present invention, the step of constructing a traffic accident classification model based on the historical traffic accident feature table using the random forest method specifically includes the following steps:

[0100] S21: Divide the first training set and the first test set according to the historical traffic accident feature table D;

[0101] For example, in an embodiment of the present invention, 70% of the historical traffic accident feature table D is used as the first training set, and the remaining 30% is used as the first test set.

[0102] S22: The bootstrap random sampling method with replacement is used to sample the first training set K times. Each time, an accident sample is extracted from the first training set to obtain K training samples.

[0103] Here, approximately two-thirds of the accident data from the first training set are extracted as samples each time.

[0104] S23: Randomly select m (m < M) accident features from all M (M = 11 in this invention) accident features in the historical traffic accident feature table, generate corresponding K basis decision trees based on the training samples and the selected m accident features, and construct a random forest traffic accident classification model.

[0105] In embodiments of the present invention, during the generation of the decision tree, the optimal feature is selected as the splitting feature at each split.

[0106] S24: Input the feature values ​​in the first test set into the random forest traffic accident classification model for testing, and adjust the parameters of the random forest traffic accident classification model to obtain the final random forest traffic accident classification model.

[0107] Specifically, after inputting 11 feature values ​​of historical traffic accidents in the first test set into the constructed random forest traffic accident classification model, each base decision tree in the random forest traffic accident classification model independently judges the accident. Each accident will obtain K classification results. Finally, the category to which the accident belongs is determined by the relative majority voting method. Then, the category to which the accident belongs in the test is compared with the category of the actual accident. If the prediction result of the accident category in the first test set meets the set accuracy requirement, the final random forest traffic accident classification model is obtained. Otherwise, the parameters of the random forest traffic accident classification model are adjusted until the accuracy of the prediction result of the accident category in the first test set meets the set accuracy requirement, and the final random forest traffic accident classification model is obtained.

[0108] By dividing the historical traffic accident feature table D and sampling training samples from the first training set after the division, a base decision tree can be generated based on the training samples and the accident features sampled from the historical traffic accident feature table. This allows for the construction of a random forest traffic accident classification model to classify traffic accidents and determine their category.

[0109] In one or more embodiments of the present invention, the classification to establish a traffic volume prediction model under traffic accidents, and the input of the classified traffic volume dataset into the traffic volume prediction model under traffic accidents for training and testing specifically includes the following steps:

[0110] S31: Divide the traffic volume dataset B into a second training set and a second test set for each category;

[0111] In this embodiment, 70% of the traffic volume time series under each of the four types of accidents is taken as the second training set, and the remaining 30% is taken as the second test set.

[0112] S32: Normalize the traffic volume time series data in the second training set. In this invention, the mapminmax function is used to normalize the traffic volume data in the training set before it is input into the neural network, and map it to the interval [0, 1]. The expression is:

[0113] q′=(qq min ) / (q max -q min )

[0114] In the formula, q′ represents the normalized traffic volume time series data; q represents the traffic volume time series data of the second training set; q min The minimum value of traffic volume time series data in the second training set; q max The maximum value of the traffic volume time series data in the second training set;

[0115] S33: Classify and establish traffic volume prediction models under traffic accidents, and use the normalized traffic volume time series data in the second training set as input to train the BP neural network to obtain multiple corresponding traffic volume prediction models based on the BP neural network.

[0116] Specifically, step S33 includes the following steps:

[0117] 1) Set the network activation function, transfer function, and initial parameters. Set the hidden layer activation function to the sigmoid function, with the expression:

[0118]

[0119] The output layer transfer function is a purelin linear function; the number of neurons in the input layer and the output layer are 30 and 10 respectively, the number of hidden layers is 1, the number of hidden layer neurons is 3, the number of training iterations is 1000, and the learning rate is 0.01.

[0120] 2) Use the first 30 traffic volumes of normalized Q1, Q2, Q3, and Q4 (i.e., the traffic volume time series 1 hour before the accident) as input to train the neural network:

[0121] The input layer of the neural network is:

[0122] X=(q′1, q′2, q′3…, q′ 30 )

[0123] The inputs to each neuron in the hidden layer are:

[0124] h i =ω 1i q′1+ω 2i q′2+…+ω 30i q′ 30

[0125] Where, ω i These are the weights from each neuron in the input layer to each neuron in the hidden layer;

[0126] The outputs of each neuron in the hidden layer are:

[0127] H i =S(h i -b i )

[0128] Where S(·) is the sigmoid function; b i The hidden layer threshold;

[0129] The inputs to each neuron in the output layer are:

[0130] y j =ω 1j H1+ω 2j H2+…+ω kj H k

[0131] Where, ω j where represents the weights from each neuron in the hidden layer to each neuron in the output layer; k is the number of neurons in the hidden layer.

[0132] The outputs of each neuron in the output layer are:

[0133] Y j =p(y j -b j )

[0134] Where p(·) is the purelin function; b j This is the threshold for the output layer.

[0135] 3) Backpropagation of errors is used for parameter tuning. The mean squared error loss function (MSE) is used to determine the difference between the predicted and actual values. The expression is:

[0136]

[0137] Among them, y i Let q be the traffic volume forecast. i Where n represents the actual traffic volume and n is the number of samples;

[0138] If the error does not meet the requirements, the weights and thresholds of each neuron are adjusted using the backpropagation method. After adjustment, the training is repeated according to the method in 2) above until the requirements are met, and the training is completed. The parameter tuning expression is:

[0139] ω=ω+ηeH

[0140] b=b+ηe

[0141] Where ω and b represent the weight and threshold, respectively; η is the learning rate; H is the number of nodes in the hidden layer; and e is the error signal value of the node.

[0142] S34: The second test set in each of the traffic volume datasets B is used as the input of the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

[0143] Specifically, the second test set in the various traffic volume datasets B is used as the input to the traffic volume prediction model under traffic accidents for testing, and the prediction results of the second test set are obtained. The prediction results of the second test set are compared with the actual values ​​of the second test set. If the accuracy of the prediction results of the second test set meets the set accuracy requirements, the final traffic volume prediction model under traffic accidents is obtained. Otherwise, the parameters of the traffic volume prediction model under traffic accidents are adjusted until the accuracy of the prediction results of the second test set meets the set accuracy requirements, and the final traffic volume prediction model under traffic accidents is obtained.

[0144] In one or more embodiments of the present invention, the traffic volume prediction method under accident considering traffic accident classification further includes the following steps:

[0145] S5: Establish a traffic volume prediction model for accidents without considering traffic accident classification, and use the traffic volume sequence of historical accidents as input for training and testing to obtain the corresponding traffic volume prediction model for accidents without considering traffic accident classification.

[0146] S6: Input the target traffic volume time series data into the accident traffic volume prediction model that does not consider traffic accident classification, and obtain the target traffic volume prediction result for the accident without considering traffic accident classification.

[0147] Specifically, using the traffic volume sequence of historical accidents as input, a BP neural network traffic volume prediction model that does not consider accident classification is established according to the method in S3, denoted as BP. o An unknown type of traffic accident is selected as the target traffic accident, and the traffic volume sequence before the target traffic accident is used as the target traffic volume time series input into BP. o The target traffic volume prediction result for this accident was obtained without considering the accident classification.

[0148] The specific process for predicting the target traffic volume after an accident, considering different accident categories, is as follows:

[0149] All M (M=11 in this invention) accident feature values ​​in the traffic accident feature table corresponding to the target traffic volume time series are input into the random forest traffic accident classification model and classified to obtain the classification result;

[0150] The target traffic volume time series is input into the traffic volume prediction model under the corresponding category of traffic accident to obtain the target traffic volume prediction result after the accident occurs under the corresponding traffic accident classification.

[0151] S6: Compare the target traffic volume prediction results under accidents that take into account traffic accident classification with the corresponding target traffic volume prediction results that do not take into account traffic accident classification, and evaluate the effectiveness of the prediction based on the error results of the two.

[0152] Specifically, the error metrics MAPE (Absolute Percentage Error), MSE (Mean Squared Error), and MAE (Mean Absolute Error) are used for comparison.

[0153]

[0154]

[0155] Among them, y i Let q be the traffic volume forecast. i denoted as actual traffic volume, and n as the number of samples.

[0156] If the error of the traffic volume prediction result under the accident considering traffic accident classification is smaller than the error of the traffic volume prediction result under the corresponding accident not considering traffic accident classification, then the prediction method of the present invention is effective.

[0157] A traffic volume prediction model is established for accidents without considering accident classification. The target traffic volume time series is then predicted to obtain the target traffic volume prediction results for accidents without considering accident classification. The errors between the target traffic volume prediction results for accidents considering accident classification and the target traffic volume prediction results for accidents without considering accident classification are compared with the actual traffic volume values. The effectiveness of the prediction is compared based on the magnitude of the errors, and the prediction results are verified to ensure the accuracy and scientific nature of the prediction method.

[0158] In the embodiments of the present invention, the traffic volume prediction method under accident conditions considering traffic accident classification of the present invention was verified by means of examples, as follows:

[0159] 1) Preprocessing alarm information. Non-accident alarm records were removed based on alarm type, and traffic volume data for accidents whose locations were not within the checkpoint coverage area could not be calculated. These accident records were also removed, and finally 274 historical traffic accidents with complete information were selected.

[0160] 2) Based on the original checkpoint data and alarm information, further processing is performed to establish a time series set of traffic volume and a set of traffic accident features under historical accidents, such as... Figure 2 As shown;

[0161] 3) Constructing a traffic accident classification model. The random forest traffic accident classification model is established using the sklearn random forest classification module in Python. After training with multiple parameter changes and comparing model performance, the parameters `max_features` are determined to be 0.7, `n_estimators` to be 60, and `max_depth` to be 6. Here, all 274 data points in the historical traffic accident feature table D are divided into a first training set and a first test set for each category. Then, the bootstrap random sampling method with replacement is used to sample K times from the first training set. Each time, accident samples are drawn from the first training set, resulting in K (the value of k is determined by the parameter `n_estimators` of the random forest traffic accident classification model) training samples. These are then randomly selected from all M (M=11 in this invention) accident features in the historical traffic accident feature table. m (m < M) accident features (the value of m is determined by the parameter max_features of the random forest traffic accident classification model) are selected. Then, based on the training samples and the m extracted accident features, K corresponding basis decision trees are generated, and a random forest traffic accident classification model is constructed. Finally, the feature values ​​in the first test set are input into the random forest traffic accident classification model for testing, and the parameters of the random forest traffic accident classification model are adjusted to obtain the final random forest traffic accident classification model. Then, one traffic accident of unknown category is taken as the target traffic accident, and the feature table Dx of the target traffic accident is input into the final random forest traffic accident classification model for classification, and its classification result is 3.

[0162] 4) Establish traffic volume prediction models for different accident categories. Using a backpropagation (BP) neural network, traffic volume prediction models BP1, BP2, BP3, and BP4 were trained for four different accident categories. After multiple experiments, and while meeting the training requirements, the combinations of hidden layer numbers and neuron numbers for the four models were determined to be 5×8, 5×16, 8×8, and 8×16, respectively.

[0163] Specifically, all traffic accidents with complete information in the traffic volume dataset B are divided into a second training set and a second test set, and normalized. Traffic volume prediction models under traffic accidents are established by category. The traffic volume time series data in the normalized second training set is used as input to train a BP neural network to obtain multiple corresponding traffic volume prediction models based on the BP neural network. Then, the second test set in each category of traffic volume time series data is used as input to test the traffic volume prediction models under traffic accidents, and the parameters of the traffic volume prediction models under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

[0164] 5) The traffic volume sequence 1 hour before the target traffic accident is used as the target traffic volume time series data to train and test the traffic volume prediction model BP3 for the corresponding category of the traffic accident, and the prediction result of the target traffic volume under the accident considering the traffic accident classification is obtained.

[0165] 6) Establish a traffic volume prediction model for accidents without considering accident classification, and use all 274 traffic volume sequences of historical accidents as input for training and testing to obtain the corresponding traffic volume prediction model BP without considering accident classification. o ;

[0166] 7) Input the traffic volume sequence 1 hour before the target traffic accident into BP as the target traffic volume time series data. o This yields the target traffic volume prediction results without considering accident classification.

[0167] 8) To compare the errors of traffic volume prediction methods that consider accident classification and those that do not, this example also calculates the actual traffic volume based on the original checkpoint data for easy comparison.

[0168] The processes of the two methods are compared, for example. Figure 3 As shown, the prediction results and errors of the two methods are compared as follows: Figure 4 and Figure 5 As shown.

[0169] from Figure 4 It can be seen that the traffic volume prediction method considering accident classification in this invention yields predictions closer to the actual values ​​than the method without considering accident classification. This demonstrates that the traffic volume prediction method considering accident classification in this invention can obtain more accurate prediction results. Figure 5 It can be seen that the prediction results obtained by the traffic volume prediction method considering accident classification in this invention have smaller errors than those obtained by the traffic volume prediction method without considering accident classification. In particular, the absolute percentage error (MAPE), mean square error (MSE), and mean absolute error (MAE) are all smaller than those obtained by the traffic volume prediction method without considering accident classification. Therefore, the traffic volume prediction method considering accident classification in this invention is effective.

[0170] like Figure 6 As shown, the present invention also provides a traffic volume prediction system under accident considering traffic accident classification, including a data processing module, a traffic accident classification module and a traffic volume prediction module.

[0171] The data processing module is used for accident classification based on the duration of traffic accidents, and to build a historical traffic accident feature table and a traffic volume dataset for classification.

[0172] The traffic accident classification module is used to construct a traffic accident classification model based on the historical traffic accident feature table using the random forest method.

[0173] The traffic volume prediction module is used to classify and establish traffic volume prediction models under traffic accidents, and input the classified traffic volume dataset into the traffic volume prediction models under traffic accidents for testing and training.

[0174] The traffic volume prediction module is also used to input the target traffic volume time series data into the traffic volume prediction model for the corresponding category of traffic accidents after training and testing, and to obtain the target traffic volume prediction result under the accident considering the traffic accident classification.

[0175] The present invention provides a traffic volume prediction system for accidents that considers accident classification. Taking into account the different levels of impact of traffic accidents on traffic, the system divides accidents into several different categories based on the duration of the accidents and establishes traffic volume prediction models for each category. This system classifies accidents according to their impact characteristics and uses the prediction models for the corresponding categories to make predictions, thereby reducing the impact of traffic accident heterogeneity on traffic volume prediction and providing timely and accurate decision support for traffic management departments.

[0176] In one or more embodiments of the present invention, the specific implementation of the data processing module establishing a historical traffic accident feature table and a classified traffic volume dataset based on the accident classification of traffic accident duration is as follows:

[0177] Based on the checkpoint data, obtain the traffic volume time series data corresponding to the time of each accident location, denoted as Q;

[0178] Based on checkpoint data, obtain time series data of traffic volume at the same location and time where no traffic accidents occurred, denoted as Q. * ;

[0179] Based on traffic volume time series data Q and traffic volume time series data Q * Obtain the duration T of each accident;

[0180] Traffic accidents are categorized into multiple accident types based on the duration T of each accident.

[0181] The checkpoint data is processed according to the accident category to obtain the traffic volume dataset B under the accident category.

[0182] The traffic accident alarm information is preprocessed to obtain the attribute values ​​and attribute categories of the accident, and the historical traffic accident feature table D is determined according to the above. The accident feature table includes time attributes, spatial attributes, accident-related attributes and weather attributes.

[0183] By using checkpoint data, we can obtain the traffic volume time series data for the road segment where each accident occurred and the traffic volume time series data for the same location at the same time when no traffic accident occurred, so as to accurately determine the duration T of each accident and thus conveniently and accurately classify traffic accidents into multiple accident categories.

[0184] In one or more embodiments of the present invention, the specific implementation of the traffic accident classification module constructing a traffic accident classification model based on the historical traffic accident feature table using the random forest method is as follows:

[0185] The first training set and the first test set are divided according to the historical traffic accident feature table D;

[0186] The bootstrap random sampling method with replacement is used to sample the first training set K times. Each time, an accident sample is extracted from the first training set to obtain K training samples.

[0187] From all M accident features in the historical traffic accident feature table, m (m < M) accident features are randomly selected. Based on the training samples and the selected m accident features, K base decision trees are generated respectively, and a random forest traffic accident classification model is constructed.

[0188] The feature values ​​in the first test set are input into the random forest traffic accident classification model, and each base decision tree in the random forest traffic accident classification model independently judges the traffic accident. Each traffic accident will obtain K classification results, and the category to which the traffic accident belongs is determined according to the relative majority voting method.

[0189] By dividing the historical traffic accident feature table D and sampling training samples from the first training set after the division, a base decision tree can be generated based on the training samples and the accident features sampled from the historical traffic accident feature table. This allows for the construction of a random forest traffic accident classification model to classify traffic accidents and determine their category.

[0190] In one or more embodiments of the present invention, the traffic volume prediction module classifies and establishes a traffic volume prediction model under traffic accidents, and inputs the classified traffic volume dataset into the traffic volume prediction model under traffic accidents for training and testing. The specific implementation of this is as follows:

[0191] The traffic volume dataset B is divided into a second training set and a second test set for each category.

[0192] The traffic volume time series data in the second training set are normalized and mapped to the interval [0, 1], as expressed by:

[0193] q′=(qq min) / (q max -q min )

[0194] In the formula, q′ represents the normalized traffic volume time series data; q represents the traffic volume time series data of the second training set; q min The minimum value of traffic volume time series data in the second training set; q max The maximum value of the traffic volume time series data in the second training set;

[0195] Traffic volume prediction models under traffic accidents are established by category, and the normalized traffic volume time series data in the second training set is used as input to train the BP neural network, resulting in multiple corresponding traffic volume prediction models based on the BP neural network.

[0196] The second test set in each of the traffic volume datasets B is used as the input to the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

[0197] By dividing the traffic volume time series data D, the traffic volume time series data in the second training set can be normalized and then used to train the BP neural network, resulting in multiple traffic volume prediction models based on the BP neural network. The traffic volume time series data in the second test set is then used to test the models and correct the parameters of the traffic volume prediction models under traffic accidents, ensuring the accuracy of the prediction results and facilitating the accurate acquisition of the corresponding prediction results.

[0198] The present invention also provides a readable storage medium including a traffic volume prediction method program for accidents considering traffic accident classification, wherein when the traffic volume prediction method program for accidents considering traffic accident classification is executed by a processor, the steps of the method are implemented.

[0199] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting traffic volume under accidents considering traffic accident classification, characterized in that, Includes the following steps: Based on the duration of traffic accidents, an accident classification system was established, including a historical traffic accident feature table and a traffic volume dataset for each category. Based on the historical traffic accident feature table, a traffic accident classification model is constructed using the random forest method. Traffic volume prediction models under traffic accidents are established by category, and the categorized traffic volume datasets are input into the traffic volume prediction models under traffic accidents for training and testing. The target traffic volume time series data is input into the traffic volume prediction model for the corresponding category of traffic accident after training and testing, and the prediction result of the target traffic volume under the accident considering the traffic accident classification is obtained.

2. The traffic volume prediction method under accident conditions considering traffic accident classification according to claim 1, characterized in that, The accident classification based on the duration of traffic accidents, and the establishment of a historical traffic accident feature table and a time series set of classified traffic volume, specifically include the following steps: Based on the checkpoint data, obtain the traffic volume time series data for the corresponding time of each accident location, and record it as follows: ; Based on checkpoint data, obtain time-series traffic volume data of the same location and time where no traffic accidents occurred, and record it as follows: ; Based on traffic volume time series data Traffic volume time series data Obtain the duration of each accident. ; Based on the duration of each accident Traffic accidents are categorized into multiple accident types; The checkpoint data is processed according to the accident category to obtain the traffic volume dataset under the accident. ; Traffic accident alarm information is preprocessed to obtain the accident's attribute values ​​and category, and a historical traffic accident characteristic table is determined. The accident feature table includes time attributes, spatial attributes, accident-related attributes, and weather attributes.

3. The traffic volume prediction method under accident conditions considering traffic accident classification according to claim 2, characterized in that, The construction of the traffic accident classification model based on the historical traffic accident feature table using the random forest method specifically includes the following steps: According to the aforementioned historical traffic accident characteristic table Divide the dataset into a first training set and a first test set; The bootstrap random sampling method with replacement is used to sample the first training set K times. Each time, an accident sample is extracted from the first training set to obtain K training samples. Randomly select from all M accident features in the historical traffic accident feature table ( ) accident characteristics, based on the training samples and the extracted Each accident feature generates a corresponding K basis decision tree, and a random forest traffic accident classification model is constructed. The feature values ​​from the first test set are input into the random forest traffic accident classification model, and the parameters of the random forest traffic accident classification model are adjusted to obtain the final random forest traffic accident classification model.

4. The traffic volume prediction method under accident conditions considering traffic accident classification according to claim 2, characterized in that, The classification process establishes a traffic volume prediction model under traffic accidents, and the classified traffic volume dataset is input into the traffic volume prediction model under traffic accidents for training and testing. Specifically, this includes the following steps: Based on the traffic volume dataset A second training set and a second test set are used to divide each category; The traffic volume time series data in the second training set are normalized and mapped to the interval [0,1], as shown in the expression: ; In the formula, This is the normalized traffic volume time series data; The second training set contains time-series traffic volume data. This represents the minimum value of the traffic volume time series data in the second training set; The maximum value of the traffic volume time series data in the second training set; Traffic volume prediction models under traffic accidents are established by category, and the normalized traffic volume time series data in the second training set is used as input to train the BP neural network, resulting in multiple corresponding traffic volume prediction models based on the BP neural network. Each of the aforementioned traffic volume datasets The second test set is used as input to the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

5. The traffic volume prediction method under accident conditions considering traffic accident classification according to any one of claims 1-4, characterized in that, It also includes the following steps: A traffic volume prediction model for accidents without considering accident classification is established, and the traffic volume sequence of historical accidents is used as input for training and testing to obtain the corresponding traffic volume prediction model for accidents without considering accident classification. Input the target traffic volume time series data into the accident traffic volume prediction model that does not consider traffic accident classification to obtain the target traffic volume prediction result for the accident without considering traffic accident classification. The prediction results of target traffic volume under accidents considering traffic accident classification are compared with the prediction results of target traffic volume under accidents not considering traffic accident classification, and the effectiveness of the prediction is evaluated based on the error results of the two.

6. A traffic volume prediction system considering traffic accident classification, characterized in that: It includes a data processing module, a traffic accident classification module, and a traffic volume prediction module; The data processing module is used for accident classification based on the duration of traffic accidents, and to build a historical traffic accident feature table and a traffic volume dataset for classification. The traffic accident classification module is used to construct a traffic accident classification model based on the historical traffic accident feature table using the random forest method. The traffic volume prediction module is used to classify and establish traffic volume prediction models under traffic accidents, and input the classified traffic volume dataset into the traffic volume prediction models under traffic accidents for training and testing. The traffic volume prediction module is also used to input the target traffic volume time series data into the traffic volume prediction model for the corresponding category of traffic accidents after training and testing, and to obtain the target traffic volume prediction result under the accident considering the traffic accident classification.

7. The traffic volume prediction system under accident conditions considering traffic accident classification according to claim 6, characterized in that, The data processing module, based on accident classification according to the duration of traffic accidents, establishes a historical traffic accident feature table and a classified traffic volume dataset. The specific implementation of this is as follows: Based on the checkpoint data, obtain the traffic volume time series data for the corresponding time of each accident location, and record it as follows: ; Based on checkpoint data, obtain time-series traffic volume data of the same location and time where no traffic accidents occurred, and record it as follows: ; Based on traffic volume time series data Traffic volume time series data Obtain the duration of each accident. ; Based on the duration of each accident Traffic accidents are categorized into multiple accident types; The checkpoint data is processed according to the accident category to obtain the traffic volume dataset under the accident. ; Traffic accident alarm information is preprocessed to obtain the accident's attribute values ​​and category, and a historical traffic accident characteristic table is determined. The accident feature table includes time attributes, spatial attributes, accident-related attributes, and weather attributes.

8. The traffic volume prediction system under accident classification considering traffic accident categories according to claim 7, characterized in that, The specific implementation of the traffic accident classification module, which constructs a traffic accident classification model based on the historical traffic accident feature table using the random forest method, is as follows: According to the aforementioned historical traffic accident characteristic table Divide the dataset into a first training set and a first test set; The bootstrap random sampling method with replacement is used to sample the first training set K times. Each time, an accident sample is extracted from the first training set to obtain K training samples. Randomly select from all M accident features in the historical traffic accident feature table ( ) accident characteristics, based on the training samples and the extracted Each accident feature generates a corresponding K basis decision tree, and a random forest traffic accident classification model is constructed. The feature values ​​from the first test set are input into the random forest traffic accident classification model, and the parameters of the random forest traffic accident classification model are adjusted to obtain the final random forest traffic accident classification model.

9. The traffic volume prediction system under accident classification considering traffic accident categories according to claim 7, characterized in that, The traffic volume prediction module classifies and establishes traffic volume prediction models under traffic accidents, and the specific implementation of inputting the classified traffic volume dataset into the traffic volume prediction models under traffic accidents for training and testing is as follows: Based on the traffic volume dataset A second training set and a second test set are used to divide each category; The traffic volume time series data in the second training set are normalized and mapped to the interval [0,1], as shown in the expression: ; In the formula, This is the normalized traffic volume time series data; The second training set contains time-series traffic volume data. This represents the minimum value of the traffic volume time series data in the second training set; The maximum value of the traffic volume time series data in the second training set; Traffic volume prediction models under traffic accidents are established by category, and the normalized traffic volume time series data in the second training set is used as input to train the BP neural network, resulting in multiple corresponding traffic volume prediction models based on the BP neural network. Each of the aforementioned traffic volume datasets The second test set is used as input to the traffic volume prediction model under traffic accidents for testing, and the parameters of the traffic volume prediction model under traffic accidents are adjusted to obtain the final traffic volume prediction model under traffic accidents.

10. A readable storage medium, characterized in that, The readable storage medium includes a traffic volume prediction method program that considers traffic accident classification. When the traffic volume prediction method program that considers traffic accident classification is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Expressway accident duration prediction method, electronic equipment and storage medium

    CN115018213A

  • Device for predictive calculation of traffic situation, predictive calculation program and predictive calculation method

    JP2011198132A