A method for identifying accident-prone road segments based on canopy-fcm

By combining the Canopy and FCM clustering algorithms, traffic accident risk factors are screened, the number of clusters is determined using the improved Canopy algorithm, and clustering is performed using the initial cluster centers of the FCM algorithm. Combined with the box plot quartile method, accident-prone road sections are identified, which solves the problem of low accuracy in identifying accident-prone road sections in the existing technology and achieves higher identification accuracy and stability.

CN117173886BActive Publication Date: 2026-08-04HARBIN INST OF TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HARBIN INST OF TECH
Filing Date
2023-09-01
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing methods for identifying accident-prone road sections suffer from low accuracy, leading to the omission or expansion of accident-prone road sections and making it impossible to effectively identify high-risk road sections.

Method used

By combining the Canopy and FCM clustering algorithms, the number of clusters is determined by screening traffic accident risk factors and using the improved Canopy algorithm. Clustering is then performed using the initial cluster centers of the FCM algorithm, and the box plot quartile method is used to identify accident-prone road sections.

Benefits of technology

It improves the accuracy and stability of identifying accident-prone road sections, effectively identifies similar road sections, reduces false identifications, and improves the accuracy of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117173886B_ABST
    Figure CN117173886B_ABST
Patent Text Reader

Abstract

The application relates to an accident-prone road section identification method based on Canopy-FCM. The process is as follows: 1: combining a traffic accident data set, screening out traffic accident risk factors; 2: using an improved Canopy algorithm to cluster the accident sample risk factors, and adopting an isolated sample discrimination mechanism to determine the final cluster group number; 3: taking the clustering center corresponding to each clustering group in the obtained cluster group number as the initial clustering center of the FCM algorithm, clustering the traffic accident risk factors, and obtaining the final traffic accident sample grouping; 4: drawing a traffic frequency box plot of each group of traffic accident samples obtained by FCM clustering; according to the quartile method principle of the box plot, the road section corresponding to the sample point with the accident number greater than Q3+1.5IQR is the accident-prone road section. The application belongs to the field of accident-prone road section identification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of accident-prone road segment identification, specifically involving an accident-prone road segment identification method based on Canopy-FCM. Background Technology

[0002] With my country's vigorous promotion of infrastructure construction, the country has achieved remarkable success in road construction. However, this success has also been accompanied by a gradual increase in traffic accidents. To effectively reduce traffic accidents, it is necessary to identify accident-prone road sections. Studying the characteristics of accident-prone road sections helps to reveal the causes and characteristics of accidents, thereby identifying patterns in their occurrence. Accurately identifying accident-prone road sections and implementing targeted improvement measures can achieve the goal of minimizing the number and severity of road accidents with minimal investment.

[0003] After years of research and accumulation, scholars both domestically and internationally have made extensive explorations in the identification of accident-prone road sections and proposed a series of methods. Based on the different methods used, these mainly include: accident data statistical analysis, safety factor method, conflict inference method, expert experience method, and model prediction method. From the perspectives of maturity, operability, and reliability, the accident data statistical analysis method has significant advantages. In summary, commonly used methods in accident data statistical analysis include the accident number method, accident rate method, equivalent property damage index method, critical accident rate method, and safety level method. These methods are basically based on fixed unit division or road segment division according to road alignment. However, these methods all have drawbacks such as omission or expansion of accident-prone road sections. Therefore, it is essential to find a new method for identifying accident-prone road sections.

[0004] Fuzzy C-means (FCM) clustering is an unsupervised fuzzy clustering method that utilizes an objective function. Its goal is to construct a constrained nonlinear function and iteratively update the cluster centers and membership matrices to find the optimal solution for the objective function, thereby achieving clustering and partitioning of sample data. The initial cluster centers are randomly selected, and their correctness directly affects the clustering effect. Compared to FCM, Canopy clustering does not require pre-defined cluster numbers and centers, and its principle is simpler and computationally faster; however, its clustering effect is worse than other clustering algorithms. Summary of the Invention

[0005] The purpose of this invention is to solve the problem that existing methods for identifying accident-prone road sections often omit or expand the scope of accident-prone road sections, resulting in low accuracy in identifying such sections. Therefore, this invention proposes an accident-prone road section identification method based on Canopy-FCM.

[0006] The specific process of an accident-prone road section identification method based on Canopy-FCM is as follows:

[0007] Step 1: Based on the traffic accident dataset, select traffic accident risk factors, which include two types: continuous risk factors and discrete risk factors.

[0008] In continuous risk factors, each factor takes the actual value of its value, which is used as the value of the continuous variable.

[0009] Each factor in the discrete risk factor is assigned a different integer value, which serves as the discrete variable value.

[0010] Step 2: Use the improved Canopy algorithm to cluster the risk factors of the accident samples, and use the isolated sample discrimination mechanism to determine the final number of cluster groups;

[0011] Step 3: Using the cluster center corresponding to each cluster group obtained in Step 2 as the initial cluster center of the FCM algorithm, the traffic accident risk factors are clustered to obtain the final traffic accident sample grouping.

[0012] Step 4: Draw box plots of accident frequency for each group of traffic accident samples obtained from FCM clustering;

[0013] According to box type Figure 4 The principle of quantile method is that the road segment corresponding to the sample point with the number of accidents greater than Q3 + 1.5IQR is the accident-prone road segment; Q3 represents the third quartile of the sample; IQR represents the interquartile range.

[0014] The FCM clustering is a fuzzy C-means clustering.

[0015] The beneficial effects of this invention are as follows:

[0016] The purpose of this invention is to identify similar road segments using clustering algorithms, and then utilize box-type... Figure 4 Based on the principle of quantile method to identify accident-prone road sections, a method for identifying accident-prone road sections based on Canopy-FCM is proposed.

[0017] This invention combines the FCM algorithm with the Canopy algorithm. First, it improves the selection of cluster centers in the Canopy algorithm using the maximum-minimum criterion and the maximum density method. Then, it uses the improved Canopy algorithm to cluster traffic accident data samples, obtaining the initial cluster centers for the FCM algorithm. Next, it uses the FCM algorithm to cluster the traffic accident data samples again, obtaining the final traffic accident sample groups, completing the identification of similar road segments. Finally, it identifies sample points in each cluster whose box plot is greater than Q3 + 1.5IQR; the road segments corresponding to these sample points are accident-prone road segments.

[0018] This invention focuses on accident-prone road sections. First, it improves the initial cluster center selection of the Canopy algorithm by employing the minimax criterion and the maximum density method. Then, it uses the improved Canopy algorithm to cluster traffic accident data samples, obtaining the initial cluster centers for the FCM algorithm. Finally, it plots frequency box plots, identifying road sections corresponding to sample points with a frequency greater than Q3 + 1.5IQR as accident-prone road sections. This invention proposes a clustering-based similar road section discrimination mechanism, significantly improving the accuracy and stability of accident-prone road section identification. Attached Figure Description

[0019] Figure 1 This is a flowchart of the method of the present invention;

[0020] Figure 2 A diagram illustrating the improved clustering process of the Canopy algorithm;

[0021] Figure 3 To improve the flowchart of the Canopy-FCM algorithm;

[0022] Figure 4 The results of risk factor importance extraction;

[0023] Figure 5 This is a cluster box diagram. Detailed Implementation

[0024] Specific Implementation Method 1: The specific process of this implementation method for identifying accident-prone road sections based on Canopy-FCM is as follows:

[0025] Step 1: Based on the traffic accident dataset, divide the road segments according to whether they have the same or similar attributes or characteristics (horizontal alignment, longitudinal alignment, etc.) and screen out traffic accident risk factors. Traffic accident risk factors include two types: continuous risk factors and discrete risk factors.

[0026] In continuous risk factors, each factor takes the actual value of its value, which is used as the value of the continuous variable.

[0027] Different integer values ​​are assigned to each factor in the discrete risk factor as discrete variable values. For example, road segment types are divided into 4 categories: basic road segment, toll station, service area and bridge, and their values ​​are assigned 1, 2, 3 and 4 respectively to represent each type of road segment.

[0028] Step 2: Use the improved Canopy algorithm to cluster the risk factors of the accident samples, and use the isolated sample discrimination mechanism to determine the final number of cluster groups;

[0029] Step 3: Using the cluster center corresponding to each cluster group obtained in Step 2 as the initial cluster center of the FCM algorithm, the traffic accident risk factors are clustered to obtain the final traffic accident sample grouping and complete the identification of similar road sections.

[0030] Step 4: Draw box plots of accident frequency for each group of traffic accident samples obtained from FCM clustering;

[0031] According to box type Figure 4 The principle of quantile method is that the road segment corresponding to the sample point with the number of accidents greater than Q3 + 1.5IQR is the accident-prone road segment; Q3 represents the third quartile of the sample; IQR represents the interquartile range.

[0032] The FCM clustering is a fuzzy C-means clustering.

[0033] Specific Implementation Method Two: This implementation method differs from Specific Implementation Method One in that: in step 1, the traffic accident dataset is combined to divide the road segments according to whether a certain attribute or characteristic (horizontal alignment, longitudinal alignment, etc.) of the road segments is the same or similar, and traffic accident risk factors are screened out. Traffic accident risk factors include two types: continuous risk factors and discrete risk factors.

[0034] In continuous risk factors, each factor takes the actual value of its value, which is used as the value of the continuous variable.

[0035] Different integer values ​​are assigned to each factor in the discrete risk factor as discrete variable values. For example, road segment types are divided into 4 categories: basic road segment, toll station, service area and bridge, and their values ​​are assigned 1, 2, 3 and 4 respectively to represent each type of road segment.

[0036] The specific process is as follows:

[0037] Continuous risk factors include the annual average number of traffic accidents, daily traffic volume, road segment length, straight segment length, horizontal curve deflection angle, horizontal curve curvature, horizontal curve length, longitudinal slope length, vertical curve slope difference, current cumulative slope, current cumulative slope length, and rainfall.

[0038] Discrete risk factors include horizontal curves (straight road sections, right velocities, left velocities), transition curves (with transition curves, without transition curves), continuous downhill slopes (with continuous downhill slopes, without continuous downhill slopes), vertical curve types (longitudinal slope road sections, convex vertical curves, concave vertical curves), and road section types (basic road sections, toll stations, service areas, bridges).

[0039] The other steps and parameters are the same as in Specific Implementation Method 1.

[0040] Specific Implementation Method Three: This implementation method differs from Specific Implementation Method One or Two in that: in step 2, the improved Canopy algorithm is used to cluster the risk factors of the accident samples, and an isolated sample discrimination mechanism is used to determine the final number of cluster groups; the specific process is as follows:

[0041] Step 21: Select min_samples_leaf and min_samples_split as hyperparameters of the random forest traffic accident prediction model (random forest model);

[0042] min_samples_leaf represents the minimum number of samples required for a leaf node; min_samples_split represents the minimum number of samples required to split an internal node.

[0043] The possible values ​​for min_samples_leaf are 1, 2, 4, and 8;

[0044] The possible values ​​for min_samples_split are 2, 5, and 10;

[0045] Using the annual average number of traffic accidents in step 1 as the output variable, and the remaining risk factors (daily traffic volume, road segment length, straight segment length, horizontal curve deflection angle, horizontal curve curvature, horizontal curve length, longitudinal slope length, vertical curve slope difference, current cumulative slope, current cumulative slope length, and rainfall) as input variables, a random forest traffic accident prediction model is constructed. The optimal values ​​of hyperparameters min_samples_leaf and min_samples_split are found to be 4 and 5, respectively, using a grid search algorithm.

[0046] The traffic accident dataset from step 1 is divided into a training set and a test set in an 8:2 ratio. The training set is further divided into four equal-sized sample subsets. These four subsets are iterated sequentially, with the current subset used as the validation set and all other samples used as the training set each time, resulting in four different random forest traffic accident prediction models. The test error of each model is calculated on the corresponding test set, resulting in four test errors. The average of these four test errors is then used to obtain a cross-validation error.

[0047] Random forest models are built upon Bagging ensembles using decision tree models, with random attributes incorporated into the training of the decision tree models.

[0048] The steps of random forest regression analysis are as follows:

[0049] Step A: Assume that the traffic accident dataset in Step 1 has M samples. Randomly select N samples with replacement (Boostrap) from them. These samples constitute the training dataset for the decision tree.

[0050] Step B: Assume that each sample in the training dataset of the decision tree has K risk factors (including discrete and continuous risk factors). Randomly select k (k<=K) risk factors from all risk factors, and then select the best attribute from the k risk factors as the split point. Use the CART algorithm to construct a decision tree, and the size of k is constant during the split of the decision tree dataset.

[0051] Step C: Repeat the above steps to build m′ decision trees, all of which are fully grown without being pruned (the decision trees completely divide the dataset without prematurely stopping the dataset division or simplifying the decision tree dataset after growth), forming a random forest;

[0052] Step D: Random forests use two main methods for variable importance measures (VIM): the Gini index method and the out-of-bag data method.

[0053] Step 22: Input the traffic accident risk factors (including both continuous and discrete risk factors) into the constructed random forest traffic accident prediction model, and use the Gini index method to extract the importance of each risk factor (Formula 4) to reflect the differences between each risk factor.

[0054] Step 23: Convert the traffic accident data samples into a list by vectorization;

[0055] Cross-validation was used to obtain two thresholds T1 and T2 for Canopy, where T1 > T2;

[0056] T1 is used to determine the "density" threshold, and T2 is used to determine the "separation" threshold.

[0057] The process of obtaining Canopy's two thresholds T1 and T2 using cross-validation is as follows:

[0058] Data preparation: First, the traffic accident dataset is divided into a training set and a validation set;

[0059] Train the Canopy clustering model using the training set and evaluate the model's performance on the validation set.

[0060] Parameter range: Determine the range of values ​​for T1 and T2. You can set a suitable range based on experience, such as starting from a smaller value and gradually increasing it, or starting from a larger value and gradually decreasing it.

[0061] Cross-validation loop: For each combination of T1 and T2, the training set is subjected to Canopy clustering on the Canopy model; then, the samples in the validation set are input into the trained Canopy model, and a cluster label is assigned to each traffic accident data sample according to the clustering results of the model, achieving the cluster prediction of the validation set samples.

[0062] Performance evaluation: Appropriate clustering performance metrics (such as silhouette coefficient, Calinski-Harabasz index, etc.) are used to measure the compactness and separation of the predicted clusters, and further evaluate the clustering quality of each combination of T1 and T2.

[0063] The closer the silhouette coefficient is to 1, the better the compactness and separation of the predicted clusters.

[0064] The larger the Calinski-Harabasz index, the better the compactness and separation of the predicted clusters.

[0065] The closer the silhouette coefficient is to 1, the higher the clustering quality.

[0066] The larger the Calinski-Harabasz index, the higher the clustering quality.

[0067] Select the optimal parameters: After the cross-validation loop ends, select the combination of T1 and T2 with the best performance according to the clustering performance metrics, which is the optimal threshold for Canopy clustering.

[0068] Step 23 has nothing to do with Step 22. The importance of each risk factor extracted in Step 22 is used in subsequent clustering (yes).

[0069] Step 24: Calculate the density of each sample in the traffic accident dataset by means of the maximum density rule, select the traffic accident data sample P with the maximum density as the first initial clustering center, and delete the traffic accident data sample with the maximum density from the list.

[0070] Step 25: Calculate the distance D from the remaining traffic accident data samples in the list to the clustering center.

[0071] If T2 < D < T1, mark the sample with a weak label, indicating that the corresponding traffic accident data sample is within this cluster (the cluster where the clustering center is located), add it to this cluster (the cluster where the clustering center is located), but it may still become the center of other classes.

[0072] Furthermore, if D < T2, then mark the sample with a strong label, indicating that the corresponding traffic accident data sample is within this cluster (the cluster where the clustering center is located), add it to this cluster (the cluster where the clustering center is located), it cannot be selected as the center of other classes anymore, and delete the corresponding traffic accident data sample from the remaining traffic accident data samples in the list.

[0073] For details, please see [link / details]. Figure 2 .

[0074] Step 26: According to the minimum-maximum criterion, calculate the distance from each remaining traffic accident data sample in the list to the existing cluster center, select the minimum distance from each sample to the cluster center, and select the traffic accident sample with the largest minimum distance as the new cluster center.

[0075] Step 27: Repeat steps 25 and 26 until the list is empty, at which point the clustering ends and step 28 is executed;

[0076] Step 28: Establish an isolated individual identification mechanism to delete groups identified as isolated individuals and accident samples within those groups, thus resolving the issue that some clusters contain only a small number of isolated samples.

[0077] Step 29: Iteratively execute step 28, and based on the isolated individual discrimination mechanism, remove isolated samples to determine the final number of cluster groups.

[0078] Other steps and parameters are the same as in specific implementation method one or two.

[0079] Specific Implementation Method Four: This implementation method differs from Specific Implementation Methods One to Three in that: in step 21, the optimal values ​​of hyperparameters min_samples_leaf and min_samples_split are found to be 4 and 5 respectively using a grid search algorithm.

[0080] The other steps and parameters are the same as those in one of the specific implementation methods one to three.

[0081] Specific Implementation Method Five: This implementation method differs from Specific Implementation Methods One to Four in that: in step 22, traffic accident risk factors (including both continuous and discrete risk factors) are input into the constructed random forest traffic accident prediction model, and the importance of each risk factor is extracted using the Gini index method (Formula 4) to reflect the differences among the risk factors; the specific process is as follows:

[0082] The importance of each risk factor is extracted using the Gini index method. The formula for calculating the Gini index is as follows:

[0083]

[0084] In the formula, K represents the number of categories of traffic accident risk factors in step 1; p mk p is the probability estimate of a sample at node m belonging to the k-th class; mk′ GI is the probability estimate of a sample at node m belonging to class k′; m This represents the Gini index of node m;

[0085] The node m represents each branch and leaf of the random forest;

[0086] For risk factor X j The importance of node m is determined by calculating the change in the Gini index before and after node m splits:

[0087]

[0088] In the formula, GI l GI r and represent the Gini index of the new node after node m splits; Indicates risk factor X j The importance of node m;

[0089] If risk factor X j If a risk factor X appears M times in the i-th decision tree (a tree has many branches and leaves), then the risk factor X... j The importance of the i-th decision tree is:

[0090]

[0091] In the formula, Indicates risk factor X j The importance of the i-th decision tree;

[0092] For risk factor X j The importance of Gini is defined as:

[0093]

[0094] In the formula, m′ represents the number of decision trees.

[0095] The other steps and parameters are the same as those in specific implementation methods one through four.

[0096] Specific Implementation Method Six: This implementation method differs from Specific Implementation Methods One to Five in that: in step 24, the density of each sample in the traffic accident dataset is calculated using the maximum density rule, the traffic accident data sample P with the highest density is selected as the first initial cluster center, and the traffic accident data sample with the highest density is deleted from the list; the specific steps are as follows:

[0097] First, the density of traffic accident data samples is defined, for the given traffic accident data sample set {p1, p2, p3, ..., p n′ The average distance of all traffic accident data samples is calculated using the following formula:

[0098]

[0099] Where n′ is the number of traffic accident data samples, d(pi ′,p j ′) represents the weighted Euclidean distance between two traffic accident data samples; p1 is the first data sample in the traffic accident data sample set, p n ′ represents the n′-th data sample in the traffic accident data sample set;

[0100] The density of each traffic accident data sample in the total traffic accident data sample set is defined based on the average distance, using the following formula:

[0101]

[0102] The definition of f(x) is as follows:

[0103]

[0104] Select the traffic accident data sample P with the highest density as the first initial cluster center, and then remove the traffic accident data sample with the highest density from the list.

[0105] The other steps and parameters are the same as those in specific implementation methods one through five.

[0106] Specific Implementation Method Seven: This implementation method differs from Specific Implementation Methods One through Six in that: in step 26, based on the minimum-maximum criterion, the distance from each remaining traffic accident data sample in the list to the existing cluster center is calculated, the minimum distance from each sample to the cluster center is selected, and the traffic accident sample with the largest minimum distance is selected as the new cluster center; the specific process is as follows:

[0107] Given n″ existing cluster centers, when solving for the (n″+1)th cluster center, calculate the distance from all remaining traffic accident data samples in the list to each cluster center, select the minimum distance from each sample to each cluster center, construct a distance set, and select the maximum value in this set as the (n″+1)th cluster center.

[0108] For example, the samples are A, B, C, and D; the cluster centers are 1, 2, 3, 4, and 5; the minimum distance from each sample to each cluster center refers to the minimum distance from A to each of the 1, 2, 3, 4, and 5, which is one value; the minimum distance from B to each of the 1, 2, 3, 4, and 5, which is one value; the minimum distance from C to each of the 1, 2, 3, 4, and 5, which is one value; the minimum distance from D to each of the 1, 2, 3, 4, and 5, which is one value; and the maximum value among the four values ​​in the distance set is selected.

[0109] The other steps and parameters are the same as those in one of the specific implementation methods one to six.

[0110] Specific Implementation Method Eight: This implementation method differs from Specific Implementation Methods One through Seven in that: in step 28, an isolated individual discrimination mechanism is established to delete groups identified as isolated individuals and accident samples within those groups, thus resolving the problem that some clusters contain only a small number of isolated samples; the specific process is as follows:

[0111] After Canopy iteration (step 7 continues until the list is empty, i.e., the FCM algorithm selects cluster centers);

[0112] If the number of clusters in the traffic accident sample dataset is numPoint, then the number of accident samples in the t-th cluster is num. t ,t=1,2,...,m,when num t When the value is less than numPoint, the traffic accident sample in group t is determined to be an isolated individual, and the accident samples in group t and group t are deleted.

[0113] The other steps and parameters are the same as those in specific implementation methods one through seven.

[0114] Specific Implementation Method Nine: This implementation method differs from Specific Implementation Methods One through Eight in that: in step 3, the cluster center corresponding to each cluster group obtained in step 2 is used as the initial cluster center for the FCM algorithm. The FCM clustering algorithm is used for clustering iteration to cluster the traffic accident risk factors, resulting in the final traffic accident sample grouping and completing the identification of similar road segments; the specific process is as follows:

[0115] Suppose X = (x1,...,x b ,...,x g ) is a set of g-data samples, x g ∈R s x g Let g be the g-th data sample in the data sample set, R be the set of real numbers, and s be an s-dimensional vector;

[0116] FCM clustering is used to cluster X = (x1, ..., x2) b ,...,x g The data is divided into c fuzzy subsets {S1, ..., S2}. a S c};

[0117] If we use V = {v1, ..., v} a , ..., v c} represents the cluster center of c fuzzy subsets, v c S represents c Cluster center, u ab Represents data sample x b For fuzzy subset S aGiven the membership degree and q as the fuzziness index, the objective function of FCM clustering is:

[0118]

[0119] u ab The following constraints must be met:

[0120]

[0121] where U=[u ab ] a=1...c,b=1...g Let d(x) represent the membership matrix of c×g. b ,v a ) represents the weighted Euclidean distance from the b-th sample data to the cluster center of the a-th fuzzy subset;

[0122] To reflect the differences among the various risk factors, the importance of each risk factor extracted from the random forest traffic accident prediction model is used as the weight of each risk factor to construct a weighted Euclidean distance.

[0123] The weighted Euclidean distance formula from the b-th sample data to the cluster center of the a-th fuzzy subset is:

[0124]

[0125] Where w r Assigning weights to each risk factor (importance in step 2), x b For the b-th sample, v a Let be the cluster center of the a-th fuzzy subset;

[0126] Cluster center:

[0127]

[0128] The membership matrix is:

[0129]

[0130] Where d(x) b ,v a d(x) represents the weighted Euclidean distance from the b-th sample data to the cluster center of the a-th fuzzy subset. b ,v k ) represents the weighted Euclidean distance from the b-th sample data to the cluster center of the k-th fuzzy subset;

[0131] Continuously iterate and update v a and u abThis minimizes the objective function of FCM clustering, thereby achieving a stable state in data sample partitioning, resulting in the final grouping of traffic accident samples, and completing the identification of similar road segments. The improved Canopy-FCM algorithm flowchart is shown below. Figure 3 .

[0132] The other steps and parameters are the same as those in specific implementation methods one through eight.

[0133] Specific Implementation Method 10: This implementation method differs from one of Specific Implementation Methods 1 to 9 in that: in step 4, accident frequency box plots are drawn for each group of traffic accident samples obtained by FCM clustering;

[0134] According to box type Figure 4 The principle of quantile method is that the road segment corresponding to the sample point with the number of accidents greater than Q3+1.5IQR is the accident-prone road segment.

[0135] IQR = Q3 - Q1

[0136] In the formula: Q1 represents the first quartile of the sample; Q3 represents the third quartile of the sample; IQR represents the interquartile range.

[0137] The other steps and parameters are the same as those in specific implementation methods one through nine.

[0138] To further verify the feasibility of the Canopy-FCM clustering model, the results of the Canopy-FCM clustering algorithm, FCM clustering algorithm, and K-means clustering algorithm were compared and analyzed using silhouette coefficients.

[0139] The silhouette coefficient is used to evaluate the clustering results. The specific principle is as follows:

[0140]

[0141] b(i′)=min(b i′1 ,b i′2 ,...,b i′j′ )

[0142] In the formula: s(i′) represents the silhouette coefficient of sample i′; a(i′) represents the dissimilarity of sample i′ within a cluster; b(i′) represents the inter-cluster dissimilarity of sample i′; b i′j′ This indicates that sample i′ is connected to a certain cluster C. j, The average distance of all samples.

[0143] The beneficial effects of the present invention are verified using the following embodiments:

[0144] Example 1:

[0145] like Figure 1The diagram shows a flowchart of an accident-prone road section identification method based on Canopy-FCM according to the present invention, which includes the following steps:

[0146] Step 1: Using the existing traffic accident dataset, the road segment is divided into 1394 prediction unit samples using the homogeneity method. Simultaneously, the input variables are defined as risk factors and assigned values. Risk factors include both continuous and discrete types. The descriptive statistical characteristics of all risk factors are shown in Tables 1 and 2.

[0147] Table 1. Descriptive statistics of continuous risk factors

[0148]

[0149] Table 2 Descriptive statistics of discrete risk factors

[0150]

[0151]

[0152] Step 21: Using the annual average number of traffic accidents as the output variable and the remaining risk factors as input variables, construct a random forest traffic accident prediction model; use the grid search algorithm to find the optimal values ​​of hyperparameters min_samples_leaf and min_samples_split, which are 4 and 5 respectively.

[0153] Step 22: Construct a traffic accident prediction model based on random forest using grid search and 4-fold cross-validation, and extract the importance of each risk factor using the Gini index method to reflect the differences among risk factors. The formula for calculating the Gini index is as follows:

[0154]

[0155] In the formula, K represents the number of categories of traffic accident risk factors in step 1; p mk p is the probability estimate of a sample at node m belonging to the k-th class; mk′ GI is the probability estimate of a sample at node m belonging to class k′; m This represents the Gini index of node m;

[0156] The node m represents each branch and leaf of the random forest;

[0157] For risk factor X j The importance of node m is determined by calculating the change in the Gini index before and after node m splits:

[0158]

[0159] In the formula, GI l GIr and represent the Gini index of the new node after node m splits; Indicates risk factor X j The importance of node m;

[0160] If risk factor X j If a risk factor X appears M times in the i-th decision tree (a tree has many branches and leaves), then the risk factor X... j The importance of the i-th decision tree is:

[0161]

[0162] In the formula, Indicates risk factor X j The importance of the i-th decision tree;

[0163] For risk factor X j The importance of Gini is defined as:

[0164]

[0165] In the formula, m′ represents the number of decision trees.

[0166] The results of risk factor importance extraction are attached. Figure 4 ;

[0167] Step 23: Improve the Canopy algorithm by vectorizing the traffic accident data samples into a list and using cross-validation to set the coarse threshold T1 and fine threshold T2. The final values ​​of the two threshold parameters of the Canopy algorithm are: T1 = 0.25 and T2 = 0.21.

[0168] Step 24: Calculate the density of each sample in the traffic accident dataset using the maximum density method, select the traffic accident sample P with the highest density as the first initial cluster center, and remove this traffic accident sample from the list. The steps of the maximum density method are as follows:

[0169] First, the density of traffic accident data samples is defined, for the given traffic accident data sample set {p1, p2, p3, ..., p n′ The average distance of all traffic accident data samples is calculated using the following formula:

[0170]

[0171] Where n′ is the number of traffic accident data samples, d(p i′ ,p j′ ) represents the weighted Euclidean distance between two traffic accident data samples; p1 is the first data sample in the traffic accident data sample set, p n′It is the n'-th data sample in the traffic accident data sample set;

[0172] Define the density of each traffic accident data sample in the total traffic accident data sample set according to the average distance. The formula is:

[0173]

[0174] The definition of f(x) is as follows:

[0175]

[0176] Select the traffic accident data sample P with the maximum density as the first initial clustering center, and delete the traffic accident data sample with the maximum density from the list.

[0177] Step 25: Calculate the distance D from the remaining traffic accident data samples in the list to the clustering center;

[0178] If T2 < D < T1, mark the sample weakly, indicating that the corresponding traffic accident data sample is in this clustering cluster, add it to this clustering cluster, but it may still become the center of other classes;

[0179] Furthermore, if D < T2, strongly mark the sample, indicating that the corresponding traffic accident data sample is in this clustering cluster, add it to this clustering cluster, it cannot be selected as the center of other classes anymore, and delete the corresponding traffic accident data sample from the remaining traffic accident data samples in the list;

[0180] Step 26: According to the minimum-maximum criterion, select the distances from the remaining traffic accident data samples in the list to the existing clustering centers, select the minimum value of each sample to the clustering center, and select the traffic accident sample with the maximum minimum value as the new clustering center;

[0181] The specific process is as follows:

[0182] When there are n″ existing clustering centers and solving for the (n″ + 1)-th clustering center, calculate the distances from all the remaining traffic accident data samples in the list to each clustering center, select the minimum value of each sample to each clustering center, construct a distance set, and select the maximum value in this set as the (n″ + 1)-th clustering center.

[0183] Step 27: Repeat Step 25 and Step 26 until the list is empty, then the clustering ends, and execute Step 28;

[0184] The number of samples in each clustering cluster is shown in Table 3.

[0185] Table 3 Number of samples in each cluster

[0186]

[0187] Step 28: Establish an isolated individual identification mechanism to delete groups identified as isolated individuals and accident samples within those groups, thus resolving the issue that some clusters contain only a small number of isolated samples.

[0188] The specific process is as follows:

[0189] After Canopy iteration (step 7 continues until the list is empty, i.e., the FCM algorithm selects cluster centers);

[0190] If the number of clusters in the traffic accident sample dataset is numPoint, then the number of accident samples in the t-th cluster is num. t ,t=1,2,...,m,when num t When the value is less than numPoint, the traffic accident sample in group t is determined to be an isolated individual, and the accident samples in group t and group t are deleted.

[0191] Step 29: Iteratively execute step 28, and based on the isolated individual discrimination mechanism, remove isolated samples to determine the final number of cluster groups.

[0192] As shown in Table 3, the accident prediction samples were divided into 28 clusters, with the sum of the sample counts in each cluster being 2277, which is greater than the number of predicted sample units. Using the isolated individual discrimination mechanism, clusters with fewer than 28 samples were removed, resulting in 10 clusters. After removing duplicate predicted samples between clusters, the number of predicted samples was 1324, accounting for 95% of the total number of predicted samples. This demonstrates that the selected 10 cluster centers can cover the vast majority of accident samples. The distances between the cluster centers are shown in Table 4.

[0193] Table 4. Distances between cluster centers

[0194]

[0195] Step 3: Using the cluster centers corresponding to each cluster group obtained in Step 2 as the initial cluster centers for the FCM algorithm, the FCM clustering algorithm is used for iterative clustering to cluster the traffic accident risk factors, resulting in the final traffic accident sample groups and completing the identification of similar road segments; the specific process is as follows:

[0196] Suppose X = (x1,...,x b ,...,x g ) is a set of g-data samples, x g ∈R s x g Let g be the g-th data sample in the data sample set, R be the set of real numbers, and s be an s-dimensional vector;

[0197] FCM clustering is used to cluster X = (x1, ..., x2)b ,...,x g The data is divided into c fuzzy subsets {S1, ..., S2}. a S c};

[0198] If we use V = {v1, ..., v} a , ..., v c} represents the cluster center of c fuzzy subsets, v c S represents c Cluster center, u ab Represents data sample x b For fuzzy subset S a Given the membership degree and q as the fuzziness index, the objective function of FCM clustering is:

[0199]

[0200] u ab The following constraints must be met:

[0201]

[0202] To reflect the differences among the various risk factors, the importance of each risk factor extracted from the random forest traffic accident prediction model is used as the weight of each risk factor to construct a weighted Euclidean distance.

[0203] The weighted Euclidean distance formula from the b-th sample data to the cluster center of the a-th fuzzy subset is:

[0204]

[0205] Where w r Assigning weights to each risk factor (importance in step 2), x b For the b-th sample, v a Let be the cluster center of the a-th fuzzy subset;

[0206] Cluster center:

[0207]

[0208] The membership matrix is:

[0209]

[0210] Where d(x) b ,v a d(x) represents the weighted Euclidean distance from the b-th sample data to the cluster center of the a-th fuzzy subset. b ,v k ) represents the weighted Euclidean distance from the b-th sample data to the cluster center of the k-th fuzzy subset;

[0211] Continuously iterate and update v a and u ab This minimizes the objective function of FCM clustering, thereby achieving a stable state in the data sample partitioning, resulting in the final grouping of traffic accident samples and completing the identification of similar road segments. The flowchart of the improved Canopy-FCM algorithm is attached. Figure 3 The number of traffic accidents in each of the 10 clusters was statistically analyzed, and the clustering results are shown in Table 5. It can be seen that there are significant differences in the frequency of traffic accidents among different clusters, which can verify the effectiveness of clustering to a certain extent.

[0212] Table 5. Basic information on accidents among different clusters.

[0213]

[0214] To further verify the feasibility of the improved Canopy-FCM clustering model, the silhouette coefficient was used to evaluate the clustering results. The principle of the silhouette coefficient is shown in the following equation:

[0215]

[0216] b(i) = min(b) i1 ,b i2 ,...,b ij (3-13)

[0217] In the formula: s(i) — the silhouette coefficient of sample i;

[0218] a(i) — Dissimilarity of sample i to the cluster;

[0219] b(i) — Inter-cluster dissimilarity of sample i;

[0220] b ij — This indicates that sample i is connected to a certain cluster C. j The average distance of all samples.

[0221] The improved Canopy-FCM clustering algorithm was compared and analyzed with the FCM clustering algorithm and the K-means clustering algorithm. The results are shown in Table 6. As can be seen from Table 6, the Canopy-FCM clustering algorithm has a larger silhouette coefficient than other clustering algorithms, which indicates that the classification effect of Canopy-FCM is better than other models, and the similarity of risk factors among the same clusters is higher.

[0222] Table 6. Silhouette coefficients of each clustering algorithm

[0223]

[0224] Box plots of accident frequency were generated for the 10 clusters obtained from FCM clustering, as shown in the appendix. Figure 5 As shown. According to the box type Figure 4 Based on the quantile method, road segments corresponding to sample points with an accident count greater than Q3 + 1.5IQR are identified as accident-prone road segments. Statistical analysis yielded 78 groups of accident-prone road segments, accounting for 5% of the total sample.

[0225] IQR = Q3 - Q1

[0226] In the formula: Q1 represents the first quartile of the sample; Q3 represents the third quartile of the sample; IQR represents the interquartile range.

[0227] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.

Claims

1. A method for identifying accident-prone road sections based on Canopy-FCM, characterized in that: The specific process of the method is as follows: Step 1: Based on the traffic accident dataset, select traffic accident risk factors, which include two types: continuous risk factors and discrete risk factors. In continuous risk factors, each factor takes the actual value of its value, which is used as the value of the continuous variable. Each factor in the discrete risk factor is assigned a different integer value, which serves as the discrete variable value. Step 2: Use the improved Canopy algorithm to cluster the risk factors of the accident samples, and use the isolated sample discrimination mechanism to determine the final number of cluster groups; Step 3: Using the cluster center corresponding to each cluster group obtained in Step 2 as the initial cluster center of the FCM algorithm, the traffic accident risk factors are clustered to obtain the final traffic accident sample grouping. Step 4: Draw box plots of accident frequency for each group of traffic accident samples obtained from FCM clustering; Based on the box plot quartile method, the number of accidents greater than... The road sections corresponding to the sample points are the accident-prone road sections; Indicates the third quartile of the sample; Indicates the interquartile range; The FCM clustering is a fuzzy C-means clustering; In step 1, traffic accident risk factors are selected by combining the traffic accident dataset. These traffic accident risk factors include two types: continuous risk factors and discrete risk factors. In continuous risk factors, each factor takes the actual value of its value, which is used as the value of the continuous variable. Each factor in the discrete risk factor is assigned a different integer value, which serves as the discrete variable value. The specific process is as follows: Continuous risk factors include the annual average number of traffic accidents, daily traffic volume, road segment length, straight segment length, horizontal curve deflection angle, horizontal curve curvature, horizontal curve length, longitudinal slope length, vertical curve slope difference, current cumulative slope, current cumulative slope length, and rainfall. Discrete risk factors include horizontal curves, transition curves, continuous downhill slopes, vertical curve types, and road segment types; In step 2, the improved Canopy algorithm is used to cluster the risk factors of the accident samples, and an isolated sample discrimination mechanism is used to determine the final number of clusters; the specific process is as follows: Step 21: Select min_samples_leaf and min_samples_split as hyperparameters of the random forest traffic accident prediction model; min_samples_leaf represents the minimum number of samples required for a leaf node; min_samples_split represents the minimum number of samples required to split an internal node; Using the average number of traffic accidents per year in step 1 as the output variable and the remaining risk factors as input variables, a random forest traffic accident prediction model is constructed. Step 22: Input the traffic accident risk factors into the constructed random forest traffic accident prediction model, and use the Gini index method to extract the importance of each risk factor; Step 23: Convert the traffic accident data samples into a list by vectorization; Two thresholds for Canopy were obtained using cross-validation. and ,in ; in Used to determine the "density" threshold. Used to determine the "resolution" threshold; Step 24: Calculate the density of each sample in the traffic accident dataset using the maximum density rule, select the traffic accident data sample P with the highest density as the first initial cluster center, and delete the traffic accident data sample with the highest density from the list; Step 25: Calculate the distance D from the remaining traffic accident data samples in the list to the cluster centers; like The sample is marked with a weak label, indicating that the corresponding traffic accident data sample is within the cluster and is added to the cluster, but may still become the center of other clusters; like If the sample is marked as such, it indicates that the corresponding traffic accident data sample is within the cluster and is added to the cluster. It cannot be selected as the center of other clusters. The corresponding traffic accident data sample is then removed from the remaining traffic accident data samples in the list. Step 26: According to the minimum-maximum criterion, calculate the distance from each remaining traffic accident data sample in the list to the existing cluster center, select the minimum distance from each sample to the cluster center, and select the traffic accident sample with the largest minimum distance as the new cluster center. Step 27: Repeat steps 25 and 26 until the list is empty, at which point the clustering ends and step 28 is executed; Step 28: Establish an isolated individual identification mechanism to delete groups identified as isolated individuals and accident samples within those groups; Step 29: Iteratively execute step 28, and based on the isolated individual discrimination mechanism, remove isolated samples to determine the final number of cluster groups.

2. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 1, characterized in that: In step 21, the optimal values ​​for the hyperparameters min_samples_leaf and min_samples_split are 4 and 5, respectively.

3. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 2, characterized in that: In step 22, traffic accident risk factors are input into the constructed random forest traffic accident prediction model, and the importance of each risk factor is extracted using the Gini index method; the specific process is as follows: The importance of each risk factor is extracted using the Gini index method. The formula for calculating the Gini index is as follows: (1) In the formula, This represents the number of categories of traffic accident risk factors in step 1; For nodes The sample belongs to the first The probability estimate of the class; For nodes The sample belongs to the first The probability estimate of the class; Represents a node The Gini index; The node These represent the branches and leaves of a random forest. For risk factors At the node The importance of computing nodes The change in the Gini index before and after splitting was obtained as follows: (2) In the formula, , Representing nodes respectively The Gini index of the new node after the split; Indicates risk factors At the node The importance of; If risk factors In the Appearing in decision trees Next, then the risk factors In the The importance of each decision tree is: (3) In the formula, Indicates risk factors In the The importance of decision trees; For risk factors The importance of Gini is defined as: (4) In the formula, The number of decision trees.

4. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 3, characterized in that: In step 24, the density of each sample in the traffic accident dataset is calculated using the maximum density rule. The traffic accident data sample P with the highest density is selected as the first initial cluster center, and the traffic accident data sample with the highest density is removed from the list. The specific steps are as follows: Regarding the given traffic accident data sample set The average distance of all traffic accident data samples is calculated using the following formula: (5) in This represents the number of traffic accident data samples. This represents the weighted Euclidean distance between two traffic accident data samples; This is the first data sample in the traffic accident data sample set. For the traffic accident data sample set One data sample; The density of each traffic accident data sample in the total traffic accident data sample set is defined based on the average distance, using the following formula: (6) in The definition is as follows: (7) Select the traffic accident data sample P with the highest density as the first initial cluster center, and then remove the traffic accident data sample with the highest density from the list.

5. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 4, characterized in that: In step 26, based on the minimum-maximum criterion, the distance from each remaining traffic accident data sample in the list to the existing cluster centers is calculated. The minimum distance from each sample to the cluster center is selected, and the traffic accident sample with the largest minimum distance is selected as the new cluster center. The specific process is as follows: When existing Find the cluster centers and solve for the i-th cluster. When selecting the cluster center, calculate the distance from all remaining traffic accident data samples in the list to each cluster center. Select the minimum distance from each sample to each cluster center to construct a distance set. Select the maximum value in this set as the first cluster center. Cluster centers.

6. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 5, characterized in that: In step 28, an isolated individual identification mechanism is established, and groups identified as isolated individuals and accident samples within those groups are deleted. The specific process is as follows: If the number of clusters in the traffic accident sample dataset is , No. t The number of accident samples in the group is ,when At that time, the first t The traffic accident samples in the group were determined to be isolated individuals, and the first group was... t The group and the accident samples in the group were deleted.

7. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 6, characterized in that: In step 3, the cluster center corresponding to each cluster group obtained in step 2 is used as the initial cluster center for the FCM algorithm. The FCM clustering algorithm is used for iterative clustering to cluster the traffic accident risk factors, resulting in the final traffic accident sample grouping. The specific process is as follows: Assumption For one g Metadata sample set, , For the data sample set, the first g One data sample, For the set of real numbers, for dimensional vector; FCM clustering is... Divided into c a fuzzy subset ; If used express c Cluster centers of a fuzzy subset, express Cluster centers Represents data samples For fuzzy subsets membership degree q Let be the ambiguity index, then the objective function for FCM clustering is: (8) The following constraints must be met: (9) in = express Membership matrix, Indicates the first The number of sample data to the number The weighted Euclidean distance of the cluster centers of a fuzzy subset; The importance of each risk factor extracted from the random forest traffic accident prediction model is used as the weight of each risk factor to construct a weighted Euclidean distance. No. The number of sample data to the number The weighted Euclidean distance formula for the cluster centers of a fuzzy subset is: (10) in The weights of each risk factor, For the first One sample, For the first Cluster centers of a fuzzy subset; Cluster center: (11) The membership matrix is: (12) in For the first The number of sample data to the number The weighted Euclidean distance of the cluster centers of a fuzzy subset. For the first The number of sample data to the number The weighted Euclidean distance of the cluster centers of a fuzzy subset; Continuous iteration and updates and This minimizes the objective function of FCM clustering, resulting in the final grouping of traffic accident samples.

8. The method for identifying accident-prone road sections based on Canopy-FCM according to claim 7, characterized in that: In step 4, box plots of accident frequency are drawn for each group of traffic accident samples obtained by FCM clustering. Based on the box plot quartile method, the number of accidents greater than... The road sections corresponding to the sample points are the accident-prone road sections; In the formula: Indicates the first quartile of the sample; Indicates the third quartile of the sample; This represents the interquartile range.