A traffic accident prediction method, system, electronic device and storage medium

CN117273443BActive Publication Date: 2026-10-13CHANGCHUN UNIV OF SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311208451.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-19
Publication Date
2026-10-13
Estimated Expiration
2043-09-19

AI Technical Summary

Technical Problem

但当处理不平衡数据时,模型性能会有所下降,从而导致评估的不准确性

Benefits of technology

[0050]本发明公开了一种交通事故预测方法、系统、电子设备及存储介质,基于数据增强技术,针对交通事故语义信息不足、内在不平衡和模型对非线性数据学习能力差等问题,提出了基于数据增强的交通事故预测模型。该模型能够显著提高提高交通事故风险预测准确度,有效降低交通事故发生概率,保证城市道路环境安全提高了交通事故预测的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117273443B_ABST
    Figure CN117273443B_ABST
Patent Text Reader

Abstract

The application discloses a traffic accident prediction method and system, electronic equipment and a storage medium, and relates to the technical field of intelligent transportation. The method comprises the following steps: acquiring to-be-predicted features; the to-be-predicted features comprise time sequence features, accident safety features and collinearity features of a to-be-predicted traffic event; performing accident prediction on the to-be-predicted traffic event based on the to-be-predicted features and a traffic accident prediction model; the traffic accident prediction model is obtained by training a double-layer stacked model architecture by using a final traffic accident data set; the final traffic accident data set is obtained by processing a derived traffic accident data set by using a CART algorithm and one-side selection in sequence after deriving features based on an original traffic accident data set; and the double-layer stacked model architecture is constructed based on a logistic regression algorithm, a random forest algorithm, a K nearest neighbor algorithm and a gradient boosting tree. The application improves the accuracy of traffic accident prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method, system, electronic device, and storage medium for predicting traffic accidents. Background Technology

[0002] With rapid socio-economic development and a continuous increase in car ownership, traffic accidents have become increasingly frequent, leading to a surge in injuries and fatalities. This increase in casualties places immense pressure on traffic safety and social stability management. Accurate traffic accident risk assessment can effectively reduce the probability of traffic accidents and prevent road congestion caused by accidents. Simultaneously, it can improve the efficiency of rescue resource allocation and reduce secondary injuries caused by delayed rescue. Therefore, research on traffic accident risk assessment helps to discover potential patterns in traffic accidents and provides a theoretical basis for mitigating accident risks.

[0003] Extensive literature exists on traffic accident risk assessment. These studies can be categorized into statistical and machine learning methods. Statistical methods primarily analyze historical traffic accident data to determine the relationship between risk factors and accident severity, then establish mathematical models to predict future accident occurrences. Currently, statistical models such as logit models, ordered logit models, and ordered probit models are widely used in traffic accident risk assessment. For example, Zhao et al. proposed an ordered logit model to explore traffic accident risk factors, showing that the severity of driver injury is related to factors such as driver age, accident time, and weather. Vieira et al. used multivariate logistic regression to study the influencing factors of collision and injury severity in traffic accidents, demonstrating a close relationship between road environment, road grip conditions, and the degree of collision, and that abnormal driver behavior increases the probability of collision. Chen et al. developed a random parameter binary ordered probability model to study the influencing factors of driver injury in the same rear-end collision, finding that driver age, gender, and the use of vehicle airbags all affect the severity of driver injury. Statistical models possess high computational efficiency and have significant advantages in real-time task processing. However, statistical models have high requirements for data during model training, and there are bias problems during the training process. They are relatively weak in learning complex nonlinear data relationships and have difficulty adapting to complex traffic accident data such as nonlinear, non-Gaussian, and non-stationary data.

[0004] Machine learning is a powerful artificial intelligence algorithm that can automatically explore relationships between data, extract valuable information, and predict future trends, thereby achieving autonomous learning and intelligent decision-making. Machine learning models are widely used in traffic accident risk assessment due to their strong adaptability to new data and their superior performance in handling complex, non-linear, non-Gaussian, and non-stationary data relationships. Representative models include SVM, GBDT, RF, MLP, CNN, LSTM, and Stacking models. Specifically, Wu et al. proposed an innovative GBDT model to explore the correlation between various risk factors and traffic accidents. Yang et al. proposed an interpretable multi-task framework based on DNN to predict collision levels related to injury, death, and property damage. Ma et al. proposed a comprehensive analysis framework based on SSAE to predict the severity of traffic accidents, and the results showed that the proposed comprehensive analysis framework had the best evaluation performance compared to the benchmark model. Machine learning models perform well in handling complex, non-linear traffic accident data relationships, often exhibiting higher evaluation accuracy than statistical models and demonstrating better feature learning. Although machine learning models have significant advantages in shallow feature learning, they often have limitations in mining deep semantic information. Furthermore, the model is not sensitive enough to noisy data and has difficulty handling unbalanced traffic accident data, thereby reducing the accuracy of model evaluation.

[0005] Despite the existence of numerous mature research methods in the field of traffic accident risk assessment, the low accuracy of accident risk assessment models remains a problem. Specifically, this manifests in two ways: First, deep feature learning helps enrich the semantic information of data, enhances the model's generalization and adaptive capabilities, and improves its evaluation performance. However, features contain rich semantic information, which lacks effective and sufficient mining and utilization. Second, traffic accident data itself is imbalanced. Existing models and methods perform well on balanced data, but their performance deteriorates when dealing with imbalanced data, leading to inaccurate assessments. Summary of the Invention

[0006] The purpose of this invention is to provide a traffic accident prediction method, system, electronic device, and storage medium, which improves the accuracy of traffic accident prediction.

[0007] To achieve the above objectives, the present invention provides the following solution:

[0008] A method for predicting traffic accidents, comprising:

[0009] Obtain the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted;

[0010] Based on the features to be predicted and the traffic accident prediction model, the traffic event to be predicted is predicted. The traffic accident prediction model is obtained by training a two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing the derived traffic accident dataset obtained after feature derivation based on the original traffic accident dataset using the CART algorithm and one-sided selection in sequence. The two-layer stacked model architecture is constructed based on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm and gradient boosting tree.

[0011] Optionally, the training process of the traffic accident prediction model includes:

[0012] Obtain the original traffic accident dataset; the original accident dataset includes: original time-series features, original accident safety features, and original collinearity features of multiple traffic accidents;

[0013] The original time-series features, original accident safety features, and original collinearity features are derived to obtain derived time-series features, derived accident safety features, and derived collinearity features, respectively.

[0014] Based on the original traffic accident dataset, all the derived time-series features, all the derived accident safety features, and all the derived collinearity features, a derived traffic accident dataset is constructed.

[0015] The CART algorithm was used to filter features in the derived traffic accident dataset, resulting in a filtered traffic accident dataset.

[0016] One-sided selection data augmentation was performed on the filtered traffic accident dataset to obtain the final traffic accident dataset.

[0017] A two-layer stacked model architecture is constructed based on logistic regression, random forest, K-nearest neighbor, and gradient boosting tree algorithms.

[0018] The traffic accident prediction model is obtained by training the two-layer stacked model architecture using the final traffic accident dataset.

[0019] Optionally, the original time-series features, original accident safety features, and original collinearity features are derived to obtain derived time-series features, derived accident safety features, and derived collinearity features, specifically including:

[0020] Determine the derived time series features corresponding to each original time series feature; the derived time series features include: hour, day of the week, month, weekend, season, week number, and time period;

[0021] The original accident safety features in the original traffic accident dataset are derived to obtain multiple derived accident safety features.

[0022] Multiple derived collinear features are obtained by deriving each original collinear feature from the original traffic accident dataset.

[0023] Optionally, the CART algorithm is used to perform feature filtering on the derived traffic accident dataset to obtain a filtered traffic accident dataset, specifically including:

[0024] Calculate the Gini coefficient of each feature in the derived traffic accident dataset;

[0025] Features with Gini coefficients less than a preset value are filtered out from the derived traffic accident dataset to obtain the filtered traffic accident dataset.

[0026] Optionally, the final traffic accident dataset is obtained by performing one-sided selection data augmentation on the filtered traffic accident dataset, specifically including:

[0027] For any current feature in the filtered traffic accident dataset:

[0028] Calculate the K nearest neighbors of the current feature using the Euclidean distance formula;

[0029] The features with the fewest number of features belonging to the same accident level in the filtered traffic accident dataset are identified as small samples, and the features in the filtered traffic accident dataset other than small samples are identified as large samples.

[0030] Calculate the proportion of small samples among the K nearest neighbors of the current feature;

[0031] When the ratio is greater than a preset value, the K nearest neighbors of the current feature are internal samples; otherwise, the K nearest neighbors of the current feature are boundary samples.

[0032] For any current boundary sample:

[0033] Calculate the K nearest neighbors of the current boundary sample using the Euclidean distance formula;

[0034] Determine whether there exists a nearest neighbor among the K nearest neighbors of the current boundary sample that belongs to a different traffic accident level than the current boundary sample, and obtain the first judgment result;

[0035] If the first judgment result is negative, then there is no Tomek links between the current boundary sample and the small sample;

[0036] If the first judgment result is yes, then determine whether the current boundary sample is included among the K nearest neighbors of any nearest neighbor that belongs to a different traffic accident level from the current boundary sample, and obtain the second judgment result;

[0037] If the second judgment result is yes, then there are Tomek links between the current boundary sample and the small sample;

[0038] Large samples in all boundary samples with Tomek links are eliminated to obtain the final traffic accident dataset.

[0039] Optionally, a two-layer stacked model architecture is constructed based on logistic regression, random forest, K-nearest neighbors, and gradient boosting trees, specifically including:

[0040] A two-layer stacked model architecture is constructed using logistic regression, random forest, and K-nearest neighbors as the first-layer basic classifiers and gradient boosting tree as the second-layer meta-learner.

[0041] A traffic accident prediction system, comprising:

[0042] The feature acquisition module is used to acquire the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted.

[0043] The traffic accident prediction module is used to predict traffic events based on the features to be predicted and the traffic accident prediction model. The traffic accident prediction model is obtained by training a two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing a derived traffic accident dataset obtained by using the CART algorithm and one-sided selection to derive features from the original traffic accident dataset. The two-layer stacked model architecture is constructed based on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm, and gradient boosting tree.

[0044] An electronic device, comprising:

[0045] One or more processors;

[0046] A storage device on which one or more programs are stored;

[0047] When the one or more programs are executed by the one or more processors, the one or more processors implement the traffic accident prediction method as described above.

[0048] A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the traffic accident prediction method as described above.

[0049] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0050] This invention discloses a traffic accident prediction method, system, electronic device, and storage medium. Based on data augmentation technology, it addresses the problems of insufficient semantic information, inherent imbalance, and poor model learning ability for nonlinear data in traffic accidents by proposing a data-augmented traffic accident prediction model. This model can significantly improve the accuracy of traffic accident risk prediction, effectively reduce the probability of traffic accidents, and ensure the safety of urban road environment, thus improving the accuracy of traffic accident prediction. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is a schematic diagram of the traffic accident prediction method provided in Embodiment 1 of the present invention;

[0053] Figure 2 A schematic diagram illustrating the process of determining a traffic accident prediction model;

[0054] Figure 3 This is a schematic diagram of the structure of a traffic accident dataset;

[0055] Figure 4 Derived from time-series features;

[0056] Figure 5 For correlation analysis heatmap;

[0057] Figure 6 A ranking chart of feature contribution;

[0058] Figure 7 For OSS-based data augmentation graphs;

[0059] Figure 8 Image showing the OSS processing results;

[0060] Figure 9 This is a schematic diagram of the traffic accident prediction model. Detailed Implementation

[0061] 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 embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0062] The purpose of this invention is to provide a traffic accident prediction method, system, electronic device, and storage medium, aiming to improve the accuracy of traffic accident prediction.

[0063] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0064] Example 1

[0065] Figure 1 This is a schematic diagram of the traffic accident prediction method provided in Embodiment 1 of the present invention. Figure 1 As shown, the traffic accident prediction method in this embodiment includes:

[0066] Step 101: Obtain the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted.

[0067] Step 102: Based on the features to be predicted and the traffic accident prediction model, perform accident prediction on the traffic events to be predicted.

[0068] The traffic accident prediction model is trained on the two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing the derived traffic accident dataset obtained by using the CART algorithm and one-sided selection to derive features from the original traffic accident dataset. The two-layer stacked model architecture is built on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm and gradient boosting tree.

[0069] The traffic accident prediction model is obtained by training a two-layer stacked model architecture using the original time-series features, original accident safety features, and original collinearity features of multiple traffic accidents. The two-layer stacked model architecture is built based on the Logistic Regression (LR) algorithm, Random Forest (RF) algorithm, K-Nearest Neighbor (KNN) algorithm, and gradient boosting tree.

[0070] As an optional implementation method, such as Figure 2 As shown, the training process of the traffic accident prediction model includes:

[0071] S1: Obtain the original traffic accident dataset; the original accident dataset includes: original time-series features, original accident safety features, and original collinearity features of multiple traffic accidents. The traffic accident dataset is as follows: Figure 3 As shown.

[0072] S2: The original time series features, original accident safety features, and original collinearity features are derived to obtain the derived time series features, derived accident safety features, and derived collinearity features.

[0073] As an optional implementation, S2 specifically includes:

[0074] Determine the derived time series features corresponding to each original time series feature; the derived time series features include: hour, day of the week, month, weekend, season, week number, and time period.

[0075] Specifically, such as Figure 4 As shown, the original time series features Date and Time are used to derive the hour, week, month, weekend, season, week number, and time period to which the accident occurred through a "deep and shallow combination" strategy.

[0076] Multiple derived accident safety features are obtained by deriving each original accident safety feature from the original traffic accident dataset.

[0077] Specifically, different methods are used to derive the original accident safety characteristics that have a relationship, as shown in the following formula:

[0078] feas_add[i,j]=feas[i]+feas[j].

[0079] feas_mult[i,j]=feas[i]×feas[j].

[0080] Where, features_add[i,j] are derived accident safety features obtained using additive polynomials based on the i-th and j-th original accident safety features; features[i] are the i-th original accident safety features; features[j] are the j-th original accident safety features; and features_mult[i,j] are derived accident safety features obtained using multiplicative polynomials based on the i-th and j-th original accident safety features.

[0081] Multiple derived collinear features are obtained by deriving each original collinear feature from the original traffic accident dataset.

[0082] like Figure 5 As shown ( Figure 5 (Both the horizontal and vertical axes represent features). A heatmap correlation analysis was performed on the features of the original data. Collinear features with high correlation between different value levels were selected for derivation. A cross-derivation method was used to process the original collinear features, as shown in the following formula:

[0083] fea[get_max(i,j)]=max{feas_c[i],feas_c[j]}.

[0084] fea[get_min(i,j)]=min{feas_c[i],feas_c[j]}.

[0085]

[0086] Where fea[get_max(i,j)] is the larger of the i-th and j-th original collinear features; feas_c[i] is the i-th original collinear feature; feas_c[j] is the j-th original collinear feature; fea[get_min(i,j)] is the smaller of the i-th and j-th original collinear features; and fea[get_avg(i,j)] is the average of the i-th and j-th original collinear features.

[0087] S3: Based on the original traffic accident dataset, all derived time-series features, all derived accident safety features, and all derived collinearity features, construct the derived traffic accident dataset.

[0088] S4: Using the CART algorithm, feature filtering is performed on the derived traffic accident dataset to obtain the filtered traffic accident dataset.

[0089] As an optional implementation, S4 specifically includes:

[0090] Calculate the Gini coefficient for each feature in the derived traffic accident dataset.

[0091] Specifically, assume that the proportion of traffic accidents of the kth level in the derived traffic accident dataset D is p. k (k=1,2,…,y), then the Gini coefficient Gini(D) of the derived traffic accident dataset D is:

[0092]

[0093] Where y represents the total number of traffic accident levels; p k' Assume that discrete data a has V possible values ​​{a} 1 ,a 2 ,...,a V If we use 'a' to partition the derived traffic accident dataset D, we will generate V branch nodes, where the v-th branch node contains all nodes in D that have the value 'a' on attribute 'a'. v The sample is denoted as The Gini index (D, a) of attribute a (which can be considered as feature a) is defined as:

[0094]

[0095] Let v be the v-th possible value of feature a in D. for The modulus of D is |D|.

[0096] The Gini index measures the contribution of a feature; the smaller the Gini index, the greater the feature's contribution. For example... Figure 6 As shown ( Figure 6 The horizontal axis represents features, and the vertical axis represents contribution. The feature contributions are sorted, and features with a contribution greater than 0.02 are selected as high information gain features to obtain the filtered traffic accident dataset.

[0097] Features with a Gini coefficient less than a preset value are filtered out from the derived traffic accident dataset, resulting in a filtered traffic accident dataset.

[0098] S5: Perform one-sided selection data augmentation on the filtered traffic accident dataset to obtain the final traffic accident dataset. For example... Figure 7 As shown, the overall sample size of the dataset is reduced after One-Sided Selection (OSS) processing, and some easily misclassified majority class samples are removed, thereby reducing the influence of large sample classes on small sample classes. Figure 8 As shown, the overall data size was reduced by 7% after OSS processing. Specifically, the number of collision samples for Level 3 accidents decreased by 4.3%, the number of collision samples for Level 2 accidents decreased by 17%, while the number of samples in the fractional class, i.e., Level 1 samples, remained unchanged.

[0099] As an optional implementation, S5 specifically includes:

[0100] For any current feature in the filtered traffic accident dataset:

[0101] Calculate the K nearest neighbors of the current feature using the Euclidean distance formula.

[0102] The features with the fewest features belonging to the same accident level in the filtered traffic accident dataset are identified as small samples, and the features in the filtered traffic accident dataset other than small samples are identified as large samples.

[0103] Calculate the proportion of small samples among the K nearest neighbors of the current feature.

[0104] When the proportion is greater than a preset value, the K nearest neighbors of the current feature are internal samples. Otherwise, the K nearest neighbors of the current feature are boundary samples.

[0105] For any current boundary sample:

[0106] Calculate the K nearest neighbors of the current boundary sample using the Euclidean distance formula.

[0107] Determine whether there exists a nearest neighbor among the K nearest neighbors of the current boundary sample that belongs to a different traffic accident level than the current boundary sample, and obtain the first determination result.

[0108] If the first judgment result is negative, then there is no Tomek links between the current boundary sample and the small sample.

[0109] If the first judgment result is yes, then determine whether the current boundary sample is included among the K nearest neighbors of any nearest neighbor that belongs to a different traffic accident level from the current boundary sample, and obtain the second judgment result.

[0110] If the second judgment result is yes, then there are Tomek links between the current boundary sample and the small sample.

[0111] Large samples in all boundary samples with Tomek links are eliminated to obtain the final traffic accident dataset.

[0112] S6: A two-layer stacked model architecture is constructed based on logistic regression, random forest, K-nearest neighbor, and gradient boosting tree algorithms.

[0113] As an optional implementation, S6 specifically includes:

[0114] A two-layer stacked model architecture is constructed using logistic regression, random forest, and K-nearest neighbors as the first-layer basic classifiers and gradient boosting decision tree (GBDT) as the second-layer meta-learner.

[0115] S7: Train the two-layer stacked model architecture using the final traffic accident dataset to obtain the traffic accident prediction model. The trained traffic accident prediction model is as follows: Figure 9 As shown.

[0116] Example 2

[0117] The traffic accident prediction system in this embodiment includes:

[0118] The module for obtaining the features to be predicted is used to obtain the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted.

[0119] The traffic accident prediction module is used to predict traffic events based on the features to be predicted and the traffic accident prediction model. The traffic accident prediction model is trained on a two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing the derived traffic accident dataset obtained by derivation of features from the original traffic accident dataset using the CART algorithm and one-sided selection. The two-layer stacked model architecture is built based on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm, and gradient boosting tree.

[0120] Example 3

[0121] An electronic device, comprising:

[0122] One or more processors.

[0123] A storage device on which one or more programs are stored.

[0124] When one or more programs are executed by one or more processors, the one or more processors implement the traffic accident prediction method as in Example 1.

[0125] Example 4

[0126] A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the traffic accident prediction method as in Example 1.

[0127] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0128] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for predicting traffic accidents, characterized in that, The method includes: Obtain the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted; Based on the features to be predicted and the traffic accident prediction model, accident prediction is performed on the traffic event to be predicted. The traffic accident prediction model is obtained by training a two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing the derived traffic accident dataset obtained after feature derivation from the original traffic accident dataset using the CART algorithm and one-sided selection sequentially. The two-layer stacked model architecture is constructed based on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm, and gradient boosting tree. The training process of the traffic accident prediction model includes: Obtain the original traffic accident dataset; the original accident dataset includes: original time-series features, original accident safety features, and original collinearity features of multiple traffic accidents; The original time-series features, original accident safety features, and original collinearity features are derived to obtain derived time-series features, derived accident safety features, and derived collinearity features, respectively. Based on the original traffic accident dataset, all the derived time-series features, all the derived accident safety features, and all the derived collinearity features, a derived traffic accident dataset is constructed. The CART algorithm was used to filter features in the derived traffic accident dataset, resulting in a filtered traffic accident dataset. One-sided selection data augmentation was performed on the filtered traffic accident dataset to obtain the final traffic accident dataset. A two-layer stacked model architecture is constructed based on logistic regression, random forest, K-nearest neighbor, and gradient boosting tree algorithms. The traffic accident prediction model is obtained by training the two-layer stacked model architecture using the final traffic accident dataset. The CART algorithm is used to perform feature filtering on the derived traffic accident dataset, resulting in a filtered traffic accident dataset, which specifically includes: Calculate the Gini coefficient of each feature in the derived traffic accident dataset; Features with Gini coefficients less than a preset value are filtered out from the derived traffic accident dataset to obtain the filtered traffic accident dataset. Based on one-sided selection data augmentation of the filtered traffic accident dataset, the final traffic accident dataset is obtained, which specifically includes: For any current feature in the filtered traffic accident dataset: Calculate the K nearest neighbors of the current feature using the Euclidean distance formula; The features with the fewest number of features belonging to the same accident level in the filtered traffic accident dataset are identified as small samples, and the features in the filtered traffic accident dataset other than small samples are identified as large samples. Calculate the proportion of small samples among the K nearest neighbors of the current feature; When the ratio is greater than a preset value, the K nearest neighbors of the current feature are internal samples; otherwise, the K nearest neighbors of the current feature are boundary samples. For any current boundary sample: Calculate the K nearest neighbors of the current boundary sample using the Euclidean distance formula; Determine whether there exists a nearest neighbor among the K nearest neighbors of the current boundary sample that belongs to a different traffic accident level than the current boundary sample, and obtain the first judgment result; If the first judgment result is negative, then there is no Tomek links between the current boundary sample and the small sample; If the first judgment result is yes, then determine whether the current boundary sample is included among the K nearest neighbors of any nearest neighbor that belongs to a different traffic accident level from the current boundary sample, and obtain the second judgment result; If the second judgment result is yes, then there are Tomek links between the current boundary sample and the small sample; Large samples in all boundary samples with Tomek links are eliminated to obtain the final traffic accident dataset.

2. The traffic accident prediction method according to claim 1, characterized in that, The original time-series features, original accident safety features, and original collinearity features are derived to obtain derived time-series features, derived accident safety features, and derived collinearity features, specifically including: Determine the derived time series features corresponding to each original time series feature; the derived time series features include: hour, day of the week, month, weekend, season, week number, and time period; The original accident safety features in the original traffic accident dataset are derived to obtain multiple derived accident safety features. Multiple derived collinear features are obtained by deriving each original collinear feature from the original traffic accident dataset.

3. The traffic accident prediction method according to claim 1, characterized in that, A two-layer stacked model architecture is constructed based on logistic regression, random forest, K-nearest neighbors, and gradient boosting trees, specifically including: A two-layer stacked model architecture is constructed using logistic regression, random forest, and K-nearest neighbors as the first-layer basic classifiers and gradient boosting tree as the second-layer meta-learner.

4. A traffic accident prediction system, used to implement the traffic accident prediction method as described in any one of claims 1 to 3, characterized in that, The system includes: The feature acquisition module is used to acquire the features to be predicted; the features to be predicted include the temporal features, accident safety features, and collinearity features of the traffic event to be predicted. The traffic accident prediction module is used to predict traffic events based on the features to be predicted and the traffic accident prediction model. The traffic accident prediction model is obtained by training a two-layer stacked model architecture using the final traffic accident dataset. The final traffic accident dataset is obtained by processing a derived traffic accident dataset obtained by using the CART algorithm and one-sided selection to derive features from the original traffic accident dataset. The two-layer stacked model architecture is constructed based on the logistic regression algorithm, random forest algorithm, K-nearest neighbor algorithm, and gradient boosting tree.

5. An electronic device, characterized in that, include: One or more processors; A storage device on which one or more programs are stored; When the one or more programs are executed by the one or more processors, the one or more processors implement the traffic accident prediction method as described in any one of claims 1 to 3.

6. A storage medium, characterized in that, It stores a computer program, wherein the computer program, when executed by a processor, implements the traffic accident prediction method as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Malicious traffic identification method and system based on data enhancement and feature fusion

    CN116318928A