Advanced Fuzzy-Logic-Based Traffic Incident Detection Algorithm

,


Introduction
e development of freeways has introduced remarkable economic and social benefits [1]. However, the number of freeway incidents has significantly increased with increasing freeway traffic mileage and network building, resulting in several traffic problems, including decreased traffic safety, decreased transportation efficiency, increased environmental pollution, and increased energy consumption. Freeway incidents must be detected in a timely manner to avoid serious traffic jams, secondary traffic incidents, and traffic delays. As a consequence, a variety of AID algorithms have been developed. Various methods have been adopted in these AID algorithms to distinguish the traffic flow status based on the range of variation of the traffic parameters (i.e., queue length, speed, and occupancy) obtained from inductive loop detectors, and these methods have been effective to various degrees in real detection systems. We can rapidly predict the occurrence of traffic parameters. e AID algorithms are closely related to the traffic parameters, which reflect the state of traffic.
However, the traffic parameters exhibit a drastic change under different weather conditions [2][3][4]; if such changes are neglected, the robustness would be poor, the error rates would be high, and the detection rates would be low, which are similar to that observed in the existing AID algorithms. An algorithm that can consider the impact of various weather conditions on traffic accident detection is used in this study to solve the problem; further, we develop an algorithm that considers the impact of different weather conditions on traffic accident detection. e proposed algorithm presents a novel method for determining the factor that reflects the relation between the occurrence of traffic accidents and the weather. Further, the algorithm uses this factor and various traffic parameters along with the LVQ neural network to detect the incidents occurring in real time.
e proposed algorithm exhibits good incident detection performance even under poor weather conditions, thereby overcoming the limitation of the existing detection algorithms.
Further, the remainder of this paper can be divided into four sections. Section 2 is a review of previous research on AID algorithms and presents a broad summary of the algorithms design. In Section 3, the proposed algorithm is presented by considering the meteorological influencing factor. Further, the evaluation of the proposed algorithm using a simulated dataset is Section 4. Subsequently, the proposed algorithm is compared with the California algorithm to future illustrate its performance. Finally, Section 5 presents an outline for this work in the future along with the concluding remarks.

Literature Review
e AID methods are mainly classified as direct detection methods and indirect detection methods [5]. Direct detection methods mainly perform target tracking and recognition as well as traffic flow detection using video and image processing methods. Indirect detection methods detect incidents according to impact on the traffic flow. e major technologies of AID methods include data collection, applicable conditions of various detection algorithms, layout and optimization setting of traffic detectors (fixed and mobile), multi-source data fusion rules and alarm systems, and selection of various event detection technologies. Previously, algorithms, such as pattern recognition [6] and statistical prediction [7], were applied for performing incident detection. ese early AID algorithms were used to build models based on the theoretical derivation, assumption, and simplification of the relations among and to change the rules of traffic flow parameters. Over the previous decades, several AID algorithms with advanced techniques [8] have been tested.
Using various mathematical models, the research on this topic can be classified into several categories based on the input data, detection technique, and complexity of detection logic. For example, advanced data collection technologies and data fusion methods have been developed for integrating the traffic data to ameliorate the detection performance of the AID algorithms. Ricci CP [16] proposed a highefficiency method and system for collecting vehicle traffic data. Faouzi et al. [17] proposed a solution to the problem of dual-station detector adaptation. However, the majority of the research efforts have focused on obtaining accurate data without considering the effects of input data on this algorithm. Further, the application conditions, advantages, and disadvantages of different detection algorithms are observed to be different as well. Meanwhile, several scholars have invested considerable efforts for creating new models or for improving the original models, which resulted in an increase of the complexity of these models. e AID algorithms have tended to adopt multiple theories for overcoming the deficiency of a single theory, and the structure of the AID algorithms was transformed from the single-input and single-output (SISO) module into a unified whole containing multiple modules, each of which exhibited unique functions. Wang et al. [18] proposed a mixed method to AID, which combines machine learning with time-series analysis. Pucher et al. [19] proposed multimodal monitoring for performing incident detection based on video and audio sensors.
In addition, the actual traffic condition on roads cannot be completely reflected by traffic parameters [20]. Various factors, such as the road speed limit, traffic detector location, incident type, and environment, will influence the performance of the AID algorithms. During the previous decades, considerable research effort has been devoted to revealing the influence of different weather conditions on the occurrence of traffic accidents. Hassan and Abdel-Aty et al. [21] probed the relation between freeway accidents and visibility using real-time traffic flow data and observed increased rates of traffic flow data and observed increased rates of traffic incidents to be connected with low visibility. Akin et al. [22] studied the effects of weather on the traffic flow characteristic of freeways and concluded that the traffic flow parameters exhibited different characteristic under different weather conditions. Although the aforementioned studies have presented the impact of meteorological factors on traffic accidents, little effort has been devoted to consider the meteorological factor in AID algorithms. Lam et al. [23] proposed an AID algorithm that can be applied on rainy days and days without rain. Further, they proved that the traffic conditions may be affected by the traffic speedflow-density relations under a variety of rainfall intensities as well as the key traffic parameter. However, under this approach, only this effect of rainfall on AID algorithms is considered further; this approach does not consider all the meteorological factors.
Based on a review of the literature, we have observed that [1] the analyses conducted in previous papers are relatively simple and are performed using the described variables and that [2] these analyses cannot yield a quantitative value to reflect the relation between the weather and the frequency of incident occurrence. Based on the aforementioned observations, we can conclude that a method is required for analyzing the relation between the incident frequency and quantitative meteorological parameters.
Because of the influences of different weather conditions upon the occurrence of traffic incidents, which usually describe the fuzzy characteristic in an inaccurate manner, just like great or small, fuzzy logic can handle them in an effective manner. After dealing with the relation between the meteorological factors and occurrence of traffic incidents using fuzzy logic, the subsequent task is to combine meteorological factors with a large number of traffic parameters for detecting incidents on freeways. e LVQ neural network is extensively applied as a key technique to solve this problem in the data fusion domain, and this method is considered to be an efficient classification method [24,25]. erefore, we use LVQ to combine the traffic parameters and meteorological factors for performing incident detection to improve the performance of the AID algorithms. 2 Advances in Fuzzy Systems e following two modules are central to the present study: (1) the incident detection module on the basis of the LVQ network and (2) the meteorological influential factor module on the basis of fuzzy logic. Typical meteorological parameters are adopted in the second module to quantify the relation between the occurrence of traffic accidents and weather conditions as a standard value using fuzzy logic. Rainfall and visibility are selected as the major parameters for modeling. e incident detection model employs an LVQ neural network for detecting traffic accidents using the factor and traffic parameters. e output of the network is denoted using binary values (1 denotes the occurrence of incidents, whereas 0 denotes that no incidents have occurred).

Meteorological Influencing the Factor Model Based on
Fuzzy Logic. We selected the parameters that are sensitive to traffic accidents as the model parameters from among a large set of meteorological factors. Rainfall and visibility were selected as the representatives of the meteorological factors in this algorithm. Because the statuses of the meteorological influencing factors have no definite boundaries, we introduced the fuzzy theory and use fuzzy linguistics to disrupt the variation of the parameters for reducing the impact of border environment. e fuzzy inference routine is a sequence of four components: (1) membership functions; (2) rule base; (3) fuzzy inference procedure; and (4) defuzzification.

Membership Functions.
Two major meteorological measures are used in this model, including six hours of rainfall and hourly visibility. On the basis of the relation between traffic accidents and meteorological parameters, a suitable incident frequency (IF) per unit time is adopted to describe the impact of various weather conditions on traffic accidents, as is denoted as follows: IF � number of incidents in this measure number of the measure occurrences × 100%.
From Figures 1 and 2, it can be observed that the meteorological conditions have evidently influenced the frequency of traffic accidents based on the data obtained from the Chongqing Expressway Project. It increases with an increase in the amount of rainfall rise, while visibility deteriorates per unit period. To determine the function members, three different regions were divided, which were characterized by the influence level for rainfall (R) and visibility (V); rainfall was classified as large, medium, and small, whereas visibility was classified as high, medium, and low. Fuzzy sets were accordingly where the universes of discourse were denoted by u R � [0, r max ] and u V � [0, v max ] (r max and v max denoted the maximum values from history). e influence of meteorological measures on the frequency of traffic incidents was divided into three levels, including little, medium, and great; further, Based on the linear distribution of visibility and rainfall, trapezoidal and triangular functions were selected to describe the fuzzy set. e method used to compare the field incident frequency with the incident frequency that is expected using the fuzzy model may make the fuzzy function consistent in a real-world situation.
For example, the expected incident frequency under different rainfall conditions R fuzzy can be described as follows: where W J 1 , W J 2 , and W J 3 denote the average incident frequency in the range U J 1 , U J 2 , and U J 3 , respectively, which denote small, medium, and large rainfall, respectively.
We can draw different curves of R fuzzy to adjust the ranges of U J 1 , U J 2 , and U J 3 through continuous testing. e minimal difference between both the curves is selected for determining the range of the fuzzy set by comparing the different R fuzzy curves with the real incident frequency in different ranges of rainfall according to Figure 1. According to the optimal R fuzzy curves, the value of W J 1 was 0.29, that of W J 2 was 0.37, and that of W J 3 was 0.46 in this study. e method that was used for determining the ranges of U J 1 , U J 2 , and U J 3 was used to determine the member function of visibility. e member functions of rainfall and visibility are denoted in Figure 3.

Rule Base.
A rule base comprising a set of rules was used for describing the relation between the inputs (U R and U V ) and output (U α ). A rule base describing the three conditions of U α (little, medium, and severe) was constructed for future knowledge. As depicted in Figure 4, R (incident frequency with rainfall every six hours) and V (incident frequency with hourly visibility) are denoted by X and Y, respectively; there are nine regions divided by X and Y, indicating that this rule base contains nine rules. For instance, when X is small and Y is low, the impact of the meteorological condition is severe. Using the IF-THEN form, the inference rules are presented in Table 1.

Fuzzy Inference
Procedure. U R and U V denote the membership functions of the fuzzy sets of rainfall and visibility, respectively. According to Figure 4, X and Y denote the variables of the fuzzy sets U R and U V , respectively. First, let the inputs be X � x and Y � y. Further, n (ranging from 1 to 4) rules may be selected for a given pair of x and y. Because the relation between U R and U V can be described as "and" in the rule base, we used Mamdani reasoning [26] as the inference methodology for determining each selected rule. e degree of membership of the chosen rule can be constructed as follows: where  In Table 1, the output of fuzzy set U α can be described to possess three consequences, Z 1 , Z 2 , and Z 3 , which denote little, medium, and severe, respectively. erefore, the number of same consequences for all selected rules for different pairs of x and y is not observed to remain fixed. To determine the degree of the selected rules with the same consequence, the max reasoning method is used in this model, which can be given as follows: where Z m denotes the degree of membership of the chosen rule with the same result, μ(A i ) and μ(A j ) denote the degrees of the rules under a particular consequence, and m denotes the number of possible consequences.

Defuzzification Procedure.
In the final process of the model, a crisp value that reveals the influence of meteorological conditions on the traffic accident is determined through the application of the fuzzy result; this value can be constructed as follows: where α denotes the meteorological influencing factor. e meteorological influencing factor that is obtained based on fuzzy logic is depicted in Figure 5.

LVQ Neural Network Model. LVQ, introduced by
Kohonen et al. [27], is an effective classification method. As depicted in Figure 4, an LVQ network comprises the following three layers: the input layer, which contains one node for each input feature and is fully linked with the Kohonen layer; the output layer, which presents each class by one node; and the Kohonen layer, which performs and learns the classification and with the output layer partially. e LVQ algorithm is a combination of supervised learning and competitive learning. Suppose each weight vector and the input vector of the first layer to be w and x, respectively. Further, the Euclidean distance between the two vectors in the Kohonen layer can be calculated by the application of the following formula: As far as competitive learning is concerned, weight w c vector (where c is the index of it) which is nearest to the input vector x will be the winning neuron.
During the process of supervised learning, the classes compete with each other to find the input vector, which is the most similar, and the one with the least Euclidean distance will be declared as the winner. Only the winner will adopt the reinforced negative or positive learning algorithm

Input layer
Kohonen layer Output layer Advances in Fuzzy Systems 5 to modify its weight depending on the classification. us, the classification is considered to be accurate if the class becomes similar to the winning input vector. e weight will be increased to become more approximate to the input vector. e basic learning process can be reflected in the equation as follows: In the above equation, the weight vectors at time t + 1 and t are used to represent w c (t + 1) and w c (t), respectively, while x(t) and η(t) are used to represent the input vector and the learning rate, respectively, where 0 < η(t) < 1. It is proposed that η(t) should be considerably small at first, such as less than 0.1; further, η(t) will continue to decrease in accordance with the equation that is given as follows: where μ and N represent the specified threshold and the number of classes, respectively. Conversely, the differentiation of the class from the input vector will fail, indicating that the classification is inaccurate. e decrease in weight will increase the difference between the class and the input vector. e following equation reflects the basic learning process: 3.3. Algorithm Execution. Based on the above models, we input traffic data, including volume, occupancy, speed (q, occ, and v, respectively) from upstream and downstream, and the meteorological influencing factor α calculated above, into the LVQ neural network. As a binary value, the output can indicate whether an incident will occur. e key to the determination of the traffic accident detection performance of the proposed algorithm lies in the number of the Kohonen layers as well as the input layers. ree models that have periods distinct from the preceding period t − n to the current time t of traffic measure both upstream and downstream as the inputs are designed to find the appropriate number of the input layers, on the basis of time period t, from t − 1 to t, from t − 2 to t. For the different inputs patterns, the range of the Kohonen layer could be calculated using the following empirical formula based on the Kolmogorov eorem 27.
where n 1 and n 2 represent the number of the input layers and the Kohonen layers, respectively. e value should be tested through trial-and-error around n 2 , as in Section 4.3 as the above formula can only be used to recommend a probable optimal number of the Kohonen layers.

Field Data.
Recently, the Chongqing Expressway has developed a series of projects based on the Internet of things technologies to improve transportation efficiency and to enhance traffic safety. In this background, a 2.2 km long stretch of the double lane Yuwu freeway in Chongqing, China, which is a main project that begins from K973 + 300 and ends at K975 + 500, was selected. To obtain the traffic measures, the meteorological conditions are monitored, and the related data are obtained in real time; further, two microwave detectors are set up downstream or upstream, and the meteorological instruments should be installed along the road.
is study adopts three datasets as follows: (1) the traffic measures collected in various weather conditions, beginning from February in 2014 and ends at the end of September in the same year using the microwave detectors installed both upstream and downstream; (2) incident data (from February 2014 to September 2014) obtained from the Chongqing Expressway; (3) real-time data obtained from the meteorological instrument closest to the test road. Because it did not snow in Chongqing, the snowfall and hail conditions are out of the scope of this study. Visibility and rainfall were considered to be the most important methods for the related data used in the proposed algorithm.
A total of 828 groups of data, including traffic measures, meteorological data, and incident state, were used in this study, and these data were obtained under different types of weather conditions, including sunshine, heavy fog, and rainstorm. e traffic parameters include volume, occupancy, and speed of interval t to t − 2. In this study, the detection period t was 5 min. e meteorological data were accumulated at 30-minute intervals. Of the 828 groups, 138 contained incidents, whereas the other 690 groups were incident-free. e total data were divided into two parts as testing and training sets, as presented in Table 2.

Estimate Measures.
Typically, the performance of the AID model should be evaluated on the basis of MTTD, FAR, and DR, and these indices have been demonstrated to be excellent for this purpose and have been used in several studies [28,29]; DR, FAR, and MTTD are defined as follows:  Advances in Fuzzy Systems DR � number of detected incident cases total number of incident cases in data set × 100%, FAR � number of false detected incident cases total number of input instances × 100%, where n, t detected , and t on−set represent the number of incident cases detected successfully, the time interval at which an alarm is initiated, and the time interval in which a traffic accident occurs, respectively. e effectiveness of an algorithm can be measured using both DR and FAR, and the efficiency of the algorithm can be obtained using MTTD. An ideal detection algorithm should feature short MTTD; the FAR should be low, whereas the DR should be high. Regardless, there exists a trade-off relation among DR, FAR, and MTTD. A persistence test can be performed to verify whether an algorithm satisfies the test expectations.

Test
Result. An experiment was conducted to determine the LVQ network architecture having the optimal detection performance to test the performance of the traffic accident detection algorithm. ree LVQ models with traffic measures having time-series of different lengths and with the factor calculated in this study as the inputs are used in this experiment. Both the upstream traffic methods and the downstream methods of the input cover periods from t − 2 to t, from t − 1 to t, and single t in the models. n 2 is calculated in accordance with formula (11) and a series of numbers around n 2 (including n 2 ), which were n 2 − 3, n 2 − 1, n 2 , n 2 + 1, n 2 + 2, and n 2 + 3 in each model; this value is verified to determine the number of Kohonen layers. e architectures of the three models are summarized in Table 3. ree criteria, including DR, FAR, and MTTD, were considered while searching for the best architecture of the new algorithm and Figure 6 indicates these three criteria for various architectures. e average of FAR and DR in the architectures with 7 and 19 inputs in the first layer is inferior to the architectures having 13 inputs. erefore, the traffic measures with the period t − 1 to t yield the optimal traffic incident detection performance. e MTTD changes marginally across various architectures in Figure 7. It can be observed that the lowest FAR and the highest DR are in accordance with the same architecture in comparison with various coordinates, including [13 × 26 × 1]. erefore, the best architecture of the proposed algorithm was determined to be [13 × 26 × 1].

Algorithm Competitiveness.
e proposed algorithm uses the LVQ neural network as the base model by inputting  both the traffic flow parameters and meteorological parameters. To understand whether the meteorological parameters have an impact on the prediction results, we use the LVQ neural network but do not input meteorological parameters. Meanwhile, the LVQ neural network model is also found best architecture and applied to the same validation database. e detection performances of the proposed algorithm and the algorithm without meteorological parameters are compared and presented in Figure 7. Figure 7 depicts that the proposed algorithm outperforms the algorithm that does not consider any meteorological parameters. It is observed that the meteorological parameters affect the forecast results, which is evidenced by their DR values of 90.24% and 85.53% and their FAR values of 3.89% and 4.22%. Furthermore, the MTTD values of both the methods are similar, and the value difference between them is only 0.01. e introduction of meteorological parameters does not increase the complexity of the algorithm.
Meanwhile, it is necessary to compare the existing algorithm and the proposed algorithm using the same dataset.
ese AID algorithms include the California algorithm, exponential smoothing algorithm, standard normal deviation algorithm, and McMaster algorithm. e incident detection performances of these four existing algorithms and   Advances in Fuzzy Systems the proposed algorithm are compared and depicted in Figure 8. As depicted in Figure 8, the proposed algorithm outperforms the other algorithms using the same dataset. A reasonable set of AID algorithms is that DR is higher than 88%, whereas the FAR is lower than 1.8% [30]. When the value of FAR is set to 1.8%, the DR of the proposed algorithm is 78.56%, which is higher than that of the remaining models. However, it is still lower than the mark with the DR value being higher than 88%. is may be caused by the excessive road space that is considered during algorithm calibration and the limitations of the LVQ neural network. However, the proposed algorithm is still feasible for performing detection under different meteorological conditions. Considerable testing is required to calibrate the thresholds using a given dataset to obtain the appropriate trade-off between FAR and DR for achieving the optimal performance from an algorithm. e optimal test results of the proposed algorithm and four existing algorithms are presented in Table 4 by considering the appropriate trade-off between FAR and DR.

Conclusion
In this study, an incident detection algorithm is proposed by considering the effects of meteorological factors on a freeway. is algorithm applies fuzzy logic to calculate the factor   reflecting the relation between the occurrence of traffic accidents and weather conditions and uses an LVQ network to combine the traffic parameters along with the meteorological factor to detect various incidents. e proposed algorithm addresses the problem of unstable DR, low DR, and high FAR under harsh and changing weather conditions, which can affect several AID algorithms. To solve this problem, the proposed algorithm was constructed based on the field data obtained from the Yuwu freeway in Chongqing China. e first experiment denoted that the algorithm with the [13 × 26 × 1] architecture performed better than the other algorithms. Based on this observation, a comparison experiment involving the proposed algorithm and the remaining four existing algorithms was conducted. e results indicated that the proposed algorithm performed better than all the remaining algorithms. is indicates that the proposed algorithm exhibits a better detection performance than the remaining algorithms according to the indices of the AID algorithm performance.
Although it can be concluded that the algorithm proposed in this study can enhance the incident detection performance on freeways, further work is required. Because of the constraints of the test environment that are presented in this thesis, we have used the field data obtained only from the Yuwu freeway to verify the proposed algorithm. More test roads and field data should be used to verify the validity of the algorithm that has been proposed in this research in a follow-up study.
Data Availability e training and testing data used to support the findings of this study have been deposited in the Chongqing Expressway repository.
e traffic incident data used to support the findings of this study are included within the article. e AID algorithms data used to support the findings of this study are currently under embargo while the research findings are commercialized. Requests for data, 6 months after the publication of this article, will be considered by the corresponding author.

Conflicts of Interest
e authors declare that they have no conflicts of interest.