Automatic driving accident occurrence mechanism analysis method based on clustering model
By analyzing autonomous driving accident data using multiple clustering models and the t-SNE algorithm, the differences in variables among different clusters are identified, solving the problem that existing technologies cannot effectively analyze autonomous driving accidents and achieving precise improvements in autonomous driving safety.
Patent Information
- Application Number
- CN202211719286.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing technologies are insufficient to effectively analyze the multidimensional factors that contribute to autonomous driving accidents, making it impossible to take targeted safety improvement measures.
Multiple clustering models are used to analyze autonomous driving accident data, and the t-SNE algorithm is combined for high-dimensional visualization to identify the differences in variables between different clusters and summarize the accident occurrence patterns.
By combining multiple clustering models and the t-SNE algorithm, the impact of factors such as roads, environment, and vehicles on autonomous driving accidents can be accurately analyzed, and targeted safety measures can be provided to improve autonomous driving safety.
Smart Images

Figure CN116484244B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of accident causation analysis, and more particularly relates to an automatic driving accident mechanism analysis method based on a clustering model. BACKGROUND
[0002] The advent of the intelligent era provides many new ways to solve traffic problems. The networked automatic driving vehicle, which integrates the Internet of Vehicles, intelligent vehicles, real-time communication and other emerging technologies, is a typical solution to traffic problems. Traffic safety is a key factor affecting the popularization and application of automatic driving technology. Previous research on traffic accident mechanisms usually focuses on analyzing traditional vehicle traffic accidents using a single clustering method. Factors affecting traffic accidents include people, vehicles, roads, and the environment. However, automatic driving vehicles involve uncontrollable factors such as artificial intelligence. Currently, there is little research on automatic driving accidents. Using multiple clustering models to analyze multi-dimensional automatic driving accident data can identify different mechanisms of occurrence compared to traditional accidents, which helps to improve automatic driving safety. At the same time, the t-SNE algorithm can visualize high-dimensional clustering, intuitively compare the output results of different clustering models, and explore the variable differences between different clusters to summarize the automatic driving accident patterns. Therefore, based on the clustering idea to analyze the automatic driving accident mechanism, combined with the t-SNE algorithm to visualize the automatic driving accident pattern, and the optimal cluster accident characteristics are summarized. The collection of automatic driving fault data, the automatic driving accident mechanism analysis method based on the clustering model of the relevant departments can take targeted safety management measures to help improve and promote the automatic driving technology, and has engineering practical value. SUMMARY
[0003] The problem to be solved by the present application is to overcome the shortcomings of the prior art and provide an automatic driving accident mechanism analysis method based on a clustering model. Multiple clustering models are used to identify the different mechanisms of occurrence of multi-dimensional automatic driving accident data and traditional accidents, which helps to improve automatic driving safety. At the same time, the t-SNE algorithm can visualize high-dimensional clustering, intuitively compare the output results of different clustering models, and explore the variable differences between different clusters to summarize the automatic driving accident patterns.
[0004] In order to solve at least one of the above technical problems, according to one aspect of the present application, an automatic driving accident mechanism analysis method based on a clustering model is provided, comprising the following steps:
[0005] S1, obtain the automatic driving accident in previous years, preprocess and feature engineering coding of multi-source data, and establish the automatic driving accident mining and analysis dataset D. The automatic driving accident related data collection includes accident report original dataset D1 and satellite map location dataset D2. The multi-source data D1 and D2 are jointly and preprocessed by using accident location, the missing values are filled by using mode, the dirty data are deleted, the text is coded as a categorical variable of unordered array, and the accident mining and analysis dataset D is established.
[0006] S2, find out the main influencing factors of automatic driving accidents by significance test and cross contingency table statistical analysis means, and adopt chi-square test formula (formula 1) to perform significance test on unordered categorical variables of accident dataset, and preliminarily screen the accident influencing factors.
[0007]
[0008] Among them, A i is the frequency of i characteristics, E i is the expected frequency of characteristics i, and n is the total frequency. The χ 2 value is used to judge the significance of the variable, and the insignificant variable is deleted.
[0009] S3, the importance of accident dataset variables is calculated and sorted by using random forest algorithm, and the feature variables are screened for establishing a multi-dimensional clustering model. The variable importance score is represented by VI, the Gini index is represented by GI, and the Gini index score VI i of each feature X i is calculated by the following formula.
[0010]
[0011] In the formula, K represents K categories, p mk represents the proportion of category k in tree node m, GI l and GI r represent the Gini index of the new node after tree branching.
[0012] S4, introduce K-Means, PCA+K-Means, GMM, DBSCAN, hierarchical clustering and other methods to cluster the automatic driving accident feature set, and compare the clustering models according to the silhouette coefficient (formula 4).
[0013]
[0014] Among them, N represents the total number of samples; a represents the average distance between sample i and other samples in the class it belongs to; and b represents the average distance between sample i and other class samples.
[0015] K-Means calculates the Euclidean distance between each sample and the cluster center, and assigns each sample to the nearest cluster center until the within-cluster sum of squared errors SSE converges to a local minimum as the termination condition (equation 5).
[0016]
[0017] where K represents the number of cluster centers; C i represents the i-th cluster center; μ i is the mean vector of the cluster center C i .
[0018] PCA+K-Means first uses principal component analysis to reduce the dimensionality of the original data, and finds k vectors to project the original data to minimize the projection error (equation 6), and then clusters the principal components as feature factors.
[0019]
[0020] M represents the number of features, the sum of distances between the original point and the projected point, and the smaller the error.
[0021] GMM classifies data through a Gaussian smoothing model, and its probability density function is equation 7.
[0022]
[0023] where K is the number of clusters; α k is the probability of belonging to the k-th Gaussian, which needs to satisfy greater than zero, and the sum of α k for one x is equal to 1; p(x|k) is the probability density of the k-th Gaussian, whose mean vector is μ k , Σ j is the covariance matrix.
[0024] DBSCAN defines Epsilon (neighborhood radius) and minimum points (the minimum number of points in the neighborhood radius is calculated according to equation 8) for unsupervised clustering, and the maximum set of points with the same density is the appropriate cluster.
[0025] MinPts≈ln(samples) (8)
[0026] Hierarchical clustering creates a hierarchical nested clustering tree by calculating the similarity between different categories of data points, and merges iterations to a threshold value to obtain a specified number of clusters through mean distance (equation 9).
[0027]
[0028] S5, using t-SNE algorithm to visualize high-dimensional clustering, using improved joint probability distribution (formula 10) in high-dimensional space to aggregate closer points in the same cluster more closely and more distant points between different clusters more distant. Intuitively compare the output results of different clustering models and derive the optimal cluster, explore the differences in variable values between different clusters, and summarize the automatic driving accident pattern.
[0029]
[0030] wherein y i , y j are the corresponding values of two points x i , x j in the high-dimensional space after being mapped to the low-dimensional space, and y j is the conditional probability of the neighborhood of y i . ij .
[0031] According to another aspect of the present application, a computer readable storage medium is provided, which stores a computer program, the program being executed by a processor to implement the steps of the cluster model-based automatic driving accident mechanism analysis method of the present application.
[0032] According to still another aspect of the present application, a computer device is provided, which comprises a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the cluster model-based automatic driving accident mechanism analysis method of the present application when executing the program.
[0033] Compared with the prior art, the present application has at least the following beneficial effects:
[0034] The cluster model-based automatic driving accident mechanism analysis method of the present application can accurately analyze the influence mechanism of road, environment, vehicle and other factors on the risk of automatic driving accidents and the pattern of automatic driving accidents by collecting automatic driving accident data to establish a high-dimensional accident feature data set, screening variables using significance test and random forest, introducing various clustering methods for feature clustering, comparing the advantages and disadvantages of models through evaluation indexes such as contour coefficients and t-SNE dimensionality reduction visualization, and outputting the best clustering for automatic driving accident pattern analysis, and can take targeted safety measures to improve automatic driving safety. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present application, but not limit the present application.
[0036] Figure 1 is the flow chart of the method of the present application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention.
[0038] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0039] Example 1:
[0040] To solve the above problems, this invention adopts the following technical solution: a method for analyzing the mechanism of autonomous driving accidents based on a clustering model, such as... Figure 1 As shown, it includes the following steps:
[0041] Step 1: Collect data related to autonomous driving accidents, including raw accident report data and satellite map location data. Search online for the publicly available connected autonomous driving accident dataset D1 from the California Department of Motor Vehicles (DMV). Collect data on direct factors such as vehicle movement behavior, vehicle type, accident type, and accident time from 479 detailed accident reports from January 2015 to September 2022. Use Google Maps to match latitude and longitude at accident locations to collect data D2 on road type, geometric design factors, and traffic facilities. Combine and preprocess the multi-source data D1 and D2 using accident IDs to create an accident mining and analysis dataset D. Merge the raw dataset and location dataset row-wise according to the accident location index to form an accident set containing multiple factors such as roads, vehicles, and environment. Preprocess the accident dataset by filling missing values with the mode, deleting dirty data, and encoding attribute values under different variables into unordered categorical variables.
[0042] Table 1 Accident Mining and Analysis Dataset D
[0043]
[0044] Step 2: Identify the main influencing factors leading to autonomous driving accidents through significance testing and cross-tabulation statistical analysis. Use the chi-square test formula (Equation 1) to conduct significance testing on the unordered categorical variables of the accident dataset, preliminarily screen the influencing factors of the accidents and represent them numerically to facilitate subsequent high-dimensional clustering coordinate visualization, as shown in Table 2.
[0045]
[0046] Among them, A i E represents the frequency of feature i.i The expected frequency of feature i, n is the total frequency. The χ 2 value is used to judge the significance of variables, and insignificant variables are deleted.
[0047] Table 2 Accident training data set
[0048] Num Vec_type AV_Move Time … Weather Severity Crash_type … Bus_sta … Road_park 1 1 1 1 … 1 1 1 … 1 … 1 2 2 2 2 … 2 2 2 … 1 … 1 3 4 5 4 … 3 3 4 … 0 … 0 … … … … … … … … … … … … 379 2 7 1 … 5 2 5 … 0 … 1 380 3 9 3 … 4 4 6 … 0 … 0
[0049] Step 3, use the random forest algorithm to calculate the importance of the variables of the accident data set and sort the evaluation, and screen the feature variables for building a multi-dimensional clustering model. The variable importance score is represented by VI, and the Gini index is represented by GI. The Gini index score VI of each feature X i is calculated by the following formula i As shown in Table 3.
[0050]
[0051] Table 3 Feature importance of accident data set calculated by random forest algorithm
[0052] Num Feature Categories Feature importance 1 Crashtype 6 0.51 2 CAV movement 4 0.47 3 HDV movement 10 0.45 4 Location 10 0.32 … … … … 17 Weather 5 0.21 18 Time 4 0.15 19 Roadside parking 2 0.08
[0053] Step 4, introduce K-Means, PCA+K-Means, GMM, DBSCAN, hierarchical clustering and other methods to cluster the automatic driving accident feature set, and compare the clustering models according to the silhouette coefficient (formula 4).
[0054]
[0055] Where N represents the total number of samples; a represents the average distance of sample i and other samples in the class it belongs to; and b represents the average distance of sample i and other class samples.
[0056] K-Means calculates the Euclidean distance between each sample and each cluster center, assigns each sample to the cluster center closest to it, and stops until the within-cluster sum of squared errors SSE converges to a local minimum as the termination condition (formula 5).
[0057]
[0058] Where K is the number of cluster centers; C i is the i-th cluster center; and μ i is the mean vector of C i .
[0059] PCA+K-Means first uses principal component analysis to reduce the dimension of the original data, finds k vectors to project the original data, and minimizes the projection error (formula 6), and then clusters the principal components as feature factors.
[0060]
[0061] M represents the number of features, The smaller the error, the smaller the sum of distances between original points and projected points.
[0062] The GMM classifies data through a Gaussian smoothing model, and its probability density function is formula 7.
[0063]
[0064] Where K is the number of clusters; α k is the probability of belonging to the kth Gaussian, which needs to satisfy greater than zero, and the sum of α k for one x is equal to 1; p(x|k) is the probability density of the kth Gaussian, whose mean vector is μ k , Σ k is the covariance matrix.
[0065] DBSCAN defines Epsilon (neighborhood radius) and minimum points (the minimum number of points in the neighborhood radius is calculated by formula 8) for unsupervised clustering, and the maximum set of points connected by density is the appropriate cluster.
[0066] MinPts≈ln(479)≈6 (8)
[0067] Hierarchical clustering creates a hierarchical nested clustering tree by calculating the similarity between different categories of data points, and merges iteratively to a threshold value by mean distance (formula 9) to obtain a specified number of clusters.
[0068]
[0069] The evaluation index results obtained after mining and analyzing the automatic driving accident data set D using the above algorithms are shown in Table 4, and the contour coefficient and other indicators show that the K-Means clustering model has the best effect, which is used for subsequent further high-dimensional visualization and best clustering analysis, and the accident feature clustering results are shown in Table 5.
[0070] Table 4 Best key parameters and evaluation indexes of different clustering models
[0071] Clustering model Parameters Contour coefficient K-Means K=5 0.72 PCA+K-Means PCA=9, K=6 0.68 GMM K=4 0.35 DBSCAN R=1.5, MinPts=6 0.46 Agglomerative hierarchical clustering K=3 0.41
[0072] Table 5 Clustering results of automatic driving accident features
[0073]
[0074]
[0075] Step 5: Use the t-SNE algorithm to visualize the high-dimensional clusters obtained by K-Means. In the high-dimensional space, the improved joint probability distribution (Equation 10) is used to cluster points that are closer together within the same cluster more tightly, and points that are farther apart between different clusters are more dispersed. The two-dimensional and three-dimensional visualization results are shown in Figure 2. The output results of different clustering models are intuitively compared and the optimal cluster is derived. The differences in variable values between different clusters are shown in Table 6, and the occurrence patterns of autonomous driving accidents are summarized.
[0076]
[0077] Among them, y i y j Two points x in a higher-dimensional space i x j The corresponding value after mapping to a lower-dimensional space, y j It is y i The conditional probability of the neighborhood is q. ij .
[0078] Table 6. Average feature values within the best cluster of autonomous driving accident features.
[0079] Cluster 1 2 3 4 5 6 Severity 1.285 2.169 2.000 2.111 2.378 2.891 Vec_type 1.105 1.932 3.476 1.889 2.256 2.173 HDV_move 3.555 2.678 1.500 1.533 1.564 6.077 Location 1.130 1.085 1.119 1.044 1.060 2.013 CAV_move 1.310 8.322 1.738 9.956 5.376 2.564 Crash_type 1.390 2.169 3.595 2.844 1.692 2.502
[0080] Different feature values within the best category roughly reflect the different severity and accident types and their occurrence mechanisms. For example, minor accidents often occur at signalized intersections, while rear-end collisions often result in serious accidents. The clustering model-based analysis method for the occurrence mechanism of autonomous driving accidents can enable targeted safety management measures.
[0081] Example 2:
[0082] The computer-readable storage medium of this embodiment stores a computer program that, when executed by a processor, implements the steps in the clustering model-based autonomous driving accident occurrence mechanism analysis method of Embodiment 1.
[0083] The computer-readable storage medium in this embodiment can be an internal storage unit of the terminal, such as the terminal's hard disk or memory; the computer-readable storage medium in this embodiment can also be an external storage device of the terminal, such as a plug-in hard disk, smart memory card, secure digital card, flash memory card, etc. equipped on the terminal; furthermore, the computer-readable storage medium can include both the terminal's internal storage unit and external storage devices.
[0084] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0085] Example 3:
[0086] The computer device of the embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the automatic driving accident occurrence mechanism analysis method based on a clustering model of embodiment 1 when executing the program.
[0087] In the embodiment, the processor can be a central processing unit, and can also be other general-purpose processors, digital signal processors, application-specific integrated circuits, ready programmable gate arrays, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any other conventional processor. The memory can include read-only memory and random access memory, and provide instructions and data to the processor. Part of the memory can also include non-volatile random access memory, for example, the memory can also store device type information.
[0088] Those skilled in the art should understand that the embodiments disclosed herein can be provided as a method, a system, or a computer program product. Therefore, the present solution can be in the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present solution can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0089] The present solution is described with reference to flowcharts and / or block diagrams of the method and computer program product according to the embodiments of the present solution, and it should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one flow or multiple flows and / or blocks
[0090] These computer program instructions can also be stored in a computer-readable memory that can guide the computer or other programmable data processing devices to work in a specific way, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one flow or multiple flows and / or blocks
[0091] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 The flowchart blocks or blocks Figure 1 The flowchart blocks or blocks
[0092] Those skilled in the art can understand that all or part of the flow of the above-mentioned embodiment method can be completed by instructing the relevant hardware through the computer program, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the flow of the above-mentioned embodiment of each method. Among them, the storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM) or a random access memory (RAM) and the like.
[0093] The examples described in the present application are only used to describe the preferred embodiments of the present application, and not to limit the concept and scope of the present application. Without departing from the design idea of the present application, various modifications and improvements of the technical solutions of the present application made by the engineers and technicians in the art shall fall within the protection scope of the present application.
Claims
1. A cluster model-based automatic driving accident occurrence mechanism analysis method, characterized by, Comprise the following steps: S1, obtain automatic driving accident, pre-process and feature engineering coding of multi-source data, establish automatic driving accident mining and analysis dataset; S2, find out the main influencing factors of automatic driving accident through significance test and cross contingency table statistical analysis method, perform significance test on the unordered classification variables of the accident dataset, and preliminarily screen the accident influencing factors; S3, calculate the importance of the variables of the accident dataset and sort the evaluation by using the random forest algorithm, and screen the feature variables for establishing a multi-dimensional clustering model; S4, cluster the automatic driving accident feature set, and compare the clustering models; S5, visualize the high-dimensional clustering by using the t-SNE algorithm, and in the high-dimensional space, use the improved joint probability distribution to make the points in the same cluster that are closer in distance more closely aggregated, and the points that are farther apart in different clusters more distant; directly compare the output results of different clustering models and derive the optimal cluster, explore the variable value difference between different clusters, and summarize the automatic driving accident occurrence mode.
2. The method of claim 1, wherein, Step S1 is as follows: automatic driving accident related data collection, including accident report original dataset D1 and satellite map location dataset D2; joint and pre-process the original dataset D1 and satellite map location dataset D2 using accident location, fill in the missing values using the mode, delete the dirty data, encode the text into unordered array classification variables, and establish the accident mining and analysis dataset D.
3. The method of claim 1, wherein, The chi-square test formula used in step S2 is as follows: wherein, wherein A i is the frequency of feature i, E i is the expected frequency of feature i, and n is the total frequency; using χ 2 values to judge variable significance and remove insignificant variables.
4. The method of claim 1, wherein, Step S3 is specifically: variable importance score is denoted by VI, Gini index is denoted by GI, and the Gini index score VI of each feature X is calculated by the following formula i i , where K represents the number of classes, p mk represents the proportion of class k in tree node m, GI l and GI r represents the Gini index of the new node after tree branching.
5. The method of claim 1, wherein, Step S4 is as follows: introduce K-Means, PCA+K-Means, GMM, DBSCAN and hierarchical clustering method to cluster the automatic driving accident feature set, compare the clustering models according to the silhouette coefficient, and the silhouette coefficient formula is as follows: Wherein, N represents the total number of samples; a represents the average distance between sample i and other samples in the same class; b represents the average distance between sample i and other class samples; K-Means calculates the Euclidean distance between each sample and each clustering center, assigns each sample to the nearest clustering center, and stops until the within-cluster sum of squared errors SSE converges to a local minimum as the termination condition, wherein K represents the number of cluster centers; C i represents the i-th cluster center; μ i is the mean vector of the cluster center C i . PCA+K-Means first uses principal component analysis to reduce the dimension of the original data, finds k vectors to project the original data, minimizes the projection error, and then clusters the principal components as feature factors, M represents the number of features, represents the sum of distances between original points and projected points, the smaller the error is; GMM classifies data through Gaussian smoothing model, and its probability density function is as follows: where K is the number of clusters; a k is the probability of belonging to the kth Gaussian, which needs to satisfy that a k sum equals 1 for one x; p(x \ k) is the probability density of the kth Gaussian, whose mean vector is μ k ,∑ k is the covariance matrix; DBSCAN defines Epsilon and minimum point for unsupervised clustering, and the maximum set of points connected in density is the appropriate cluster, MinPts≈ln(samples)(8) Hierarchical clustering creates a hierarchical nested clustering tree by calculating the similarity between different class data points, and according to formula 9, Merge iterations to threshold to get a specified number of clusters.
6. The method of claim 1, wherein, The improved joint probability distribution formula used in step S5 is as follows: where y i , y j are the corresponding values after x i , x j are mapped to the low-dimensional space, and y j is the neighborhood of y i . The conditional probability of y ij is q .
7. A computer readable storage medium having stored thereon a computer program, characterized in that: The program is executed by a processor to implement the steps in the automatic driving accident occurrence mechanism analysis method based on the clustering model in any one of claims 1-6.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps in the cluster model-based automatic driving accident mechanism analysis method according to any one of claims 1-6 when executing the program.
Citation Information
Patent Citations
Automatic drive vehicle test scene construction method based on traffic accident case deconstruction, and test method
CN108765235A
Method and system for avoidance of accidents
US20160061625A1