# Predicting Critical Bicycle-Vehicle Conflicts at Signalized Intersections

Authors: Alireza Darzian Rostami; Anagha Katthe; Aryan Sohrabi; Arash Jahangiri
Journal: Journal of Advanced Transportation
 (2020)

---

## Abstract

Continuous development of urban infrastructure with a focus on sustainable transportation has led to a proliferation of vulnerable road users (VRUs), such as bicyclists and pedestrians, at intersections. Intersection safety evaluation has primarily relied on historical crash data. However, due to several limitations, including rarity, unpredictability, and irregularity of crash occurrences, quantitative and qualitative analyses of crashes may not be accurate. To transcend these limitations, intersection safety can be proactively evaluated by quantifying near-crashes using alternative measures known as surrogate safety measures (SSMs). This study focuses on developing models to predict critical near-crashes between vehicles and bicycles at intersections based on SSMs and kinematic data. Video data from ten signalized intersections in the city of San Diego were employed to train logistic regression (LR), support vector machine (SVM), and random forest (RF) models. A variation of time-to-collision called T2 and postencroachment time (PET) were used to specify monitoring periods and to identify critical near-crashes, respectively. Four scenarios were created using two thresholds of 5 and 3 s for both PET and T2. In each scenario, five monitoring period lengths were examined. The RF model was superior compared to other models in all different scenarios and across different monitoring period lengths. The results also showed a small trade-off between model performance and monitoring period length, identifying models with monitoring period lengths of 10 and 20 frames performed slightly better than those with lower or higher lengths. Sequential backward and forward feature selection methods were also applied that enhanced model performance. The best RF model had recall values of 85% or higher across all scenarios. Also, RF prediction models performed better when considering just the rear-end near-crashes with recalls of above 90%.


---

## Body

## 1. Introduction

With a growing interest in using eco-friendly modes of travel such as bicycling and walking, there is an increasing trend in the number of crashes involving. Comparing to vehicular modes of transportation, bicyclists and pedestrians are at an increased risk of fatal or severe injuries at the time of the collision. Based on the National Highway Traffic Safety Administration (NHTSA) report [1] in 2018, 857 bicycle fatalities occurred in the US roadways, which was 6% more than the preceding year and the highest number since 1990. Bicyclist fatalities had increased from 1.9% of total road crash fatalities in 2009 to 2.3% in 2018. Intersections are considered as hot spots when looking at traffic fatalities and injuries due to the complex nature of interactions. The presence of mixed traffic flow specifically makes intersections more important resulting in a large number of traffic incidents and collisions. According to the Federal Highway Administration (FHWA), an average of 2.5 million crashes occur every year at intersections. Traffic Safety Facts published by NHTSA in 2018 indicates that 29% of pedalcyclist fatalities happened at intersections. Road-user movements possessing distinct conflicting patterns could lead to a large number of crashes at signalized intersections [2]. Therefore, it is crucial to understand the dynamics of interactions between bicyclists and motor vehicles by looking at their critical conflicts.In general, direct or indirect techniques can be used to perform safety analysis [3]. Direct techniques hinge on historical crash data to evaluate the degree of road safety. Traditionally, crash frequency and crash severity have been used as metrics for safety evaluations. Crash data help in identifying high-risk locations, current conditions, necessary safety improvements, and safety evaluation of road users [4, 5]. However, unpredictability and irregularity of crash occurrences in the real environment result in the inefficiency of quantitative and qualitative crash determination. Due to the possibility of erroneous or inconsistent reporting, crash data are unreliable [6]. When it comes to improving intersection safety, crash data have several limitations. First, as roadway crashes are rare events, it takes a long period of time for meaningful crash data to be available. This is more so the case when a specific crash type is being studied (e.g., a crash between bicyclists making left turns from an approach and vehicles going through the intersection from the opposite approach). Moreover, changes such as design improvements and demand increase could occur during such long periods, potentially impacting safety evaluation outcomes. Second, reporting of crash events largely depends on the type of road users involved and the severity of crash events and is also found to be unevenly distributed [7]. Specifically, vulnerable road users are heavily underreported, thus making it unreliable and less accurate to use crash data for safety evaluation. Third, although crash data specify the occurrence of the event, it has a limited scope of information regarding the cause of the crash that includes precrash movements, distinct road-user behavior patterns, and other situational aspects [7]. Last, crash data analysis is a reactive approach in which remedial measures can be incorporated only after the occurrence of crashes, and hence, critical locations are identified after observing multiple fatalities and injuries, and countermeasures are implemented after the fact [8].Given these shortcomings, indirect safety indicators have been studied [7, 9–11]. Traffic conflict technique (TCT) was proposed [12, 13] that utilizes conflicts (i.e., near-crashes) as a substitute for actual crashes [14, 15]. A traffic conflict is an “observable situation in which two or more road users approach each other in space and time to such an extent that there is a risk of collision if their movements remain unchanged” [16]. TCT concept classifies various traffic events based on conflict severity level and represents road-user interactions as a continuum of safety-related events. These safety-related events range from slight conflicts, potential conflicts, and severe conflicts [17, 18]. The severity and frequency of these conflicts are typically quantified by measures known as surrogate safety measures (SSMs). Critical near-crashes are detected if an SSM value crosses a critical threshold [19].Frequency estimation of near-crashes using SSMs has been conducted in the past and still is ongoing research. Various SSMs have been used, and among them, time-to-collision (TTC) and postencroachment time (PET) have been widely used to evaluate safety at signalized intersections. At an instantt, TTC is defined as the “time taken by the two road users to collide, provided the collision course and speed difference are the same” [20]. Considering the trajectories of two road users, the relative time-to-collision (RTTC) is estimated as the difference in time taken by the first and second road users to reach a predicted trajectory intersection point (TIP). TTC is considered as a special case of RTTC where the RTTC value is zero (i.e., both users reach TIP at the same time resulting in a collision). As RTTC decreases, the conflict is considered more critical. However, a low value of RTTC could also arise from cases when two objects that are far away from the TIP have close arrival times to the TIP. Therefore, RTTC alone could not be a good indicator of critical near-crashes. To address this issue, Laureshyn et al. [7] proposed T2 as the predicted time taken by the latest road user to reach the conflict points. A low value of T2 indicates time remained for the second road user to perform braking or do an evasive maneuver to prevent or mitigate potential collisions. PET is defined as the “time between the departure of the encroaching vehicle from the conflict point and the arrival of the vehicle with the right of way at the conflict point” [14, 21]. Unlike TTC and RTTC, PET provides a single value for every road-user pair crossing the path of each other. As PET is calculated based on an observed TIP (as opposed to “predicted TIP” in the TTC case), it is considered as a tangible indicator of how critical an interaction is based on what actually occurred as opposed to what was predicted.Since SSMs can be used to identify unsafe events proactively, it is of interest to develop models to predict whether an interaction is going to be safe. Timely prediction of near-crashes could be used in countermeasures such as changing the signal settings to avoid or mitigate crashes or warning approaching road users about potential collisions in a connected environment. However, there are a limited number of studies on this topic, especially for vehicle-bicycle interactions. The goal of this research is to develop models for bicyclists at signalized intersections to predict critical bicycle-vehicle near-crashes. Kinematic features such as velocity and acceleration as well as the SSMs were used in the model development process. The prediction models were developed using logistic regression (LR), support vector machine (SVM), and random forest (RF) methods. The remainder of the paper is organized as follows: past studies are reviewed in the literature review section. Next, data preparation tasks are described. Subsequently, scenario development using different SSMs is explained followed by the model development section. Finally, the model results, conclusions, and potential future research are discussed.


## 2. Literature Review

Modeling crash probability and severity has long been studied among researchers and practitioners. Conventional safety performance functions (SPFs) estimate the crash frequency of a road segment or intersection as a function of explanatory variables describing the characteristics of roadway design and environment, vehicles, and humans [22, 23]. Due to the rare and sporadic nature of crashes, statistical count models such as Poisson and negative binomial (NB) and their variants are frequently used for analyzing explanatory variables and predicting crash frequency [24–26]. Besides statistical count models, artificial intelligence models have also been proposed for crash frequency prediction [27–29]. Typical SPFs consider design features such as speed limits and intersection type as well as aggregated measures like annual average daily traffic (AADT) to identify hazardous locations and missing information about individual driver behavior. However, it was found that variations in traffic dynamics across individuals could be a potential contributing factor to the crashes, which can be utilized to predict the occurrence of crashes in real time [22]. Explanatory variables related to traffic dynamics include speed, flow, and occupancy obtained from real-time traffic data [30].Several studies were conducted considering traffic dynamics data along with crash data to predict crash likelihood at different road types and intersections in real time. Oh et al. [30] defined a 5-minute period right before a crash as a disruptive traffic condition and a 5-minute period 30 minutes before the crash as a normal traffic condition. Using the two traffic conditions, an SPF model was developed using the nonparametric Bayesian approach to assess the likelihood of crashes in real time. It was found that the standard deviation of speed was the most reliable indicator to develop an accurate SPF. In the real-time application of this model, traffic dynamics were continuously monitored in 5-minute intervals to estimate the crash likelihood after each interval. If the likelihood of crash was above a certain threshold, the driver would be alerted to either reduce/increase the speed to minimize the overall speed variation. Similarly, Hossain and Muromachi [31] developed a Bayesian network model using traffic data collected from an expressway over 16 months to predict crashes in real time. This study considered 5-minute aggregated average speed and cumulative flow as the main predictive variables. Five minutes before a crash termed as “precrash traffic conditions” and corresponding average speed and cumulative flow were used to predict the probability of crashes. To improve the performance of the SPF, a hybrid model combining support vector machine and k-means clustering algorithm was developed that promised better crash predictions [32]. Traffic flow data for 5–10 minutes before the occurrence of a crash were considered in this study. Speed, volume, and traffic flow difference between upstream and downstream and average traffic flow were the predictive variables considered in this study. To extend the analysis to signalized intersections, Yuan and Abdel-Aty [33] developed a Bayesian conditional logistic model to predict real-time crashes within the intersection and also at the entrance of the intersection. This model obtained the best results when traffic data were taken from the 5- to 10-minute time period before the crash. In addition to real-time traffic data, signal timing and weather conditions were considered in order to predict crash likelihood.Most crash prediction models utilize historical crash data that have some limitations, as described earlier. In order to overcome these limitations, crash surrogates, also called “near-crashes” or “traffic conflicts,” have been proposed to see if they can serve as reliable indicators of safety. El-Basyouny and Sayed [34] developed SPFs based on traffic conflicts at signalized intersections and found a significant proportional relationship between traffic conflicts and crashes. In a similar study, Sacchi and Sayed [35] developed SPFs from traffic conflicts for each crash type. Some efforts [36–38] focused on developing crash probabilistic frameworks that estimate collision risk based on road users’ hypothetical future movements and the traffic conflict concept. For example, Fu et al. [36] used a distance-velocity (DV) framework to study secondary pedestrian-vehicle interactions at nonsignalized intersections. The framework used in this study incorporates road-user kinematic and SSMs data with driver reaction time to assess the safety of interactions between road users. Several studies investigated the relationship between crashes and near-crashes. Parker and Zegeer [39] showed a statistically significant linear relationship between crashes and near-crashes. He et al. [40] used the safety pilot model deployment (SPMD) to study the statistical relationship between SSMs and crashes and found that modified time-to-collision (MTTC) performed better than deceleration to avoid a crash (DRAC) and TTC.Many studies proved the benefits of the extreme value theory approach that estimates the risk of crashes (extreme events) based on the risky interactions between road users [41–44]. In a recent study, this approach was used to predict crashes at a signalized intersection based on traffic conflicts extracted from microscopic traffic simulation and real-world data [45]. The result showed a high correlation between simulated and actual field traffic conflict and a promising result for crash estimation using field conflict. Zheng and Sayed [46] compared four SSMs, including TTC, PET, modified time-to-collision (MTTC), and deceleration to avoid a crash (DRAC), to estimate crashes at signalized intersections and found that the MTTC produced the most accurate result. Guo et al. [47] evaluated the use of near-crashes to assess the safety and showed a positive correlation between causes for crashes and near-crashes. Similar analyses were conducted by [48, 49] confirming a positive correlation between crashes and near-crashes.Although SSMs have been used in numerous studies to evaluate the safety or investigate their correlations to actual crashes, there is limited research on using SSMs to predict near-crashes, as summarized in Table1. Some studies used regression analysis to estimate the frequency of near-crashes over a time period. For example, Essa and Sayed [52, 54] developed a safety performance model to predict traffic conflicts in each cycle at signalized intersections using a set of explanatory variables such as traffic volume, queue length, and platoon ratio. Ma et al. [53] developed a model to predict an hourly conflict risk index (HCRI) for expressway diverging areas using variables such as traffic volume and speed in the mainline and the ramp areas. HCRI was calculated based on rear-end and lane changing conflicts identified by TTC.Table 1
Near-crash prediction studies.
StudyConflict typeInteraction typeMethodsIdentifying near-crashesLocationIndependent variableEvaluation metricFormosa et al. [50]Rear-end, lane changingVehicles-vehiclesDeep learning (DP)Time headway, lateral acceleration, lateral distance, spacing, speed, etc.Roadway segment26 variables including SSMsClassification: accuracy, AUC, precision, recall, and false alarm ratioOsman et al. [51]Rear-endVehicles-vehiclesKNN, random forest, SVM, decision trees, Gaussian NB, and AdaBoostDefined in the SHRP2 NDS databaseRoadway segmentStd of kinematic dataClassification: accuracy, recall, precision, andF1Essa and Sayed [52]Rear-endVehicles-vehiclesThe safety performance functions (SPFs) were developed using the full Bayesian approachTTC, MTTC, and DRCASignalized intersectionsTraffic volume, shock wave area, maximum queue length, backward-moving shock wave speed, platoon ratioRegression: goodness of fit, the scaled deviance (SD), and the Pearson chi-squared (χ2)Ma et al. [53]Rear-end, lane changingVehicles-vehiclesMultivariate linear regressionTTCExpressway diverging areas and rampsTraffic volume, speed, etc.Regression: goodness of fitR2Other efforts have been done on predicting and classifying the upcoming near-crashes between a pair of road users in real time. Utilizing near-crash data from SHRP2 NDS datasets, Osman et al. [51] applied several supervised machine learning models to predict rear-end near-crashes a few seconds before they happen. The standard deviations of the vehicle kinematics data such as acceleration, yaw rate, speed, and pedal position during a monitoring period before the conflicts were used as independent variables to identify the upcoming unsafe events. The time before a traffic conflict was divided into two periods: the turbulence horizon, which is the time to monitor and record the kinematic data, followed by the prediction period, which is the time for the model to predict the outcome before the conflict. Results from sensitivity analysis showed 1 second as optimal prediction horizon length and 3 seconds as turbulence horizon. This study concluded that near-crash prediction models are highly efficient in predicting most instances of near-crashes with minimum false predictions. Formosa et al. [50] combined highly disaggregated traffic data taken from motorway incident detection and automatic signaling (MIDAS) with various SSMs including TTC and PET calculated from in-vehicle sensors data from an instrumented vehicle using centralized, integrated data architecture to develop a real-time traffic conflict detection and prediction method using deep learning methodology. A total of 26 input variables were used consisting of six widely used SSMs, the mean and standard deviation of ego vehicle’s speed and speed variance between lanes and traffic variables by lane such as speed, density, flow, headway, and occupancy. The safe traffic dynamics and traffic conflicts were identified using time headways between the probe vehicle and the leading vehicle for rear-end and lane changing conflicts. It was found that TTC varied by speed, weather, and traffic density. The best deep neural network model provided an accuracy of 94%. However, this study is limited to lane change and rear-end type of conflicts.


### 2.1. Identification of Critical Events

Although SSMs provide a means to quantify near-crash events, there is a necessity to distinguish such events as critical or noncritical by considering a threshold value for the SSM of interest. Studies on predicting critical near-crashes took different approaches to distinguish between critical and noncritical near-crashes. Formosa et al. [50] considered several criteria for time headway, lateral distance, and speed of following and leading vehicle to identify critical lane changing and rear-end conflict. Essa and Sayed [52] used a range of threshold values for TTC, modified time-to-collision (MTTC), and deceleration rate to avoid a crash (DRAC) to label near-crashes, and they reported the result for all of these variations. Ma et al. [53] recruited a group of students to watch the video and find critical near-crashes. Then, they used a 85-percentile of TTC value as the threshold for this SSM. There has not been a consensus among researchers to use consistent threshold values. This could be due to various factors such as type of the road, different driver behaviors in different locations, type of conflicts, and type of SSMs used [55, 56]. Mahmud et al. [57] provided a review of 38 common SSMs and their thresholds. To find the optimal SSMs threshold, a recent study [58] investigated a range of thresholds for SSMs and chose the ones that maximize the correlation coefficient between crash data and risk associated with SSMs. Sayed et al. [59] included only bicycle-vehicle interactions that had TTC value less than 3 s in their safety evaluation. In another study, the TTC and PET threshold values were considered as 1.5 seconds for interactions between vehicles (including taxis), lorries (including bus), pedestrians, and bicyclists [60]. Considering vehicle-bicycle interactions, Zangenehpour et al. [61] used both TTC and PET threshold values less than 5 seconds and less than 1.5 seconds for labeling them as conflicts and dangerous conflicts, respectively. In some studies [62, 63], conflicts between vehicles and bicycles were classified into more than two categories; conflicts were categorized as very dangerous interactions for PET  ≤  1.5 seconds, dangerous interactions for 1.5 seconds < PET < 3 seconds, mild interactions for 3.0 seconds < PET  ≤  5.0 seconds, and no interactions for PET > 5 seconds. Table 2 summarizes some of the common SSMs threshold used in previous studies.Table 2
PET and TTC thresholds used in previous studies.
SSMsThreshold underStudiesPET1.5[61–63]3[62–64]5[61–64]TTC1.5[60]3[45, 59]5[61]


## 2.1. Identification of Critical Events

Although SSMs provide a means to quantify near-crash events, there is a necessity to distinguish such events as critical or noncritical by considering a threshold value for the SSM of interest. Studies on predicting critical near-crashes took different approaches to distinguish between critical and noncritical near-crashes. Formosa et al. [50] considered several criteria for time headway, lateral distance, and speed of following and leading vehicle to identify critical lane changing and rear-end conflict. Essa and Sayed [52] used a range of threshold values for TTC, modified time-to-collision (MTTC), and deceleration rate to avoid a crash (DRAC) to label near-crashes, and they reported the result for all of these variations. Ma et al. [53] recruited a group of students to watch the video and find critical near-crashes. Then, they used a 85-percentile of TTC value as the threshold for this SSM. There has not been a consensus among researchers to use consistent threshold values. This could be due to various factors such as type of the road, different driver behaviors in different locations, type of conflicts, and type of SSMs used [55, 56]. Mahmud et al. [57] provided a review of 38 common SSMs and their thresholds. To find the optimal SSMs threshold, a recent study [58] investigated a range of thresholds for SSMs and chose the ones that maximize the correlation coefficient between crash data and risk associated with SSMs. Sayed et al. [59] included only bicycle-vehicle interactions that had TTC value less than 3 s in their safety evaluation. In another study, the TTC and PET threshold values were considered as 1.5 seconds for interactions between vehicles (including taxis), lorries (including bus), pedestrians, and bicyclists [60]. Considering vehicle-bicycle interactions, Zangenehpour et al. [61] used both TTC and PET threshold values less than 5 seconds and less than 1.5 seconds for labeling them as conflicts and dangerous conflicts, respectively. In some studies [62, 63], conflicts between vehicles and bicycles were classified into more than two categories; conflicts were categorized as very dangerous interactions for PET  ≤  1.5 seconds, dangerous interactions for 1.5 seconds < PET < 3 seconds, mild interactions for 3.0 seconds < PET  ≤  5.0 seconds, and no interactions for PET > 5 seconds. Table 2 summarizes some of the common SSMs threshold used in previous studies.Table 2
PET and TTC thresholds used in previous studies.
SSMsThreshold underStudiesPET1.5[61–63]3[62–64]5[61–64]TTC1.5[60]3[45, 59]5[61]


## 3. Materials and Methods

This study aims to develop a model to predict critical bicycle-vehicle interactions at signalized intersections. The model response variable is a dichotomous variable (critical or noncritical) that was labeled using the PET value. In addition, this study utilizes T2 (a variation of time to the collision as described earlier) to define a monitoring period during which road-user kinematic data were extracted for prediction model development. The methodology of this study is summarized in Figure 1.Figure 1
Methodology framework.


### 3.1. Data Collection and Preparation

In this study, we used video data collected from cameras installed at ten signalized intersections in the city of San Diego. The video data were collected for a period of 24 hours for each intersection on a workday (Tuesday, Wednesday, or Thursday) in the month of May, June, or July 2018. The original data were collected as part of a previous study [65]. The ten signalized intersections utilized in the present study were chosen based on their higher bicycle activities identified by manually reviewing video recordings. The ten data collection sites are shown in Figure 2 and Table 3.Figure 2
Study intersections.Table 3
Study intersections.
Intersection numberName of the intersection1College Ave & Montezuma Rd25th Ave & Laurel St3Fairmount Ave & University Ave4Fifth Ave & B St5Sixth Ave & Broadway6Genesee Ave & Governor Dr710th Ave & J St8Union St & Ash St97th Ave & Robinson Ave10La Jolla Blvd & Pearl StThe video data were then reviewed focusing on morning, afternoon, and evening peak hours. Based on manual observation of the maximum activity of bicyclists, video data were filtered further down to 5-minute clips to focus on bicycle-vehicle interactions. A video data analysis was performed on raw video data in order to extract the road-users’ trajectory and transform it into the top-down view (bird’s-eye view). The detailed procedure of this process can be found in [65], which discusses tasks such as data annotation, object detection, and trajectory extraction. Figure 3 shows an example of the annotation task that is essential in identifying object trajectories. While the machine vision modeling was not the focus of the present study, the outputs from the machine vision models were used including the road-users type and the location at each frame. Each frame in this study is 1/30 of a second.Figure 3
Example of annotation output.Vehicles and bicyclists were monitored as they interacted with each other to calculate SSMs and kinematic features for each interaction. Several kinematic features including velocity, acceleration, relative approach distance, and relative approach velocity were computed for both vehicles and bicycles at each frame. For each vehicle and bicycle that interacted with each other, the TIPs were predicted utilizing the velocities and headings of the two objects. Next, time taken by each of the objects to reach the predicted TIP was determined as the time to intersection (TTX1 and TTX2, respectively). TTX and its derivatives are continuous variables, meaning that as long as the predicted path of two road-users crosses each other, these values could be calculated. Furthermore, PET was estimated by calculating the difference between the time frame when the first road-user departs from the observed TIP and the time frame when the second one reaches the same observed TIP. Table 4 demonstrates all features that were used in this study.Table 4
Prediction model features.
FeaturesDescriptionVelocityVelocity computed for interacting vehicle and bicycle at every frameAccelerationAcceleration computed for interacting vehicle and bicycle at every frameRelative distanceThe Euclidean distance between interacting vehicle and bicycle in the same frameRelative velocityRate of change of relative distance computed at every frameTTXavgMean of TTX1 and TTX2RTTCAbsolute difference between TTX1 and TTX2T2T2 is defined as the maximum value of TTX1 and TTX2Direction of conflict1: if the angle between two road users is between 0°and 15°, and 0: otherwise1 indicates a rear-end type of near-crash. Otherwise, it could be sideswipe, lane changing, or other types of near-crashesDistance to conflict pointDistance from the current road-user location and the predicted TIP


### 3.2. Scenario Development

Scenarios were developed using two parameters: (1) PET values were employed to identify “critical (C)” or “noncritical (NC)” near-crashes. Two commonly used values of 3 s and 5 s were used to identify critical near-crashes. A near-crash was labeled as critical when the PET value goes below the defined threshold. Also, near-crashes with no PET value or PET value higher than the threshold were labeled as noncritical. (2) As shown in Figure4, T2 values were used to define monitoring periods. The end of the monitoring period (TE) was designated as the first time the T2 value reaches below a defined threshold during an interaction. Two thresholds of 3 and 5 s for T2 were utilized. The interactions that did not have a T2 value below the threshold were not considered as a near-crash. For example, the T2 value of 5 seconds means that in an interaction, the second road-user (farthest from the TIP) has 5 seconds to perform a maneuver to avoid a potential crash. Stepping 1, 5, 10, 20, and 30, frames backward from the monitoring period end points marked different starting points (TS), resulting in five different lengths of monitoring periods (1/30 s, 1/6 s, 1/3 s, 2/3 s, and 1 s, respectively). As a result, four scenarios were developed for near-crash prediction models using different PET (i.e., 3 and 5) and T2 (i.e., 3 and 5) thresholds. Each scenario was examined for five different monitoring periods. As illustrated in Figure 4, kinematic features and SSMs such as RTTC were recorded during the monitoring period until T2 reaches below the threshold (e.g., 3) at TE. Kinematic data recorded at each time frame during a monitoring period resulted in a series of values for each feature. Therefore, statistical measures such as mean and standard deviation were used to reduce multiple values into one. Due to sudden changes in speed and travel direction, the value of SSMs was not present at all frames during an interaction. Therefore, the last value of these features recorded at the end of the monitoring period was used. The last recorded value of SSMs is also more indicative of the severity of an interaction as it presents the situation closest to the TIP. Table 5 shows all the 30 initial features used in this study.Figure 4
Scenario development parameters.Table 5
Input features.
Kinematic features(i) Mean of object 1 velocity, max of object 1 velocity, min of object 1 velocity, and the standard deviation of object 1 velocity(ii) Mean of object 2 velocity, max of object 2 velocity, min of object 2 velocity, and the standard deviation of object 2 velocity(iii) Mean of object 1 acceleration, max of object 1 acceleration, min of object 1 acceleration, and the standard deviation of object 1 acceleration(iv) Mean of object 2 acceleration, max of object 2 acceleration, min of object 2 acceleration, and the standard deviation of object 2 acceleration(v) Mean of relative distance, max of relative distance, min of relative distance, and the standard deviation of relative distance(vi) Mean of relative velocity, max of relative velocity, min of relative velocity, and the standard deviation of relative velocitySSM-related featuresT2, RTTC, TTXavg, object 1 distance to conflict point, object 2 distance to conflict point, and direction of conflict


### 3.3. Model Building and Analysis

Predicting bicycle-vehicle conflicts as “critical conflicts” and “noncritical conflicts” is a classification problem. Three popular supervised machine learning classifiers of logistic regression, SVM, and random forest were used to build vehicle-bicycle near-crash prediction models. Logistic regression is a commonly used machine learning classifier offering ease of implementation and interpretation and fast computation. Also, it has been extensively used in crash prediction literature and mostly as a baseline model. Since the dependent variable in this study is dichotomous (critical or noncritical near-crashes), we used binary logistic regression to describe the relationship between the dependent and independent variables. SVM is a supervised machine learning classifier that can be used to solve both classification and regression problems. This method plots each data point in then-dimensional space defined by the input features. Then, the algorithms find the best hyperplane that could divide the classes with the largest gap between classes. Depending on the kernel function, SVM could perform linear and nonlinear classification boundaries. SVM is suitable for cases with high-dimensional input features, and it could perform well in facing the outliers and extreme cases in binary classification, leading to good generalization. Random forest (RF) is an ensemble learning method that can be used for both classification and regression problems. It generates several random decision trees at training time and relies on the majority of votes across these trees to predict classes for each observation. RF performs well on imbalanced datasets, and since it generates several trees on the subset of the data and combines the output of all the trees, it reduces overfitting and variance problems.In this study, logistic regression and SVM were implemented using the Python scikit-learn library. The random forest classifier was implemented using the BalancedRandomForestClassifier in the Python imbalanced-learn package. In this implementation of random forest, random undersampling of the majority class (noncritical near-crashes) was performed on each bootstrap sample. This classifier was chosen to address the issue of imbalanced data in the prediction model.


### 3.4. Model Evaluation

Model performance was evaluated using stratified 5-fold cross-validation with 20 repeats. This approach is appropriate for small-sized datasets and helps eliminate bias and overfitting in model training [66]. In this implementation, the dataset is split into 5 stratified folds with the same ratio of positive and negative cases, and each time one of the folds is used as a test set, and the remaining folds are used for training. This process is repeated 20 times, which provides a more robust model assessment.To evaluate our models, several performance metrics were used, such as AUC (area under the curve), overall accuracy, recall, andF2. AUC is the area under the receiver operating characteristic (ROC) curve that measures the ability of a classifier to correctly distinguish between classes. The F2 is a variation of the F-score measure, which calculates the harmonic mean of precision and recall, as shown in equation (1). A high value of the F-score indicates a high balanced classifier performance. In F2 calculation, higher weight is given to recall because correctly identifying the minority class (i.e., critical near-crashes) is more important than incorrectly classifying a noncritical conflict as critical. Other metrics such as the overall accuracy alone may not be suitable for model evaluation as they result in poor classification performance for the minority class. Therefore, we opted to use F2 as the primary metric for comparing results between different classifiers, though other metrics were also used for comparison:(1)F2=1+22×precision×recall22×precision+recall.


## 3.1. Data Collection and Preparation

In this study, we used video data collected from cameras installed at ten signalized intersections in the city of San Diego. The video data were collected for a period of 24 hours for each intersection on a workday (Tuesday, Wednesday, or Thursday) in the month of May, June, or July 2018. The original data were collected as part of a previous study [65]. The ten signalized intersections utilized in the present study were chosen based on their higher bicycle activities identified by manually reviewing video recordings. The ten data collection sites are shown in Figure 2 and Table 3.Figure 2
Study intersections.Table 3
Study intersections.
Intersection numberName of the intersection1College Ave & Montezuma Rd25th Ave & Laurel St3Fairmount Ave & University Ave4Fifth Ave & B St5Sixth Ave & Broadway6Genesee Ave & Governor Dr710th Ave & J St8Union St & Ash St97th Ave & Robinson Ave10La Jolla Blvd & Pearl StThe video data were then reviewed focusing on morning, afternoon, and evening peak hours. Based on manual observation of the maximum activity of bicyclists, video data were filtered further down to 5-minute clips to focus on bicycle-vehicle interactions. A video data analysis was performed on raw video data in order to extract the road-users’ trajectory and transform it into the top-down view (bird’s-eye view). The detailed procedure of this process can be found in [65], which discusses tasks such as data annotation, object detection, and trajectory extraction. Figure 3 shows an example of the annotation task that is essential in identifying object trajectories. While the machine vision modeling was not the focus of the present study, the outputs from the machine vision models were used including the road-users type and the location at each frame. Each frame in this study is 1/30 of a second.Figure 3
Example of annotation output.Vehicles and bicyclists were monitored as they interacted with each other to calculate SSMs and kinematic features for each interaction. Several kinematic features including velocity, acceleration, relative approach distance, and relative approach velocity were computed for both vehicles and bicycles at each frame. For each vehicle and bicycle that interacted with each other, the TIPs were predicted utilizing the velocities and headings of the two objects. Next, time taken by each of the objects to reach the predicted TIP was determined as the time to intersection (TTX1 and TTX2, respectively). TTX and its derivatives are continuous variables, meaning that as long as the predicted path of two road-users crosses each other, these values could be calculated. Furthermore, PET was estimated by calculating the difference between the time frame when the first road-user departs from the observed TIP and the time frame when the second one reaches the same observed TIP. Table 4 demonstrates all features that were used in this study.Table 4
Prediction model features.
FeaturesDescriptionVelocityVelocity computed for interacting vehicle and bicycle at every frameAccelerationAcceleration computed for interacting vehicle and bicycle at every frameRelative distanceThe Euclidean distance between interacting vehicle and bicycle in the same frameRelative velocityRate of change of relative distance computed at every frameTTXavgMean of TTX1 and TTX2RTTCAbsolute difference between TTX1 and TTX2T2T2 is defined as the maximum value of TTX1 and TTX2Direction of conflict1: if the angle between two road users is between 0°and 15°, and 0: otherwise1 indicates a rear-end type of near-crash. Otherwise, it could be sideswipe, lane changing, or other types of near-crashesDistance to conflict pointDistance from the current road-user location and the predicted TIP


## 3.2. Scenario Development

Scenarios were developed using two parameters: (1) PET values were employed to identify “critical (C)” or “noncritical (NC)” near-crashes. Two commonly used values of 3 s and 5 s were used to identify critical near-crashes. A near-crash was labeled as critical when the PET value goes below the defined threshold. Also, near-crashes with no PET value or PET value higher than the threshold were labeled as noncritical. (2) As shown in Figure4, T2 values were used to define monitoring periods. The end of the monitoring period (TE) was designated as the first time the T2 value reaches below a defined threshold during an interaction. Two thresholds of 3 and 5 s for T2 were utilized. The interactions that did not have a T2 value below the threshold were not considered as a near-crash. For example, the T2 value of 5 seconds means that in an interaction, the second road-user (farthest from the TIP) has 5 seconds to perform a maneuver to avoid a potential crash. Stepping 1, 5, 10, 20, and 30, frames backward from the monitoring period end points marked different starting points (TS), resulting in five different lengths of monitoring periods (1/30 s, 1/6 s, 1/3 s, 2/3 s, and 1 s, respectively). As a result, four scenarios were developed for near-crash prediction models using different PET (i.e., 3 and 5) and T2 (i.e., 3 and 5) thresholds. Each scenario was examined for five different monitoring periods. As illustrated in Figure 4, kinematic features and SSMs such as RTTC were recorded during the monitoring period until T2 reaches below the threshold (e.g., 3) at TE. Kinematic data recorded at each time frame during a monitoring period resulted in a series of values for each feature. Therefore, statistical measures such as mean and standard deviation were used to reduce multiple values into one. Due to sudden changes in speed and travel direction, the value of SSMs was not present at all frames during an interaction. Therefore, the last value of these features recorded at the end of the monitoring period was used. The last recorded value of SSMs is also more indicative of the severity of an interaction as it presents the situation closest to the TIP. Table 5 shows all the 30 initial features used in this study.Figure 4
Scenario development parameters.Table 5
Input features.
Kinematic features(i) Mean of object 1 velocity, max of object 1 velocity, min of object 1 velocity, and the standard deviation of object 1 velocity(ii) Mean of object 2 velocity, max of object 2 velocity, min of object 2 velocity, and the standard deviation of object 2 velocity(iii) Mean of object 1 acceleration, max of object 1 acceleration, min of object 1 acceleration, and the standard deviation of object 1 acceleration(iv) Mean of object 2 acceleration, max of object 2 acceleration, min of object 2 acceleration, and the standard deviation of object 2 acceleration(v) Mean of relative distance, max of relative distance, min of relative distance, and the standard deviation of relative distance(vi) Mean of relative velocity, max of relative velocity, min of relative velocity, and the standard deviation of relative velocitySSM-related featuresT2, RTTC, TTXavg, object 1 distance to conflict point, object 2 distance to conflict point, and direction of conflict


## 3.3. Model Building and Analysis

Predicting bicycle-vehicle conflicts as “critical conflicts” and “noncritical conflicts” is a classification problem. Three popular supervised machine learning classifiers of logistic regression, SVM, and random forest were used to build vehicle-bicycle near-crash prediction models. Logistic regression is a commonly used machine learning classifier offering ease of implementation and interpretation and fast computation. Also, it has been extensively used in crash prediction literature and mostly as a baseline model. Since the dependent variable in this study is dichotomous (critical or noncritical near-crashes), we used binary logistic regression to describe the relationship between the dependent and independent variables. SVM is a supervised machine learning classifier that can be used to solve both classification and regression problems. This method plots each data point in then-dimensional space defined by the input features. Then, the algorithms find the best hyperplane that could divide the classes with the largest gap between classes. Depending on the kernel function, SVM could perform linear and nonlinear classification boundaries. SVM is suitable for cases with high-dimensional input features, and it could perform well in facing the outliers and extreme cases in binary classification, leading to good generalization. Random forest (RF) is an ensemble learning method that can be used for both classification and regression problems. It generates several random decision trees at training time and relies on the majority of votes across these trees to predict classes for each observation. RF performs well on imbalanced datasets, and since it generates several trees on the subset of the data and combines the output of all the trees, it reduces overfitting and variance problems.In this study, logistic regression and SVM were implemented using the Python scikit-learn library. The random forest classifier was implemented using the BalancedRandomForestClassifier in the Python imbalanced-learn package. In this implementation of random forest, random undersampling of the majority class (noncritical near-crashes) was performed on each bootstrap sample. This classifier was chosen to address the issue of imbalanced data in the prediction model.


## 3.4. Model Evaluation

Model performance was evaluated using stratified 5-fold cross-validation with 20 repeats. This approach is appropriate for small-sized datasets and helps eliminate bias and overfitting in model training [66]. In this implementation, the dataset is split into 5 stratified folds with the same ratio of positive and negative cases, and each time one of the folds is used as a test set, and the remaining folds are used for training. This process is repeated 20 times, which provides a more robust model assessment.To evaluate our models, several performance metrics were used, such as AUC (area under the curve), overall accuracy, recall, andF2. AUC is the area under the receiver operating characteristic (ROC) curve that measures the ability of a classifier to correctly distinguish between classes. The F2 is a variation of the F-score measure, which calculates the harmonic mean of precision and recall, as shown in equation (1). A high value of the F-score indicates a high balanced classifier performance. In F2 calculation, higher weight is given to recall because correctly identifying the minority class (i.e., critical near-crashes) is more important than incorrectly classifying a noncritical conflict as critical. Other metrics such as the overall accuracy alone may not be suitable for model evaluation as they result in poor classification performance for the minority class. Therefore, we opted to use F2 as the primary metric for comparing results between different classifiers, though other metrics were also used for comparison:(1)F2=1+22×precision×recall22×precision+recall.


## 4. Results and Discussion

A total of 324 vehicle-bicycle interactions were identified with a T2 of less than 5 s. Of these events, 85 cases had PET values less than 5 s, and 58 cases had PET values less than 3 s. Considering the T2 threshold of 3 s reduced the number of events to 174 interactions, of which 56 had a PET value of less than 5 s and 46 had a PET value of less than 3 s. The decrease in the number of cases is due to the fact that a smaller threshold would naturally result in fewer observations.Figure5 shows the F2 performance of all scenarios of near-crash prediction models. The balanced random forest surpassed SVM and logistic regression in all scenarios. Due to the random undersampling of the majority class on each bootstrap, the balanced random forest performed better on the imbalanced data. Also, it could be seen that for interactions with T2 less than 5 s, models using 10-frame monitoring periods had higher performance, while for interactions with T2 less than 3 s, 20-frame monitoring period models performed better. By increasing the monitoring period length, there are more data available for the model, which potentially could help to predict near-crashes more accurately. However, by increasing the length of the monitoring period, data from way before the near-crash occurrence are added to the model, which could negatively impact the model performance. Therefore, a small trade-off between model performance and monitoring period length is noticeable, showing models with monitoring period lengths of 10 and 20 frames performed slightly better than those with lower or higher monitoring period lengths.Figure 5
F2 performance of all models. (a) PET = 5 and T2 = 5; (b) PET = 3 and T2 = 5; (c) PET = 5 and T2 = 3; (d) PET = 3 and T2 = 3.
(a)(b)(c)(d)Table6 shows the detailed result of the best near-crash prediction model for each of the four scenarios.Table 6
Result of the best near-crash prediction models using all features.
ScenariosMonitoring periodClassifierAccuracyAUCRecallF2PrecisionPET = 5 and T2 = 510RF0.6980.7840.7780.6910.488PET = 3 and T2 = 510RF0.6570.7760.8240.6360.338PET = 5 and T2 = 320RF0.6840.7680.7450.6860.537PET = 3 and T2 = 320RF0.6750.7850.8060.6990.478In order to reduce overfitting and improve model performance, a sequential backward and forward feature selection was performed. These methods were implemented using the Python Mlxtend package [67]. In the backward feature selection, the algorithm starts with all of the features, and then in each step, one feature that after elimination maximizes the model performance is removed. Also, in each step, algorithms try adding previously removed features back to the feature subset to see if they could increase the performance. The algorithm went through all 30 features in this study and identified the best subset of features with the highest F2 performance in the balanced random forest using the same cross-validation technique. The forward selection utilizes a similar procedure, except that it starts, with zero features, and features are added in each step. In case both forward and backward feature selections reach the same result, the feature subset containing fewer variables is selected for model training to reduce overfitting. Figure 6 shows the best performance obtained from feature selection for each of the scenarios.Figure 6
Best result achieved using the forward and backward feature selection in each scenario. (a) Monitoring period = 10, PET = 5, and T2 = 5; (b) monitoring period = 10, PET = 3, and T2 = 5; (c) monitoring period = 20, PET = 5, and T2 = 3; (d) monitoring period = 20, PET = 3, and T2 = 3.
(a)(b)(c)(d)Table7 shows the detailed result of near-crash prediction using the selected subset of features. As can be seen from the table, feature selection significantly improved model performance.Table 7
Result of the best near-crash prediction models after feature selection.
ScenariosMonitoring periodClassifierAccuracyAUCRecallF2PrecisionPET = 5 and T2 = 510RF0.7080.8070.870.7550.501PET = 3 and T2 = 510RF0.6510.8020.9060.6810.346PET = 5 and T2 = 320RF0.7440.8290.8450.7740.597PET = 3 and T2 = 320RF0.7140.8140.910.7830.514Changing the T2 threshold from 5 to 3 s resulted in F2 improvements, as shown in Table 7. Events with smaller values of T2 present situations where road users are closer to the TIP. Therefore, the improvements could be attributed to the fact that as road-users move closer to the TIP, their behaviors are better reflected in their kinematic and SSM-related features. Furthermore, lowering the T2 threshold results in exclusion of less severe interactions and improves the data imbalance, which in turn could improve the model performance.Lastly, the prediction models were investigated only for the rear-end type of near-crashes. Rear-end near-crashes were identified as interactions with the direction of conflict of one, which almost constitutes half of the interactions in each scenario. Table8 shows the best results obtained in each scenario for rear-end near-crashes after the feature selection. Comparing Table 8 with Table 7, the near-crash prediction models perform better in almost all of the metrics when considering rear-end interactions alone. The increase in performance could be due to the fact that, in rear-end near-crashes, the interacting road users are on the same or adjacent lanes traveling towards the same direction. Therefore, the future trajectories of these road users are more predictable. In contrast, in other types of near-crashes, such as crossing or sideswipe interactions, it is more challenging to predict the road-user movements. The sudden changes in the direction of travel and yielding for traffic when making turns or crossing add more uncertainty to the prediction problem.Table 8
Result of the best near-crash prediction models for rear-end interactions after feature selection.
ScenariosMonitoring periodClassifierAccuracyAUCRecallF2PrecisionPET = 5 and T2 = 510RF0.7660.8020.9360.8410.614PET = 3 and T2 = 510RF0.7670.8730.920.7870.516PET = 5 and T2 = 320RF0.8020.8650.9530.870.671PET = 3 and T2 = 320RF0.8440.9220.9410.8780.734


## 5. Conclusions and Future Works

There has been an alarming rise in the number of crashes involving bicyclists at signalized intersections. This study adopted a proactive safety assessment approach to predict critical bicycle-vehicle near-crashes at signalized intersections a few seconds before they occur. Kinematic data of interacting road users and SSMs during a monitoring period were used to develop prediction models to distinguish critical from noncritical events. Video data collected from ten signalized intersections in the city of San Diego were used in this study. Critical interactions between vehicles and bicyclists were labeled using two PET thresholds of 3 and 5 s. Different monitoring periods were also defined using two T2 thresholds of 3 and 5 s as well as five different monitoring period lengths from 1/30 to 1 second. Near-crash prediction models were developed and compared using three machine learning classifiers of SVM, logistic regression, and random forest.In almost all metrics, the balanced random forest provided higher prediction performance compared to SVM and logistic regression and, therefore, was identified as the best classifier. While all four scenarios of near-crash prediction models performed fairly well with recalls above 70% andF2 above 60%, two feature selection methods of backward and forward were adopted to reduce the overfitting and improve the model performance. These two algorithms were implemented in order to find the subset of features with the highest F2 and with the same cross-validation as for model training. The feature selection significantly improved the recall and F2 metrics to above 85% and around 70% across all four scenarios, respectively. Also, the AUC metric for all the models was above 80% after feature selection. Predicting rear-end near-cashes recall values were further improved to above 90% in all the scenarios, suggesting better prediction performance can be achieved when only a certain conflict type is taken into account. The results also showed that when the end of the monitoring period is defined with a T2 threshold of 5 s, 10-frame monitoring periods led to the best prediction performance. When a T2 threshold of 3 s was used, 20-frame monitoring periods resulted in the best performance. Monitoring periods smaller or larger than 10 and 20 led to lower prediction performance in all scenarios. This suggested a small trade-off between the monitoring period length and the prediction performance.The models developed in this study could be utilized in intelligent transportation management centers focusing on proactive safety applications. The modeling framework used in this study could also be extended and applied to conflicts involving other road-user types (e.g., vehicle-scooter). In a connected environment, these models can inform proactive safety planning in real time by identifying where and when critical conflicts occur between road users. Developing accurate near-crash prediction models for all types of interactions is challenging. Typically, cyclists move faster than pedestrians, and their movements are generally more unpredictable than vehicles. Moreover, many bicyclists tend to participate in dangerous and sudden maneuvers while passing the intersection. The emerging transportation technology such as automated vehicles, as well as newer modes of transportation such as electric bicycles and scooters with unknown behavioral impacts, would also add to the complexity of the prediction problem. Future research may focus on extensive data collection for all road-user types and at different geographical locations in order to obtain representative interaction samples. The present study focused on developing models using kinematic data only. However, it should be noted that other factors such as geometric design, traffic signal schemes, and weather could also play important roles in identifying the severity of near-crash events. While this study adopted SSM thresholds recommended by previous studies, it should be noted that any SSM and threshold should be validated as there is no consensus among researchers on what metrics or thresholds are the right ones for unsafe event identification. Future research may focus on including other environmental and design characteristics in near-crash identification and also incorporating more metrics and thresholds as well as qualitative analysis to conduct validation and sensitivity analysis studies. Future work could also entail investigating multiple conflict severity classes, other methods, and features.



---

*Source: 8816616-2020-12-03.xml*