N ON - PARAMETRIC MACHINE LEARNING METHODS FOR EVALUATING THE EFFECTS OF TRAFFIC ACCIDENT DURATION ON FREEWAYS

: Traffic accidents usually cause congestion and increase travel-times. The cost of extra travel time and fuel consumption due to congestion is huge. Traffic operators and drivers expect an accurately forecasted accident duration to reduce uncertainty and to enable the implementation of appropriate strategies. This study demonstrates two non-parametric machine learning methods, namely the k-nearest neighbour method and artificial neural network method, to construct accident duration prediction models. The factors influencing the occurrence of accidents are numerous and complex. To capture this phenomenon and improve the performance of accident duration prediction, the models incorporated various data including accident characteristics, traffic data, illumination, weather conditions, and road geometry characteristics. All raw data are collected from two public agencies and were integrated and cross-checked. Before model development, a correlation analysis was performed to reduce the scale of interrelated features or variables. Based on the performance comparison results, an artificial neural network model can provide good and reasonable prediction for accident duration with mean absolute percentage error values less than 30%, which are better than the prediction results of a k-nearest neighbour model. Based on comparison results for circumstances, the Model which incorporated significant variables and employed the ANN method can provide a more accurate prediction of accident duration when the circumstances involved the day time or drunk driving than those that involved night time and did not involve drunk driving. Empirical evaluation results reveal that significant variables possess a major influence on accident duration prediction.


Introduction
Traffic accidents usually cause considerable speed reduction and congestion on freeways due to lane closures or obstacles.For fifty large U.S. urban areas, the cost of extra travel time and fuel consumption due to congestion annually amounts to approximately $37.5 billion (Winston & Langer, 2006).To mitigate the impacts due to congestion, traffic management centres usually develop accident management programs.The aims of these programs include exploration of the important factors of accidents, detection of accidents, and provision of accident information forecasts.The impacts of each accident, i.e., duration and resulting congestion queue, may be affected by different features.Relevant features include continuous and/or categorical data, such as accident type, accident characteristics, the number of injuries or fatalities, illumination, type of vehicle involved, road geometry characteristics, and weather conditions.If these data can be processed and analysed effectively, traffic patterns under the influence of accidents could be adequately characterized for various applications in transportation.Therefore, the objectives of this study are to collect, cross-check, and integrate accident features and traffic data for an accident duration forecasting model on a freeway.The model is based on a related accident database maintained by several public agencies.The proposed forecasting models apply a correlation analysis to select significant variables and employ k-nearest neighbour (kNN) and artificial neural network (ANN) approaches to develop a relationship between the selected variables and Ying Lee, Chien-Hung Wei, Kai-Chon Chao Non-parametric machine learning methods for evaluating the effects of traffic accident duration on freeways 92 accident duration.To demonstrate the performance of the proposed procedure, model performance evaluation is conducted to compare the prediction performance of models with and without correlation analysis and compare the prediction performances for the significant circumstances.The remainder of this paper is divided into the following sections.Relevant literature is reviewed and assessed in Section 2. Section 3 presents data sources and data analysis.Section 4 provides a brief introduction to the methodologies and a model evaluation indicator.Section 5 illustrates the evaluation results of four prediction models.Finally, Section 6 presents concluding remarks and suggestions for future research.

Literature Review 2.1. Accident duration forecast
Many types of incidents occur on highways.Whether it is a serious traffic accident or a falling object, the event can be referred to as an incident that occurs on the road.To reduce the uncertainty of travellers during an incident, several researchers have investigated the relationship between incident duration and traffic/incident data to estimate/forecast accident duration.Kim and Chang (2011) developed a hybrid prediction model for freeway incident duration.It consists of a rule-based tree model (RBTM), a multinomial logit model (MNL), and a naïve Bayesian classifier (NBC).The decision tree model involves a five-step procedure.It classifies the incident duration data from a database according to incident type, and constructs a rule-based tree under the incident conditions.The results show that incident durations of 120 to 180 minutes and 180 to 240 minutes have satisfactory outcomes.The model performs well for incidents of less than 60 minutes or longer than 300 minutes.Zhan et al. (2011) applied a regression method and the M5P tree algorithm to predict the lane clearance time of an incident for five scenarios.The model inputs included time of day, day of the week, lighting condition, the number of vehicles involved in the incident, vehicle type involved in the incident, and the number of lanes occupied in the incident.The results of the model showed that incidents that occurred during weekends or those that involved buses or trucks have longer lane clearance times.When the incidents occurred during the daytime period on weekdays, the lane clearance times were shorter.The mean absolute percent error (MAPE) of model performance during prediction was about 42%.When the incident duration was longer than 30 minutes, the prediction error increased and the MAPE value was higher than 78%.Khattak et al. (2012) analysed traffic incidents and presented iMiT (incident management integration tool) to dynamically predict incident durations.Based on a statistical regression method, the prediction model incorporated time of day, weather conditions, incident location, the number of vehicles involved in the incident, and incident type as the inputs.The MAPE of model performance in estimation and prediction was lower than 55% and displayed reasonable estimation and prediction results.Li (2015) applied a survival analysis model to develop an incident duration prediction model during three incident duration stages.When the incident duration was between 15 and 60 minutes, the MAPE of model performance was lower than 47% and exhibited reasonable prediction behaviour.When the incident duration was short (less than 15 minutes) or long (greater than 60 minutes), the prediction error was large and the MAPE value was higher than 61%.Chung et al. (2015) proposed an accelerated failure time model to forecast accident duration and evaluate model performance for the number of lanes blocked.Their results indicated that the accident duration with no blocked lanes was less than those with two or three blocked lanes.However, the accident duration with one blocked lane was less than those with no blocked lanes.Most studies agree that the data or information collected from management processes can improve the accuracy of predicted incident duration for model development.For incident duration model development, Qi and Teng (2008) (Spławińska, 2015;Pamula, 2012).Thus, kNN and ANN were chosen as the key analytical techniques in this study.

Feature selection with correlation analysis
Most researches incorporate high-dimensional data to describe and distinguish complex objects.However, large feature vectors may result in some disadvantages to the model, such as longer model training time and more noise in model development.
To avoid these problems, the feature vectors must be properly reduced (Lee & Wei, 2009).Correlation is a technique for determining whether a linear relationship exists between two variables.The closer the correlation coefficient is to ±1, the stronger the linear relationship between the two variables is.Therefore, conducting a correlation analysis is useful for distinguishing significant independent features from dependent features before model development.Zhang (2000) presented a prediction algorithm using artificial neural networks.The model was determined by correlation analysis.The parameters of the model can be obtained through nonlinear optimization.Preliminary studies showed that this approach can yield reasonably accurate results.Based on the discussed literatures, it is clear that conducting research on accident duration is as important as on travel time prediction during an incident.In order to reduce the impact of incidents on travel time prediction, this study identifies significant accident features and develops accident duration prediction models.

Data 3.1. Study site
This study selected the Taiwan National Freeway No. 5 (from the Nan-Gang system interchange to the Su-Ao interchange) as the site of the case study.This double-lane road is 54-kilometers long and has seven interchanges as indicated in Figure 1.The distance between two neighbouring vehicle detectors (VDs) is about 2 km.There are five tunnels in the case study site, including the Hsueh-Shan Tunnel, which is the fifth longest tunnel in the world.

Data sources
Currently, two public agencies, namely the National Police Agency (NPA) and the National Freeway Bureau (NFB), maintain separate raw data regarding traffic accident information on National Freeway No. 5 in Taiwan.The traffic data from NFB includes incident duration and location.The accident data from NPA is the primary source providing detailed information of accident features and environmental factors at an accident site, such as the number of fatalities/injuries, weather conditions, and pavement conditions.To incorporate all information in this study, all data from these two databases require integration and cross-checking.The relevant features of these two databases are listed below: The National Freeway Bureau In order to obtain the information of accident duration, this study integrates the above database with the Tow Truck Service Report database maintained by the NFB.Thus, the start time and clear-up time of an accident is practically available to evaluate the associated impact, i.e., accident duration.
A total of 239 accidents on National Freeway No. 5 were recorded during 2012 in the NPA database.However, most accident records are for the purpose of liability appraisal rather than for accident duration prediction.Therefore, integration with the NFB database is required due to the availability of clearance time of accidents.Consequently, a data set of 49 accidents on National Freeway No. 5 is obtained that combines the response time (Nation Police Agency) and clearance time (National Freeway Bureau).
The NFB installs VDs on highways to record traffic data such as speed, volume, and occupancy.Traffic patterns and variations during an accident can be adequately characterized by these data.Therefore, the accident duration can be obtained and verified by analysing these data.This study also incorporates the average speed and average volume as the model features.The traffic data from the VD were accumulated at an interval of five minutes.

Accident duration
The accident duration in this study represents the period between the time an accident is reported and the time when all handlers leave the accident site.The minimum, maximum, and average durations for 46 accidents were 14, 108, and 42 minutes.

Independent variables
An accurate accident duration forecast will assist a driver to decrease uncertainty.The factors influencing an accident are numerous and complex.
It is a challenge to accurately predict the impact of an accident due to the uncertainties involved.To capture the phenomenon of accidents, the independent variables incorporated in an accident duration forecasting model were selected from the NPA and NFB databases as shown in Table 3.Most accidents occurred during peak hours (52.2%+21.7%),rainy days (37%), night time (58.7%), at road sections with flexible pavements (95.7%), at road sections with direction facility (e.g., jersey barrier) (65.2%), and as a result of drunk driving (45.7%).Type A1 accidents did not occur during the data collection period.Most variables, such as average upstream speed, average upstream volume, time of day, and weather conditions, can be collected immediately from the database after an accident has been reported to the traffic management centre.This study incorporated all the collected variables to develop the accident duration prediction model and evaluate the model performance.Details are presented in Section 5.
Ying Lee, Chien-Hung Wei, Kai-Chon Chao Non-parametric machine learning methods for evaluating the effects of traffic accident duration on freeways 96

Model construction -Artificial Neural Networks
The ANN model is a structure describing the complex nonlinear relations between input and output variables.An artificial neuron is a computational model inspired by natural neurons.These consist of inputs, which are multiplied by weights to determine the activation of a neuron.Another function computes the output of the artificial neuron.ANNs combine artificial neurons in order to process information.The ANN model is based on the biological neural system and has been widely applied to prediction and classification problems.The most popular learning algorithm is the back-propagation network.The ANN algorithm was run with the MATLAB software, which allows continuous and categorical data to be defined clearly.The initial weights from the input layer to the hidden layer were default random values and adjusted in the process until the result was stable and acceptable.In the model structure setting, one hidden layer was chosen and the optimal number of hidden units was determined with the performance index embedded in the software.Before model training, 60% of the samples were randomly selected as the training data and the remaining 40% were selected as the testing data.A typical ANN structure is shown in Figure 2, where the output "y" denotes the accident duration for the accident duration prediction model; the input "x" represents accident and traffic features; "z" stands for the node of the hidden layer; and "w" indicates the weight of the path.The network paradigm is a multilayer perceptron (MLP).In this study, the number of neurons in the input layer was determined by the features discussed in Section 3.4.The output layer represented the accident duration for the accident duration prediction model.

Variable selection -Correlation analysis
To confirm the significant variables and resulting impacts for model construction, all the accident data collected in this study need to be analysed via a correlation analysis.The sample set of accident data collected is a comprehensive collection that covers most of the items recorded in the database.Thus, we first need to specify similar features in order to reduce the complexity of the data set.Relevant literature (Kim & Chang, 2011; Qi & Teng, 2008) indicates that weather conditions, illumination, temporal characteristics, involved vehicle characteristics, and cause of an accident are significant factors in model construction.Many items for each accident are recorded in the two accident databases.After excluding irrelevant items, correlation analysis is conducted to identify features that have a significant impact on accident duration.The evaluation of accident features is based on the correlation coefficient, r.To describe the correlation coefficient, accident duration is defined as the dependent variable y and each individual feature is defined as an independent variable x.When an independent variable is both quantitative and continuous, the Pearson correlation coefficient is used to compute the correlation coefficient.Point-Biserial Correlation is a special case of the Pearson correlation in which the independent variable is a dichotomous variable.When the independent variable is a binary variable, the correlation coefficient is computed by Equation 3 as follows:   ( 1) where: r denotes the correlation coefficient; -1 M represents the mean value of y when the value of the independent variable x is 1; -0 M indicates the mean value of y when the value of the independent variable x is 0; -n1 denotes the number of independent variables x whose values are 1; -n0 represents the number of independent variables x whose values are 0.
The results of the correlation analysis for the accident duration prediction model are presented in Table 4.The correlation analysis yielded a high significance at a confidence level of 99% for the following variables: Average volume at upstream, the number of injuries, crash into roadside parapets, and accident severity.An additional five variables, namely rainy day, day time, pavement condition, drunk driving, and the number of vehicles involved, significantly correlated with accident duration at a confidence level of 95%.
Vol. 43 # involved vehicles -0.282 * 0.038 #: the number of *: indicates that the independent variable significantly correlated with accident duration at a confidence level of 95%.**: indicates that the independent variable significantly correlated with accident duration at a confidence level of 99%.

Performance evaluation
Evaluation of model accuracy is required in order to assess the performance of the prediction models.The mean absolute percentage error (MAPE) is a summary measure widely used for evaluating the accuracy of prediction results (Zhan et Ying Lee, Chien-Hung Wei, Kai-Chon Chao Non-parametric machine learning methods for evaluating the effects of traffic accident duration on freeways 100 where: actual i V denotes the actual value of observation; predicted i V represents the predicted value of observation; n indicates the sample size. The lower the MAPE value is, the more accurate the prediction model will be.A MAPE value less than 10% indicates a highly accurate prediction; a MAPE value between 11% and 20% means a good prediction; and a MAPE value between 21% and 50% refers to a reasonable prediction.The threshold of MAPE was suggested by Lewis (1982).

Evaluation
Since the fundamental theory of the kNN and ANN training algorithms are stochastic-oriented, various combinations of initial weights and hidden units may lead to different states of convergence.The literature, however, does not offer a general guideline as to determining the best choice.Therefore, a suitable number of trials should be implemented to verify the performance of the proposed kNN and ANN models.Given the sample set of 46 accidents prescreened with the corresponding accident duration times, ten experiments were conducted for examining the proposed methodology.In each experiment, 60% of the data was randomly selected as the training set from the sample set and the remaining 40% of data served as the testing set.Four accident duration prediction models were developed in this study.Both Models 1 and 2 utilized the kNN method as the key algorithm.Model 1 incorporated all the variables in Table 3 while Model 2 incorporated the significant variables in Table 3.Both Models 3 and 4 used the ANN method as the key algorithm.Model 3 incorporated all the variables in Table 3 and Model 4 incorporated the significant variables in Table 3.The same training/testing set was applied to the four models in each experiment.

Results of the accident duration prediction model
Table 5 depicts the results of the ten experiments.The average MAPE values were below 48% for each type of model, yielding a level of reasonable prediction.For most experiments, Model 4 which applied the ANN method and incorporated the significant variables provided the best prediction results and the MAPE values close to 20%.Based on the results of model evaluation, Model 4 can provide good and reasonable predictions.The performances of the model that incorporated significant variables were better than those that incorporated all the variables.The models that applied the ANN method could predict the accident duration more accurately than those that applied the kNN method.6 compares the performance of the two models which applied the kNN method.The average performance of Model 2 was slightly better than the average performance of Model 1 and the average improvement was about 2.4%.The second column of Table 6 compares the performance of the two models which applied the ANN method.The average performance of Model 4 was better than the average performance of Model 3 and the improvement was about 18.4%.This result indicates that Model 2 and Model 4 may be considered a potential candidate approach to predict accident duration when a suitable set of accident variables is provided.
The third column of Table 6 compares the performance of the two models which incorporated all the variables.The average performance of Model 101 3 was better than the average performance of Model 1 and the average improvement was about 34.7%.The fourth column of Table 6 compares the performance of the two models which incorporated significant variables.Similarly, the average performance of Model 4 was better than the average performance of Model 2 and the average improvement was about 44.3%.Based on the aforementioned results, the ANN method is more efficient in developing the relationship between traffic/accident data and accident duration than the kNN method when the models incorporate the same variables.
Figure 3 shows the performance assessment with respect to the predicted accident duration vs. actual accident duration.Generally speaking, most data points are scattered along the 45° line with a reasonable distance (discrepancy), especially the plots of Model 4.  Ying Lee, Chien-Hung Wei, Kai-Chon Chao Non-parametric machine learning methods for evaluating the effects of traffic accident duration on freeways 102 As can be seen, most plots of Model 2 are closer to the 45° line than most plots of Model 1; meanwhile, most plots of Model 4 are closer to the 45° line than most plots of Model 3.This indicates that the prediction of models that incorporate significant variables can match the actual accident duration.Most plots of Model 3 are closer to the 45° line than most plots of Model 1; meanwhile, most plots of Model 4 are closer to the 45° line than most plots of Model 2. This implies that the models that apply the ANN method may sufficiently capture the relationship between the inputs (accident features) and the output (accident duration).

Performance comparison for circumstances
Table 7 shows the MAPE values and p-values of a ttest for two circumstances of each feature for a comparison of the prediction performance.The statistic t-test was used to test the equality of MAPE values for two circumstances of each feature.The p-values were greater than 0.05 and the MAPE values for the four models were not significantly different between (i) rainy days and other weather conditions, (ii) dry and wet pavement conditions, and (iii) a crash into a roadside parapet and other collision type.This result means that the four models can provide a similar prediction performance in all types of weather conditions, pavement conditions, and collision type.Based on the p-values below 0.05, Model 4, which incorporated significant variables and employed the ANN method, can provide a more accurate prediction of accident duration when the circumstances involved the day time or drunk driving than those that involved night time and did not involve drunk driving.For Model 1 and Model 2, the p-values between Type A2 and Type A3 accidents were less than 0.05 and the MAPE values of the Type A2 accident were significantly lower than those of the Type A3 accident.This result shows that the models that apply the kNN method may better capture the phenomenon of the Type A2 accident than that of Type A3.

Fig. 2 .
Fig. 2. The structure of an ANN model

Fig. 3 .
Fig. 3. Assessment results of the four models

Table 1 . Recent studies of highway accident duration prediction Researcher Methodology Characteristics for model input Best model performance Study area
(2009)applied a correlation method to select the important features as the inputs for a pattern recognition model.The experimental results showed that the model selected 37 features from 73 features by the correlation method and achieved 90% classification accuracy rate in pattern recognition.
Chung et al., 2015 Accelerated failure time model Temporal, Weather, Accident, Traffic -Taiwan Ying Lee, Chien-Hung Wei, Kai-Chon Chao Non-parametric machine learning methods for evaluating the effects of traffic accident duration on freeways 94 Guo and Nixon

Table 3 .
Independent variables

Table 4 .
Correlation coefficients of accident duration and features

Table 5 .
The MAPE values of the accident duration prediction model

Table 6 .
The difference of model performance

Table 7 .
A comparison of model performance by circumstance