Proposing New Methods to Estimate the Safety Level in Different Parts of Freeway Interchanges

Since attention to the safety of traﬃc facilities including freeway interchanges has been increased during recent years, accident prediction models are being developed. Simulation-based surrogate safety measures (SSMs) have been used in the absence of real collision data. But, obtaining diﬀerent outputs from diﬀerent SSMs as safety indicators had led to a complexity of using them as the collision avoidance system basis. Additionally, applying SSM requires trajectory data which can be hardly obtained from video processing or calibrated microsimulations. Estimating safety level in diﬀerent parts of freeway interchanges through a new proposed method was considered in this paper. Fuzzy logic was applied to combine the outputs of diﬀerent SSMs, and an index called no-collision potential index (NCPI) was deﬁned. 13608 calibrated simulations were conducted on diﬀerent ramps, weaving, merge, and diverge areas with diﬀerent geometrical and traﬃc characteristics, and NCPI was determined for every case. The geometrical and traﬃc characteristics formed input data of two safety estimator models developed by Artiﬁcial Neural Network and Particle Swarm Optimization. Ten freeway interchanges were investigated to calibrate the simulations and to ensure the validity of the fuzzy method and accuracy of the models. Results showed an appropriate and accurate development of the models.


Introduction
Providing an acceptable safety level of traffic facilities is logically vital due to its consequent effects on prevention of fatality and property damage.On the other hand, the low level of safety shall lead to the low performance of these facilities, as well.Since the freeways have always played a significant role in road transportation, determination of the safety level in different segments of the freeways has been one of the main concerns of researchers.Previous investigations are divided into two categories.ese two categories include the real-accident data analyzing and the simulation-based safety study.In the real-accident studies, the effect of some factors (such as mainline speed at the beginning of the weaving segments, the speed difference between the beginning and the end of the weaving segment, the logarithm of the volume, the maximum length of the weaving area [1], the heavy vehicle rate, the hourly traffic volume, the speed differential between cars and heavy vehicles, the number of accesses [2], the number of vehicles that enter and exit the freeway at a specific segment, the length of the speed change lane, the speed of off-ramps [3], parallel-type or taper-type exit ramps [4], left-side or right-side merging and diverging areas [5,6], the number of lanes on freeways, the number of lanes on ramps, and the speeding-related crashes [7]) on the number and/or severity of accidents was separately investigated and some models were developed.When there are no registered data about the accidents in a specific facility or when someone is trying to design that facility or when the facility has not yet been built, simulation-based safety studies/estimations such as conflict analysis by microscopic simulation and surrogate safety measures (SSMs) including time-to-collision (TTC), postencroachment time (PET), proportion of stopping distance (PSD), crash potential index (CPI), unsafe density (UD), max speed (Max S), relative speed (ΔV), kinetic energy (KE), and deceleration rate to avoid collision (DRAC) are often used to estimate the danger or risk of possible collisions.Integrating the rate of TTC variation and the level of hazard associated with TTC as an approximate safety indicator [8] and calculating the risk of sideswipe collisions [9] are some kind of using these measures.An FHWA-sponsored research project has also studied the potential to derive SSMs from existing traffic simulation models.In that research, TTC, PET, and DRAC were used to measure the severity of the conflict, and by use of additional information about the mass of the vehicles, Max S and ΔV were used to measure the severity of the potential collision [10].
ese are some examples of using simulation-based SSMs.ese measures are so useful because they occur more frequently than accidents and therefore need shorter periods of the study compared with real-accident investigations [11].It is important to note that the results of using SSMs mostly showed a good relationship between the proposed SSM and actual accident data [12].So, using the SSM will help to stay far from long-term real-accident data analysis.But, there are some shortcomings in this way.Different surrogate measures for safety result in different outcomes, and unfortunately, an acceptable method to choose the best outcome especially to use as the basis of collision avoidance systems has not yet been presented.On the other hand, using these measures requires some prerequisites such as providing microsimulation software, simulation experts, and trajectory data.In addition, when it is intended to investigate the safety aspects of interchanges, there is not enough literature which focused well on these traffic facilities to review.Here, the questions are that by focusing on freeway interchanges: (1) Is it possible to combine the outcomes of different SSMs and have an exclusive outcome which could be a safety indicator of the interchange or not?(2) Could the level of safety be indicated just by having traffic and geometrical characteristics of the interchange instead of simulation attempts, trajectory data, or accident data?
e first purpose of the paper is to present a method to show that it is possible to give a positive answer to the first question.To do this, the fuzzy inference system (FIS) was used to combine the outcomes of the SSM, and fuzzy logic was applied to define an index called no-collision potential index (NCPI) as a safety indicator of the interchange (i.e., the exclusive outcome).Fuzzy logic could be a suitable technique where qualitative definitions cannot be directly quantified.e next purpose is to develop a model to estimate the safety level in the ramps, weaving, merge, and diverge areas of interchanges based on their traffic and geometrical properties.One of the approaches in developing the model is using a powerful tool dealing with the prediction and classification problems, and that is Artificial Neural Network (ANN) which has been a consistent alternative method to analyze the freeway accident frequency and does not require any predefined underlying relationship between dependent and independent variables [13].Another approach is using an evolutionary computation algorithm motivated by the behavior of organisms and gathered social psychology principles in sociocognition human agents and evolutionary computations.e algorithm is particle swarm optimization (PSO) which has a simple concept and efficiency in computations and is implemented easily [14][15][16][17].

Description of the Proposed Fuzzy Method
2.1.1.NCPI Definition and Determination.In this paper, a fuzzy-based method was proposed to estimate the safety level in different parts of freeway interchanges.In this method, different outputs of SSMs were combined, and the outcome was NCPI which is defined as a safety indicator.
e value of NCPI falls within the range of zero to 100. e higher the value of NCPI, the higher the safety level.Since it was intended to indicate the level of safety despite many other types of research that usually determine the level of risk, NCPI was defined to show the likelihood of no collision in the interchange instead of indicating the probability of collisions to occur.To determine the NCPI, the SSM were categorized into two groups: Number estimation measures: the measures consist of TTC, PET, PSD, CPI, UD, and DRAC which are usually used to measure the severity of the conflicts.ese measures can be used to estimate the number of nearcrash events.Severity estimation measures: the measures include Max S, ΔV, and KE which are usually used to measure the severity of the potential collisions.Due to the complexity and time-consuming of using all measures, in this research study, the measures of TTC and DRAC were selected to estimate the number of possible collisions, and the severity of these potential collisions was estimated by the measures KE and ΔV.

Definition of the Used SSM.
Here, the definitions of the measures TTC, DRAC, KE, and ΔV are briefly described.
TTC: this was first defined by Hayward as the remaining collision occurrence time between two vehicles if the collision course and speed difference were maintained constant [18].When TTC is low, there is an imminent danger of collision [19].TTC for rear-end conflicts can be calculated by [20] TTC where TTC is the time-to-collision, X is the vehicle position (L: leading and F: following), V is the vehicle speed (L: leading and F: following), and l is the vehicle length.DRAC: deceleration rate is a good measure to detect dangerous maneuvers.DRAC is the rate at which a vehicle 2 Advances in Civil Engineering must decelerate to avoid a probable collision.For vehicles traveling in the same path, DRAC is de ned as [11] DRAC where l veh L is the length of the leading vehicle and other parameters were described previously.For angled con icts, the equation changes as where ΔV ij(t) is the relative speed of two vehicles engaged in the con ict and D i(t) is the distance between the current position of the vehicle i and point of the intersection ahead of two vehicles.KE: from Newtonian physics, we know that a moving vehicle has a kinetic energy as [21] where K is the kinetic energy, m is the mass, and v is the speed of the vehicle.e kinetic energy transferred to the target vehicle can be calculated by where KE s is the kinetic energy transferred to the target vehicle, m s is the mass of the target vehicle, and Δv s is the change of the target vehicle speed before and after the collision [21].Δv: Δv is the relative speed of vehicles involved in the con ict as a collision severity re ector [22].

Trajectory Data Analysis.
Finding the variables' values of (1-5) requires analyzing the data of trajectory.It was assumed that the vehicles had a linear movement with a constant acceleration or deceleration rate between every two consecutive time intervals in the analysis.So, the coordinates of the intersection ahead of two vehicles i and j could be computed.e acceleration or deceleration rate and speed of vehicles could also be determined using these assumptions.It should be noted that any collision in the study areas could either be a rear-end collision or occurs at an angle of β.
us, the analysis should be done with respect to angled collisions.In a special case in which the angle of collision is zero, it will be a rear-end collision.e collision of two vehicles at an angle of β is depicted in Figure 1.
On the other hand, it is necessary to check whether the coordinates are within the limits of the study area or not.By assuming no changes in the conditions, it can be concluded that two vehicles i and j will never collide with each other if the coordinates of the intersection ahead of the two vehicles are outside of the limits of the study area.
e distance between the position of each vehicle to the intersection ahead and the time required to reach this point can be obtained by simple calculations.Assume that T i and T j are the time required to reach the point of intersection of vehicles i and j, respectively.While the absolute value of the di erence between T i and T j is less than the TTC threshold, there will be a near-crash event.e value of the TTC threshold varies in several studies.e proposed values of thresholds are 1.5 seconds for urban areas [23], 4 seconds to distinguish between safe and unsafe situations [12], and 1.0 second for critical situations [24].But, according to the surrogate safety assessment model, which considers a con ict as an event with TTC less than 1.5 seconds [25], a threshold of 1.5 seconds was used in this paper.Among di erent pairs of vehicles i and j, the number of those that encountered a near-crash event was counted by where C TTC is the number of pairs of vehicles that encountered a near-crash event.Regarding the angled collision of two vehicles i and j, the relative speed of these two vehicles at the time of the collision could be determined by (7) and (8) in each direction of vehicles i and j.
where β is the angle of collision.e minimum required DRAC could be also found by Maximum deceleration rate for di erent vehicles was proposed by Maurya and Bokare [26].If the value of each of the DRACs is more than the maximum deceleration rate, there will be a near-crash event.e DRAC of a couple of vehicles, i and j, is the maximum DRAC of them as written in (11).e number of cases in which a near-crash event takes place will be counted by where C DRAC is the number of cases in which a near-crash event occurs.e speed of the vehicle i at the time of collision is calculated by

Advances in Civil Engineering
where a i is the acceleration/deceleration rate of the vehicle i and V i is the speed of the vehicle i at the time of analysis.Decomposition of the speed vectors at the moment of collision is shown in Figures 2 and 3. So, the relative speed of two vehicles i and j at the moment of the collision could be determined by If the di erence between the speed of vehicle j before and after the collision is equal to the ΔV obtained above, the amount of kinetic energy transferred in the collision will be de ned as where m j is the mass of vehicle j.
2.1.4.Probabilistic Framework.Four surrogate measures were used to estimate the number and the severity of possible collisions.But the probability that a near-crash event becomes a real collision should be determined and be considered in the model development.
ere are two following probabilities: (1) e probability that after detection of an event as a near-crash event, the event becomes a real collision (it is possible that both or one of the drivers prevents the collision to take place by performing an evasive act).(2) e probability that the severity of collision does not change (it is possible that both or one of the drivers engaged in a collision reduces the speed to avoid the collision.Even if the collision occurs, the collision severity will become lower).
When both or one of the drivers has a time to react, both mentioned probabilities will appear.In other words, the more the TTC, the less the probability of the collision taking place with a certain severity.A probability density function (PDF) was de ned which was sensitive to the perceptionreaction time of drivers.For this purpose, an exponential PDF was selected among the most appropriate distributions which satisfy the requirements of the problem and was written as where Pr i is the probability that a near-crash event with a certain severity becomes a real collision with the same severity, t reaction is the perception-reaction time of drivers, and λ is a constant value which should be de ned based on the problem.Since the probability must be closed to one when TTC approaches zero second, the value of λ should be equal to 1.0.e American Association of State Highway and Transportation O cials (AASHTO) mandates using a perception-reaction time of 2.7 seconds in most calculations [27].But, in certain more complex situations, drivers may require more time to react than 2.7 seconds, for example, situations where drivers should detect and react to unexpected events.According to the AASHTO, where a collision avoidance maneuver is needed, the perception-reaction time of 3.0 seconds should be used for rural roads and 9.1 seconds for urban roads.In situations that avoiding a collision needs alterations in the speed, path, and/or direction, the AASHTO recommends a range of perception-reaction time between 10.2 and 11.2 seconds for rural roads, 12.1 and 12.9 seconds for suburban roads, and 14.0 and 14.5 seconds for urban roads [28].Due to the high speed of vehicles, disorderly movements of vehicles, and a high number of lane changes in a freeway interchange, avoiding a collision certainly requires changing the speed, path, and direction.So, the perception-reaction time of 11.2 seconds was used in this paper.Figure 4 presents the relation between the probability and TTC with λ 1.0 and t reaction 11.2.
Vehicle i

4
Advances in Civil Engineering e number and the severity of collisions in di erent parts of freeway interchanges could be better estimated by applying the above probability as where N TTC is the number of predicted collisions by the TTC, N DRAC is the number of predicted collisions by the DRAC, S KE is the severity of predicted collisions by the KE, and S ΔV is the severity of predicted collisions by the ΔV.

Fuzzy Logic.
e estimated number of collisions using the measures of TTC and DRAC is usually di erent, and the results of the severity of the predicted collisions using the measure of KE are not the same as that of the measure of ΔV, as well.But, all the outputs from the four measures should be considered all together.So, the NCPI must be a function of the outputs of the four mentioned measures as four variables as shown in e determining function of the NCPI was de ned using a Mamdani-type FIS with four inputs (the values of the four measures) and one output (NCPI).At rst, a membership function with three qualitative classes was de ned for each measure.en, a fuzzi cation procedure was implemented for the measures.It means that the quantitative value of each measure was automatically placed in one of the three qualitative classes of "low," "medium," and "high" using the membership functions.Between NCPI and its variables, 81 rules were set.ese rules determine the qualitative value of NCPI by taking the qualitative values of the four measures into account simultaneously.Table 1 presents the 81 applied  Advances in Civil Engineering rules.A membership function for NCPI was de ned with ve qualitative classes of "very low," "low," "medium," "high," and "very high."So, a qualitative index was attributed to NCPI based on the rules and the membership function.After all, a defuzzi cation procedure using the centroid method was accomplished, and the quantitative value of NCPI was obtained by the use of NCPI membership function.e FIS settings for AND/OR methods were set to MIN/MAX and for IMP/AGGR methods were set to MIN/MAX, as well.Figure 5 shows the membership functions of NCPI and N TTC , for example, and Figure 6 depicts two samples of 3D pro les of NCPI and its variables.

Field Study.
e eld study was carried out to reach the following three aims: (1) To calibrate the simulations (2) To control the validity of the proposed method in which the safety level is indicated using fuzzy logic and SSM (3) To check the accuracy of safety estimator models (the safety estimator models will be described in the following sections) Ten freeway interchanges in Tehran Province in Iran were investigated.All the tra c and geometrical characteristics of the interchanges were gathered and shown in Table 2.
e behavior of the drivers and the trajectory data were extracted by video processing tools.e driving times in di erent parts of the interchanges, the headways, the real acceleration and deceleration scenarios, the number of lane changes, the route selections of the drivers, the length before the gores which the lane change occurs, and the accepted gap for the lane change were obtained by analyzing the behavior of the drivers.According to the gathered data and analysis on the behavior of the drivers, the simulation was calibrated.
e value of the NCPI was also computed for every case by analyzing the real trajectory data and applying the proposed fuzzy method.e interchanges were simulated, and trajectory data were derived.
e NCPIs computed using simulation trajectory data were compared with the NCPIs obtained from real trajectory data for controlling the validity   7 presents the aerial photos of the ten studied interchanges.e results were used to check the accuracy of the future developed safety estimator models, too.

Development of Safety Estimator Models.
In the previous section, it was shown that the safety level could be determined using microsimulation, trajectory data analysis and computations, SSM, and the proposed fuzzy method and computing NCPI.But, providing expensive prerequisites like simulation software, simulation experts, trajectory computations, and the time required is di cult and time-consuming.In this paper, it was intended to develop two models to estimate the level of safety based on geometrical and tra c characteristics of freeway interchanges.Developing the models needs generating a database containing geometrical and tra c characteristics of the ramps, weaving, merge, and diverge areas as inputs and computed NCPIs as output.en, ANN and PSO were used to develop the models.

Generating Database
. Every e ective geometrical and tra c variable which may a ect the safety level of the interchange was recognized, and a list of these variables comprising the length of the weaving area, the number of lanes in the weaving area, the number of lanes in on-ramp, the number of lanes in o -ramp, the free ow speed in freeway, the free ow speed in on-ramp, the free ow speed in o -ramp, the freeway ow rate, the on-ramp ow rate, the o -ramp ow rate, the length of the acceleration lane, the length of the deceleration lane, the length of the interchange ramp, the average slope of the ramp, and the ramp radius was prepared.Table 3 describes the variables and their range used for the simulations.Combining various values of each variable with those of the other variables resulted in the generation of 13608 di erent ramps, weaving, merge, and diverge areas with di erent tra c and geometrical characteristics.Di erent kinds of interchange ramps, weaving, merge, and diverge areas with di erent geometry and di erent tra c characteristics were simulated.
e trajectory data were derived from every simulation run.By applying the proposed fuzzy-based method, NCPI was computed for every case.us, a database could be generated containing 10368, 2160, 720, and 360 rows of information for weaving areas, merge areas, diverge areas, and ramps, respectively.
As described in Table 4, the database comprised geometrical and tra c characteristics of the ramps, weaving, merge, and diverge areas of the interchange as inputs and computed NCPIs as the output.Using this database, the models could be developed.

ANN Approach.
ANNs are massive parallel architectures that can determine answers to demanding problems with the participation of simple mutually dependent processing elements (arti cial neurons) [29].An ANN has powerful aspects of learning and data processing, and thus, it is an e ective tool for engineering applications.e multilayer backpropagation network, the most popular ANN paradigm [30], was used for e cient generalization competence.ANNs have the ability to carry out with a good amount of generalization from the patterns on which they are trained [31].Training incorporated processing neural networks with a set of known speci c input-output data using the generated database.
e backpropagation ANN included layers with neurons: the input layer, the output layer, and the hidden layers.
e learning process was continued in the output layer where the error between the model outputs and desired outputs was calculated and then propagated back to the network with updated weights for the direction in which the performance function decreases very rapidly [32].e entire training process was repeated for a number of epochs until the desired accuracy in the network output was gained.After training and then, validation of the network, the network was tested by using data that have never experienced before.

Advances in Civil Engineering
Determining the number of hidden neurons is an important task.e number of hidden neurons has a strong effect on the stability of the neural network which is estimated by error (minimal error reflects better stability).e random selection of a number of hidden neurons may cause either overfitting or underfitting of the predicting models [33]. is concern arises when the network corresponds to the data so closely that the ability to generalize over the test   8 Advances in Civil Engineering data is lost.An excessive number of hidden neurons will cause over tting where neural networks overestimate the complexity of the target problem.In this sense, determination of the proper number of hidden neurons to prevent over tting is critical for problem estimation with the capability for steady generalization with the lowest possible deviation in estimation.Accordingly, the number of hidden neurons must be delimited within a reasonable range.To reach the minimum error, the optimized number of hidden neurons was determined.e ANN model had also a number of neurons in the input layer and one neuron in the output layer.In the trial and error attempts, the number of neurons in the input layer was considered equal to or a multiple of the number of variables in every part of the interchange.Subsequently, the neural network results were evaluated to determine the number of neurons that would provide satisfactory results.
To ensure good generalization under ANN processing, dividing the experimental data into three subdivisions is mandatory: training, validation, and testing.For database partitioning, Looney recommended 25% for testing [34], whereas Swingler proposed 20% [35] and Nelson and L W is the length of the weaving area, N W is the number of lanes in the weaving area, N R-ON is the number of on-ramp lanes, N R-OFF is the number of o -ramp lanes, V FW is the freeway volume, V R-ON is the on-ramp volume, S FW is the freeway free-ow speed, S R-ON is the speed of on-ramp, and S R-OFF is the speed of o -ramp.b L ACC is the length of the acceleration lane, V FW is the freeway volume, N FW is the number of freeway lanes, V R-ON is the on-ramp volume, N R- ON is the number of on-ramp lanes, S FW is the freeway free-ow speed, and S R- ON is the speed of on-ramp.c L DEC is the length of the deceleration lane, N FW is the number of freeway lanes, N R-OFF is the number of o -ramp lanes, V FW is the freeway volume, S FW is the freeway free-ow speed, and S R-OFF is the speed of o -ramp.d L R is the length of the interchange ramp, N R is the number of lanes in the interchange ramp, S LONG is the average slope of the ramp, V R is the ramp ow rate, and R R is the radius of the ramp.Illingworth suggested 20 to 30% [36].
erefore, in the present work, the training dataset consists of 60% of data entries, and the remaining data entries are divided equally between the validation and testing sets.To test the reliability of the neural network model, 20% of the samples were randomly selected as the validation set and 20% of the samples as the test set.e performance of an ANN-based model primarily depends on the network architecture and parameter settings.In this study, the Matlab ANN toolbox [37] was used for ANN applications.All the networks were trained using the Levenberg-Marquardt algorithm with tansig transfer functions between the input and the hidden layers and the purelin transfer function between the hidden layers and the output layer along with a trainlm training function.Performance evaluation was characterized by plots of root-mean-squared error (RMSE) versus epoch for the training, validation, and test performances of the data.In principle, the error is reduced after more epochs of training but may begin to increase on the validation dataset as the network starts over tting the training data.To reach the best ANN, its performance was deduced from the epoch with the lowest validation error after which there was no more increase in the RMSE error.Consequently, a reliable ANNbased safety estimator model was developed, and therefore, NCPI could be estimated using adequate information about the values of geometrical and tra c characteristics.e structure of the ANN used for estimation of the safety level in the weaving area is shown in Figure 8 a PSO algorithm to be used for global optimization on the basis of random exploration methods and models of simple social systems.ey stated that the algorithm is very e cient in solving the nonlinear problems.e PSO algorithm is established based on researches on di erent communities such as birds' community and can be used to optimize both nonlinear-continuous and discrete problems.In addition, the algorithm does not require plenty of time and memory for calculations because of its simple concept [17,38,39]."Any information can be exchanged among the population" and "the behavior of each particle is a ected by the behavior of other particles in the community" are the two hypotheses of the PSO algorithm which forms its basic concepts according to the results of a lot of studies on di erent communities.PSO has been developed in a two-dimensional (x-y) space, and the coordination of each particle is de ned in this space.
e vectors of the movement of particles are illustrated as V x and V y in each direction as velocity vectors.So, the movements of each particle are depicted by its coordination and vectors.Every particle in the community tries to optimize a speci c target function.It knows its own best results and current coordination, and the particle is also informed about the best results of the community.erefore, the movement vector of each particle can be achieved by [40]  where v k i is the movement vector of particle i in iteration k, v k+1 i is the modified movement vector of particle i, rand is a random digit between 0 and 1, x i k is the current location of particle i in iteration k, pbest is the best result of particle i, gbest is the best result of the community, w i is the weight coefficient of the velocity vector of particle i, and c i is the weight coefficient of each component.e location of each particle can be obtained by [40]: e concept of modifying the search point is depicted in Figure 9.
To ensure the convergence of the PSO, a contraction factor was applied to (27).
us, the equation of the movement vector is modified as [40] where K is the contraction factor and can be computed by [40] All parameters were described previously.Choosing an appropriate w will lead to creating a balance between the general and local search.e coefficient w can be calculated by [40] where iter is the number of iterations and iter max is the maximum number of iterations.Based on the above concepts, the following steps were performed to develop the PSO-based safety estimator model in the four parts of freeway interchanges.
Step 1 (defining the general formulation).Equation (33) depicts the general formulation of the PSO algorithm.
where NCPI i,PSO is the NCPI calculated by the PSO-based model in iteration i, t 1 to t n are the traffic variables, g 1 to g n are the geometry variables, and a 1,i to a n,i are the constant parameters and coefficients of the PSO basic equation.
Step 2 (defining the input data).e geometry and traffic variables in the database were considered as the input data of the PSO algorithm.
Step 3 (defining the target output data).e NCPIs (safety level) in the rows of information of the generated database were considered as the target output data.
Step 4 (proposing a basic equation with adequate constant parameters and coefficients).Some equations were proposed, and after a great deal of trial and error attempts, the best equations were chosen.Equations (34)(35)(36)(37)(38)(39)(40) are the selected equations.Constant parameters of the basic equations would be defined based on the generated database.
Weaving area: where NCPI W is the NCPI in the weaving segment, L W is the length of the weaving area, N W is the number of lanes in the weaving area, N R-ON is the number of on-ramp lanes, N R-OFF is the number of off-ramp lanes, V FW is the freeway volume, V R-ON is the on-ramp volume, S FW is the freeway free-flow speed, S R-ON is the speed of on-ramp, S R-OFF is the speed of off-ramp, and a i and b i are constant parameters.Merge area: where NCPI M is the NCPI in the merge area, L ACC is the length of the acceleration lane, N FW is the number of freeway lanes, N R-ON is the number of on-ramp lanes, V FW is the freeway volume, V R-ON is the on-ramp volume, S FW is the freeway free-flow speed, S R-ON is the speed of on-ramp, and a i and b i are constant parameters.

Advances in Civil Engineering
Diverge area: FW + a 7 e a 8 S FW + a 9 S R-OFF + a 10 , where NCPI D is the NCPI in the diverge area, L DEC is the length of the deceleration lane, N FW is the number of freeway lanes, N R-OFF is the number of off-ramp lanes, V FW is the freeway volume, S FW is the freeway free-flow speed, S R-OFF is the speed of off-ramp, and a i and b i are constant parameters.Ramps: where NCPI R is the NCPI of the interchange ramp, L R is the length of the ramp, L R,mod is the modified length of the ramp, N R is the number of lanes in the ramp, S LONG is the average slope of the ramp, V R is the ramp flow rate, R R is the radius of the ramp, and a i and b i are constant parameters.
Step 5 (checking the difference between the NCPIs estimated by the PSO-based model and the NCPIs in the database).e results of the NCPI using the basic equations were compared to the NCPI in the database, and the RMSE was calculated by where NCPI i,DB is the NCPI in the rows of information of the generated database.
Step 6 (obtaining the global best result).After a lot of trial and error attempts and several iterations, the best results of constant parameters (as the global best results) of the basic equations were obtained when the possible minimum RMSE was reached.

Statistical Analysis.
e models were evaluated by statistical analysis and field studies.e survey results were compared with the models' outputs.Regarding possible differences between the survey results and the models' outputs, it was necessary to know that these differences were because of either data distribution and their random properties or a significant diversity between the outcomes.Statistical analysis indicated whether there was a significant difference between the surveyed NCPIs and the corresponding NCPIs estimated by the models or not.A pooled t-test was used due to the limited number of samples.Statistical t could be calculated by [41] where µ m and µ s are the mean of the models' population and the mean of the survey population, respectively.n m and σ m are the number of samples and standard deviation of the models' results, and n s and σ s are the number of samples and standard deviation of survey results, respectively.Computed t should be compared with the tabulated values of the t-distribution table.e tabulated values of the t-distribution table depend on the degree of freedom, f, which represents the number of independent parts.e degree of freedom is defined by (44) in t-distributions [41]: Once the statistical t is determined, the tabulated values of the t-distribution table yield the probability of a situation in which the t value is greater than the computed value.In order to limit the probability of a "type I" error to 0.05, the difference in the means will be considered significant only if the probability is less than or equal to 0.05.In other words, if the calculated t value falls within the 5% area of the tail, or in other words, if there is less than a five percent chance that such a difference could be found in the same population, the difference in the means will be considered significant.If the probability is greater than 5% (or the computed t value is less than the tabulated values of the t-distribution table), it could be concluded that such a difference in means could be found in the same population and the difference would not be considered significant [41].

Results and Discussion
Estimation of the safety level in the ramps, weaving, merge, and diverge segments of freeway interchanges was the main purpose of this research.A huge number of simulated parts of freeway interchanges and the ten existed freeway interchanges in Tehran Province in Iran were investigated, and by using the proposed fuzzy-based method, the NCPI was determined in every case.e models' required database was generated after the NCPI was calculated in all the cases.e database contained, respectively, nine, seven, six, and five traffic and geometric characteristics for weaving areas, merge areas, diverge areas, and ramps as inputs and the NCPIs as output.erefore, two ANN-based and PSO-based models were developed utilizing the database.

ANN Results.
e ANN-based development process was accomplished, and data training was stopped when the RMSE in the validation set began to increase, which signifies that the ANN generalization stopped increasing.Further analysis was conducted to test the accuracy of estimation by completely new input data to ensure that the reference model of the neural networks provides reliable results.To verify that the given estimation models are suitable to provide reliable results, a complete set of new data (which were not used in the evaluation) was used.e results of the ANN-based model were categorized into three collections of all data, validation data, and test data as indicated in Figure 10 for interchange ramps, for instance.For each collection, ANN outputs were compared with the NCPI in the database (as the target), and the results were presented in the first graph.Error diagram and error distribution of the data of each collection were depicted in the second and third graphs, respectively.e results of using the ANN to estimate the NCPI in the four parts of the interchange are illustrated in Figure 11, and the correlation between the estimated NCPI by the ANN-based model and the NCPI in the generated database in the interchange ramps was represented in Figure 12, for instance.According to the results, considering the fact that all neural network models showed similar small error means and high coefficients of correlation, the difference between the results of training and validation sets was negligible.
As shown in Figures 11 and 12, the analysis indicated a relative agreement between the NCPIs in the database and estimated data, according to all statistical performance measures.e standard deviation, coefficient of correlation, error mean, and RMSE of the three collections demonstrated a proper development of the ANN-based model.e low values of RMSE and error mean and the high value of coefficient of correlation are commonly recognized as a good estimation of the model.
But, comparing the statistical results of the four parts with each other, the highest coefficient of correlation and the minimum RMSE along with the smallest value of standard deviation were found in the diverge area.e lowest coefficient of correlation was detected in the merge area, and the high values of RMSE and standard deviation were obtained in interchange ramps and merge areas.However, the results of conducted analysis indicated that the proposed ANN-based model could generally be used to estimate the safety level of the four parts of the freeway interchange with sufficient accuracy, and the results clearly depicted that, for all the samples, values estimated with the ANN-based model are strongly consistent with the values obtained by analyzing the trajectory data.It is clear that the modeling results are exceptionally correct; therefore, there is no doubt regarding the accuracy of the estimation performance of the ANNbased model.

PSO Results
. After a lot of trial and error attempts, the maximum number of iterations and the best population size (swarm size) were discovered in the PSO-based model development process.When the algorithm reached the minimum MSE as the best cost, the trial and error attempts were stopped.erefore, the constant parameters of (34)(35)(36)(37)(38)(39)(40) were determined based on the results of iterations.e global best results and their position in the basic equations along with MSE and RMSE of the algorithm for the diverge area are presented in Figure 13, for instance, and a brief overview of applying the optimization process on all parts of interchanges is presented in Table 5.    Advances in Civil Engineering All parameters were described previously.

Field Studies' Outcomes.
As it was mentioned before, field studies were used to evaluate the proposed method and the models.Six weaving areas, five merge areas, five diverge areas, and five ramps were surveyed through the field study on ten freeway interchanges of Tehran Province in Iran.e values of the NCPI were computed using trajectory data analysis and estimated by applying ANN-based and PSObased models on the interchanges with characteristics brought in Table 2. e results of statistical analysis are illustrated in Table 6.It could be said that no significant differences between the means of the models' population and the real population were found when almost all computed statistical t-values (which are achieved from statistical analysis of the population of the models and studied areas) are less than the tabulated values of the t-distribution table.

Conclusion
In this paper, it was intended to propose a new method to have an exclusive safety indicator among different SSMs at the first step and to develop a model to estimate the safety level according to geometrical and traffic characteristics of different parts of freeway interchanges at the second step.Different surrogate measures were combined using fuzzy logic, and an index called NCPI was defined as a safety level indicator.e variables of NCPI including outputs of four surrogate measures of safety were determined by analyzing the trajectory data.
e trajectory data could be either achieved from video processing or derived from microsimulation.
en, NCPI was obtained by applying fuzzy rules to the variables.It was done to estimate the level of safety when there are not enough data or information about the number and severity of accidents or the segment is just being designed and has not yet been built.Due to the difficulties of accessing or obtaining the trajectory data, two models were developed by ANN and PSO algorithms to estimate the safety level based on geometrical and traffic characteristics of interchanges.At last, field studies were carried out to calibrate the simulations, controlling the validity of the proposed fuzzy method and checking the accuracy of safety estimator models.
e results indicated an acceptable confidence about the validity of the proposed fuzzy method.
e results also showed a good accuracy of the developed models in terms of compliance with the database generated from data analysis and also surveyed data of the field studies.It also became clear that, in most cases, the results of the ANN-based model have more accuracy than the results of the PSO-based model.However, the advantage of using the PSO-based model is that finally, there will be a certain relationship which can be conveniently used, while the ANN-based model has some prerequisites to work, say, database knowledge and MAT-LAB expertise.
e developed models can also be used for comparing different proposed plans of interchanges from safety aspects and ranking them in the design steps and plan selection process.In these cases, the lower accuracy of some PSObased models compared with the ANN-based models does not matter.
In general, the proposed models will be valid when the geometric and traffic characteristics of interchange's parts fall within the range of variables' values used for model development.Definitely, the more the difference between the values of these characteristics and the range of mentioned variable values, the more the reduction in the validity of the models.Another conclusion is that the models could be trained to estimate other traffic parameters such as the density, delay, and speed of interchange's parts or other traffic facilities based on their traffic and geometric characteristics.
In this paper, it was proposed to use fuzzy logic and the algorithms of ANN and PSO to estimate the safety level of different parts of freeway interchanges.But, there will be a long way to reach a point that these methods become general and be used in every situation.In this way, we propose that these methods can be applied in a wider range of variables' values and also be used in other segments of the freeway which include traffic conflicts, merging, or diverging.

Figure 1 :
Figure 1: Collision of two vehicles at an angle of β.

Figure 2 :
Figure 2: Decomposition of the speed vectors of vehicle j parallel with and perpendicular to the movement direction of vehicle i.

Figure 3 :
Figure 3: Decomposition of the speed vectors of vehicle i parallel with and perpendicular to the movement direction of vehicle j.

Figure 4 :
Figure 4: PDF for a near-crash event becomes a real collision.

Figure 5 :
Figure 5: e membership functions for NCPI and N TTC .

Figure 6
Figure 6: e 3D pro les of NCPI and its variables.(a) Severity estimation variables; (b) number estimation variables.

5 2. 2 . 3 .
, for example.e properties of the designed ANNs are as follows: Weaving area: Number of hidden layers: 3 Number of neurons in each hidden layer: 9 Merge area: Number of hidden layers: 3 Number of neurons in each hidden layer: 7 Diverge area: Number of hidden layers: 3 Number of neurons in each hidden layer: 7 Ramps: Number of hidden layers: 3 Number of neurons in each hidden layer: PSO Approach.Recently, Eberhart et al. proposed

Figure 8 :
Figure 8: ANN for estimation of the safety level in the weaving area.

Figure 9 :
Figure 9: e concept of modifying the search point in PSO.

Figure 10 :
Figure 10: Ramps: (a) test data comparison of the ANN output and the NCPI in rows of information as target, (b) error diagram, and (c) error distribution.

Figure 11 :Figure 12 :Figure 13 :
Figure 11: Statistical results of using the ANN-based model.

Table 1 :
e rules of the FIS.

Table 2 :
Characteristics of the interchanges investigated in the field studies.

Table 5 :
A brief outlook of applying the optimization process on all parts of interchanges.