liintegratedapproachmachinelearning2023.md 86 KB


category: literaturenote citekey: liintegratedapproachmachinelearning2023 title: An integrated approach of machine learning and Bayesian spatial Poisson model for large-scale real-time traffic conflict prediction authors: "Li, Dongya; Fu, Chuanyun; Sayed, Tarek; Wang, Wei" year: 2023 date: 2023-00-00 2023 doi: 10.1016/j.aap.2023.107286 publication: "Accident Analysis & Prevention" url: "https://doi.org/10.1016/j.aap.2023.107286" zotero_key: 9TBT5AAI zotero_storage: BKDGFB8B collections: transpordi_planeerimine folder: 001_artiklid firstAuthor: "Li, Dongya"

status: converted

Contents lists available at ScienceDirect

Accident Analysis and Prevention

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

An integrated approach of machine learning and Bayesian spatial Poisson model for large-scale real-time traffic conflict prediction

Dongya Li a,c , Chuanyun Fu b,c,* , Tarek Sayed c , Wei Wang a

  • a School of Transportation, Southeast University, China
  • b School of Transportation Science and Engineering, Harbin Institute of Technology, China
  • c Department of Civil Engineering, The University of British Columbia, Canada

ARTICLE INFO

Keywords: Real-time conflict prediction Large-scale Integrated approach Machine learning Bayesian spatial Poisson model

ABSTRACT

The use of traffic conflicts in road safety evaluation is gaining considerable popularity as it plays a vital role in developing a proactive safety management strategy and allowing for real-time safety analysis. This study proposes an integrated approach that combines a machine learning (ML) algorithm and a Bayesian spatial Poisson (BSP) model to conduct large-scale real-time traffic conflict prediction by considering traffic states as the explanatory variables. Traffic conflicts are measured by two indicators, the Time to Collision (TTC) and the Post-Encroachment Time (PET). Based on both TTC and PET, traffic conflict severity is classified into five categories. For each conflict severity category, a binary variable (conflict occurrence) and a count variable (conflict frequency) are developed, respectively. In addition to conflict variables, traffic state parameters are extracted from a large-scale high-resolution trajectory dataset. The traffic parameters include volume, density, speed, and the corresponding space-based and space–time-based measures within a 30-second interval. Eight ML-based classifiers are applied to predict conflict occurrence, and the best classifier is selected. A binary logistic regression is developed to explore the potential linkages between traffic states and conflict occurrence. As well, a resampling technique Borderline-SMOTE is used to mitigate the sparsity caused by the predefined short interval. The BSP model is utilized to predict the specific number of conflicts. Further, the BSP model can also explain the relationship between traffic states and conflict frequency, and thus the significant influencing traffic states are identified. The results show that random forest outperforms the other MLs in terms of conflict occurrence prediction accuracy. Further, the proposed integrated approach achieves a high performance of conflict frequency prediction with RMSE values of 0.1384 ~ 0.1699, MAPE values of 9.25% ~ 36.99%, and MAE values of 0.0087 ~ 0.6398. The finding emphasizes the need for separately predicting the occurrence and frequency of conflicts with different severities.

1. Introduction

Many recent studies have advocated the proactive management of road safety using surrogate measures such as traffic conflicts (Bao et al., 2019; Fu and Sayed, 2021a, 2023; Hu et al., 2022; Zheng et al., 2021; Zheng and Su, 2014), because they occur more frequently than crashes in a shorter time period. This proactive approach to safety management is facilitated by recent developments in sensing and vehicle technologies (e.g., computer vision, edge cameras, and autonomous vehicles). These technologies enable the collection of traffic conflicts data from road user trajectories and estimate crash risk almost in real-time (Fu and Sayed, 2022a; Ghoul et al., 2023a, 2023b). Real-time safety evaluation uses traffic conflicts and dynamic traffic parameters collected over very short time intervals (e.g., seconds or minutes) to estimate real-time crash risk.

As a common approach to perform conflict-based real-time safety evaluation, real-time traffic conflict prediction is generally conducted in previous studies, which has been proved effective in identifying crashprone situations, e.g., unsafe traffic conditions (Ali et al., 2023; Fu and Sayed, 2021b, 2022b). Moreover, real-time traffic conflict prediction can also be considered as a stand-alone safety evaluation measure in some instances such as monitoring traffic in real time and identifying unsafe traffic dynamics (Zheng et al., 2021). In addition, it is noted that existing real-time traffic conflict prediction studies mainly focus on road segments, a single intersection or a few intersections, and freeways (Fu

* Corresponding author at: School of Transportation Science and Engineering, Harbin Institute of Technology, China. E-mail address: fcy1128@mail.ubc.ca (C. Fu).

Fig. 1. Schematic diagram of data extraction.

and Sayed, 2022c; Hu et al., 2022; Mohammadian et al., 2021; Yuan et al., 2022). However, these studies evaluate the safety of specific locations with relatively simple traffic and environment conditions, which may cause the inadequacy of the developed traffic conflict prediction models for real-time safety evaluation of large-scale urban networks including several intersections.

In earlier studies, real-time traffic conflict prediction models can be generally classified into two broad categories: the binary-classificationbased model (i.e., the output is a dichotomous category event, namely a conflict occurs or no conflict occurs) (Hu et al., 2022) and the countbased model (i.e., the output is the conflict frequency) (Katrakazas et al., 2021; Zheng et al., 2021). The binary-classification-based model is extensively used due to its easy implementation and high efficiency, but it is unable to forecast the number of conflicts (Arun et al., 2021; Zheng et al., 2021). Therefore, additional studies are expected to integrate the binary-classification-based model and the count-based model to concurrently predict conflict occurrence and frequency.

For both binary-classification-based and count-based real-time traffic conflict predictions, the machine learning-based method (MLM) and statistical method (SM) are commonly used. Several representative MLMs have shown very good capabilities of real-time conflict prediction, including k-nearest neighbors (KNN) (Katrakazas et al., 2018; Orsini et al., 2021), support vector machine (SVM) (Hu et al., 2022; Katrakazas et al., 2018; Mohammadian et al., 2021; Yuan et al., 2022), random forest (RF) (Hu et al., 2022; Katrakazas et al., 2018; Mohammadian et al., 2021; Orsini et al., 2021), decision tree (DT) (Hu et al., 2022; Orsini et al., 2021), gradient boosting (GB) (Mohammadian et al., 2021), XGBoost (XGB) (Yuan et al., 2022), long short-term memory network (LSTM) (Yao et al., 2021), convolutional neural network (CNN) (Formosa et al., 2020), among others. Despite their excellent performance, MLMs are less capable than SMs in explaining how explanatory variables affect traffic conflicts because they generally function as a black box. By contrast, SMs predict traffic conflicts by establishing the causality between conflicts and explanatory variables. The frequentlyused SMs include linear/nonlinear regression models (Cafiso et al., 2018; Zhang et al., 2014), extreme value theory models (Fu and Sayed, 2021c, 2022c, 2022b), random parameters models (Yuan et al., 2022), Poisson regression models (Essa and Sayed, 2018; Zhang et al., 2014), among others. All these SMs also have shown good predictive capabilities.

However, it should be noted that neither MLMs nor SMs have robust interpretable and predictive capabilities. To solve this problem, previous studies propose a common framework that combines SMs and MLMs to perform real-time traffic conflict prediction. This framework uses SMs (e.g., binary logistic regression and random parameter logit models) to understand the causal relationship between traffic conflicts and explanatory variables, and then employs MLMs (e.g., SVM, RF, and XGB) to implement real-time conflict prediction (Hu et al., 2022; Xu et al., 2014; Yuan et al., 2022). It is simple but efficient, and it outperforms the corresponding single methods (i.e., MLM or SM) in terms of predictability and interpretability. However, despite its benefits, the framework may suffer from an imbalanced data issue. Conflict data is usually imbalanced, since conflicts are considered random events and conflict data is overdispersed (Zheng et al., 2021). Although various data resampling techniques have been proposed to address the imbalanced data issue, they usually work well for the binary-classification-based model and are little useful for the count-based model (Aggarwal, 2014; Han et al., 2005). Therefore, the proposed framework may be less applicable for short-term conflict frequency prediction and needs to be further improved.

Besides, for real-time traffic conflict prediction model development, several traffic factors have been considered in previous studies. For example, Mohammadian et al. (2021) use traffic flow, density and speed to predict the time spent in conflict (TSC), and argue that these macroscopic traffic states have the potential to help better understand the conflict occurrence mechanism, as they can inherently reveal the underlying car-following interactions and dynamic fundamental relations between vehicles. As well, Gore et al. (2023) take the threewheeled motorcycle proportion, two-wheeled motorcycle proportion, and standard deviation of speed into consideration to forecast TSC. Formosa et al. (2020) and Islam and Abdel-Aty (2023) utilize acceleration, deceleration, and the change rate of heading of the vehicles for real-time conflict occurrence prediction. Hu et al. (2022) and Yuan et al. (2022) consider lane-based variables such as lane type as well as differences in speed and volume between adjacent lanes to predict the lanelevel conflict occurrence. Yuan et al. (2022) point out that the mean

Table 1 Descriptive statistics of traffic state measures.

Category Variable Unit Description Mean Min Max Sd.
Type 1 Q veh/h Macroscopic volume (Equation (1) 681.4 8.65 2710.1 452.32
K veh/
km
Macroscopic density (Equation (2) 43.85 0.62 179.99 26
V km/h Macroscopic speed (Equation (3) 15.79 0.82 54.45 9.19
Type 2 Hm S Mean value of the headway; i.e., mean headway 1.86 0.19 28.44 1.87
Hs S Standard deviation of the headway; i.e., sd headway 1.8 0.02 13.66 1.69
Nm – Mean value of the number of vehicles; i.e., mean vehicle count 1.86 0.03 12.34 5.22
Ns – Standard deviation of the number of vehicles; i.e., sd vehicle count 6.61 0.3 46.9 1.09
Type 3 Vsm km/h Mean value of standard deviation of vehicle speeds at sub-interval τ; i.e., space-sd and time-mean
speed
8.82 0.02 27.14 4.91
Vmm km/h Mean value of vehicle mean speeds in sub-interval τ; i.e., space-mean-time-mean speed 15.24 0.55 53.17 8.95
Vms km/h Standard deviation of vehicle mean speeds at sub-interval τ; i.e., space-mean and time-sd speed 6.82 0.85 27.35 3.95
Asm m/s2 Mean value of standard deviation of the vehicle acceleration in sub-interval τ; i.e., space-sd and
time-mean acceleration
0.461 0.01 3.458 0.228
Amm m/s2 Mean value of vehicle mean accelerations at sub-interval τ; i.e., space-mean and time-mean
acceleration
0.549 0.01 3.654 0.256
Ams m/s2 Standard deviation of vehicle mean accelerations at sub-interval τ; i.e., space-mean and time-sd
acceleration
0.348 0.0.04 4.13 0.23

Note: Sd. denotes standard deviation.

heterogeneity of traffic flow characteristics impacts the conflict occurrence prediction results. In general, these macroscopic factors are effective in real-time traffic conflict prediction but still have some limitations. For example, the macroscopic factors used for previous studies focus more on their relatively basic forms (e.g., the standard deviation and mean value) and less on their intricate spatiotemporal-shifted features. In addition, Arun et al. (2021) and Tageldin et al. (2017) also demonstrate that microscopic traffic state factors can effectively improve the accuracy of real-time traffic conflict prediction, and they are recommended to be considered for future studies.

Therefore, to fill the above research gaps, this study proposes an integrated approach that combines a machine learning (ML) algorithm and a Bayesian Spatial Poisson (BSP) model to conduct large-scale realtime traffic conflict prediction with traffic states in a short period that are extracted from a large-scale vehicle trajectory dataset. The integrated approach firstly predicts the traffic conflict occurrence with MLs, and then forecasts the traffic conflict frequency with a BSP model. The study has four main contributions:

  • i) An integrated approach that combines a ML algorithm and a BSP model is proposed to ensure that the conflict prediction has robust predictive performance and interpretation capability.
  • ii) The study predicts the large-scale real-time occurrence and frequency of traffic conflicts with different severities based on a large-scale high-resolution vehicle trajectory dataset.
  • iii) The spatial correlation across the study intersections is accounted for to improve the conflict prediction performance.
  • iv) Several novel spatiotemporal traffic state measures that are used to better predict traffic conflict events are developed.

2. Data collection and manipulation

This study uses the pNEUMA dataset, which is a high-resolution vehicle trajectory dataset collected in central Athens, Greece (Barmpounakis and Geroliminis, 2020). As presented in Fig. 1, the study area includes a central area of 1.3 km2 with more than one hundred busy intersections. A total of ten drones are utilized to record traffic flows during the morning hours (8:00–11:00) on four weekdays. They are October 24th, 29th, and 30th, 2018 as well as November 1st, 2018. Each drone's hovering point is decided by ensuring that there are overlapped coverage areas of neighboring drones. The sampling frequency is 0.04 s, with a maximum positioning error of 33 cm. The pNEUMA dataset is adopted because it provides full-sample, large-scale, and high-resolution vehicle trajectories (Barmpounakis and Geroliminis, 2020). According to the pNEUMA dataset, traffic state parameters and traffic conflict measures can be extracted in the same spatiotemporal window. It should be noted that in the pNEUMA dataset, the data observation periods are relatively short. However, the study focuses on prediction over short intervals (e.g., 30-second), and thus the used dataset can generate adequate samples for the approach training and testing.

Based on the high-resolution vehicle trajectories, traffic state indicators and traffic conflict indicators are calculated at a 30-second interval. The schematic diagram of data extraction is visualized in Fig. 1. It should be noted that due to the consideration of some realistic constraints such as channelization, volume, and spatial distribution, a total of 39 intersections are selected, yielding a total of 20,035 samples.

2.1. Traffic state attributes

Three types of spatiotemporal traffic state indicators are calculated, including the basic traffic flow parameters (Type 1), space-based measures (Type 2), and space–time-based measures (Type 3). According to the Edie's definition (Edie, 1963), basic traffic flow parameters usually includes volume (Q), density (K), and speed (V). They are written as:

$$Q = \sum_{i=1}^{n} t_i / (\Delta x \Delta t) \tag{1}$$

$$K = \sum_{i=1}^{n} d_i / (\Delta x \Delta t)$$ (2)

$$V = \sum_{i=1}^{n} di / \sum{i=1}^{n} t_i$$ (3)

where Δx and Δt represent the size of a specific window in the time–space diagram, Δx is the spatial range of the intersection, and Δt is the time interval; n is the number of vehicles within the window; ti and di are the travel time and distance of vehicle i, respectively. Edie's definitions inherently include the underlying car-following interactions and meet the hydrodynamic relationship Q = K*V (Laval, 2011). To better capture the spatiotemporal characteristics of traffic state, this study further uses a very small timestep τ, which splits the window of Δ*x*Δt into several sub windows, Δ*xΔt* = ∑t i Δx • τi, where t is the number of sub windows within the window. The other two types of spatiotemporal measures are calculated as:

$$m = \frac{1}{\ell} \sum{i}^{\ell} \mathcal{X}{i} \tag{4}$$

Table 2 Descriptive statistics of conflict occurrence and frequency measures.

Conflict frequency Conflict occurrence
Variable Min Max Mean S.D. Variable No conflict events Mean S.D.
Count Percentage
NTTC1 0 26 0.0923 0.5441 BTTC1 18,775 93.71% 0.0629 0.2428
NTTC2 0 26 0.1892 0.6632 BTTC2 17,437 87.03% 0.1297 0.3360
NTTC3 0 32 0.5328 1.0266 BTTC3 13,086 65.32% 0.3468 0.4760
NTTC4 0 63 1.0031 1.4963 BTTC4 9,057 45.21% 0.5479 0.4977
NTTC5 0 81 1.4806 1.9350 BTTC5 6,149 30.69% 0.6931 0.4612
NPET1 0 30 0.0836 0.6185 BPET1 18,705 93.36% 0.0664 0.2490
NPET2 0 34 0.4317 0.8600 BPET2 13,908 69.42% 0.3058 0.4608
NPET3 0 36 0.7320 1.1517 BPET3 10,897 54.39% 0.4561 0.4981
NPET4 0 36 0.9102 1.3187 BPET4 9,518 47.51% 0.5249 0.4994
NPET5 0 54 1.0377 1.4854 BPET5 8,722 43.53% 0.5647 0.4958

Note: "Percentage" means the proportion of no-conflict samples to total samples.

Fig. 2. Overview of the proposed integrated approach.

$$s = \sqrt{\frac{1}{\ell - 1} \sum{i}^{\ell} \left( \mathscr{X}{i} - m \right)^{2}} \tag{5}$$

$$ms = \sqrt{\frac{1}{\ell - 1} \sum_{i}^{\ell} \left( \left( \frac{1}{ni} \sum{i}^{ni} \mathcal{X}{i,j} \right) - \overline{m} \right)^2}$$ (6)

$$sm = \frac{1}{\ell} \sum_{i}^{\ell} \left( \sqrt{\frac{1}{ni - 1} \sum{j}^{ni} \left( \mathcal{X}{ij} - m_i \right)^2} \right)$$ (7)

$$mm = \frac{1}{\ell} \sum_{i}^{\ell} \left( \frac{1}{ni} \sum{i}^{ni} \mathscr{X}{ij} \right)$$ (8)

where m and s are space-based measures (Type 2); m represents the mean value of X i; s represents the standard deviation of X i; X *i*is a measure of conflict in *i*th sub-window; ms, sm, and mm are space–timebased measures (Type 3), in which ms is the standard deviation of the mean values of several sequential time intervals (i.e., the space-mean and time-sd measure, where space-mean represents the mean value within a certain sub-window and time-sd indicates the standard deviation of the sub-windows within a specific window); sm is the mean value of the standard deviations over several sequential time intervals (i.e., the space-sd and time-mean measure), and mm is the mean value of the mean values over several sequential time intervals (i.e., the space-mean and time-mean measure); X *i,j*is the measure of *j*th vehicle in *i*th sub-window; ni and mi are the total number of vehicles and the mean value of X *i,j*in *i*th sub-window, respectively; and m is the mean value of mi; i = 1, 2, ⋯, t and j = 1*,2,⋯,ni*. It should be noted that in this study, Δt = 30s, τ = 1s, and thus t = 30. The descriptive statistics of selected macroscopic variables are presented in Table 1.

2.2. Traffic conflict indicators

To establish the relationship between traffic states and conflicts, the two most prevalent indicators, time to collision (TTC) and post encroachment time (PET), are used to measure the conflicts. TTC is defined as the time remaining before a collision if the involved pair of

Table 3 Strengths and weaknesses of the selected ML classifiers.

ML classifier Strengths Weaknesses
KNN (Cover and
Hart, 1967)
Simple and easy; suitable for
large-scale data.
High computational cost;
high communication cost;
precision degradation.
SVM (Vapnik,
1995)
Strong nonlinear processing;
good promotion; powerful in
multi-view pattern
recognition.
Not suitable for solving
multiple classification
problems and training large
scale data; sensitive to
missing data.
RF (Laval, 2011) Fast; rarely overfitting;
powerful in multi-view
pattern recognition.
Not suitable for solving
multiple classification
problems; sensitive to noise.
GB (Friedman,
2001)
Efficiently and robust;
strong predictive power.
Hard to parallelly train data.
DT (Quinlan, 1986) Simple and easy; suitable for
both numerical and non
numerical data.
Poor on chronological data;
not suitable for multiple
classifications.
LR (Safavian and
Landgrebe,
1991)
Simple and fast; extremely
low computational cost; low
storage resources.
Poor on multi-view data and
multiple classifications; low
accuracy; not suitable for
nonlinear samples.
CatB (
Prokhorenkova
et al., 2017)
Excellent performance;
rarely overfitting, highly
scalable, and robust.
High computational cost;
susceptible to random
parameters.
XGB (Chen and
Guestrin, 2016)
Highly scalable, flexible, and
versatile; robust during the
model tuning.
High memory consumption
and time-consuming; large
cache missing.

Table 4 Diagnostic confusion matrix.

Observed BTTC/BPET
Unsafe (z =
1)
Safe (z =
0)
Total
Predicted
conflict
Unsafe (̂z =
1)
TU FU TU + FU
occurrence Safe (̂z = 0)
Total
FS
TU + FS
TS
FU + TS
FS + TS
TU + FS +
FU + TS

Note: TU means correctly predicting the unsafe condition (i.e., conflict occurs, z = 1), TS refers to the samples correctly identified as safe condition (i.e., no conflict occurs, z = 0), FU corresponds to the safe condition incorrectly predicted as unsafe, and FS indicates unsafe condition incorrectly predicted as safe.

vehicles don't change their speeds and directions (Ismail et al., 2011). PET is defined as the time separation between two vehicles passing each other in a conflict point where the two paths cross each other (Ismail et al., 2011). For rear-end conflicts, TTC is calculated as Equation (9), and for side-impact conflicts, TTC is calculated using Equation (10) (Fu et al., 2021). For PET, these two kinds of conflicts are both calculated in Equation (11).

$$TTC = \begin{cases} \frac{\Delta I - L}{v{sub} - v{pre}}, \forall v{sub} > v{pre} \ \infty, \forall v{sub} \le v{pre} \end{cases}$$ (9)

$$TTC = \begin{cases} \frac{E{nub}}{v{nub}} = \frac{E{pre}}{v{pre}}, & \text{if an underlying conflictoccurs} \ \infty, & \text{if no underlying conflict occurs} \end{cases}$$ (10)

$$PET = \begin{cases} t{sub} - t{pre} \approx \frac{\Delta I}{v_{sub}}, & \text{if an underlying conflict occurs} \ & \infty, & \text{if no underlying conflict occurs} \end{cases}$$ (11)

where Δl is the position distance between two successive car-following vehicles; L represents the length of the preceding vehicle; vsub and vpre

are the instantaneous speeds of the subject vehicle and its preceding vehicle, respectively; Esub and Epre are their position distances to the conflicting point; tsub and tpre represent the moments of the subject vehicle and its preceding vehicle leaving the conflicting point, respectively.

In this study, for both TTC and PET, conflict severity is classified into five levels: 1 s (the most severe), 2 s, 3 s, 4 s, and 5 s. For the subsequent analysis, the numbers of conflicts with different severities within a 30 second interval are collected. In addition, given a threshold (e.g., 5 s), those interactions with either TTC or PET greater than the threshold are considered normal events (i.e., no conflict). Specifically, the number of conflict events within the interval is denoted as NTTC or NPET. Further, the corresponding binary measures named BTTC and BPET are also introduced, which indicate whether a conflict event occurs within the interval. For instance, if NTTC is greater than or equal to 1, BTTC is equal to 1; otherwise, BTTC is equal to 0. Similarly, NTTC1 represents the number of conflicts with TTC ≤ 1 s for a 30-second interval, and BTTC1 signifies whether TTC-based conflict event occurs (BTTC = 1) or not (BTTC = 0) within a 30-second interval. Table 2 presents the descriptive statistics of numbers of conflicts with different severities and the corresponding binary measures.

3. Methodology

3.1. Integrated approach framework

As illustrated in Fig. 2, the proposed integrated approach combines the ML classifier and the BSP model, which ensures that the large-scale real-time conflict prediction has robust predictive performance and interpretation capability. The framework mainly includes conflict occurrence and conflict frequency prediction. With respect to conflict occurrence prediction, the conflict data are transformed into binary data first. Specifically, the variable z is equal to 1 (i.e., conflict) if the observed conflict frequency is greater than zero; otherwise, the variable z equals 0 (i.e., no conflict). The binary logistic regression model is developed to identify significant influence factors, which are then input into ML classifiers for conflict occurrence prediction (i.e., z values of the samples). The best ML classifier is selected. Afterwards, with the consideration of spatial correlation, a BSP is developed to predict conflict frequency based on the samples with predicted z value equals 1 as input.

In the integrated framework, the ML classifier is an indispensable component for implementing the BSP model. On the one hand, for shortterm (e.g., 30 s and 1 min) real-time conflict prediction, the dataset is typically imbalanced due to the data sparsity. Such data imbalanced problem is handled by the ML model with the aid of data resampling technique. Therefore, the output of ML classifier is helpful to screen the necessary input samples for the BSP model, and its interpretability and predictive performance are improved. It should also be noted that, the main objective of the proposed integrated approach is the real-time conflict count prediction, while the real-time conflict risk prediction is the an auxiliary output. From another viewpoint, no conflict risk for a short time interval indicates that the conflict count within the time interval is zero.

3.2. Conflict occurrence and frequency prediction approaches

3.2.1. Binary logistic regression

As one of the most commonly used methods in traffic safety analysis, the binary logistic regression method is applied to identify the significant factors for ML classifiers, because it has stronger interpretability than ML classifiers, and its outcome is easy to explain and comprehend by investigating the statistical significance and the sign of the associated coefficients (Elias and Shiftan, 2014; Hu et al., 2022; Savolainen et al., 2011). A linear relationship between explanatory variable X = (*x*1, *x*2,

Table 5 Results of binary logistic regression models.

Model Estimate Explanatory variables
K V Hm Ns Vsm Vms Asm Amm Ams
BTTC1 Coef. 0.385* − 0.384* – – – – – 0.402** –
P-value <0.001 <0.001 – – – – – 0.009 –
BTTC2 Coef. 0.427* − 0.350* – – – 0.173** 0.341* 0.281*** –
P-value <0.001 <0.001 – – – 0.005 <0.001 0.013 –
BTTC3 Coef. 0.491* − 0.342* – 0.085*** 0.141** 0.293* – 0.389* –
P-value <0.001 <0.001 – 0.023 0.004 <0.001 – <0.001 –
BTTC4 Coef. 0.639* − 0.247* – 0.171* 0.248* 0.359* – 0.446* –
P-value <0.001 <0.001 – <0.001 <0.001 <0.001 – <0.001 –
BTTC5 Coef. 0.713* − 0.234* − 0.008** 0.341* 0.318* 0.468* – 0.501* –
P-value <0.001 <0.001 0.009 <0.001 <0.001 <0.001 – <0.001 –
BPET1 Coef. 0.454* 0.181*** – 0.317* – – – 0.213 –
P-value <0.001 0.024 – <0.001 – – – 0.152 –
BPET2 Coef. 0.495* – – 0.189* – 0.256* – 0.340* –
P-value <0.001 – – <0.001 – <0.001 – <0.001 –
BPET3 Coef. 0.510* -0.1381 − 0.009** 0.181* 0.172* 0.382* – 0.418* –
P-value <0.001 0.001 0.007 <0.001 <0.001 <0.001 – <0.001 –
BPET4 Coef. 0.532* -0.1751 − 0.012* 0.212* 0.212* 0.444* – 0.414* –
P-value <0.001 <0.001 <0.001 <0.001 <0.001 <0.001 – <0.001 –
BPET5 Coef. 0.581* − 0.171* − 0.011* 0.239* 0.207* 0.437* – 0.447* –
P-value <0.001 <0.001 0.001 <0.001 <0.001 <0.001 – <0.001 –

Note: "*", "**", and "***" denotes significance at the levels α = 0*.05, α = 0.01, and α = 0.*001, respectively. '-' means the variable is not included.

…xn) and the log-odds of the event p = P(y = 1|X) can be denoted as g(x) in Equation (12). Therefore, the corresponding effects of the explanatory variables can be calculated by Equation (13), i.e., Odds ratio (OR) (Hu et al., 2022).

$$g(x) = \ln\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1 x_1 + \dots + \beta_n x_n \tag{12}$$

$$OR = \frac{p}{1 - p} = \exp(g(x)) \tag{13}$$

where p represents the conflict occurrence probability, g(x) is the log of the odds ratio or likelihood ratio if a conflict occurs, xi is the traffic state variable, *βi*is the regression coefficient of xi.

3.2.2. ML classifiers

ML classifiers are utilized to predict BTTC/BPET with significant traffic state variables as input. A total of 8 ML classifiers are selected, including KNN (Cover and Hart, 1967), SVM (Vapnik, 1995), RF (Laval, 2011), GB (Friedman, 2001), DT (Quinlan, 1986), logistic regression (LR) (Safavian and Landgrebe, 1991), CatBoost (CatB) (Prokhorenkova et al., 2017), and XGB (Chen and Guestrin, 2016). KNN, as well as SVM, is one of the most popular classifiers and has been widely applied in engineering fields. RF and GB belong to the class of tree-based ensemble learning methods that are derived from DT. The former is an extension variant of Bagging technique, and the latter is a typical Boosting technique. CatB and XGB are the most representative and advanced variants of GB, and they are commonly used as the baseline methods for the performance comparison between ML classifiers. These methods are chosen due to their wide application in the machine learning domain (Al Daoud, 2019; Chen and Guestrin, 2016; Guo et al., 2003; Mohamed and Abdellah, 2021; Muller et al., 2001), and their strengths and weaknesses are summarized in Table 3. These classifiers are implemented to predict BTTC or BPET individually, and the best one is selected for the subsequent analysis.

Besides, as exhibited in Table 2, the BTTC (or BPET) dataset is imbalanced, especially for severe conflicts (for instance, for TTC1, the proportion of conflict events is only 6.29%). Therefore, a resampling method, i.e., Borderline Synthetic Minority Over-Sampling Technique (Borderline-SMOTE) (Han et al., 2005), is employed to resample the dataset for training.

3.3. Bayesian spatial Poisson model

This study uses a BSP with CAR priors to predict the conflict frequency y. The Poisson model is given as (Ismail et al., 2011):

$$Y_i|\lambda_i \ Poisson(\lambda_i)$$ (14)

where Yi is the conflict frequency at intersection i (i = 1*,⋯,* N) for time interval Δt; and *λi*is the expected conflict frequency, which can be formalized as a function of the explanatory variables. It is expressed as:

$$\log(\lambda_i) = \log(e_i) + X_i \gamma + \theta_i + \phi_i$$ (15)

where Xi is a vector of explanatory variables, γ represents a vector of estimable parameters, and each entry of γ is supposed to follow a normal distribution with a zero mean and a large variance, e.g., N (0, 106 ); ei is the conflict exposure, and the traffic volume at intersection is used as an exposure variable, which is expected to have a positive effect on conflicts; *θi*is an unstructured error term that accounts for the unobserved heterogeneity; *ϕi*is a structured error term that captures the spatial correlation.

An ordinary exchangeable normal distribution is specified as the prior for θi, and it is written as:

$$\theta_i \ normal(0, \frac{1}{a_h})$$ (16)

where *αh*is the precision (reciprocal of variance) of θi, and has the noninformative prior gamma distribution (0.5, 0.0005).

The CAR prior of *ϕi*is given as (Besag, 1974):

$$\phi_i \ normal(\overline{\phi}_i, \frac{1}{\alpha_i})$$ (17)

with $$\overline{\phi}i = \frac{\sum{i\neq j} \phii w{ij}}{\sum{i\neq j} w{ij}}$$ and $\alpha_i = \frac{\alphac}{\sum{i\neq j} w_{ij}}$ where $\alpha_c$ is the precision param-

eter in CAR and assigned to a noninformative prior of gamma distribution (0.5,0.0005), *wi,j*is the entry within the adjacency matrix. In this study, a 0–1 first-order adjacency matrix is manually constructed and exported with the software QGIS. If intersection i and intersection j share a common segment, they are considered neighbors, and the weight wi,j between them is 1, and otherwise 0 (Wang et al., 2016).

Additionally, the proportion of variability α in the random effects explained by the spatial correlation term is introduced as (Ismail et al.,

Table 6 Performance evaluation of ML classifiers for conflict occurrence prediction.

Accuracy (%) MAR (%) FAR (%)
M1 M2 M3 M4 M5 M6 M7 M8 M1 M2 M3 M4 M5 M6 M7 M8 M1 M2 M3 M4 M5 M6 M7 M8
BTTC1 81.9 83.0 95.7 88.3 94.7 54.3 75.5 87.2 49.8 99.5 0.0 0.0 0.0 49.8 99.5 0.0 17.4 15.2 4.4 12.0 5.4 45.7 22.8 13.0
BTTC2 72.0 69.7 92.8 88.0 92.1 58.5 70.7 82.9 27.9 30.8 8.7 11.9 8.2 44.7 33.4 11.5 28.1 30.1 6.6 12.1 7.8 40.1 27.6 19.4
BTTC3 72.6 68.7 93.1 86.9 92.0 58.5 69.5 83.6 27.4 31.6 7.4 12.8 8.1 43.2 32.9 10.2 27.4 31.1 6.7 13.3 7.9 40.5 29.1 20.2
BTTC4 72.3 69.3 92.8 87.0 90.9 59.6 69.3 83.6 26.6 30.0 7.7 12.5 8.5 41.0 32.7 11.7 28.2 31.0 6.9 13.2 9.4 40.1 29.5 18.9
BTTC5 71.7 68.3 92.5 86.1 90.7 57.7 67.7 83.1 30.7 32.6 8.7 14.3 9.6 45.1 37.7 12.3 26.9 31.2 6.8 13.7 9.2 40.6 29.0 19.7
Mean 74.1 71.8 93.4 87.2 92.1 57.7 70.6 84.1 32.5 44.9 6.5 10.3 6.9 44.8 47.2 9.1 25.6 27.7 6.3 12.9 7.9 41.4 27.6 18.2
BPET1 78.8 75.1 90.6 86.5 88.6 63.1 79.1 83.8 40.8 44.1 38.8 46.1 39.6 47.7 52.2 39.6 19.9 23.6 7.5 11.4 9.6 36.2 18.8 14.6
BPET2 67.2 63.6 82.3 77.3 80.4 57.9 62.9 74.0 34.1 36.9 22.2 24.1 21.3 42.4 40.3 21.5 31.9 36.1 14.9 21.8 18.5 41.9 35.1 28.9
BPET3 66.1 65.7 80.3 76.6 78.9 55.9 65.9 74.2 37.6 38.0 24.1 28.2 25.8 45.7 40.1 22.2 31.6 32.0 17.0 20.5 18.3 43.2 30.4 28.1
BPET4 65.0 62.2 78.2 73.2 76.8 57.6 63.3 71.4 40.0 41.1 27.3 30.8 25.8 46.7 43.5 25.4 31.9 35.7 18.4 24.3 21.6 39.8 32.5 30.5
BPET5 64.7 63.3 77.6 74.3 75.2 59.2 63.5 71.0 38.2 39.0 26.6 29.3 27.2 41.2 41.4 23.9 33.5 35.3 19.8 23.6 23.3 40.5 33.5 32.1
Mean 68.4 66.0 81.8 77.6 80.0 58.7 66.9 74.9 38.2 39.8 27.8 31.7 28.0 44.7 43.5 26.5 29.8 32.6 15.5 20.3 18.2 40.3 30.1 26.8

2011):

$$\alpha = \frac{sd(\phi)}{sd(\phi) + sd(\theta)} \tag{18}$$

where sd(•) means the empirical marginal standard deviation function.

3.4. Model comparison

3.4.1. ML classifier selection

To evaluate the performance of ML classifier, the diagnostic confusion matrix is calculated by comparing the predicted and observed conflict occurrence, which are detailed in Table 4. Therefore, five essential assessment criteria can be calculated. The first three criteria, including Accuracy, Missingalarmrate(MAR), and Falsealarmrate (FAR), are calculated by Equation (19)-(21). A higher Accuracy, a lower MAR, and a lower FAR indicate that the ML classifier has better performance, and vice versa. The other two criterion are the receiver operating characteristic curve (ROC) and the area under the ROC curve (AUC), and they are also calculated to reflect the ML classifier overall performance.

$$Accuracy = \frac{TU + TS}{TU + FS + FU + TS} \tag{19}$$

$$\textit{Missingalarmrate}(\textit{MAR}) = \frac{FS}{TU + FS} \tag{20}$$

$$False alarm rate (FAR) = \frac{FU}{TS + FU}$$ (21)

3.4.2. Prediction performance evaluation

⎧

The predictive performance of the integrated approach is evaluated by comparing the observed and predicted numbers of conflicts with five severity levels. The evolution criteria are Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and Mean Absolute Error (MAE). They are computed by Equation (22).

$$\begin{cases} RMSE = \sqrt{\frac{1}{N^2}} \sum_{i=1}^{N} \left( x_i - \widetilde{x}i \right)^2 \ MAPE = \frac{100\%}{N} \sum{i=1}^{N} \frac{\left| x_i - \widetilde{x}_i + \varepsilon \right|}{xi + \varepsilon} \ MAE = \frac{100\%}{N} \sum{i=1}^{N} \left| x_i - \widetilde{x}_i \right| \end{cases}$$ (22)

where xi and ̃xi are the observed and predicted values of the conflict frequency, respectively; ε is an extremely small number used to avoid the division by zero (ε = 0*.*0001 in this study); N is the number of the samples in the testing dataset.

4. Results and discussions

4.1. Model estimation results

Since the extracted explanatory variables may be correlated, the multicollinearity between these variables is tested. Some of the variables which show strong multicollinearity are removed. It is found that there is a high correlation between space-mean and time-sd speed and macroscopic speed, sd headway and mean headway, as well as macroscopic density and mean vehicle count, respectively. In virtue of the variance inflation factor (VIF), space-mean and time-mean speed, sd headway, and mean vehicle count are discarded because they contributed to bigger VIF and have relatively weaker representations.

As mentioned earlier, the dependent variables include the binary variables (i.e., BTTC and BPET) and the counting variables (i.e., NTTC and NPET), respectively. The observed data are randomly divided into

Fig. 3. Comparison of ROC curves and AUC to predict conflict occurrence.

the training dataset (80%) and the testing dataset (20%). By considering the significant traffic states (identified by a binary logistic regression) as explanatory variables and conflict occurrence as the dependent variable, eight ML classifiers (including KNN, SVM, RF, GB, DT, LR, CatB, and XGB) are trained separately. Further, based on the conflict frequency from the training dataset, a BSP model is trained. Afterwards, with the use of the testing data, the best ML classifier is performed to predict conflict occurrence for each time interval. For the intervals with conflict occurrence, the BSP model is used to predict the number of conflicts, i.e., conflict frequency. The predicted conflict frequency is compared to the observed conflict frequency. It is noted that both occurrence and frequency of conflicts measured by TTC and PET are predicted, respectively.

Binary logistic regression models are estimated using STATA 12.0. Subsequently, the ML classifiers are implemented using the Sklearn, Catboost, and XGBoost packages from Python (Chen and Guestrin, 2016; Pedregosa et al., 2011; Prokhorenkova et al., 2017). Before executing the ML classifiers, the k-fold cross-validation is used to perform the hyperparameters tuning with GridSearchCV by searching among a typical range of values. The training dataset is randomly divided into k = 5 samples (folds), and the model evaluation is repeated k times, where each time, the remaining *k-*1 folds are used for model training, and the remaining fold is used for validation. BSP models are estimated using the freeware WinBUGS 14.3. The posterior summaries are obtained via 50,000 iterations, and the first 20,000 iterations are discarded as a burnin sample for each model. The ratios of the Monte Carlo errors relative to the standard deviations of the estimates are lower than 5%, and kernel density and trace plots are also utilized to assess the convergence (Fu et al., 2020; Fu and Sayed, 2022c, 2021c).

Table 5 shows the results of the binary logistic regression models for the occurrence of conflicts with different severities. The identified significant explanatory variables are different across different conflict severities. Interestingly, for both BTTC and BPET, the model with lower conflict severity has more significant explanatory variables. For instance, models from BTTC1 to BTTC5 have 3, 5, 6, 6, and 7 significant explanatory variables, respectively. With respect to models BTTC3 and BPET3, models BTTC4 and BPET4, as well as models BTTC5 and BPET5, the identified significant explanatory variables are almost consistent. They are macroscopic density, macroscopic speed, sd vehicle count, space-sd and time-mean speed, space-mean and time-sd speed, and space-mean and time-mean acceleration. In contrast, space-sd and time-mean acceleration and space-mean and time-sd acceleration show weak relationship with the conflict occurrence. On the other hand, the macroscopic density, sd vehicle

count, space-sd and time-mean speed, space-mean and time-sd speed, and space-mean and time-mean acceleration have positive influences on the conflict occurrence, while macroscopic speed and mean headway have negative impacts on the conflict occurrence. These results indicate that the high density, high acceleration, and a large fluctuation of vehicle fleet size within the intersection may contribute to a high likelihood of conflict occurrence. As well, as either the spatial (space-sd and time-mean speed) or temporal (space-mean and time-sd speed) volatility of the speeds increases, the conflict likelihood within the intersection increases. In other words, both the inter-individual heterogeneity of the vehicles' speeds at a certain moment and the time-varying heterogeneity of the vehicles' mean speeds impact conflict occurrence at intersections, i.e., leading to unsafe traffic conditions. On the contrary, a high speed or a high headway indicates a satisfactory interaction scenario and stable traffic flow at intersections, yielding a safer driving environment. From another perspective, macroscopic density and space-mean and time-mean acceleration are the most important explanatory variables for conflict occurrence analysis because they are all statistically significant in these 10 models.

4.2. Large-scale real-time conflict prediction

4.2.1. Conflict occurrence prediction

Table 6 presents the performance evaluation of ML classifiers for conflict occurrence prediction. The table shows that BTTC models generally perform better than BPET models in terms of prediction accuracy, MAR, and FAR. As for ML classifiers, RF always outperforms others regardless of the conflict indicators and severities, which is consistent with previous studies (Hu et al., 2022). Further, the BTTC1 model has the best prediction, and the BPET1 model also performs best, while both the BTTC5 model and the BPET4 model have relatively the worst performance. The ROC curves and AUC values of ML classifiers are shown in Fig. 3. The figure shows that the RF model outperforms others, especially for more severe conflict modeling. Accordingly, the bestperformed RF is ultimately retained and applied for the proposed integrated model.

4.2.2. Conflict frequency prediction

Table 7 and Table 8 show the estimation results of BSP models for conflict frequency prediction with TTC and PET, respectively. It is noted that only significant variables are included in the BSP model.

It is found that similar to conflict occurrence prediction, the significant explanatory factors for numbers of conflicts with different

Table 7 Results of BSP models of conflicts with TTC.

Variable Estimate (NTTC1) Estimate (NTTC2) Estimate (NTTC3) Estimate (NTTC4) Estimate (NTTC5)
Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI
K 0.325* (0.054,0.747) – – 0.323 (0.026,0.616) 0.353 (0.126,0.577) 0.463 (0.275,0.655)
V – – − 0.008* (− 0.563,0.182) – – − 0.296 (− 0.531,-0.059) − 0.403 (− 0.601,-0.210)
Hm – – – – − 0.148 (− 0.299,-0.023) − 0.175 (− 0.296,-0.055) − 0.158 (− 0.256,-0.063)
Vms – – – – − 0.546 (− 0.876,-0.217) − 0.461 (− 0.700,-0.221) − 0.479 (− 0.675,-0.284)
Asm − 0.139* (− 0.848,0.104) − 0.295* (− 1.158,0.011) − 0.603* (− 1.067,-0.148) − 0.506 (− 0.839,-0.172) − 0.505 (− 0.778,-0.233)
Ams – – – – 0.456 (0.188,0.715) 0.387 (0.185,0.589) 0.344 (0.177,0.514)
Amm – – 0.429 (− 0.102,1.232) – – – – – –
α 0.203 (0.053,0.473) 0.173 (0.050,0.411) 0.252 (0.082,0.502) 0.197 (0.069,0.414) 0.206 (0.061,0.465)
sd(ϕ) 0.206 (0.014,1.364) 0.076 (0.014,0.324) 0.224 (0.014,1.934) 0.063 (0.014,0.222) 0.103 (0.014,0.494)
sd(θ) 0.470 (0.202,1.894) 0.296 (0.205,0.558) 0.381 (0.135,2.110) 0.221 (0.167,0.393) 0.292 (0.203,0.703)

Note: "*"denotes significance at 90% BCI, while the remaining at 95% BCI, and '-' means insignificant; 95 %BCI denotes Bayesian confidence intervals.

Table 8 Results of BSP models of conflicts with PET.

Variable Estimate (NPET1) Estimate (NPET2) Estimate (NPET3) Estimate (NPET4) Estimate (NPET5)
Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI Mean 95 %BCI
K – – 0.055* (− 0.057,0.390) – – 0.127* (− 0.097,0.352) 0.256 (0.034,0.482)
V – – – – – – − 0.354 (− 0.591,-0.115) − 0.413 (− 0.641,-0.189)
Hm – – – – − 0.076 (− 0.201,0.003) − 0.152 (− 0.273,-0.034) − 0.158 (− 0.272,-0.046)
Vms − 0.463* (− 1.132,0.085) − 0.174* (− 0.530,-0.055) − 0.353* (− 0.600,-0.109) − 0.318 (− 0.556,-0.076) − 0.360 (− 0.589,-0.130)
Asm – – – – – – – – − 0.448 (− 0.779,-0.115)
Ams – – – – 0.213 (0.021,0.436) 0.246 (0.043,0.448) 0.309 (0.101,0.512)
α 0.161 (0.041,0.430) 0.280 (0.083,0.494) 0.197 (0.070,0.427) 0.196 (0.068,0.426) 0.199 (0.064,0.441)
sd(ϕ) 0.090 (0.014,0.468) 0.691 (0.015,2.881) 0.064 (0.014,0.272) 0.065 (0.014,0.252) 0.080 (0.014,0.362)
sd(θ) 0.356 (0.232,0.726) 1.281 (0.143,4.714) 0.215 (0.158,0.454) 0.221 (0.169,0.399) 0.253 (0.184,0.564)

Note: "*"denotes significance at 90% BCI, while the remaining at 95% BCI, and '-' means insignificant; 95 %BCI denotes Bayesian confidence intervals.

Table 9 Accuracy measure of the proposed integrated approach.

Measure The proposed integrated approaches for different conflict severities
TTC1 TTC2 TTC3 TTC4 TTC5 PET1 PET2 PET3 PET4 PET5
RMSE 0.1699 0.3978 0.5814 1.0482 1.5361 0.1384 0.4241 0.7441 0.8698 1.0213
MAPE 9.26% 13.38% 19.27% 26.97% 36.99% 9.25% 17.22% 20.45% 24.37% 27.87%
MAE 0.0124 0.0343 0.1092 0.3341 0.6383 0.0087 0.0704 0.2015 0.2833 0.3585

severities are not exactly the same, though the NTTC4 model, the NTTC5 model, and the NPET5 model have common significant variables. It can be observed that all the significant variables have a similar influence (either positive or negative) on the number of conflicts with different severities. More specifically, macroscopic density, space-mean and time-sd acceleration, and space-mean and time-mean acceleration are positively associated with the numbers of conflicts with different severities, while macroscopic speed, mean headway, space-mean and time-sd speed, and space-sd and time-mean acceleration show negative effects. One unanticipated finding is that acceleration-based variables, including space-mean and time-sd acceleration, space-mean and time-mean acceleration, and space-sd and time-mean acceleration, have opposite impacts on conflict frequency. Specifically, the higher the space-mean and time-sd/mean acceleration, as well as the lower the space-sd and time-mean acceleration, the larger the conflict frequency is. This may be explained by the fact that given a certain time interval if the conflict is expected to occur, the lower and more differentiated accelerations of vehicles imply a much safer traffic state at intersection.

With respect to the effect of residual terms, α represents the ratio of the spatial residual to the sum of the spatial residual and over-dispersed residual. In light of the values of α (α = 0*.173 ∼ 0.*252 for NTTC models and α = 0*.161 ∼ 0.*280 for NPET models), it can be observed that the consideration of spatial correlation between adjacent intersections improves conflict frequency prediction. Moreover, an interesting difference is that the values of α, sd(ϕ), and sd(θ) for both NTTC and NPET models are higher if the conflict threshold is smaller. This implies that the number of severe conflicts at an intersection is more likely to be affected by the safety conditions of its neighboring intersections.

It is also found that space-sd and time-mean speed and sd vehicle count are statistically insignificant in all the models, which demonstrates that both the heterogeneous speeds of the vehicles within a certain time interval and the change of vehicles' count for a time interval have insignificant effect on intersection conflict frequency prediction. On the contrary, macroscopic density and space-mean and time-sd speed are statistically significant in the most models. Accordingly, the density and deviation of the mean speeds over time may significantly enlarge the indetermination of conflict frequency prediction. An important observation is that the most frequently significant variable for NTTC models is space-sd and time-mean acceleration, while the most frequently significant variable for NPET models is space-mean and time-sd speed because either of them is always significant regardless of the conflict severity. Thus, it can be generally concluded that the heterogeneous spatial distribution of vehicles' accelerations is the most significant factor for TTC-based conflict frequency prediction, and the temporal change of speed of the traffic flow has the most impact on PET-based conflict frequency estimation.

4.2.3. Validation of the integrated approach

With the testing dataset, the predicted results of the integrated approach can be obtained. The accuracy measure of the integrated approach is shown in Table 9. Generally, for severe conflicts, both TTCbased and PET-based models perform better in terms of RMSE, MAPE, and MAE. The PET1 model is the best with RMSE of 0.1384, MAPE of 9.25%, and MAE of 0.0087, while the TTC5 based model is the worst with RMSE of 0.1699, MAPE of 36.99%, and MAE of 0.6398.

Actually, the 3 and 4 s are the most popular used thresholds for surrogate conflict measures (Hu et al., 2022; Sayed and Zein, 1999; Zheng et al., 2021). In this study, the proposed approach performs well for TTC3, TTC4, PET3, and PET4, and the values of RMSE, MAPE, and MAE are 0.4241 ~ 1.0482, 17.22% ~ 26.97%, and 0.0704 ~ 0.3341, respectively. Further, Fig. 4 visually depicts the observed and predicted conflict frequencies as well as the prediction accuracy. The figure shows that the conflict occurrences are distinct from each other across different intersections, though some resemblance among the proximal intersections still can be found due to prominent clustering characteristics in these heatmaps of the observed conflict frequency. Therefore, this emphasizes the need for the consideration of spatial correlation when estimating conflict frequency, which has been considered in the BSP model. Besides, it is apparent from the comparison between the observed and predicted conflict frequencies that the predicted conflict frequency approximately coincides with the observed conflict frequency, which shows the effectiveness of the proposed integrated approach. Moreover, the heatmaps of model accuracy indicate relatively high accuracy for the vast majority of the intersections, from which the noteworthy performance of the proposed integrated approach can be confirmed.

5. Conclusions and discussions

This study proposes an integrated approach that combines a ML algorithm and a BSP model to predict large-scale real-time conflict occurrence and frequency with the use of spatiotemporal traffic state measures. ML classifiers are more effective in traffic event prediction than traditional statistical models in most cases, which can also conveniently mitigate issues related to data sparsity by using the resampling technique. However, the ML classifier cannot specify the associations of the variables, while the traditional statistical model-based method can remedy this defect. For instance, BSP can explain the correlation between conflict frequency and traffic state measures. Apart from BSP, another traditional statistical model-based method, i.e., the logistic regression, is employed to show the correlation between conflict occurrence and traffic state measures. In addition, by combining with the ML classifier, the BSP model does not have to suffer from the data sparsity issue in the integrated approach. As well, the CAR priors that are used to capture the spatial correlation among the observed intersections help to enhance the performance of BSP model.

Based on the analysis, the main findings of the study are summarized as follows:

  • i) It is found that the proposed integrated approach achieves good performance of large-scale real-time traffic conflict prediction. On the one hand, the RF classifier can efficiently predict the conflict occurrence by capturing the traffic state characteristics and performs better than the other tested ML classifiers. On the other hand, the integrated approach achieves desirable results in conflict frequency prediction.
  • ii) The newly developed spatiotemporal traffic state measures are demonstrated to be capable of explaining traffic conflict occurrence and frequency. Specifically, the results of binary logistic models show that traffic state measures are statistically significant in conflict occurrence prediction. Generally, macroscopic density, macroscopic speed, and space-mean and time-mean acceleration are always significant in all the BTTC and BPET models. Furthermore, the BSP model results indicate that traffic state measures can significantly explain

Fig. 4. The visualized accuracy of conflict frequency prediction.

conflict frequency. To be specific, space-sd and time-mean acceleration is the most frequently significant in NTTC models, while space-mean and time-sd speed is always significant in NPET models. It is noted that the significant variables in conflict frequency prediction models are different from those in the conflict occurrence prediction models. Therefore, this comparison shows the usefulness of the proposed integrated approach in expanding our understanding of how traffic state measures affect the occurrence and number of conflicts measured with different conflict indicators. Additionally, the results also clearly highlight the existence of spatial correlation for the conflict frequency between adjacent intersections.

The proposed approach demonstrates the feasibility and importance of real-time traffic safety evaluation and can be extended to other application contexts such as the occurrence and number of crashes at freeways, zonal level analysis, and especially for short-term traffic flow prediction. The approach can be useful for several proactive road safety management applications such as proactively allocating enforcement resources and providing safer route planning for drivers. Moreover, explaining conflicts with traffic states offers the possibility of balancing mobility and safety at intersections since they are consistently represented by the same variables.

Despite the promising results, this study has several limitations. First, the study focuses only on intersections and should be expanded to include road segments. Second, traffic conflicts occurring at different areas within an intersection should be modeled according to the channelization and the interaction patterns of traffic flows. Third, other spatial weight features such as common boundary-length-based, geometric centroid-distance-based, and geometric centroid-distance-order (Wang et al., 2016) can be further considered in the BSP model. Besides, since the time series data is not continuous (some time intervals have no data), the temporal correlation of traffic conflicts is not considered for the BSP model development. Additional studies can concurrently consider both the temporal and spatial correlations of conflicts to improve the BSP model performance with larger dataset. Fourth, the data used for this study are collected during morning hours on four workdays. Such short observation periods may not fully represent weekly/monthly/seasonal variation of traffic flow over one year, which may impact the performance of real-time traffic conflict prediction. Therefore, it is anticipated that collecting vehicle trajectory data over longer observation periods, especially which can cover weekly/ monthly/seasonal variation of traffic flow, will enhance the accuracy and precision of real-time traffic conflict prediction. Finally, both the macroscopic fundamental diagram-based characteristics such as levels of service and the three-phase traffic theory are able to further refine this study on road segments, where previous studies indicate that hazardous traffic conditions may render the traffic state a weaker representative of traffic safety if the macroscopic traffic states (e.g., levels of service, freeflow phase, synchronized flow phase, and wide moving jams) are ignored (Liu et al., 2021; Xu et al., 2015, 2014).

CRediT authorship contribution statement

Dongya Li: Conceptualization, Methodology, Software, Writing – original draft. Chuanyun Fu: Conceptualization, Methodology, Writing – review & editing, Funding acquisition. Tarek Sayed: Supervision, Methodology, Data curation, Writing – review & editing. Wei Wang: Supervision, Writing – review & editing.

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Data availability

Data will be made available on request.

Acknowledgments

The work was jointly supported by the National Natural Science Foundation of China (72371082), Natural Science Foundation of Heilongjiang Province of China (LH2022E074), Opening Project of Intelligent Policing Key Laboratory of Sichuan Province, China (ZNJW2023KFZD001), Fundamental Research Funds for the Central Universities (FRFCUAUGA5710010222), and China Scholarship Council (202106090220).

References