You are on page 1of 13

Accident Analysis and Prevention 178 (2022) 106848

Contents lists available at ScienceDirect

Accident Analysis and Prevention


journal homepage: www.elsevier.com/locate/aap

Developing a new real-time traffic safety management framework for urban


expressways utilizing reinforcement learning tree
Kui Yang a, *, Mohammed Quddus b, Constantinos Antoniou a
a
TUM School of Engineering and Design, Technical University of Munich, Arcisstraße 21, 80333 Munich, Germany
b
Department of Civil and Environmental Engineering, Imperial College London, Exhibition Road, London SW7 2AZ, United Kingdom

A R T I C L E I N F O A B S T R A C T

Keywords: One of the main objectives of an urban traffic control system is to reduce the crash frequency and the loss caused
Urban expressways by these crashes on urban expressways. Real-time crash risk prediction (RTCRP) is an essential technique to
Traffic safety identify crash precursors so as to take proactive measures to smooth traffic fluctuations. In addition, automatic
Real-time crash risk prediction
incident detection (AID) is another important approach to timely detect an incident so as to design counter­
Automatic crash detection
Reinforcement learning tree
measures that reduce any negative impacts on traffic dynamics. With the introduction of disruptive technologies
in transport, highly disaggregated large datasets have started to emerge for modelling while existing modelling
techniques utilized in RTCRP and AID may not be able to accurately predict traffic crashes in real-time.
Therefore, this paper proposes a state-of-the-art reinforcement learning tree (RLT) approach to develop
RTCRP model and automatic crash detection (ACD) model similar to AID, and further utilizes it to build a real-
time traffic safety management framework for urban expressways with the input of online traffic data streaming.
Recorded traffic flow data and historical crash data were extracted and integrated to develop and implement
both RTCRP models and ACD models. The prediction results were compared with the frequently used logistic
regression (LR), support vector machine (SVM) and deep neural network (DNN) and a sensitivity analysis for
variable effects was conducted. The results confirm that RLT outperforms LR, SVM and DNN in developing
RTCRP and ACD models. At the cost of 10% false-alarm rate, about 96% of the crashes were predicted or detected
correctly by the proposed framework. The results also indicate that: i) collecting more data is helpful to improve
the predictive performance and approximatively a minimum sample size of 20 observations per variable is
reasonable for training RLT models; and ii) obtaining more factors is beneficial to improve the predictive per­
formance. With the RLT approach, it was demonstrated that selected important variables also have the capability
to provide reasonable predictive performance.

1. Introduction recently become important research topics. The overall purpose of


RTCRP is to predict the probability of crash occurrence in advance or in
There are around 3,700 traffic fatalities per day on the roads around real-time via a calibrated model and to identify the crash-prone traffic
the world and the traffic safety problem has been deteriorating over time conditions for a proactive traffic management system (Yang et al., 2019;
(World Health Organization, 2018). Additionally, road traffic crashes Hossain et al., 2019). Moreover, the goal of AID is to identify the inci­
cause millions of severe injuries and result in a loss of 3 % of gross do­ dent occurrence on a road network by analyzing the changing of the
mestic products (GDP) in most countries (World Health Organization, traffic flow characteristics (Masters et al., 1991) so as to reduce impacts
2018). With the wide use of traffic detection devices and the techno­ of incidents, both in terms of throughput and safety.
logical advances in data storage and data mining, real-time collection of In existing studies, many artificial intelligence techniques and
traffic flow data has been possible. This facilitates to detect unstable traditional statistical models have been applied to develop models for
traffic dynamics and traffic incidents in real-time lead to proactive real-time crash risk prediction (RTCRP) and automatic incident detec­
traffic safety management. Therefore, studies related to real-time crash tion (AID). Although they can achieve the reasonable prediction accu­
risk prediction (RTCRP) and automatic incident detection (AID) have racy, the performance of these models can further be enhanced by

* Corresponding author.
E-mail addresses: kui.yang@tum.de (K. Yang), m.quddus@imperial.ac.uk (M. Quddus), c.antoniou@tum.de (C. Antoniou).

https://doi.org/10.1016/j.aap.2022.106848
Received 19 May 2022; Received in revised form 21 August 2022; Accepted 15 September 2022
Available online 26 September 2022
0001-4575/© 2022 Elsevier Ltd. All rights reserved.
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

utilizing more advanced modelling techniques. In addition, the gener­ approach to develop RTCRP models with the help of a limited dataset. It
alized definition of incidents is any non-recurring event that causes a found that compared with the model trained by the limited data, meta-
reduction of roadway capacity or an abnormal increase in demand, such regression could improve the prediction performance significantly.
as traffic crashes, disabled vehicles, spilled cargoes and debris, special Exploring RTCRP modelling techniques with the good prediction
events, or any other event that significantly affects roadway operations performance is one of the most important research points. For example,
(Mandzuka et al., 2011). Similarly, this paper focuses on automatic deep learning technique (e.g., Huang et al., 2020; Basso et al., 2021) and
crash detection (ACD) to detect the crash occurrence since only crash its improvements such as deep generative models (Cai et al., 2020), long
cases are included in our dataset. Note that a crash in this paper is short-term memory convolutional neural network (LSTM) (Yuan et al.,
defined as the collision of one motor vehicle with other vehicle (s). 2019), LSTM convolutional neural network (LSTM-CNN) (Li et al., 2020)
This paper is, therefore, to apply the reinforcement learning tree and convolutional neural networks (Yu et al., 2020) were employed to
(RLT), which is a state-of-the-art reinforcement learning based develop crash risk prediction models. They have achieved the good
approach, to formulate real-time crash risk prediction (RTCRP) and performance. In addition to the freeway and urban expressways, some
automatic crash detection (ACD) models. By taking advantage of rein­ researchers focus on ramps (e.g., Wang et al., 2019), signalized in­
forcement learning in the tree construction processes and the variable tersections (e.g., Zheng and Sayed, 2020; Yuan et al., 2020) and arterials
muting procedure, RLT has significantly improved performance (e.g., Li et al., 2020) for the RTCRP studies, including investigating the
compared to state-of-the-art methods (i.e. support vector machines and development and transferability of the real-time safety performance
deep neural network), especially when the true model structure is sparse models of signalized intersections (Essa et al., 2019), extreme value
and the dimension is high (Zhu et al., 2015). analysis for RTCRP at signalized intersections (Zheng and Sayed, 2020;
For the purpose of employing reinforcement learning tree (RLT) to Fu and Sayed, 2022), self-learning adaptive signal control optimization
develop both RTCRP and ACD models, recorded traffic flow data and for real-time safety (Essa and Sayed, 2020), evaluation and quantifica­
historical crash data from urban expressways in Shanghai, China were tion of the importance of flow composition in RTCRP (Basso et al.,
combined based on a matched case-control design and then divided into 2020), modeling real-time cycle-level crash risk based on high-
training data and test data. The training data was used to identify the resolution event-based data (Yuan et al., 2020), and etc. Except as
important variables with the use of RLT and then to develop the RTCRP traditional traffic flow data, some new data types such as vehicle-by-
and ACD models. The prediction performance of models was evaluated vehicle data (Basso et al., 2022) and floating car trajectory data
by the test data. A comparison with two state-of-the-art classification (Wang et al., 2019), are applied to conduct RTCRP studies. For instance,
models was made by using the performance measure – the area under Ali et al. (2022) used a driving simulator to collect trajectory data to
ROC curves (AUC). In addition, some model explorations related to the quantify mandatory lane-changing crash risk in the traditional and
application of RLT were conducted, including RLT prediction perfor­ connected environments by employing an extreme value theory
mance in a small sample environment, the impact of variable selections, approach. It proved that the connected environment could significantly
and the validation by the full dataset, and a sensitivity analysis. Finally, reduce mandatory lane-changing crash risk compared with traditional
a traffic safety management framework based on RLT for urban ex­ environments. After obtaining the crash risk, the reinforcement learning
pressways with real-time traffic data streaming was developed. technique is used to develop intelligent interventions for real-time
proactive road safety management, such as reinforcement learning-
2. Related work based variable speed limits (VSL) control framework (Li et al., 2020;
Roy et al., 2022), multi-objective reinforcement learning approach for
2.1. Real-time crash risk prediction studies adaptive traffic signal control intersections (Gong et al., 2020), and
combined variable speed limit and lane change guidance based on
Given the technical improvement of traffic flow monitoring and data distributed deep reinforcement learning (Peng and Xu, 2021). For
analysis, the traffic flow data from traffic monitoring devices (e.g., instance, Roy et al. (2022) used the reinforcement learning algorithm to
traffic inductive-loop detectors, camera, microwave radar, etc.) are develop VSL for proposing a proactive road safety management system
applied to analyze the traffic flow characteristics, crash characteristics including a RTCRP model. The simulation experiment proved that this
etc. Since the beginning of this century, numerous studies have applied proposed real-time system could reduce the crash risk by 19 %.
various statistical models or machine leaning methods to identify crash Hossain et al. (2019) discussed the development pathways, chal­
factors, to investigate the relationship between the crash risk and pa­ lenges and ubiquitous requirements of a universal RTCRP model from
rameters of traffic flow, to reveal crash mechanisms and to further existing literature. It clarified that the model prediction ability is still
predict real-time crash risk, e.g., Abdel-Aty and Pemmanaboina, 2006; one of the most important challenges from the concept of RTCRP tech­
Zheng et al., 2010; Yu and Abdel-Aty, 2013; Wang et al., 2015; Basso niques to the real-world implementation of an active traffic safety
et al., 2018; Yang et al., 2018, 2019. For instance, Yang et al. (2019) management system. Therefore, this paper aims to explore new
proposed a recurrent neural network (RNN) to conduct the model modelling methods in the model development of RTCRP with higher
development of the real-time crash risk prediction. It found that RNN prediction performance.
outperformed the logistic regression model and support vector machine
(SVM), since RNN can update its own parameters via a time sequence, 2.2. Automatic incident detection
which improves its adaptability for traffic dynamics with the spa­
tial–temporal variability. Abdel-Aty et al. (2004) adopted a matched In the 1970s, there were some studies that investigate the incident
case-control logistic regression model to develop crash likelihood pre­ detection on roads. For example, Dudek et al. (1974) developed an
diction models based on the underground sensor data and crash data. automatic incident detection model with the help of the standard normal
Zheng et al. (2010) also used a matched case-control design to develop a deviation of the control variable (energy or lane occupancy) on urban
case-control sample including crash cases and non-crash cases from freeways in 1974. Incident detection was an important research hotspot
high-resolution traffic and crash data from a freeway segment. It in transportation fields. So far, various models and methods have been
employed a conditional logistic regression model to explore how traffic introduced to detect incidents quickly to help traffic managers to take
oscillations affects traffic safety. Yu and Abdel-Aty (2013) investigated measures quickly to further reduce the impact of incidents on traffic flow
the application of SVM in the model development of RTCRP. The results and drivers, e.g., neural networks (Dia and Rose, 1997; Samant and
found that the SVM model based on radial kernel functions had better Adeli, 2001), wavelet technique (Teng and Qi, 2003), time-series anal­
prediction performance than Bayesian logistic regression model. Xu ysis techniques (Ahmed and Cook, 1982), Bayesian network (Zhang and
et al. (2015) employed Bayesian meta-analysis and Bayesian inference Taylor, 2006), support vector machine (SVM) (Xiao, 2019), generative

2
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

adversarial networks (Lin et al., 2020), hybrid deep learning model (Li Table 1
et al., 2020), partial least squares regression (Wang et al., 2008), and Calculation steps of reinforcement learning trees.
probabilistic topic model (Kinoshita et al., 2015). For instance, Lin et al. 1. Select T bootstrap samples from the whole dataset D.
(2020) firstly used generative adversarial networks (GANs) to solve the 2. For the t − th bootstrap sample, where t ∈ {1,2,⋯,T}, fit one RLT model ft , and the
issue of an imbalanced and small sample due to the scarcity of incident rules and steps are:
i. For any internal node B, fit an embedded model fB to the training data in B,
samples and then developed an incident detection framework. This
restricted to the set of k1 strong variables {1, 2, ⋯, k}.
framework firstly identified important factors with the help of random ii. Using fB to calculate the variable importance measure VIB (j) for each variable Xj ,
forests, and then used GANs to generate new incident samples, and where j ∈ k.
finally applied a SVM to develop the traffic incident detection model. It iii. Split node B into two children nodes with the help of the variables with the highest
found that their framework had good performance with respect to low variable importance measure.
iv. Update the muted noise variables for the two children nodes by adding the
false alarm rate and high detection rate in detecting traffic incidents.
variable who has the lowest variable importance at the current node.
Similar to Lin et al. (2020), for the purpose of dealing with the small data v. Apply i)–iv) on each child node to make sure that node sample size is smaller than a
size and imbalanced datasets, Li et al. (2020) employed a hybrid deep pre-specified value nmin .
learning model to develop incident detection models. This proposed

3. Average T trees to obtain a final model f = I(0.5 < T− 1 Tt=1 ft ) for the classification
hybrid models firstly used GAN to balance data and expand the data size, purpose.
and then applied a deep learning model to develop the traffic incident
detection model.
E(Y|X = x) for the future predictions and classifications.
In recent years, some new data have been applied to detect traffic
incidents, e.g., social media data (Gu et al., 2016; Salas et al., 2017), on-
3.1.2. Evaluation criterion
board GPS data (Asakura et al., 2017), and bluetooth detection data
In this paper, three indicators were used as criteria to estimate and
(Margreiter, 2016). For instance, Gu et al. (2016) explored to extract
compare the performance. They are the area under the Receiver Oper­
incident occurrence information on highways and arterials by mining
ating Characteristic (ROC) curve (AUC), the false positive rate and the
tweet texts, which was proved to be a cheap and efficient alternative.
true positive rate. This ROC curve has become the commonly used tool
Asakura et al. (2017) investigated how to use floating data from probe
to assess predictive accuracy for evaluating and comparing algorithms,
vehicles with global positioning system (GPS) devices to detect traffic
models or technologies that produce the classifications and predictions.
incidents. Additionally, Asakura et al. (2017) also analyzed the char­
The false positive rate is used as x-axis and true positive rate is used as y-
acteristics of traffic flow dynamics during incidents.
axis to plot the ROC curve. AUC has a value between 0.5 and 1.0, and it
Similar to real-time crash risk prediction, the detection ability of
can present the prediction performance of models. If the AUC is big, the
automatic incident detection models and automatic crash detection is
prediction performance of models is better (e.g., Yu and Abdel-Aty,
still a research interest. Therefore, this paper focuses on new modelling
2013; Yang et al., 2019).
methods to develop more accurate crash detection models similar to
The formulas of false positive rate and true positive rate are:
incident detection models.
FP
False positive rate =
3. Methodology and data preparation FP + TN

TP
3.1. Methodology True positive rate =
TP + FN
In this part, reinforcement learning tree and evaluation criteria are where FP is the number of non-crashes that fail to be classified
briefly described. The reinforcement learning tree is used to develop correctly,TN is the number of non-crashes that are successfully classified
models that predict the crash risk and detect the crash occurrence while into the non-crash group, TP refers to the number of crashes that are
the evaluation criteria were utilized to appraise the model performance. classified correctly into the crash group, and FN refers to the number of
crashes incorrectly classified into the non-crash group.
3.1.1. Reinforcement learning tree
The reinforcement learning tree (RLT), which was firstly proposed by
Zhu et al. (2015), is a tree-based regression model. Basically, it is a 3.2. Data preparation
random forest model with the implementation of reinforcement learning
in splitting variable selection and noise variable muting at each internal The studied area is the urban expressway in Puxi area of Shanghai,
node (Zhu et al., 2015). It should be noted that the selection of splitting China and it includes six elevated roads (see Fig. 1). It should be noted
variables and constructing daughter nodes are the key elements of RLT. that there are no intersections in the urban expressway system. Its length
In the step of selecting splitting variables, the mechanism is to try to is 236 km and it is separated artificially into 238 roadway segments by
obtain the biggest return of the long-term performance from future child the on/off ramps in two directions (see Yang at al. (2018b) for details).
splits, and it is helpful to beak hidden structure and then avoid incon­ The number of lanes of road segments varies from two to six. The per­
sistency. In the step of constructing daughter nodes, muting some noise centage of two, three, four, five and six lanes are 26.9 %, 31.1 %, 33.6 %,
variables is employed, especially at the deeper part of the tree, and RLT 8.0 % and 0.4 %, respectively. Two datasets from this studied area were
can still identify the strong variables. Additionally, RLT can provide integrated: (i) real-time traffic flow data collected by dual loops de­
linear combination rules for splits to obtain more efficiency. tectors (LDs) under the road surface of elevated roads, and (ii) historical
Table 1 provides the steps in developing the RLT algorithm (Zhu crash data in April 2014. Note that a crash in this paper is defined as the
et al., 2015). We observe a sample whose observations are D = {(X1 ,Y1 ), collision of one motor vehicle with other vehicle (s). Fig. 2 illustrates the
T
(X2 , Y2 ), ⋯, (Xn , Yn )}, where each Xi = (Xi1 , ⋯, Xik ) denotes the traffic descriptive statistics of the incident types. A total of 2,165 incidents
flow variables (e.g., speed, volume) and it is a set of k variables from a occurred on the studied corridor in April 2014, including 658 break-
feature space X. Y is the binary variable as the output in the model and it down incidents (i.e., 30.4 %), 15 single-vehicle crashes (i.e., off-road
has values of 1 for a crash case or 0 for a non-crash case. The expected single-vehicle crashes, 0.7 %), 1,271 two-vehicle crashes (i.e., 58.7 %)
value E(Y|X) is calculated based on the set of k1 strong variables and and 141 multi-vehicle crashes (i.e., 6.5 %) and 80 other incidents (i.e.,
here k1 < k. In addition, the other k2 variables (k2 = k − k1 ) are noise 3.7 %, e.g., cargo drops and catching fire). LDs data provides average
variables. The aim of training is to obtain the estimate in function f(x) = speed, counts of vehicles, and time occupancy for every lane at every 20
s. We calculated the mean and standard deviation of volume, speed, and

3
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Fig. 1. Shanghai urban expressway network (Puxi area) (Yang at al., 2018b).

time occupancy respectively based on the data aggregation at 5 min previous studies (e.g., Abdel-Aty et al., 2010; Yu and Abdel-Aty, 2013;
intervals for each roadway segment. The reason why a 5 min time in­ Sun et al., 2014; Xu et al., 2016; Yang et al., 2018a, 2018b; Basso et al.,
terval is employed as the time window is that an optimal temporal ag­ 2018).
gregation interval of 5 min can reduce the random noise of the traffic
flow monitoring data for urban roads (Lu et al., 2012), like most of

4
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Finally, the matched case-control data for RTCRP models has 1,336
crashes and 5,792 non-crashes scenarios. The descriptive statistics of
variables are listed in Table 2. It was further split into the training data
from the first half of the month and the test data from the second half of
the month. The training data has 639 crashes and 2,764 non-crashes.
Besides, the test data has 697 crashes and 3,028 non-crashes.

3.2.2. Automatic crash detection


In order to detect the crash occurrence timely, we selected the traffic
flow data from three segments around the crash location at the 0–5 min
just after the reported time of the crash occurrence. Similarly, three
segments around the crash location were also identified (see Fig. 3). For
instance, regarding the crash occurred at 13:32, we extracted traffic data
from 13:32 to 13:37 (i.e. 5 min window) and termed it as “AfterCrash”
(AC). We also used a matched case-control design to select normal traffic
flow conditions, like the data preparation of matched case-control data
Fig. 2. Descriptive statistics of incident types.
in RTCRP analysis. A ratio of 4:1 was also used to randomly select the
non-crash cases for each crash case, given the same location. In addition,
the same 18 variables, namely the average values and standard devia­
3.2.1. Real-time crash risk prediction
tion of volume, speed and time occupancy for three roadway segments
In order to predict the likelihood of a crash occurrence in advance,
were calculated based on the raw data. Additionally, the length of three
we extracted the traffic flow data on related roadway segments between
segments and the number of lanes of the crash segment were also
5 and 10 min before the reporting time of the crash occurrence (see
collected.
Fig. 3). Besides, three segments around the crash location, i.e. upstream,
Finally, the matched case-control data for the automatic crash
crash and downstream, were identified and termed as U segment, C
detection analysis has 1,152 crashes and 4,608 non-crashes scenarios.
segment and D segment, respectively. For example, if a crash occurred at
The descriptive statistics of variables are listed in Table 2. It was further
13:32, we extracted traffic flow data from 13:22 to 13:27 (i.e. 5 min
split into the training data from the first half of the month and the test
window) and named it as “BeforeCrash” (BC). Since the location the
data from the second half of the month. The training data has 559
crash occurrence is described by using the unique number of roadway
crashes and 2,236 non-crashes. Besides, the test data has 593 crashes
segments, we firstly used ArcMap (ESRI, 2006) to identify the spatial
and 2,372 non-crashes.
relationship of the roadway segments in the road network map, which
further helps match crash data with traffic data, similar to Yang at al.
4. Analysis results
(2018a, 2018b).
In this paper, we used a matched case-control design to extract the
Firstly, the reinforcement learning tree was utilized to identify the
traffic flow data of corresponding non-crash cases for each crash, similar
important traffic variables for model development of real-time crash risk
to Yang at al. (2018a, 2018b). It is notable that the non-crash scenario
prediction (RTCRP) and automatic crash detection (ACD), respectively.
refers to the “normal traffic condition” when there is no crash observed
And then, the important factors were considered as the input of rein­
within the continuous 1 h window within the three roadway segments.
forcement learning tree (RLT), logistic regression, support vector ma­
The matched case-control study randomly selects four non-crash cases
chine (SVM) and deep neural network (DNN) models to predict the crash
for each crash, given the same location. Besides, we calculated six var­
risk and detect the crash occurrence, respectively. Since SVM is a good
iables, i.e., average speed (AvgSpd), standard deviation of speed
classifier and can obtain good performance for real-time crash risk
(StdSpd), average volume (AvgVol), standard deviation of volume
predictions (e.g., Sun et al., 2014; Basso et al., 2018), it was utilized in
(StdVol), average time occupancy (AvgOcc), and standard deviation of
this paper to compare with the RLT for evaluating the prediction per­
time occupancy (StdOcc), based on the raw traffic flow data from dual
formance of RLT.
LDs on the same roadway segment. It therefore created 18 traffic vari­
ables (i.e. 6 Variables × 3 Segments = 18). Additionally, the length of
4.1. Variables selection
three segments (i.e. U_length, C_length, D_length) and the number of
lanes of crash segment were also collected as variables.
There are numerous factors that contribute to the crash occurrence
and conversely, the crash occurrence would significantly affect the
traffic operations. Recently, like random forest technique (e.g., Wu
et al., 2013), the reinforcement learning tree was employed to rank the
importance of variables and select the important variables. The ranking
results of the variable importance for RTCRP and ACD are shown in
Fig. 4.
It can be found that AvgSpd_C_BC (average speed for crash segment
before the crash occurrence) and AvgSpd_C_AC (average speed for crash
segment after the crash occurrence) are the most important indicator for
the crash prediction and crash detection, respectively. Variable corre­
lations should be carefully considered for the linear models since it will
cause the multicollinearity problem (Daoud, 2017). A combination of
variable importance and variable correlations was used to select the
variables in the final model for RTCRP and ACD. The rules are i) to
prioritize variables with higher importance, and ii) to exclude other
variables that are highly correlated with existing variables. Therefore,
five important variables are chosen for the crash prediction and crash
Fig. 3. Nomenclature of the time–space slices of crashes. detection models, respectively. The crash risk prediction model has

5
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Table 2
Statistical summary of variables.
Real-time crash risk prediction Automatic crash detection

Variable Mean Std Dev Min Max Variable Mean Std Dev Min Max

AvgVol_U_BC 5.21 2.91 0 12.89 AvgVol_U_AC 5.19 2.73 0 12.73


StdVol_U_BC 2.17 1.08 0 12.80 StdVol_U_AC 2.22 1.05 0 12.55
AvgSpd_U_BC 59.21 19.06 6.15 91.06 AvgSpd_U_AC 56.80 20.52 5.43 89.85
StdSpd_U_BC 11.72 6.09 0 42.12 StdSpd_U_AC 12.34 6.51 0 39.6
AvgOcc_U_BC 16.06 14.31 0 76.54 AvgOcc_U_AC 18.14 15.69 0 77.91
StdOcc_U_BC 9.82 9.53 0 50.03 StdOcc_U_AC 10.95 9.90 0 49.69
AvgVol_C_BC 5.15 3.10 0 22.51 AvgVol_C_AC 5.10 2.90 0 23.07
StdVol_C_BC 2.24 1.52 0 16.80 StdVol_C_AC 2.27 1.43 0 16.5
AvgSpd_C_BC 58.95 19.15 7.59 97.83 AvgSpd_C_AC 57.73 19.73 4.53 92.76
StdSpd_C_BC 11.89 6.43 0 48.50 StdSpd_C_AC 12.64 6.77 0 43.35
AvgOcc_C_BC 16.02 14.41 0 78.70 AvgOcc_C_AC 17.17 15.05 0 90.86
StdOcc_C_BC 9.75 9.57 0 49.27 StdOcc_C_AC 10.62 9.94 0 50.85
AvgVol_D_BC 5.19 2.89 0 14.12 AvgVol_D_AC 5.20 2.83 0 13.78
StdVol_D_BC 2.18 1.08 0 12.49 StdVol_D_AC 2.21 1.11 0 12.83
AvgSpd_D_BC 60.42 17.84 7.5 90.15 AvgSpd_D_AC 60.62 17.48 5.38 92.51
StdSpd_D_BC 11.52 5.98 0 45.15 StdSpd_D_AC 11.70 6.01 0 39.88
AvgOcc_D_BC 14.90 12.59 0 75.00 AvgOcc_D_AC 14.72 12.20 0 72.15
StdOcc_D_BC 10.02 9.90 0 49.07 StdOcc_D_AC 10.11 9.71 0 50.05
C_length 1000.83 492.32 114 3498 C_length 1014.77 486.25 198 3121
U_length 891.55 522.25 114 3121 U_length 887.04 512.40 114 2445
D_length 964.85 477.32 124 3498 D_length 959.82 457.24 124 3498
Lanes 3.40 0.84 2 6 Lanes 3.48 0.81 2 6

Fig. 4. The variable importance rankings.

AvgSpd_C_BC, AvgOcc_D_BC, AvgVol_U_BC, AvgOcc_U_BC and Avg­ model for real-time crash risk prediction (RTCRP). The results are listed
Vol_C_BC. On the other hand, the automatic crash detection model has in Table 3. AvgSpd_C_BC has a negative sign, which means that low
AvgSpd_C_AC, AvgSpd_U_AC, AvgVol_U_AC, AvgVol_C_AC and StdOc­ speed increases crash risk. The sign of AvgOcc_D_BC and AvgOcc_U_BC
c_U_AC. Hence, these five selected variables were employed as the inputs are positive meaning that the higher time occupancy at the upstream
of models for RTCRP and ACD, respectively. and crash segments will increase the crash risk. In addition, AvgVo­
l_U_BC and AvgVol_C_BC have positive signs, which means that the
larger traffic flow at the upstream and crash segments will also increase
4.2. Real-time crash risk prediction models
the crash risk.
4.2.1. Logistic regression models
The selected variables were inputted into the logistic regression (LR)

6
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Table 3
Logistic regression models.
Real-time crash risk prediction Automatic crash detection

Parameter Estimate Z value 95 % CI Parameter Estimate Z value 95 % CI

Intercept − 1.075 − 3.743 − 1.638 − 0.512 Intercept 4.923 11.484 4.083 5.763
AvgSpd_C_BC − 0.054 − 17.252 − 0.060 − 0.048 AvgSpd_C_AC − 0.076 − 19.139 − 0.083 − 0.068
AvgOcc_D_BC 0.027 5.553 0.018 0.037 AvgSpd_U_AC − 0.044 − 12.306 − 0.051 − 0.037
AvgVol_U_BC 0.039 4.070 0.020 0.057 AvgVol_U_AC − 0.083 − 2.750 − 0.141 − 0.024
AvgOcc_U_BC 0.036 8.432 0.027 0.044 StdOcc_U_AC 0.053 7.415 0.039 0.066
AvgVol_C_BC 0.157 7.450 0.116 0.199 AvgVol_C_AC − 0.057 − 2.014 − 0.113 − 0.002

4.2.2. Support vector machine models set to eight for the final RLT model by considering the performance and
SVM models in this paper were trained by the Packages ‘e1071′ training time. Different RLT models with various numbers of trees are
(Meyer et al., 2017) in R®4.0.5 (R, 2022). The different combinations of trained and tested, whose results are shown in Fig. 5. We can notice that
parameters including kernel function, cost (C) value and gamma (γ) are the AUC value increases with the improvement of the number of trees,
considered to find the best model. We considered two kinds of kernel and then the AUC value is stable at about 0.90. Considering the pre­
functions, i.e., linear kernel and radial kernel. They provide the non- diction performance and the training cost, the final RLT model has 8
linear relationship and linear relationship between output variables cores and 100 trees.
and input variables, respectively. The C value presents the size of the
“soft margin” around the hyperplane of SVM models. As the C value 4.2.5. Predictive performance evaluation
reduces, the size of the “soft margin” increases and more points inside After the development of the RLT, LR, SVM and DNN models for the
the soft margin cannot be classified into any group. γ indicates the de­ real-time crash risk prediction (RTCRP) with the input of the training
gree of curvature of the hyperplane. As the increase of γ, the hyperplane data, the test data as discussed earlier was employed to validate and
becomes curvier, which may classify points too well and cause over­ compare their prediction performances. Table 4 providess the results.
fitting issues. SVM models are trained with the input of the five The AUC values from the training data are greater than 0.87 and these
important variables. We considered 10 different γ (i.e. 100, 10, 5, 2, 1, values from the test data are not significantly less than those from the
0.5, 0.1, 0.01, 0.001, 0.0001) and 10 different C values (i.e. 1000, 500, training data, respectively. It indicates that the developed models have
100, 50, 10, 1, 0.1, 0.01, 0.001, 0.0001). Therefore, 200 SVM models (i. good prediction performance and they have no overfitting issues.
e. 10 × 10 × 2 = 200) were trained and compared by using the classi­ The RLT model has the biggest AUC value which is 0.903. It is
fication error. The kernel function, γ, C value, the number of support significantly better than that of LR, SVM and DNN models. Therefore,
vectors of the final (best) SVM model are “Radial”, 0.01, 100, and 822, RLT offers the best prediction performance and it has the potential to
respectively. In addtion, its classification error is 0.1065 which is the estimate the probability of crash occurrence in real-time.
smallest.
4.3. Automatic crash detection models
4.2.3. Deep neural network
Deep neural network (DNN), which is one of the emerging machine
Similarly, the same training data were employed to train LR, SVM,
learning methods, was also developed with the input of the same
DNN, and reinforcement learning tree models to develop the automatic
important variables in this paper for comparisons. We considered
crash detection (ACD) models with the variables identified earlier as
different combinations of important parameters, such as the number of
input.
hidden layers (e.g., 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 35, 40), the
Table 3 presents the results of the logistic regression (LR) model for
number of neurons in each layer (e.g., 10, 20, 30, 40, 50, 60, 70, 80, 90,
ACD. AvgSpd_C_AC, AvgSpd_U_AC, AvgVol_U_AC and AvgVol_C_AC
100, 200, 300, 400,500), activation functions so as to obatin the best
have negative signs meaning that after the crash occurrence, speed and
models. Rectified Linear Unit (ReLU) and tangent hyperbolic (Tanh)
traffic flow at the upstream and crash segments will reduce quickly due
were considered as activation functions. To avoid over-fitting issues,
to the impact of a crash. The sign of StdOcc_U_AC is positive, which
dropout rate and L2 regularization were used in the DNN structure. We
means that the fluctuation of traffic flow at the upstream segment will
found that there was no significant improvement as the increase of the
increase since drivers in different lanes will take different measures such
number of hidden layers. When the number of neurons is greater than
100, the AUC value tends to be stable with the increase of the number of
neurons. By using the AUC and accuracy values and considering the
computing cost, therefore, we determine the best DNN model for RTCRP
and it has 15 hidden layers and 100 neurons in each hidden layer. Be­
sides, its activation function, dropout rate, L2 regularization value are
tangent hyperbolic (Tanh), 0.1 and 0.001, respectively.

4.2.4. Reinforcement learning tree


The Package ‘RLT’ (Zhu, 2022) in R®4.0.5 (R, 2022) was used to
develop the reinforcement learning tree (RLT) models. Thousands of
different numbers of cores (i.e. 1, 2, 3, 4, 5, …, 6000) and different
numbers of trees (i.e., 1, 2, 3, …, 10, 20, 30, …, 100, 200, 300, 400, 500)
were employed to structure different RLT models. The results show that
the AUC values of the developed RLT models with different numbers of
cores are similar (at about 0.90), which means that the impact of the
number of cores on the model performance is not significant. Addi­
tionally, the training time of RLT models increases significantly with the
improvement of the number of cores. Therefore, the number of cores is Fig. 5. The AUC values of RLT models with different numbers of trees
for RTCRP.

7
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Table 4
AUC values of RTCRP and ACD models.
Models RLT LR SVM (Kernel=“Radial”) DNN

Training Test Training Test Training Test Training Test

RTCRP 0.980 0.903 0.892 0.870 0.898 0.884 0.894 0.869


ACD 0.989 0.936 0.922 0.898 0.960 0.930 0.923 0.914

as changing lanes and reducing speeds. This result is reasonable 5. Model exploration
intuitively.
The experimental design also led to the evaluation of a total of 200 Since the real-world application is complicated, more model explo­
SVM models, with different combinations of 10 different γ (i.e. 0.0001, rations related to the applications and implementation of the RLT model
0.001, 0.01, 0.1, 0.5, 1, 2, 5, 10 and 100), 10 different C values (i.e. should be conducted, including RLT predictive performance in small
0.0001, 0.001, 0.01, 0.1, 1, 10, 50, 100, 500, 1000) and two kernel sample environments, the impact of variable selections, the validation
functions (i.e. linear and radial), to find the best one for crash detections. by the full dataset, and a sensitivity analysis.
Finally, the kernel function, the C value and γ of the best SVM model
have found to be “radial”, 100 and 0.1, respectively. Its classification
error achieves the smallest. 5.1. RLT prediction performance in the small sample environment
Similar to the development of DNN models for RTCRP, thousands of
DNN models with different parameter combinations of activation func­ The predictive ability of classifiers mostly depends on the size and
tions, the number of hidden layers, and the number of neurons in each quality of the training sample (Kim, 2009; Figueroa et al., 2012).
layer were examined to determine the best models. Finally, the best DNN However, the data collection and preparation can be expensive, since
model for ACD has 30 hidden layers and 50 neurons in each hidden the crash is rare and traffic monitoring data is expensive to analyze. On
layer. In addition, its activation function, dropout rate, L2 regularization the other hand, relatively small samples may result in many issues such
value are tangens hyperbolic (Tanh), 0.1 and 0.001, respectively. as the model fitness and the unbiasedness of estimators (e.g., Yu and
Similarly, thousands of reinforcement learning tree models with Abdel-Aty, 2013). Therefore, it needs to estimate the size of the sample
different numbers of cores and trees were developed and compared. The required to reach a performance target (Figueroa et al., 2012). This
results show that the AUC values of the developed RLT models with 1 to paper samples different percentages of the whole dataset from the first
50 cores are similar (at about 0.93), which means that the number of half of the month to train RLT models and then uses the same test data to
cores has no significant impact on the model performance when it is less test their predictive performance, for RTCRP and ACD, respectively.
than 50. When the number of cores is greater than 50, the AUC values of Table 5 provides the results. Note that in order to obtain results that are
these RLT models are stable at about 0.90. Therefore, the number of more robust, each model is trained by using randomly sampled datasets
cores is set to four for the final RLT model by considering the perfor­ and tested more than 20 times and the average AUC values are calcu­
mance and training time. Finally, different RLT models who have lated. We can find that the AUC values of RLT models increase as the
different numbers of trees are trained and tested, whose results are sampling percentage increases implying that higher samples improves
shown in Fig. 6. As we expect, the AUC value increases with the the predictive performance.
improvement of the number of trees, and then the AUC value is stable at Besides, the increase amplitude of AUC values is not large after a
about 0.93. Considering the prediction performance and training cost, certain percentage (e.g., 30 %). Regarding RLT-based real-time crash
the final RLT model has 4 cores and 100 trees. risk prediction models, 20% of sampled datasets can help RLT obtain
Finally, the detection performance of developed RLT, LR, SVM and reasonable predictive performance (i.e., AUC = 0.887), which is closed
DNN models were tested by the same test data. Table 4 exhibits the to 98.3 % of the predictive performance of the RLT model that was
results. The models are well developed since their AUC values are trained by the whole dataset. The number of crashes is about 26 times as
relatively high and there is no big difference between the AUC values of many as the number of variables (i.e., 639 × 20 % / 5 ≈ 26) since there
the training and the test datasets. We can notice that RLT also has the are five variables in the model. When conditions are extremely limited,
highest AUC value (0.936), which is significantly higher than LR, SVM 10 % of sampled datasets can help RLT obtain acceptable predictive
and DNN models. Therefore, RLT also has the potential to detect crash performance (e.g., AUC = 0.878). Regarding RLT-based automatic crash
occurrence quickly. detection models, 10 % of sampled datasets can help RLT obtain
reasonable predictive performance (i.e., AUC = 0.920), which is closed
to 98.2 % of the predictive performance of the RLT model that are
trained by the whole dataset. Similarly, the number of crashes is about

Table 5
AUC values of RLT models for RTCRP and ACD based on different training sizes.
Percentage of the whole dataset from the RTCRP ACD
first half of the month
Training Test Training Test

100 % 0.980 0.903 0.989 0.936


90 % 0.979 0.901 0.989 0.936
80 % 0.981 0.900 0.988 0.935
70 % 0.982 0.900 0.988 0.934
60 % 0.981 0.898 0.988 0.934
50 % 0.981 0.896 0.988 0.933
40 % 0.981 0.894 0.988 0.931
30 % 0.985 0.890 0.991 0.928
20 % 0.983 0.887 0.990 0.924
10 % 0.986 0.878 0.993 0.920
5% 0.986 0.871 0.993 0.906
1% 1.000 0.850 1.000 0.886
Fig. 6. The AUC values of RLT models with different numbers of trees for ACD.

8
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

11 times as many as the number of variables (i.e., 559 × 10 % / 5 ≈ 11). Table 7


Therefore, we can conclude that approximatively, a minimum sample Results of model prediction performance for RTCRP.
size of 20 observations per variable is reasonable for training RLT False RLT SVM (Kernel=“Radial”) DNN
models, and that when conditions are extremely limited, a minimum positive
True True Difference True Difference
sample size of 10 observations per variable is also acceptable. This result rate
positive positive positive
is consistent with existing studies, e.g., the concept of event per variable rate rate rate
of 10 (Concato et al., 1995; Peduzzi et al., 1996), the concept of event 1.0 % 25.3 % 21.8 % 3.50 % 16.36 % 8.94 %
per variable of 20 (Austin & Steyerberg, 2017). 5.0 % 61.6 % 60.4 % 1.20 % 48.23 % 13.37 %
10.0 % 79.3 % 73.0 % 6.30 % 67.96 % 11.34 %
20.0 % 91.4 % 84.8 % 6.60 % 83.98 % 7.42 %
5.2. The impact of variable selections 30.0 % 96.8 % 92.6 % 4.20 % 93.25 % 3.55 %
40.0 % 98.3 % 96.5 % 1.80 % 97.13 % 1.17 %
There is a dilemma in selecting features because too many variables 50.0 % 99.5 % 98.0 % 1.50 % 99.66 % − 0.16 %
60.0 % 99.8 % 98.7 % 1.10 % 99.83 % − 0.03 %
in the model may cause the multicollinearity problem whereas too few
70.0 % 100.0 % 99.8 % 0.20 % 100.00 % 0.00 %
variables cannot provide required information. Therefore, it is impor­ 80.0 % 100.0 % 99.8 % 0.20 % 100.00 % 0.00 %
tant to explore the impact of variable selections on the performance of 90.0 % 100.0 % 100.0 % 0.00 % 100.00 % 0.00 %
RLT models in future applications. The training data from the first half of
the month is employed to train RLT models and the test data from the
second half of the month is used to test them for RTCRP and ACD, Table 8
respectively. Two models were created: (i) using only five selected Results of model detection performance for ACD.
important variables and, (ii) employing all variables, respectively. The
False RLT SVM (Kernel=“Radial”) DNN
results are provided in Table 6. These models are well trained since all of positive
their AUC values from the training data are closed to 1.0 and their AUC True True Difference True Difference
rate
positive positive positive
values from the test data are also more than 0.90. The AUC values of the rate rate rate
RLT models with all variables are found to be a little higher than those
1.0 % 46.7 % 34.4 % 12.30 % 18.55 % 28.15 %
with the five variables for RTCRP and ACD, respectively and their dif­
5.0 % 82.1 % 67.8 % 14.30 % 57.84 % 24.26 %
ference are 0.915 – 0.903 ≈ 0.01 and 0.954 – 0.936 ≈ 0.02. The RLT 10.0 % 92.7 % 82.0 % 10.70 % 79.26 % 13.44 %
models with the inclusion of all variables can slightly increase the per­ 20.0 % 97.5 % 92.2 % 5.30 % 93.09 % 4.41 %
formance compared to the RLT models with limited variables. There­ 30.0 % 98.7 % 93.9 % 4.80 % 96.96 % 1.74 %
40.0 % 99.3 % 96.1 % 3.20 % 98.31 % 0.99 %
fore, collecting as more factors as possible for a specified application
50.0 % 99.8 % 97.6 % 2.20 % 98.82 % 0.98 %
may be helpful to improve the predictive performance of RLT models 60.0 % 100.0 % 98.8 % 1.20 % 99.33 % 0.67 %
because of including more feature information even though the esti­ 70.0 % 100.0 % 99.3 % 0.70 % 99.66 % 0.34 %
mated parameters may be slightly biased due to the multicollinearity 80.0 % 100.0 % 99.8 % 0.20 % 100.00 % 0.00 %
issue. When the condition is limited, selected important variables can 90.0 % 100.0 % 100.0 % 0.00 % 100.00 % 0.00 %

also obtain reasonable predictive performance.


79.26 % of crash cases are detected correctly by the RLT model, SVM
5.3. Validation by the full dataset and DNN models, respectively (see Table 8). The RLT could improve the
crash detection accuracy by at least 10.70 % compared with SVM and
For nonparametric models, such as tree-based models, the multi­ DNN models.
collinearity is less of an issue according to the analysis above. Therefore,
the full dataset with all variables can be applied as the input of RLT 5.4. Sensitivity analysis
models and SVM models in the implementation of RTCRP and ACD since
the full dataset includes more complete information. It should be noted Fig. 7 shows the impact of important variables on the estimation of
that one day has 288 time slices (24 h × 60 min / 5 min = 288). crash risk. Note that other variables are set as their statistical mean
Therefore, the test data including all cases has 697 crashes and 676,396 values derived from the data. We can find that the relationship between
non-crashes for RTCRP. The test data including all cases has 593 crashes crash risk and traffic volume at the upstream segment before the crash (i.
and 676,396 non-crashes for ACD. Table 7 and Table 8 list the results. e. AvgVol_U_BC) is non-linear. As the average volume in the upstream
In Table 7, we employed the percentage of the correctly predicted segment increases, the crash risk firstly increases, then reduces, and then
crash cases (i.e. true positive rate) for different false-alarm rates (i.e. increases gradually again. With the improvement of average occupancy
false positive rate) to measure the prediction performance. The RLT at the upstream segment before the crash (i.e. AvgOcc_U_BC), the crash
model has better crash prediction accuracy than the SVM model. If a 10 risk increases with some fluctuations. Similarly, the crash risk increases
% false-alarm rate is utilized, 79.3 %, 73.0 % and 67.96 % of crash cases and fluctuates at a relative high level when the average occupancy at the
are predicted correctly by the RLT, SVM and DNN models, as shown in downstream segment before the crash (i.e. AvgOcc_D_BC) is less than
Table 7. The difference of true positive rates between the RLT and SVM, about 30 %. Differently, the crash risk reduces and tends to be stable
DNN models are 6.3 % and 11.34 %, respectively. It means that RLT after a value of 30 % of the AvgOcc_D_BC. With the increase of average
could improve the crash accuracy by at least 6.3 % compared with SVM speed at the crash segment before the crash (i.e. AvgSpd_C_BC), the
and DNN. crash risk firstly fluctuates at a high level, and then reduces. We can
Similarly, when the false-alarm rate is 10.0 %, 92.7 %, 82.0 % and understand that it is safer when the traffic flow moves at a higher speed.

Table 6 6. Discussion
AUC values of the RLT models based on different variable numbers.
RTCRP ACD 6.1. Framework
Training Test Training Test
With the technological improvement of detecting, storing and min­
Variable selection 0.980 0.903 0.989 0.936 ing data, reinforcement learning tree (RLT) has the potential to be used
All variables 0.997 0.915 0.999 0.954
to develop models for real-time crash risk prediction (RTCRP) and

9
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Fig. 7. The impact of variables on crash risk.

automatic crash detection (ACD). They could be further employed in and further assist traffic managers to intervene and change the traffic
traffic safety management systems with the input of real-time traffic flow quickly and even proactively. The concept of real-time crash pre­
detection data to enhance the ability of the real-time traffic surveillance, diction relates to the hypothesis that the probability of a crash occurring

Fig. 8. Traffic safety management framework based on real-time traffic detector data.

10
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

on a specific road section within a very short time window can be pre­ correctly by RTCRP and ACD simultaneously. Totally, 96.0 % of crashes
dicted in advance by using the instantaneous traffic dynamics (e.g. can be predicted or detected correctly by the proposed framework,
Hossain et al., 2019). However, the idea of ACD involves an analysis and which is helpful to improve road traffic safety.
identification of traffic patterns by utilizing traffic monitoring data
observed just after the occurrence of historical incidents to be applied in 6.2. Policy implications
the future to detect crashes on the freeway in real time (Abdel-Aty et al.,
2010), and further provide quick and reliable information, such as the This proposed traffic safety management framework can be imple­
location, changes in traffic patterns. Fig. 8 illustrates a traffic safety mented in the current and future traffic environments. In the current
management framework based on real-time traffic detector data traffic environment including only traditional human-driven vehicles,
including RTCRP and ACD to identify and detect the hazardous traffic this proposed framework can be applied in the freeway and urban
conditions. expressway systems with instrumented detectors. It is helpful to provide
Loop detectors on urban expressways monitor the traffic flow in­ real-time information (i.e., crash risk, warnings, traffic management
formation and send it to the data center in real time. More traffic vari­ measures) to the drivers around the related area and traffic management
ables are created during the data aggregation and are used to assess the engineers. In the near future, there will be mixed traffic flow including
crash probability (which is also termed as crash risk) by the developed traditional human-driven vehicles and connected and autonomous ve­
RLT-based RTCRP model. Once the crash probability is bigger than the hicles (CAVs) for quite some time. Even though the driving errors of
predetermined threshold, the corresponding segment is labeled with a CAVs may reduce, there are still conflicts or crash risk between CAVs
potential crash sign, and then the system will provide a dangerous and traditional human-driven vehicles or between traditional human-
warning to inform the road operator and drivers around directly/indi­ driven vehicles. Therefore, this proposed framework will be still help­
rectly. Special interventions are also triggered to smooth traffic fluctu­ ful for traffic managers and drivers if it is introduced to the freeway and
ations (Abdel-Aty et al., 2010) to avoid the crash occurrence. urban expressways. The crash risk information can also be used in the
Meanwhile, the aggregated traffic information is also flowing into the route planning or choices of vehicles. Additionally, there is an advantage
ACD algorithms based on reinforcement learning tree in real time to of employing real-time trajectory data into the input and development of
detect crashes. If trends satisfy certain conditions (e.g. pre-identified real-time crash risk prediction (RTCRP) and automatic crash detection
thresholds), the segment is flagged as a crash, and then a crash warn­ (ACD), which can further improve the model performance and help
ing is triggered to inform the road operator and drivers on the upstream evaluate the crash risk at the individual vehicle level. In future, the CAV
of traffic flow directly/indirectly, and further measures are triggered for will encroach the whole roads of some special freeway or urban ex­
loss reductions. ACD is helpful in two ways: (i) to shorten the start time pressways. This proposed framework will also be helpful since it can
of dispatching emergency personnel for medical supports, road main­ provide the information of real-time crash risk and CAVs could choose
tenance, and removing obstructions, and (ii) to provide the real-time the safer routes.
distribution information of incidents in the road network to optimize
the route choice for road users. Besides, the intervention strategies 7. Limitations
include variable speed limit, variable message sign, speed harmoniza­
tion, queue warning, ramp metering, rerouting information on dynamic In the future application, the engineer can design their own process
message sign, merge control, managed lanes, temporary shoulder use of the variable collection, cleaning, aggregation and merging according
and so on. to the real-world device conditions (e.g., the ability of traffic detection,
The full dataset is employed to validate the proposed framework. The data storage and data mining). For instance, if more accurate informa­
result is shown in Fig. 9. When the false-alarm rate is 10.0 %, the RLT- tion about time and location of the crash occurrence can be collected, or
based RTCRP model of the framework can predict correctly 77.7 % of more emerging data such as driver behavior data and GPS data can be
the crashes. If reasonable proactive measures in advance can be con­ obtained in real time, more variables that are more accurate can be
ducted to provide warnings, these crashes can be avoided. In addition, developed as the input of the models to future improve the model per­
93.0 % (i.e., 96.0 % − 3.0 % = 93.0 %) of crashes can be detected formance. Besides, definitions of pre-crash period and over-
correctly by automatic crash detections (ACD). If proactive measures do representation of the normal traffic condition are also essential issues
not prevent the crash occurrence, 93.0 % of crashes can be detected to that should be carefully explored in the next step. Additionally, due to
provide timely rescues and disposals to reduce the loss. Additionally, brevity, this paper could not explore the impacts of different time win­
74.7 % (i.e., 77.7 % − 3.0 %) of crashes can be predicted and detected dows (e.g., 1 min, 2 min, 3 min, 4 min, 5 min) on the model performance
and verify the crash occurrence time even though the error about crash
reporting time is less than 2 min and almost impossible to reach 5 min
(Yang et al., 2018a). They are two of the most important research points
in our next step.

8. Conclusion

This study aimed to develop better modelling methods for real-time


crash risk prediction (RTCRP) and automatic crash detection (ACD).
Firstly, the important factors for RTCRP and ACD were identified. Sec­
ondly, after finding the optimal parameters, LR, SVM, DNN and RLT
were applied to develop RTCRP and ACD models, respectively. Then
comparisons of these developed models were made via the AUC values
and a sensitivity analysis. In addition, some model explorations related
to the application and implementation of RLT models were conducted,
including RLT predictive performance in small sample environments,
the impact of variable selections, the validation by the full dataset, and
the sensitivity analysis. Finally, a new real-time traffic safety manage­
ment framework based on RLT models was developed.
Fig. 9. The effectiveness of the traffic safety management framework. From the model results, the average speed at the crash section, the

11
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

volume at the crash and the upstream sections, and the time occupancy Ali, Y., Haque, M.M., Zheng, Z., 2022. An Extreme Value Theory approach to estimate
crash risk during mandatory lane-changing in a connected environment. Analytic
at the upstream and the downstream sections are important crash
Methods in Accident Research 33, 100193.
contributing factors for RTCRP. The speed and volume at the crash and Asakura, Y., Kusakabe, T., Nguyen, L.X., Ushiki, T., 2017. Incident detection methods
the upstream sections, and the standard deviation of time occupancy at using probe vehicles with on-board GPS equipment. Transp. Res. Part C: Emerging
the upstream section are the most important for ACD. RLT outperforms Technol. 81, 330–341.
Austin, P.C., Steyerberg, E.W., 2017. Events per variable (EPV) and the relative
LR, SVM and DNN in the applications of RTCRP and ACD confirmed by performance of different strategies for estimating the out-of-sample validity of
the AUC values and the sensitivity test. When the false-alarm rate was logistic regression models. Stat. Methods Med. Res. 26 (2), 796–808.
10.0 %, 79 % of crashes were predicted correctly by RTCRP and 93 % of Basso, F., Basso, L.J., Bravo, F., Pezoa, R., 2018. Real-time crash prediction in an urban
expressway using disaggregated data. Transp. Res. Part C: Emerging Technol. 86,
crashes were detected correctly by ACD. Overall, 96 % of crashes were 202–219.
predicted or detected correctly by the proposed framework, which can Basso, F., Basso, L.J., Pezoa, R., 2020. The importance of flow composition in real-time
help improve the road traffic safety. RLT has the potential to predict crash prediction. Accid. Anal. Prev. 137, 105436.
Basso, F., Pezoa, R., Varas, M., Villalobos, M., 2021. A deep learning approach for real-
crash probability and detect the occurrence of crashes in real-time in the time crash prediction using vehicle-by-vehicle data. Accid. Anal. Prev. 162, 106409.
application in the proactive traffic safety management. Cai, Q., Abdel-Aty, M., Yuan, J., Lee, J., Wu, Y., 2020. Real-time crash prediction on
This paper also revealed that collecting more data helps improve the expressways using deep generative models. Transp. Res. Part C: Emerging Technol.
117, 102697.
predictive performance of RLT models and approximatively, a minimum Concato, J., Peduzzi, P., Holford, T.R., Feinstein, A.R., 1995. The importance of event per
sample size of 20 observations per variable is acceptable for training RLT variable (EPV) in proportional hazard analysis: I. Background, goals and general
models. When conditions are extremely limited, a minimum sample size strategy. J. Clin. Epidemiol. 48 (12), 1495–1501.
Daoud, J.I., 2017. Multicollinearity and regression analysis. Journal of Physics:
of 10 observations per variable is also adequate. Besides, collecting as
Conference Series 949 (1), 012009.
more factors as possible is helpful to improve the prediction perfor­ Dia, H., Rose, G., 1997. Development and evaluation of neural network freeway incident
mance of RLT models. When the condition is limited, selected important detection models using field data. Transp. Res. Part C: Emerging Technol. 5 (5),
variables are also good to obtain reasonable predictive performance. 313–331.
Dudek, C.L., Messer, C.J., Nuckles, N.B., 1974. Incident detection on urban freeways.
The findings from this paper on detecting potential crashes based on Transp. Res. Rec. 495, 12–24.
unstable traffic dynamics would be essential to any traffic control cen­ ESRI, E. ArcMap 9.2. ESRI Inc, 2006.
ters that operate and manage traffic on high-speed networks. This paper Essa, M., Sayed, T., Reyad, P., 2019. Transferability of real-time safety performance
functions for signalized intersections. Accid. Anal. Prev. 129, 263–276.
contributes in the robust implementation of a new Artificial Intelligence Essa, M., Sayed, T., 2020. Self-learning adaptive traffic signal control for real-time safety
(AI) / Machine Learning (ML) based algorithm implementation in the optimization. Accid. Anal. Prev. 146, 105713.
field of RTCRP and can also help conceptualize such a system through Figueroa, R.L., Zeng-Treitler, Q., Kandula, S., Ngo, L.H., 2012. Predicting sample size
required for classification performance. BMC Med. Inf. Decis. Making 12 (1), 1–10.
the description. Fu, C., Sayed, T., 2022. Bayesian dynamic extreme value modeling for conflict-based
real-time safety analysis. Analytic Methods in Accident Research 34, 100204.
Gong, Y., Abdel-Aty, M., Yuan, J., Cai, Q., 2020. Multi-objective reinforcement learning
CRediT authorship contribution statement approach for improving safety at intersections with adaptive traffic signal control.
Accid. Anal. Prev. 144, 105655.
Kui Yang: Conceptualization, Methodology, Software, Validation, Gu, Y., Qian, Z.S., Chen, F., 2016. From Twitter to detector: Real-time traffic incident
detection using social media data. Transp. Res. Part C: Emerging Technol. 67,
Formal analysis, Investigation, Resources, Data curation, Writing –
321–342.
original draft. Mohammed Quddus: Supervision, Methodology, Hossain, M., Abdel-Aty, M., Quddus, M.A., Muromachi, Y., Sadeek, S.N., 2019. Real-time
Writing – review & editing, Project administration. Constantinos crash prediction models: State-of-the-art, design pathways and ubiquitous
Antoniou: Supervision, Writing – review & editing, Project requirements. Accid. Anal. Prev. 124, 66–84.
Huang, T., Wang, S., Sharma, A., 2020. Highway crash detection and risk estimation
administration. using deep learning. Accid. Anal. Prev. 135, 105392.
Kim, S.Y., 2009. Effects of sample size on robustness and prediction accuracy of a
prognostic gene signature. BMC Bioinf. 10 (1), 1–10.
Kinoshita, A., Takasu, A., Adachi, J., 2015. Real-time traffic incident detection using a
Declaration of Competing Interest probabilistic topic model. Information Systems 54, 169–188.
Li, P., Abdel-Aty, M., Yuan, J., 2020b. Real-time crash risk prediction on arterials based
The authors declare that they have no known competing financial on LSTM-CNN. Accid. Anal. Prev. 135, 105371.
Li, L., Lin, Y., Du, B., Yang, F., & Ran, B., 2020. Real-time traffic incident detection based
interests or personal relationships that could have appeared to influence on a hybrid deep learning model. Transportmetrica A: Transport Science, 1-21.
the work reported in this paper. Li, Z., Xu, C., Pu, Z., Guo, Y., Liu, P., 2020c. Reinforcement learning-based variable speed
limits control to reduce crash risks near traffic oscillations on freeways. IEEE Intell.
Transp. Syst. Mag. 99, 1.
Data availability
Lin, Y., Li, L., Jing, H., Ran, B., Sun, D., 2020. Automated traffic incident detection with a
smaller dataset based on generative adversarial networks. Accid. Anal. Prev. 144,
The authors do not have permission to share data. 105628.
Lu, Z., Xia, J., Jiao, T., Shi, X., Huang, W., 2012. Analysis of optimal temporal
aggregation interval of traffic flow data for urban road traffic monitoring.
Acknowledgement J. Southeast Univ. Natural Science Edition 42 (5), 1000–1005.
Mandzuka, S., Kljaić, Z., Skorput, P., 2011. The use of mobile communication in traffic
incident management process. J. Green Eng. 4, 413–429.
This work has been funded from the European Union’s Horizon 2020 Margreiter, M., 2016. Automatic incident detection based on bluetooth detection in
research and innovation programme i–DREAMS under grant agreement northern Bavaria. Transp. Res. Procedia 15, 525–536.
No 814761. Masters, P. H., Lam, J. K., & Wong, K., 1991. Incident detection algorithms for compass-
an advanced traffic management system. In Vehicle Navigation and Information
Systems Conference, 2: 295-310.
References Meyer, D., Dimitriadou, E., Hornik, K., Weingessel, A., Leisch, F., 2017. e1071: Misc
functions of the department of statistics, probability theory group (Formerly:
E1071), TU Wien; [R Package e1071 Version 1.6-8]. < https://CRAN.R-project.org/
Abdel-Aty, M., Uddin, N., Abdalla, M., Pande, A., and Hisa, L., 2004. Prediction freeway
package=e1071>.
crashes based on loop detector data using matched case-control logistic regression.
Peduzzi, P., Concato, J., Kemper, E., Holford, T.R., Feinstein, A.R., 1996. A simulation
Presented at the 83th Annual Meeting of the Transportation Research Board,
study of the number of events per variable in logistic regression analysis. J. Clin.
Washington, D.C.
Epidemiol. 49 (2), 1373–1379.
Abdel-Aty, M., Pande, P., Liang, H., 2010. The concept of proactive traffic management
Peng, C., & Xu, C. . Combined variable speed limit and lane change guidance for
for enhancing freeway safety and operation. ITE J. 80 (4), 34–41.
secondary crash prevention using distributed deep reinforcement learning. Journal
Abdel-Aty, M.A., Pemmanaboina, R., 2006. Calibrating a real-time traffic crash-
of Transportation Safety & Security.
prediction model using archived weather and ITS traffic data. IEEE Trans. Intell.
R Core Team, 2022. R: A language and environment for statistical computing. R
Transp. Syst. 7 (2), 167–174.
Foundation for Statistical Computing, Vienna, Austria. .
Ahmed, S.A., Cook, A.R., 1982. Application of time-series analysis techniques to freeway
incident detection. Transp. Res. Rec. 841, 19–21.

12
K. Yang et al. Accident Analysis and Prevention 178 (2022) 106848

Roy, A., Hossain, M., Muromachi, Y., 2022. A deep reinforcement learning-based Xu, C., Liu, P., Wang, W., 2016. Evaluation of the predictability of real-time crash risk
intelligent intervention framework for real-time proactive road safety management. models. Accid. Anal. Prev. 94, 207–215.
Accid. Anal. Prev. 165, 106512. Yang, K., Wang, X., Quddus, M., & Yu, R., 2019. Predicting Real-Time Crash Risk on
Salas, A., Georgakis, P., Petalas, Y., 2017. Incident detection using data from social Urban Expressways Using Recurrent Neural Network (No. 19-03921). Presented at
media. In: 2017 IEEE 20th International Conference on Intelligent Transportation the 98th Annual Meeting of the Transportation Research Board, Washington, D.C.
Systems (ITSC), pp. 751–755. Yang, K., Wang, X., Yu, R., 2018a. A Bayesian dynamic updating approach for urban
Samant, A., Adeli, H., 2001. Enhancing neural network traffic incident-detection expressway real-time crash risk evaluation. Transp. Res. Part C: Emerging Technol.
algorithms using wavelets. Comput.-Aided Civ. Infrastruct. Eng. 16 (4), 239–245. 96, 192–207.
Sun, J., Sun, J., Chen, P., 2014. Use of support vector machine models for real-time Yang, K., Yu, R., Wang, X., Quddus, M., Xue, L., 2018b. How to determine an optimal
prediction of crash risk on urban expressways. Transp. Res. Record: J. Transp. Res. threshold to classify real-time crash-prone traffic conditions? Accid. Anal. Prev. 117,
Board 2432, 91–98. 250–261.
Teng, H., Qi, Y., 2003. Application of wavelet technique to freeway incident detection. Yu, R., Abdel-Aty, M., 2013. Utilizing support vector machine in real-time crash risk
Transp. Res. Part C: Emerging Technol. 11 (3–4), 289–308. evaluation. Accid. Anal. Prev. 51, 252–259.
Wang, L., Abdel-Aty, M., Shi, Q., Park, J., 2015. Real-time crash prediction for Yu, R., Wang, Y., Zou, Z., Wang, L., 2020. Convolutional neural networks with refined
expressway weaving segments. Transp. Res. Part C: Emerging Technol. 61, 1–10. loss functions for the real-time crash risk analysis. Transp. Res. Part C: Emerging
Wang, L., Abdel-Aty, M., Lee, J., Shi, Q., 2019b. Analysis of real-time crash risk for Technol. 119, 102740.
expressway ramps using traffic, geometric, trip generation, and socio-demographic Yuan, J., Abdel-Aty, M., Gong, Y., Cai, Q., 2019. Real-time crash risk prediction using
predictors. Accid. Anal. Prev. 122, 378–384. long short-term memory recurrent neural network. Transp. Res. Rec. 2673 (4),
Wang, W., Chen, S., Qu, G., 2008. Incident detection algorithm based on partial least 314–326.
squares regression. Transp. Res. Part C: Emerging Technol. 16 (1), 54–70. Yuan, J., Abdel-Aty, M.A., Yue, L., Cai, Q., 2020. Modeling real-time cycle-level crash
Wang, J., Luo, T., Fu, T., 2019a. Crash prediction based on traffic platoon characteristics risk at signalized intersections based on high-resolution event-based data. IEEE
using floating car trajectory data and the machine learning approach. Accid. Anal. Trans. Intell. Transp. Syst. 22 (11), 6700–6715.
Prev. 133, 105320. Zhang, K., Taylor, M.A., 2006. Effective arterial road incident detection: a Bayesian
World Health Organization, 2018. Global status report on road safety 2018. World network based algorithm. Transp. Res. Part C: Emerging Technol. 14 (6), 403–417.
Health Organization. Zheng, Z., Ahn, S., Monsere, C.M., 2010. Impact of traffic oscillations on freeway crash
Wu, J., Abdel-Aty, M., Yu, R., Gao, Z., 2013. A novel visible network approach for occurrences. Accid. Anal. Prev. 42 (2), 626–636.
freeway crash analysis. Transp. Res. Part C: Emerging Technol. 36, 72–82. Zheng, L., Sayed, T., 2020. A novel approach for real time crash prediction at signalized
Xiao, J., 2019. SVM and KNN ensemble learning for traffic incident detection. Physica A intersections. Transp. Res. Part C: Emerging Technol. 117, 102683.
517, 29–35. Zhu, R., Zeng, D., Kosorok, M.R., 2015. Reinforcement learning trees. J. Am. Stat. Assoc.
Xu, C., Wang, W., Liu, P., Li, Z., 2015. Calibration of crash risk models on freeways with 110 (512), 1770–1784.
limited real-time traffic data using Bayesian meta-analysis and Bayesian inference Zhu, R., 2022. RLT: Reinforcement Learning Trees. < https://cran.r-project.org/web/
approach. Accid. Anal. Prev. 85, 207–218. packages/RLT/index.html>.

13

You might also like