A two-stage generative adversarial network model for road traffic accident considering imbalanced data

CN118428419BActive Publication Date: 2026-10-20INNER MONGOLIA UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410488498.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-23
Publication Date
2026-10-20
Estimated Expiration
2044-04-23

AI Technical Summary

Technical Problem

但由于它们被设计为仅对单个标签数据进行训练,无法生成合成输入序列和相应的标签,因此GAN在不平衡问题上的应用面尚窄

Benefits of technology

[0055]本发明结合SA-SMOTE和AE-GAN的双阶段生成增强网络模型(AGSMF),每个阶段以及每个模型组件都旨在最大限度地发挥其优势。且本发明应用AGSMF模型的整体性能表现优于SYMPROD、SMOTEWB、ANS、AMSCO等目前流行的数据增强方法,即所提模型能够有效解决碰撞严重程度数据不平衡的问题,进一步证明了该模型在提升道路碰撞事故预测性能方面的卓越潜力。本发明通过SHAP方法对模型结果进行解释,不仅揭示了交通事故严重程度预测中关键因素的重要性,还为制定有效的交通事故预防策略提供了深入洞察和科学依据。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118428419B_ABST
    Figure CN118428419B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of network model, and particularly relates to a two-stage generation enhanced network model for road traffic accidents considering unbalanced data, comprising the following steps: collecting data and preprocessing the data; solving the problems of parameter fixation and noise influence in the process of near neighbor interpolation based on simulated annealing improved SMOTE; generative adversarial network embedded with self-encoder component; using artificial neural network for classification prediction; using SHAP for model explanation. The two-stage generation enhanced network model (AGSMF) combining SA-SMOTE and AE-GAN, each stage and each model component aims to maximize its advantages. The model results are explained by the SHAP method, which not only reveals the importance of key factors in traffic accident severity prediction, but also provides in-depth insight and scientific basis for formulating effective traffic accident prevention strategies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network model technology, specifically relating to a two-stage generative augmentation network model for road traffic accidents that considers imbalanced data. Background Technology

[0002] In traffic accident research, the relative scarcity of fatal injuries and the resulting imbalance in collision data across different categories pose a significant challenge to supervised learning. Commonly used statistical models in traffic safety research also fail to address the sample imbalance problem. Therefore, efficiently achieving inter-class balance has become a hot topic in traffic safety research.

[0003] Specifically, regarding collision data, the accuracy of predicting injury severity for the majority class (non-fatal collisions) is significantly higher than that for the minority class (fatal collisions). Fatal collisions are rare, therefore addressing the extreme imbalance in injury data is essential for model prediction. To address the data imbalance problem, various data rebalancing methods have been proposed to improve the performance of prediction models. Among them, Synthetic Minority Oversampling (SMOTE) is a widely used oversampling method. In road safety research, existing technologies use SMOTE as a countermeasure for imbalanced data. Existing technologies employ improved algorithms of SMOTE, such as Weighted Majority Minority Oversampling (MWMOTE), Borderline-SMOTE (BL-SMOTE), Adaptive Synthetic Oversampling (ADASYN), and other variants. However, the SMOTE sample generation process has a certain degree of randomness, which may lead to problems such as uneven distribution, noise, and lack of information. Improved methods of SMOTE have made some improvements to address these problems, but they still suffer from weak parameter sensitivity and insufficient diversity of generated samples. In addition, its application in deep learning is also limited, especially as it cannot be directly applied to high-dimensional, complex deep learning data. Generative Adversarial Networks (GANs) and their variants are emerging deep learning data augmentation techniques. They generate "fake" samples with realistic data attributes through the synergistic effect of two deep learning algorithms, helping to balance class distributions and avoid overfitting. In the transportation field, existing techniques use GANs to fill in data gaps in rear-end collision accidents. Deep learning strategies such as Deep Convolutional Generative Adversarial Networks (DCGANs), Graph Autoencoder-Generative Adversarial Networks (DVGAE-GANs), and Wasserstein Gradient Penalized Generative Adversarial Networks (WGAN-GPs) effectively address the data imbalance problem. However, because they are designed to be trained on only single-label data, they cannot generate synthetic input sequences and corresponding labels, thus limiting the application of GANs in addressing imbalance problems. Summary of the Invention

[0004] To address the limited application of GANs in imbalanced data problems, this invention provides a two-stage generative augmentation network model for road traffic accidents that considers imbalanced data. By drawing on the concept of transfer learning, a two-stage generative augmentation network framework is constructed. The invention combines the heuristic algorithm Simulated Annealing (SA) with an embedded autoencoder (AE) component to overcome their respective shortcomings.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:

[0006] A two-stage generative augmentation network model for road traffic accidents considering imbalanced data includes the following steps:

[0007] S1. Collect data and preprocess the data;

[0008] S2. Improved SMOTE based on simulated annealing to solve the problems of parameter fixation and noise influence in the nearest neighbor interpolation process;

[0009] S3, Generative Adversarial Network with Embedded Autoencoder Components;

[0010] S4. Use artificial neural networks for classification and prediction;

[0011] S5. Use SHAP to interpret the model.

[0012] The data collected in S1 comes from the FLHSMV database and uses non-motorized vehicle traffic accident reports and statistics on public roads in Florida from 2011 to 2019.

[0013] The method for preprocessing data in S1 is as follows: by sorting out the report content and non-motorized vehicle accident dataset, basic information is summarized using code, and accident records with serious missing variable information are removed during the sorting process.

[0014] The method in S2 for solving the problems of parameter fixation and noise influence in the nearest neighbor interpolation process based on simulated annealing-based improved SMOTE is as follows:

[0015] The optimal sampling rate is found using SA (Susceptibility Analysis), and the k-nearest neighbor-based suspected noise is considered as part of the states or solutions in SA. These states are represented by a state vector, where each state is encoded as a set of parameters, each representing the processing decision for the corresponding suspected noise. Each state is considered a solution to SA. Assuming there are r suspected noises among the k nearest neighbors of the minority class, the state vector in SA-SMOTE is represented as follows:

[0016] S = (S1, S2, ..., S...) r )

[0017] Where S i This represents the processing decision for the corresponding suspicious noise. This decision vector is a binary vector, where 1 indicates that the suspicious noise should be retained and 0 indicates that it should be eliminated.

[0018] The F-λ value is used as a fitness function to measure each state in SA-SMOTE and reflects the reasonableness of denoising the original dataset. Real noise samples are removed from each state according to each noise processing scheme. Then, after noise removal, the SMOTE method is applied to obtain a balanced sample set. The F-λ value is calculated as follows:

[0019]

[0020] Where Recall is the recall rate and Precision is the precision rate;

[0021] Guided by the fitness function F-λ, the state with the optimal fitness value is obtained. This state represents the optimal noise processing scheme. By adopting this optimal scheme, noise can be effectively removed. During the iteration of SA, the state is gradually optimized through the adjustment of temperature parameters and random search to find the best strategy to retain false noise in the dataset.

[0022] The method of the generative adversarial network with an embedded autoencoder component in S3 is as follows:

[0023] Autoencoders compute nonlinear mappings by learning a latent feature space between the input and output. They project latent information into this latent space while learning it, ensuring the generator retains its ability to reconstruct the original data during generation. The objective function of the autoencoder is L. rec Represented as:

[0024]

[0025] GANs guide the generator to learn highly discriminative features through adversarial training between their internal generative and discriminative models, prompting the generator and discriminator to repeatedly compete and learn, thus optimizing the performance of both networks. The objective function of the GAN network is L. GAN for:

[0026]

[0027] Among them, E x~Pdata E x~Pz(x) Not a variable, E x~Pdata This indicates that for data from the true data distribution P data(x) The expectation of a random variable x sampled from the middle; E x~Pz(x) This indicates that for data generated from distribution P z(x) The expected value of a random variable x sampled from the middle;

[0028] By minimizing the combination of autoencoders and generative adversarial networks, AE-GAN is improved to generate more realistic data that is closer to the real world. The hierarchical representation of the generated data is also enhanced. The overall objective function of AE-GAN, L... AE-GAN Represented as:

[0029] L AE-GAN =λL rec +βL GAN

[0030] Z n =f n (X n ), X n Denotes the sample, f n Indicates encoder, g n Let G(z) represent the decoder, G(z) be the generator output, N represent the number of training samples, D(·) be the discriminator, z be a random vector sampled from the latent space, and P be the output of the generator. data P represents the true data distribution. z This represents the distribution of generated data, and the hyperparameters λ and β are used to balance various losses.

[0031] The method for classification and prediction using artificial neural networks in S4 is as follows:

[0032] During training, backpropagation is used to update the weights in the network to capture the nonlinearity of the data and minimize the energy function representing the instantaneous error; if it represents the target output of the k-th neuron in the ANN output layer, then the prediction error of the k-th neuron in a specific training scenario is calculated; if there is a set of neurons in the output layer, the prediction error is calculated; the total error considering all training scenarios is calculated.

[0033] Backpropagation (BP) is accomplished by minimizing the mean squared error in the predictions. It updates the weights of the branches in the network, and the ANN weights are adjusted iteratively until the number of iterations reaches the defined maximum value or the error is less than the defined tolerance level.

[0034] The prediction error E of the k-th neuron in the specific training scenario k The calculation formula is:

[0035]

[0036] If there is a set of neurons in the output layer, the method for calculating the prediction error is as follows:

[0037]

[0038] Calculate the total error E considering all training scenarios. tol The method is as follows:

[0039]

[0040] Among them, T ok It is the target output of the k-th neuron, O ok It is the actual output s of the k-th neuron, T okl For the target output of the k-th neuron in the l-th training sample, O okl This is the actual output of the k-th neuron in the l-th training sample.

[0041] The method for performing backpropagation by minimizing the mean square error in the prediction is as follows:

[0042]

[0043] The method for updating the weights of branches in the network is as follows:

[0044]

[0045] Where η is a proportionality constant, w jk This represents the weights connecting neurons j and k.

[0046] The method for model interpretation using SHAP in S5 is as follows:

[0047] S5.1 For the feature space of the input sample, all possible subsets are created by sampling different combinations of features;

[0048] S5.2 For each feature subset, calculate the model's predicted output for samples containing that subset;

[0049] S5.3 Calculate the marginal contribution of each feature subset to the model output, i.e. the difference in the model output, and perform the calculation for all possible subsets;

[0050] S5.4 Determine the contribution of each feature.

[0051] The method for determining the contribution of each feature in S5.4 is as follows:

[0052]

[0053] Where, Φ i is the SHAP value of feature i; N is the feature set; v(S) is the model's prediction output for the feature subset S; S is the size of the feature subset S.

[0054] Compared with the prior art, the beneficial effects of this invention are:

[0055] This invention combines a two-stage generative augmentation network model (AGSMF) of SA-SMOTE and AE-GAN, with each stage and model component designed to maximize their advantages. Furthermore, the overall performance of the AGSMF model applied in this invention outperforms currently popular data augmentation methods such as SYMPROD, SMOTEWB, ANS, and AMSCO, demonstrating that the proposed model effectively addresses the problem of imbalanced collision severity data and further proving its outstanding potential in improving road collision accident prediction performance. This invention interprets the model results using the SHAP method, revealing not only the importance of key factors in traffic accident severity prediction but also providing in-depth insights and scientific basis for developing effective traffic accident prevention strategies. Attached Figure Description

[0056] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings in the following description are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.

[0057] The structures, proportions, sizes, etc. illustrated in this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed herein, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.

[0058] Figure 1 This is a block diagram of the overall structure of the present invention;

[0059] Figure 2 This is a structural block diagram of the self-generating adversarial network module of the present invention;

[0060] Figure 3 This is a structural block diagram of the interpretable model learning of SHAP in this invention;

[0061] Figure 4 The convergence curves of SA-SMOTE and GA-SMOTE of the present invention are shown.

[0062] Figure 5 This is a diagram illustrating the explanatory features of the SHAP of this invention. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. These descriptions are only for further illustrating the features and advantages of the present invention, and not for limiting the claims of the present invention. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0064] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0065] I. Two-stage generative reinforcement network model

[0066] This embodiment proposes a novel Generate the Sample Migration Framework (AGSMF), which combines an improved SMOTE with a Generative Adversarial Network (GAN). The specific research framework is as follows: Figure 1 As shown.

[0067] AGSMF draws inspiration from transfer learning to construct a two-stage generative augmentation network framework for research. First, it uses SMOTE combined with simulated annealing (SA-SMOTE) to denoise and perform a first-stage balancing of the original imbalanced data. Then, the generated samples after the first balancing are transferred to a generative adversarial network (AE-GAN) embedded with an autoencoder component for a second sampling. This two-stage iterative process ensures that the generated samples, after two iterations of sampling, more closely approximate the distribution of the real samples. Simultaneously, the autoencoder component in the second sampling ensures excellent performance when generating samples for multi-feature sequence datasets.

[0068] This embodiment demonstrates the effectiveness and superiority of AGSMF in improving imbalanced datasets within this research framework. This method not only effectively denoises and balances the original data, but also improves the quality of generated samples through transfer learning, thereby significantly enhancing the performance of the prediction model.

[0069] 1. Improved SMOTE based on simulated annealing (SA-SMOTE)

[0070] In the Phase 1 SMOTE sampling process, this embodiment correlates the sampling rate setting with the degree of imbalance, the overall sample distribution, and the intra-class sample situation, treating this correlation process as an optimization problem to be considered when oversampling occurs. This embodiment employs the heuristic simulated annealing (SA) algorithm to optimize this process, not only because SA performs well in global search and can accept inferior solutions during the search process, but also because SA parameter tuning is relatively easy, as it only optimizes based on a single solution. Overall, SA-SMOTE achieves certain success in addressing the problems of parameter fixation and noise influence in nearest neighbor interpolation.

[0071] This embodiment uses SA to find the optimal sampling rate and considers the suspected noise based on k nearest neighbors as part of the states or solutions in SA. These states can be represented by a state vector. Each state can be encoded as a set of parameters, where each parameter represents the processing decision for the corresponding suspected noise. Therefore, each state can be regarded as a solution of SA. Assuming that there are r suspected noises among the k nearest neighbors of the minority class, the state vector in SA-SMOTE can be expressed as Equation (1):

[0072] S = (S1, S2, ..., S...) r (1)

[0073] Where S i The decision vector represents the processing decision for the suspected noise. This decision vector can be a binary vector, where 1 indicates that the suspected noise is retained and 0 indicates that it is eliminated. The entire state space consists of all possible suspected noise processing schemes. In order to evaluate the decision for each state vector, the F-λ value is used as a fitness function to measure each state in SA-SMOTE and to reflect the reasonableness of the original dataset denoising. In this embodiment, real noise samples are removed according to each state of each noise processing scheme. Then, after the noise is removed, the SMOTE method is applied to obtain a balanced sample set. The calculation method of the F-λ value is as shown in equation (2):

[0074]

[0075] Through a series of operations and multiple iterations, guided by the fitness function F-λ, this embodiment obtains the state with the optimal fitness value. This state represents the optimal noise processing scheme in this embodiment. By adopting this optimal scheme, this embodiment can effectively remove noise. During the iteration of SA, the state is gradually optimized through the adjustment of temperature parameters and random search to find the best strategy for retaining spurious noise in the dataset. The pseudocode of the optimization denoising algorithm can be described as Algorithm 1, and the pseudocode of SA-SMOTE can be described as Algorithm 2.

[0076] Table 1 Algorithm 1 - Optimization and Noise Reduction

[0077]

[0078]

[0079] Table 2 Algorithm 2-SA-SMOTE

[0080]

[0081] 2. Generative Adversarial Network (AE-GAN)

[0082] Phase two applies an improved GAN model, namely an Autoencoder-Generative Adversarial Network (AE-GAN) with embedded autoencoder components, to regenerate samples. For example... Figure 2 As shown, the core of this stage is to embed the autoencoder into the generator as part of the generator to generate latent representations. The generator's output serves as the input to the decoder, forming a holistic generative model. Through the synergistic effect of feature learning provided by the autoencoder and adversarial training of the GAN, the quality of generation is co-optimized, enabling the GAN to learn the data distribution more effectively.

[0083] The autoencoder computes a nonlinear mapping by learning the latent feature space between the input and output, projecting the latent information onto the latent space while learning it, thus ensuring that the generator retains its ability to reconstruct the original data during the generation process. The objective function is shown in equation (3):

[0084]

[0085] GAN guides the generator to learn highly discriminative features through adversarial training of its two internal sub-network models (generator and discriminator), prompting the generator and discriminator to repeatedly compete and learn, thus optimizing the performance of both networks. The objective function of the GAN network is shown in equation (4):

[0086]

[0087] By minimizing the combination of autoencoders and generative adversarial networks, AE-GAN promotes the generation of more realistic data that is closer to the real world, and the hierarchical representation of the generated data is also improved. The overall objective function of AE-GAN is expressed as Equation (5):

[0088] L AE-GAN =λL rec +βL GAN (5)

[0089] Z n =f n (X n), X n Denotes the sample, f n Indicates encoder, g n Let G(z) represent the decoder, G(z) be the generator output, D(·) be the discriminator, z be a random vector sampled from the latent space, and P be the delimiter. data P represents the true data distribution. z This represents the distribution of generated data, and the hyperparameters λ and β are used to balance various losses.

[0090] 3. Collision Injury Severity Prediction Model

[0091] This paper utilizes Artificial Neural Networks (ANNs) for classification prediction. ANNs effectively solve various classification problems by learning the complex nonlinear relationship between input and output. When selecting the ANN network structure, this embodiment needs to consider the number of neurons in the input, hidden, and output layers, as well as the choice of activation functions. A reasonable network structure can better capture the features of the data and improve the model's generalization ability. This embodiment's classification architecture... Figure 1 It is already included.

[0092] During training, back propagation (BP) is used to update the weights in the network to capture the nonlinearity of the data, in order to minimize the energy function representing the instantaneous error. If the target output of the k-th neuron in the ANN output layer is represented, the prediction error of the k-th neuron in a specific training scenario can be calculated by Equation (6); if there is a set of neurons in the output layer, the prediction error can be calculated by Equation (7); the total error considering all training scenarios is calculated by Equation (8).

[0093]

[0094]

[0095]

[0096] In this embodiment, BP is achieved by minimizing the mean square error in the prediction, as shown in equation (9). The weights of the branches in the network are updated according to the rules in equation (10).

[0097]

[0098]

[0099] Where η is a proportionality constant, w jk This represents the weights connecting neurons j and k. The ANN weights are adjusted iteratively until the number of iterations reaches a defined maximum or the error is less than a defined tolerance level.

[0100] Overall, the adversarial training process combined with AE (Autoencoder) causes the generator to tend to optimize the minimum generation distribution of the generated data. This helps avoid mode collapse, where GANs tend to generate identical or similar samples. The autoencoder, through feature mapping, can learn different data representations, providing greater diversity and mitigating this problem. Simultaneously, AE-GAN helps suppress the influence of noise generated in stage one, enabling better feature learning in the generated samples and resulting in more discriminative data.

[0101] 4. SHAP Model Interpretation Techniques

[0102] SHAP (Shapley Additive exPlanations) is a framework for model interpretation based on cooperative game theory. Within this framework, all features are considered "contributors." For each predicted sample, the model produces a prediction value, and the SHAP value is used to fairly allocate the contribution of each feature to the prediction across all possible feature combinations, reflecting the influence of each feature in each sample. Specifically... Figure 3 As shown.

[0103] The SHAP value is calculated as follows:

[0104] 1) For the feature space of the input sample, all possible subsets are created by sampling different combinations of features.

[0105] 2) For each feature subset, calculate the model's predicted output for samples containing that subset.

[0106] 3) Calculate the marginal contribution of each feature subset to the model output, i.e. the difference in the model output, and perform the calculation for all possible subsets.

[0107] 4) Determine the contribution of each feature according to equation (11).

[0108]

[0109] Where, Φ i is the SHAP value of feature i; N is the feature set; v(S) is the model's prediction output for the feature subset S; S is the size of the feature subset S.

[0110] II. Data Description

[0111] 1. Data Sources and Preprocessing

[0112] The data in this embodiment comes from the FLHSMV database, using reports and statistics on non-motorized vehicle traffic accidents on public roads in Florida from 2011 to 2019. The reports mainly include the time, location, and injuries / fatalities of the accidents, basic information about the vehicles involved, road conditions, and relevant information about the individuals involved.

[0113] The preprocessing stage involved analyzing the report content and the non-motorized vehicle accident dataset, summarizing basic information using codes (e.g., 1 and 2 represent weekdays and weekends respectively), and other information was also represented by codes. Simultaneously, accident records with severely missing variable information were removed during the processing. A total of 23,041 collision accidents were ultimately collected.

[0114] 2. Variable selection and description

[0115] The analysis of road traffic accidents involves a wide range of potential influencing factors. Therefore, in the process of integrating the report, factors that may affect the severity of accidents are categorized into two main types: event attributes and driving factors, which include multiple multi-category or continuous factors. The explanation and variable classification of each factor are shown in Table 3.

[0116] Table 3. Description of Key Variables

[0117]

[0118]

[0119] III. Experimental Results and Analysis

[0120] 1. Experimental setup

[0121] All experiments in this embodiment were conducted on a Windows 11 platform equipped with a 3060 GPU and 16GB of RAM. The model, method, and baseline in this embodiment were all built on the PyTorch 1.7.0 framework. Based on extensive validation studies, the Adam optimizer was used, with a batch size of 128, default parameters, and a learning rate of 0.0001. The autoencoder dimension was set to d = 1024 - 512 - 256, where d is the dimension of the input data. This embodiment simply employs a dense (i.e., fully connected) network, with each layer followed by a ReLU layer. The generator and discriminator structures have five and four linear layers, respectively, with each layer followed by a batch normalization layer and a ReLU layer. Furthermore, SMOTE oversampling was performed using the k=5 nearest neighbor after the denoising step. The overall training stopping criterion was based on the validation error to avoid overlearning. It was also ensured that the generator and discriminator losses remained significant but did not approach zero.

[0122] 2. Evaluation Criteria

[0123] This embodiment uses accuracy, recall, F-score, AUC, and geometric mean (Gm) as evaluation metrics for collision prediction. The ROC curve is considered a reliable performance evaluation technique in imbalanced learning. It plots the relationship between the true positive rate (TPR) and the false positive rate (FPR), while the area under the curve (AUC) is a good evaluation metric for comprehensive assessment. Recall, also known as sensitivity, refers to the proportion of correctly identified fatal accidents; specificity refers to the proportion of correctly detected non-fatal accidents. In accident safety research, the goal is to identify as many fatal collisions as possible while achieving a low false alarm rate. Sensitivity and specificity can adequately meet these requirements, calculated as shown in equations (11) and (12).

[0124] Sensitivity=TP / (TP+FN)=TPR (11)

[0125] Specificity =TN / (TN+FP)=1-FPR (12)

[0126] Gm combines the two metrics of sensitivity and specificity and assigns them equal importance to detect overfitting of non-lethal samples and underfitting of lethal samples. The calculation is shown in Equation (13). The higher the Gm value, the better it is at identifying the minority class and can also better distinguish the majority class, reducing misclassification.

[0127]

[0128] The F-value is an indicator calculated based on sensitivity and precision, and is the harmonic mean of sensitivity and precision. As shown in equation (14), where is the trade-off parameter between precision and sensitivity, used to adjust the importance of sensitivity and precision.

[0129]

[0130] 3. Results Analysis

[0131] This embodiment designs 7 ablation experiments and 9 comparative experiments to verify the feasibility and superiority of the proposed two-stage generative enhancement network model.

[0132] 1) Ablation experiment

[0133] To verify the performance gains brought to the model by the SA-SMOTE and AE-GAN improvement strategies, this embodiment designed 7 ablation experiments and validated them on the Florida accident dataset. The results are shown in Table 4. From the first 5 sets of experimental results in Table 4, it can be seen that using the single-stage SMOTE and GAN methods did not achieve ideal results; some metrics even decreased. However, when using the improved SA-SMOTE method, each metric showed an improvement of 1%-5%. Furthermore, when using the SMOTE-GAN two-stage improvement method, the improvement effect on each metric was more significant, with an improvement of 1%-2% compared to the single-stage method, initially verifying the effectiveness of the SMOTE-GAN two-stage network. Through the last 3 sets of experiments, further replacing SA-SMOTE and AE-GAN with SMOTE and GAN respectively on the basis of the SMOTE-GAN two-stage network, the results showed a further improvement in model performance. Compared to SMOTE-GAN, SMOTE-AE-GAN improved Gm and F values ​​by 0.6% and 3.3%, respectively. Although the improvement was not significant, it was enough to prove that AE-GAN has a positive effect on improving model performance.

[0134] Overall, the two-stage network model based on SA-SMOTE and AE-GAN performed best, improving Gm by 8.6%, F-score by 8.1%, and AUC by 2.8% compared to the original unsampled case, while maintaining accuracy. Compared to single-stage methods, all metrics showed significant improvements, with the highest improvement in accuracy of 11.41%, Gm by 10.9%, and F-score and AUC by 12.77% and 4.21%, respectively. Compared to the two-stage SMOTE-GAN and SMOTE-AE-GAN, the improvements were not significant, but at least the accuracy improved by 2.85%, the Gm by 4.1%, and the F-score and AUC by 0.3% and 0.4%, respectively.

[0135] Table 4 Ablation Study Results of Each Component of AGSMF

[0136]

[0137] “√” indicates how to use it.

[0138] 2) Comparative Experiment

[0139] ① Overall performance comparison

[0140] This embodiment aims to compare the performance of different methods for handling imbalanced data on the Florida public road traffic accident dataset to verify the effectiveness of the proposed AGSMF method. The comparison methods include GASMOTE, Distance_SMOTE, SYMPROD, SMOTE_WB, ANS, AMSCO, NRAS, CCR, and the AGSMF method proposed in this embodiment. Table 5 details the comparison results of each method on the Florida traffic accident dataset. Bold text indicates the best metric among different algorithms. In terms of accuracy, the AGSMF method achieves 0.7575, significantly outperforming other methods and demonstrating its advantage in overall classification accuracy. The AGSMF method also performs well in terms of Gm and AUC, although not the highest, it remains at a high level compared to other methods. In terms of F-beta and Recall, the AGSMF method significantly outperforms other methods, demonstrating its advantage in identifying minority class samples.

[0141] Table 5. Comparison results with other methods

[0142]

[0143] Overall, the AGSMF method proposed in this embodiment performs excellently on the Florida traffic accident dataset, particularly in handling imbalanced data and improving the ability to identify minority class samples. Compared with other methods, the AGSMF method achieves the best performance on multiple metrics, validating its effectiveness and feasibility.

[0144] ② Convergence performance comparison

[0145] GA-SMOTE is the only classic example of an improved SMOTE based on heuristic optimization. This embodiment aims to compare its convergence curve with SA-SMOTE to observe the error changes and overall convergence speed of parameter optimization in each iteration of these two heuristically optimized SMOTE algorithms. By observing the curves, the effectiveness of using SA-SMOTE for optimization in the first stage is further verified. The maximum number of iterations is 50, and the loss (i.e., cross-entropy loss) for each iteration is recorded. The results are as follows. Figure 4 As shown.

[0146] from Figure 4It can be seen that both methods converge quickly before the 10th iteration, but the convergence speed gradually slows down after the 10th iteration. Furthermore, the loss values ​​of the two methods are relatively similar before the 10th iteration, but as the number of iterations increases, the loss value of GA-SMOTE still fluctuates significantly, showing a clear upward trend in some iteration cycles, indicating that its optimization process is not stable enough. Especially after the number of iterations exceeds 20, the loss value of SA-SMOTE is significantly lower than that of GA-SMOTE, and the trend is more stable. In addition, throughout the entire iteration process, the loss value of SA-SMOTE fluctuates less, and the convergence speed is faster. In comparison, it can be concluded that SA-SMOTE exhibits better stability and convergence speed during the optimization iteration process, and its optimization effect is significantly better than that of GA-SMOTE.

[0147] 3) Explanation of the SHAP model

[0148] Before further analysis, the preprocessing procedure can determine the correlation between severe collision injury and influencing factors, including but not limited to road conditions, collision event attributes, and personnel behavior. Despite this prior knowledge, the exact impact of these features on collision injury remains unclear. Therefore, the SHAP model interpretation technique was employed to explore the correlation between severe collision injury and influencing factors, providing strong support for the interpretation of the model results. The results are as follows: Figure 5 As shown.

[0149] Figure 5 A SHAP summary plot was created. The color gradients in the plot represent the range of eigenvalues. Based on the interpretations of different variables in Table 3, color gradients corresponding to specific values ​​were obtained. The visualization of the data distribution by color provides an indication of the impact of each variable. Notably, among these variables, the position of the blue dots to the left of the center line indicates that the corresponding eigenvalues ​​are beneficial for improving traffic safety and reducing the incidence of serious injuries. On the other hand, the distribution of red dots on the right side suggests that the corresponding eigenvalues ​​tend to increase the severity of collision injuries. SHAP results show that most of the red dots related to human-driven factors appear on the right side. Additionally, certain collision attribute factors, such as collision time, whether it occurred on a weekend, and collision location, are positively correlated with collision severity. Therefore, it can be inferred that weekends, nighttime, improper driving behavior, vehicle malfunction, alcohol or drug stimulation, and older drivers all lead to higher injury severity. However, the impact of teenage drivers remains uncertain, as age may have a complex influence on the severity of collision injuries.

[0150] The above description only illustrates the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention, and all such changes should be included within the protection scope of the present invention.

Claims

1. A method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data, characterized in that, Includes the following steps: S1. Collect data and preprocess the data; S2. Improved SMOTE based on simulated annealing to solve the problems of parameter fixation and noise influence in the nearest neighbor interpolation process; The optimal sampling rate is found using SA (Susceptibility Analysis), and the k-nearest neighbor-based suspected noise is considered as part of the states or solutions in SA. These states are represented by a state vector, where each state is encoded as a set of parameters, each representing the processing decision for the corresponding suspected noise. Each state is considered a solution to SA. Assuming there are r suspected noises among the k nearest neighbors of the minority class, the state vector in SA-SMOTE is represented as follows: in This represents the processing decision for the corresponding suspicious noise. This decision vector is a binary vector, where 1 indicates that the suspicious noise should be retained and 0 indicates that it should be eliminated. Will The value serves as a fitness function to measure each state in SA-SMOTE and reflects the reasonableness of denoising the original dataset. Real noise samples are removed from each state according to each noise processing scheme. Then, after noise removal, the SMOTE method is applied to obtain a balanced sample set. The value is calculated as follows: Where Recall is the recall rate and Precision is the precision rate; In fitness function Under the guidance of the algorithm, the state with the optimal fitness value was obtained. This state represents the optimal noise processing scheme. By adopting this optimal scheme, noise can be effectively removed. During the iteration of SA, the state is gradually optimized by adjusting the temperature parameter and random search to find the best strategy to retain false noise in the dataset. S3, Generative Adversarial Network with Embedded Autoencoder Components; Autoencoders compute nonlinear mappings by learning a latent feature space between the input and output. They project latent information into this latent space while learning it, ensuring the generator retains its ability to reconstruct the original data during generation. The objective function of the autoencoder is L. rec Represented as: GANs guide the generator to learn highly discriminative features through adversarial training between their internal generative and discriminative models, prompting the generator and discriminator to repeatedly compete and learn, thus optimizing the performance of both networks. The objective function of the GAN network is L. GAN for: Among them, E x~Pdata E x~Pz(x) Not a variable, E x~Pdata This indicates that for data from the true data distribution P data(x) The expectation of a random variable x sampled from the middle; E x~Pz(x) This indicates that for data generated from distribution P z(x) The expected value of a random variable x sampled from the middle; By minimizing the combination of autoencoders and generative adversarial networks, AE-GAN is improved to generate more realistic data that is closer to the real world. The hierarchical representation of the generated data is also enhanced. The overall objective function of AE-GAN, L... AE-GAN Represented as: in , Indicates a sample, Indicates encoder, Indicates decoder, This is the output of the generator, where N represents the number of training samples. It is a discriminator. Random vectors sampled in the latent space, Represents the true data distribution. Indicates the distribution of generated data, hyperparameters Used to balance various losses; S4. Use artificial neural networks for classification and prediction; S5. Use SHAP to interpret the model.

2. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 1, characterized in that: The data collected in S1 comes from the FLHSMV database and uses non-motorized vehicle traffic accident reports and statistics on public roads in Florida from 2011 to 2019.

3. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data as described in claim 1, characterized in that: The method for preprocessing data in S1 is as follows: by sorting out the report content and non-motorized vehicle accident dataset, basic information is summarized using code, and accident records with serious missing variable information are removed during the sorting process.

4. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 1, characterized in that: The method for classification and prediction using artificial neural networks in S4 is as follows: During training, backpropagation is used to update the weights in the network to capture the nonlinearity of the data and minimize the energy function representing the instantaneous error; if it represents the target output of the k-th neuron in the ANN output layer, the prediction error of the k-th neuron in a specific training scenario is calculated; if there is a set of neurons in the output layer, the prediction error is calculated; the total error considering all training scenarios is calculated. Backpropagation (BP) is accomplished by minimizing the mean squared error in the predictions. It updates the weights of the branches in the network, and the ANN weights are adjusted iteratively until the number of iterations reaches the defined maximum value or the error is less than the defined tolerance level.

5. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 4, characterized in that: The prediction error of the k-th neuron in the specific training scenario The calculation formula is: If there is a set of neurons in the output layer, the method for calculating the prediction error is as follows: Calculate the total error considering all training scenarios. The method is as follows: in, It is the target output of the k-th neuron. It is the actual output of the k-th neuron. The target output of the k-th neuron in the l-th training sample. This is the actual output of the k-th neuron in the l-th training sample.

6. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 4, characterized in that: The method for performing backpropagation (BP) by minimizing the mean square error in the prediction is as follows: The method for updating the weights of branches in the network is as follows: in, It is a proportionality constant. This represents the weights connecting neurons j and k.

7. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 1, characterized in that: The method for model interpretation using SHAP in S5 is as follows: S5.1 For the feature space of the input sample, all possible subsets are created by sampling different combinations of features; S5.2 For each feature subset, calculate the model's predicted output for samples containing that subset; S5.3 Calculate the marginal contribution of each feature subset to the model output, i.e. the difference in the model output, and perform the calculation for all possible subsets; S5.4 Determine the contribution of each feature.

8. The method for a two-stage generative augmentation network model of road traffic accidents considering imbalanced data according to claim 7, characterized in that: The method for determining the contribution of each feature in S5.4 is as follows: in, is the SHAP value of feature i; N is the feature set; v(S) is the model's prediction output for the feature subset S; It is the size of the feature subset S.