A method for intersection motorcycle accident severity prediction and causation analysis

By constructing a multi-source feature fusion FL-LightGBM model and using SHAP analysis, the problems of incomplete features, data imbalance, and model rigidity in the prediction and causal analysis of motorcycle accidents at intersections were solved, achieving accurate prediction and interpretable causal analysis, and supporting the formulation of dynamic prevention and control strategies.

CN122114633APending Publication Date: 2026-05-29NANJING FORESTRY UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING FORESTRY UNIV
Filing Date
2026-02-26
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies for predicting and analyzing the causes of motorcycle accidents at intersections suffer from incomplete feature dimensions, imbalanced data categories, uninterpretable models, and insufficient dynamic update capabilities, leading to limitations in prediction accuracy and the formulation of prevention and control strategies.

Method used

By constructing an enhanced feature set that fuses multi-source static and dynamic features, using the FL-LightGBM model and introducing the FocalLoss function, combined with the SHAP framework for causal analysis, and designing a dynamic iterative optimization mechanism for the model, we can achieve accurate prediction of intersection motorcycle accidents and explanation of key causes.

Benefits of technology

It enables accurate prediction of the severity of motorcycle accidents at intersections, improves the model's ability to identify a minority of accidents, provides intuitive causal analysis tools, and ensures the model's adaptability to changes in the traffic environment and the accuracy of prevention and control strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122114633A_ABST
    Figure CN122114633A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of traffic safety analysis, in particular to a kind of intersection motorcycle accident severity prediction and cause analysis method, step S1. Multi-source data acquisition and fusion;Step S2. Data preprocessing and division;Step S3. FL-LightGBM model construction;Step S4. Model training and verification;Step S5. Accident severity prediction;Step S6. Cause analysis based on SHAP;Step S7. Model dynamic iteration optimization;The application constructs the enhanced feature set by fusing multi-source static and dynamic characteristics, and combines the LightGBM model (FL-LightGBM) by introducing FocalLoss function, which effectively solves the limitations of traditional methods. On the one hand, the dynamic characteristics extracted by real-time monitoring are fused, so that the model can more comprehensively depict the real-time risk scenario of the accident. On the other hand, the FocalLoss function dynamically adjusts the loss weight, significantly enhances the model's recognition ability for a small number of key categories such as "serious injury accidents", and alleviates the prediction bias caused by data class imbalance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic safety analysis technology, specifically to a method for predicting the severity and analyzing the causes of motorcycle accidents at intersections. Background Technology

[0002] Road traffic safety, especially the prevention of motorcycle accidents at intersections, is a core issue in urban management and public safety. Motorcycles, due to their high mobility and relatively low stability, face a high risk of accidents in complex traffic conflict zones such as intersections, and these accidents often result in serious personal injury. Therefore, accurately predicting the severity of motorcycle accidents at intersections and deeply analyzing their key causes is of great significance for implementing precise and proactive traffic safety intervention measures. Currently, academia and industry have conducted extensive research in this field, aiming to assess accident risks or predict accident consequences through data analysis and machine learning techniques. Existing methods can be mainly categorized into two types: one is statistical and machine learning modeling based on historical accident data, and the other is risk extrapolation based on vehicle trajectory or behavioral data.

[0003] A method for quantitatively assessing the risk of motor vehicle accidents at intersections, as described in application number CN202211191193.4 and authorized announcement date 20250103, includes: acquiring historical vehicle trajectory data within the intersection's influence area and preprocessing it to obtain preprocessed data; extracting dangerous driving behavior characteristic data, including rapid acceleration and deceleration, from the preprocessed data; calculating the daily average frequency of dangerous vehicle behaviors under different turning labels; statistically analyzing the daily average motor vehicle trajectory flow under different turning labels based on the historical vehicle trajectory data; calculating the spatiotemporal distribution of motor vehicle accident risk probabilities under different turning labels and generating a spatiotemporal map; and weighted calculation of the overall motor vehicle accident risk level index of the intersection. This invention utilizes the frequency characteristics of dangerous driving behaviors of connected vehicles to correlate with the probability characteristics of intersection accidents, effectively compensating for the difficulty in collecting traffic accident data and effectively supporting safety early warning services for vehicles passing through intersections.

[0004] While the methods described above and those in the prior art have made some progress, they still have several limitations: First, most studies rely on historical accident data or trajectory data from a single source, lacking multi-source fusion with real-time dynamic traffic behavior characteristics (such as traffic flow, helmet wearing rate, and frequency of high-risk behaviors), resulting in incomplete feature dimensions and difficulty in accurately depicting the immediate scene of the accident. Secondly, when dealing with the inherent class imbalance in accident data (such as the number of serious injury accidents being far less than the number of property damage accidents), conventional machine learning models are prone to overfitting to the majority class samples and have insufficient predictive performance for the few but crucial serious accident samples. Furthermore, existing models are mostly "black boxes." Even if they can make predictions, they lack intuitive and interpretable causal analysis tools to reveal key risk factors and their nonlinear impact mechanisms, making it difficult to effectively support the formulation of targeted prevention and control strategies. Finally, most models lack an effective dynamic update mechanism and cannot self-optimize over time and with the accumulation of new data, which may cause their predictive and analytical capabilities to decline as the traffic environment changes.

[0005] In view of this, there is an urgent need to design a method for predicting the severity of motorcycle accidents at intersections and analyzing their causes to solve the above problems. Summary of the Invention

[0006] The purpose of this invention is to provide a method for predicting the severity and analyzing the causes of motorcycle accidents at intersections, in order to overcome the aforementioned shortcomings in the prior art.

[0007] To achieve the above objectives, the present invention provides the following technical solution: A method for predicting the severity and analyzing the causes of motorcycle accidents at intersections includes the following steps: Step S1. Multi-source data acquisition and fusion: Collect historical accident data and real-time monitoring video data of the target intersection, apply computer vision technology to the monitoring video data to extract dynamic features of motorcycle traffic flow, helmet wearing status and frequency of high-risk behaviors, and exclude personal identification information. Then, fuse the static features and the dynamic features to construct an enhanced feature set and perform data cleaning. It should be noted that: In step S1: The historical accident data refers to motorcycle traffic accident records collected at the target intersection over a period of 3 to 5 years, with a valid sample size of no less than 7,234 records. The static features in the historical accident data cover four dimensions: driver, vehicle, road, and environment. Static characteristics of a driver include: driver's age, gender, whether the driver fled the scene, and state of distraction. Vehicle static characteristics include: number of vehicles in collision, estimated speed, motion state, and collision type; Static characteristics of a road include: road alignment, control method, speed limit, and shoulder type; Static environmental characteristics include: ambient lighting conditions, weather conditions, and road surface conditions; The severity of the accidents is classified into three levels: serious injury accidents, minor injury accidents, and accidents involving only property damage. The dynamic features extracted from real-time monitoring video data include motorcycle traffic flow, helmet wearing status, and the frequency of at least one high-risk behavior among running red lights, driving against traffic, and speeding.

[0008] In step S1: The process of extracting dynamic features from surveillance video data follows the principle of privacy protection, specifically excluding any facial features, license plate information, and rider biometric data, and retaining only aggregated statistical features or anonymized classification features such as motorcycle traffic statistics, helmet wearing ratio, and frequency of high-risk behaviors.

[0009] Step S2. Data preprocessing and partitioning: Encode the classification features in the enhanced feature set, discretize the continuous features, normalize all feature values ​​to the [0, 1] interval, and then divide the preprocessed data into training set and test set according to the ratio, while maintaining the original imbalanced distribution of accident categories; It should be noted that: In step S2, the data preprocessing and encoding specifically include: (a) Data cleaning: Outlier samples with predicted speed >120 mph and age >120 years were removed using the interquartile range (IQR) method. The missing values ​​of key features are handled by random forest imputation, and samples with more than 30% missing core features are removed. (b) Feature encoding: Label encoding is used for binary classification features, and one-hot encoding is used for multi-class classification features; (c) Discretization of continuous features: Drivers' ages are divided into four ranges: ≤25 years old, 26-40 years old, 41-59 years old, and ≥60 years old. Estimated speeds are divided into three ranges: ≤40 mph, 41-59 mph, and ≥60 mph. (d) The processed enhanced feature set is divided into training set and test set in a 7:3 ratio and normalized using the Min-Max method.

[0010] Step S3. FL-LightGBM Model Construction: A classification model is constructed using LightGBM as the framework, and the FocalLoss loss function is introduced to replace its original loss function. The FocalLoss function dynamically adjusts the attention given to minority class samples and difficult-to-classify samples during model training through the class weight coefficient α and the focusing parameter γ. It should be noted that: In step S3, the specific expression of the FocalLoss loss function is as follows: ; Among them, P t α represents the model's predicted probability for the severity category of a real accident. tα is the class weight coefficient (optimal value α=0.24), and γ is the focusing parameter (optimal value γ=2), which is used to increase the loss weight of serious and minor injury accident samples and enhance the model's attention to difficult-to-classify samples.

[0011] Step S4. Model Training and Validation: The FL-LightGBM model is trained using the training set, and the hyperparameters and FocalLoss function parameters are jointly optimized using grid search and cross-validation methods. The performance of the optimized model is then evaluated using the test set, with accuracy and F1 score as the core indicators to verify its superiority. It should be noted that: In step S4: The joint optimization specifically employs a grid search and 5-fold cross-validation method to optimize the model hyperparameters and FocalLoss function parameters. The optimized parameter range includes: Learning rate 0.01-0.2, number of iterations 50-200, number of leaf nodes 15-63, class weight coefficient α 0.1-0.5, focus parameter 1-5; The final optimal parameter combination is: learning rate 0.1, number of iterations 100, number of leaf nodes 31, α=0.24, γ=2; In step S4: The trained and optimized FL-LightGBM model achieved a prediction accuracy of no less than 78.58% and an F1 score of no less than 0.5406 on the test set. Its F1 score was improved by 2% to 50% compared to the LightGBM baseline model, XGBoost model and random forest model without using the FocalLoss loss function.

[0012] Step S5. Accident Severity Prediction: For the target intersection, its corresponding feature data is preprocessed and then input into the trained FL-LightGBM model, which then outputs the predicted category and probability distribution of the accident severity. It should be noted that: In step S5: The predicted severity of the accident output includes the probability distributions of three categories: serious injury, minor injury, and property damage only. The category corresponding to the highest probability is used as the final predicted category.

[0013] Step S6. SHAP-based causal analysis: Apply the SHAP framework to calculate the contribution value of each feature in the enhanced feature set to the prediction result, sort them according to the global importance of each feature's SHAP value, identify key causal factors, and analyze their influence patterns in conjunction with the SHAP dependency graph. It should be noted that: In step S6: The feature contribution analysis based on SHAP values ​​is calculated using cooperative game theory, and the expression is as follows: ; Or equivalent to: ; Where, Φ i Let f be the SHAP value of feature i, F be the set of all features, S be the subset of features, and f(∙) be the model prediction function; Global importance is ranked by calculating the mean absolute value of each feature's SHAP value in all samples, and the top 20 key causal factors are identified. The key causal factors include at least the number of vehicles involved in the collision, the estimated speed, the helmet wearing status, the driver's gender and age, and the nonlinear relationship between key features and the predicted probability of accident severity is analyzed using SHAP dependency graphs. Based on the probability distribution and real-time dynamic characteristics, a dynamic risk heat map of traffic safety at the intersection-time period level is generated. Based on the causal analysis results, a tiered prevention and control strategy is generated, which includes real-time law enforcement early warning, engineering modification suggestions, and special publicity and education strategies.

[0014] Step S7. Dynamic Iterative Optimization of the Model: Regularly collect new data, retrain the FL-LightGBM model and update its parameters to achieve dynamic optimization of the model, so as to maintain the accuracy of prediction and causal analysis.

[0015] It should be noted that: In step S7: The model is dynamically updated on a quarterly basis, and new accident data and corresponding time period monitoring dynamic characteristics of the target intersection are collected regularly. During updates, the FL-LightGBM model architecture is retained, and the model parameters and feature weights are updated through incremental learning or retraining, so that the prediction accuracy of the updated model is maintained above 78%, and the accuracy fluctuation range is controlled within ±1.5%.

[0016] Furthermore, the method is applicable to various intersection scenarios in urban and rural roads, and the vehicle types include fuel-powered motorcycles and electric two-wheelers. The entire data processing process does not extract or store any information that can directly or indirectly identify a specific natural person or a specific vehicle.

[0017] In the above technical solution, the present invention provides a method for predicting the severity and analyzing the causes of motorcycle accidents at intersections, which has the following advantages: (1) This invention effectively solves the limitations of traditional methods by constructing an enhanced feature set that integrates multi-source static and dynamic features and combining it with the LightGBM model (FL-LightGBM) that introduces the FocalLoss function. On the one hand, by integrating the dynamic features extracted from real-time monitoring, the model can more comprehensively depict the immediate risk scenario of the accident. On the other hand, the FocalLoss function significantly enhances the model's ability to identify a few key categories such as "serious injury accidents" by dynamically adjusting the loss weights, thus alleviating the prediction bias caused by the imbalance of data categories. Experimental verification shows that while maintaining high accuracy, the optimized model has a significantly improved F1 score compared to the traditional benchmark model, indicating that the prediction of the severity of accidents, especially serious injury accidents, is more accurate and reliable.

[0018] (2) This invention integrates the SHAP interpretable artificial intelligence framework, which successfully transforms model prediction into intuitive causal contribution analysis. This method can globally quantify and rank the key factors affecting the severity of accidents and reveal the complex nonlinear relationship between key features and accident consequences. This enables safety management to not only "predict" the results, but also "understand" the core motivations behind them, thus providing a clear and direct data-driven basis for formulating targeted law enforcement intervention, engineering transformation and publicity and education strategies, which greatly improves the accuracy and effectiveness of prevention and control measures.

[0019] (3) By designing a dynamic model update mechanism with a quarterly cycle, the present invention can periodically use new data to iteratively optimize the model. This mechanism ensures that the model can continuously adapt to the dynamic changes of factors such as traffic environment and driving behavior, and avoids the decay of analytical capabilities over time due to model solidification. The technical solution puts forward clear requirements for the stability of the updated model performance, thereby ensuring the practicality and reliability of the method in long-term application and providing sustainable technical support for the intelligent operation of traffic safety management.

[0020] (4) Throughout the entire process of data collection and processing, this invention strictly adheres to privacy protection regulations. In particular, when extracting dynamic features from surveillance videos, it actively excludes all personal identification information such as faces and license plates through technical means, and only uses aggregated statistical or anonymized features. This design enables the method to fully explore the value of public video data while fully complying with the relevant regulations on personal information protection, successfully avoiding the risk of privacy leakage, and laying a solid foundation for the large-scale deployment and compliant application of this method in urban areas. Attached Figure Description

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

[0022] Figure 1 This is a flowchart illustrating an embodiment of the present invention for predicting the severity and analyzing the causes of motorcycle accidents at intersections.

[0023] Figure 2 This is a SHAP analysis result diagram provided by an embodiment of the method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to the present invention. Detailed Implementation

[0024] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.

[0025] like Figures 1-2 As shown in the figure, an embodiment of the present invention provides a method for predicting the severity and analyzing the causes of motorcycle accidents at intersections, which includes the following steps: Step S1. Multi-source data acquisition and fusion: Collect historical accident data and real-time monitoring video data of the target intersection, apply computer vision technology to the monitoring video data to extract dynamic features of motorcycle traffic flow, helmet wearing status and frequency of high-risk behaviors, and exclude personal identification information. Then, fuse the static features and the dynamic features to construct an enhanced feature set and perform data cleaning. It should be noted that: In step S1: The historical accident data refers to motorcycle traffic accident records collected at the target intersection over a period of 3 to 5 years, with a valid sample size of no less than 7,234 records. The static features in the historical accident data cover four dimensions: driver, vehicle, road, and environment. Static characteristics of a driver include: driver's age, gender, whether the driver fled the scene, and state of distraction. Vehicle static characteristics include: number of vehicles in collision, estimated speed, motion state, and collision type; Static characteristics of a road include: road alignment, control method, speed limit, and shoulder type; Static environmental characteristics include: ambient lighting conditions, weather conditions, and road surface conditions; Further explanation: In the research examples upon which this method is based, the static feature set contains 21 independent variables. In addition to the core features mentioned above, it also comprehensively covers driver physical condition (e.g., health status, fatigue, alcohol consumption), vehicle motion state (straight driving, turning, etc.), road features (vertical curve type, number of lanes, road separation pattern), and road environment features (urban and rural roads, visibility obstruction, etc.), as shown in Table 1. This comprehensive feature system provides a multi-dimensional analytical foundation for the model. Table 1. Description and Statistics of Variables Table2Descriptionandstatisticsofvariables

[0026] Although the cited study states in its conclusion that "helmet wearing has not been considered", this method prospectively uses it as one of the key dynamic features extracted from real-time surveillance video in step S1, thereby enhancing the completeness and real-time performance of the feature set and helping to improve the model's predictive and interpretive capabilities in practical applications. The severity of the accidents is classified into three levels: serious injury accidents, minor injury accidents, and accidents involving only property damage. The dynamic features extracted from real-time monitoring video data include motorcycle traffic flow, helmet wearing status, and the frequency of at least one high-risk behavior among running red lights, driving against traffic, and speeding.

[0027] In step S1: The process of extracting dynamic features from surveillance video data follows the principle of privacy protection, specifically excluding any facial features, license plate information, and rider biometric data, and retaining only aggregated statistical features or anonymized classification features such as motorcycle traffic statistics, helmet wearing ratio, and frequency of high-risk behaviors.

[0028] Step S2. Data preprocessing and partitioning: Encode the classification features in the enhanced feature set, discretize the continuous features, normalize all feature values ​​to the [0, 1] interval, and then divide the preprocessed data into training set and test set according to the ratio, while maintaining the original imbalanced distribution of accident categories; It should be noted that: In step S2, the data preprocessing and encoding specifically include: (a) Data cleaning: Outlier samples with predicted speed >120 mph and age >120 years were removed using the interquartile range (IQR) method. The missing values ​​of key features are handled by random forest imputation, and samples with more than 30% missing core features are removed. (b) Feature encoding: Label encoding is used for binary classification features, and one-hot encoding is used for multi-class classification features; (c) Discretization of continuous features: Drivers' ages are divided into four ranges: ≤25 years old, 26-40 years old, 41-59 years old, and ≥60 years old. Estimated speeds are divided into three ranges: ≤40 mph, 41-59 mph, and ≥60 mph. (d) The processed enhanced feature set is divided into training set and test set in a 7:3 ratio and normalized using the Min-Max method.

[0029] Step S3. FL-LightGBM Model Construction: A classification model is constructed using LightGBM as the framework, and the FocalLoss loss function is introduced to replace its original loss function. The FocalLoss function dynamically adjusts the attention given to minority class samples and difficult-to-classify samples during model training through the class weight coefficient α and the focusing parameter γ. It should be noted that: The core purpose of introducing the FocalLoss function is to address the severe class imbalance problem in accident data (e.g., in this example, serious injury, minor injury, and property damage-only accidents account for 1.3%, 29.8%, and 68.9%, respectively). This function adjusts parameters to make the model focus more on the less common serious and minor injury accident categories, as well as difficult-to-classify samples, during training. This improves the prediction accuracy for minority class accidents and overcomes the problem of majority class samples masking minority class information, which may occur with traditional methods.

[0030] In step S3, the specific expression of the FocalLoss loss function is as follows: ; Among them, P t α represents the model's predicted probability for the severity category of a real accident. t α is the class weight coefficient (optimal value α=0.24), and γ is the focusing parameter (optimal value γ=2), which is used to increase the loss weight of serious and minor injury accident samples and enhance the model's attention to difficult-to-classify samples.

[0031] Step S4. Model Training and Validation: The FL-LightGBM model is trained using the training set, and the hyperparameters and FocalLoss function parameters are jointly optimized using grid search and cross-validation methods. The performance of the optimized model is then evaluated using the test set, with accuracy and F1 score as the core indicators to verify its superiority. It should be noted that: In step S4: The joint optimization specifically employs a grid search and 5-fold cross-validation method to optimize the model hyperparameters and FocalLoss function parameters. The optimized parameter range includes: Learning rate 0.01-0.2, number of iterations 50-200, number of leaf nodes 15-63, class weight coefficient α 0.1-0.5, focus parameter 1-5; The final optimal parameter combination is: learning rate 0.1, number of iterations 100, number of leaf nodes 31, α=0.24, γ=2; This optimal parameter combination is consistent with the results obtained through cross-validation and grid search in the research example (as shown in Table 2), ensuring the optimal state of model performance; Table 2 FL-LightGBM Model Parameter Information Table3FL-LightGBMmodelparameterinformation

[0032] In step S4: The trained and optimized FL-LightGBM model achieves a prediction accuracy of no less than 78.58% and an F1 score of no less than 0.5406 on the test set. Moreover, its F1 score is 2% to 50% higher than that of the LightGBM baseline model, XGBoost model, and random forest model without using the FocalLoss loss function. Based on the comparative experiments in the research examples (as shown in Tables 3 and 4), the FL-LightGBM model performed best in both accuracy (78.58%) and F1 score. In particular, compared with benchmark models such as LightGBM and XGBoost processed by various data sampling techniques (e.g., SMOTE, RUS), FL-LightGBM significantly improved the F1 score (by 2%-50%) while maintaining high accuracy. This demonstrates the effectiveness and superiority of the proposed model in handling imbalanced accident data and improving the prediction performance of minority classes of accidents.

[0033] Table 3. Experimental comparison of the improved methods Table4Experimentalcomparisonofimprovedmethods

[0034] Table 4. Experimental comparison of different models Table5ExperimentalComparisonofDifferentModels

[0035] Step S5. Accident Severity Prediction: For the target intersection, its corresponding feature data is preprocessed and then input into the trained FL-LightGBM model, which then outputs the predicted category and probability distribution of the accident severity. It should be noted that: In step S5: The predicted severity of the accident output includes the probability distributions of three categories: serious injury, minor injury, and property damage only. The category corresponding to the highest probability is used as the final predicted category.

[0036] Step S6. SHAP-based causal analysis: Apply the SHAP framework to calculate the contribution value of each feature in the enhanced feature set to the prediction result, sort them according to the global importance of each feature's SHAP value, identify key causal factors, and analyze their influence patterns in conjunction with the SHAP dependency graph. It should be noted that: In step S6: The feature contribution analysis based on SHAP values ​​is calculated using cooperative game theory, and the expression is as follows: ; Or equivalent to: ; Where, Φ i Let f be the SHAP value of feature i, F be the set of all features, S be the subset of features, and f(∙) be the model prediction function; Global importance is ranked by calculating the mean absolute value of each feature's SHAP value in all samples, and the top 20 key causal factors are identified. The key causal factors include at least the number of vehicles involved in the collision, the estimated speed, the helmet wearing status, the driver's gender and age, and the nonlinear relationship between key features and the predicted probability of accident severity is analyzed using SHAP dependency graphs. Based on the SHAP analysis results of the aforementioned research examples (such as...) Figure 1 As shown in the figure, the key causative factors identified, ranked by importance, include: number of vehicles involved in the collision, driving speed, gender, age, collision type, and control method. Specific analysis revealed: 1) Number of vehicles involved in a collision: Single-vehicle collisions have a significant impact on the severity of all types of accidents, especially in serious injury accidents; 2) Driving speed: Speeds between 41-59 mph (approximately 66-95 km / h) are one of the most critical variables leading to serious injury accidents; 3) Driver characteristics: Female drivers and young drivers aged ≤25 are more likely to cause serious injuries; 4) Road and environmental factors: Uncontrolled intersections, rural roads, and nighttime lighting conditions can exacerbate the severity of accidents.

[0037] These findings provide a clear basis for targeted prevention and control.

[0038] Based on the probability distribution and real-time dynamic characteristics, a dynamic risk heat map of traffic safety at the intersection-time period level is generated. Based on the causal analysis results, a tiered prevention and control strategy is generated, which includes real-time law enforcement early warning, engineering modification suggestions, and special publicity and education strategies.

[0039] Step S7. Dynamic Iterative Optimization of the Model: Regularly collect new data, retrain the FL-LightGBM model and update its parameters to achieve dynamic optimization of the model, so as to maintain the accuracy of prediction and causal analysis.

[0040] It should be noted that: In step S7: The model is dynamically updated on a quarterly basis, and new accident data and corresponding time period monitoring dynamic characteristics of the target intersection are collected regularly. During updates, the FL-LightGBM model architecture is retained, and the model parameters and feature weights are updated through incremental learning or retraining, so that the prediction accuracy of the updated model is maintained above 78%, and the accuracy fluctuation range is controlled within ±1.5%.

[0041] In another embodiment of the present invention, the method is applicable to various intersection scenarios in urban and rural roads, the vehicle types include fuel-powered motorcycles and electric two-wheelers, and the entire data processing does not extract or store any information that can directly or indirectly identify a specific natural person or a specific vehicle.

[0042] The foregoing has only described certain exemplary embodiments of the present invention by way of illustration. Undoubtedly, those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the foregoing drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A method for predicting the severity and analyzing the causes of motorcycle accidents at intersections, characterized in that, Includes the following steps: Step S1. Multi-source data acquisition and fusion: Collect historical accident data and real-time monitoring video data of the target intersection, apply computer vision technology to the monitoring video data to extract dynamic features of motorcycle traffic flow, helmet wearing status and frequency of high-risk behaviors, and exclude personal identification information. Then, fuse the static features and the dynamic features to construct an enhanced feature set and perform data cleaning. Step S2. Data preprocessing and partitioning: Encode the classification features in the enhanced feature set, discretize the continuous features, normalize all feature values ​​to the [0, 1] interval, and then divide the preprocessed data into training set and test set according to the ratio, while maintaining the original imbalanced distribution of accident categories; Step S3. FL-LightGBM Model Construction: A classification model is constructed using LightGBM as the framework, and the FocalLoss loss function is introduced to replace its original loss function. The FocalLoss function dynamically adjusts the attention given to minority class samples and difficult-to-classify samples during model training through the class weight coefficient α and the focusing parameter γ. Step S4. Model Training and Validation: The FL-LightGBM model is trained using the training set, and the hyperparameters and FocalLoss function parameters are jointly optimized using grid search and cross-validation methods. The performance of the optimized model is then evaluated using the test set, with accuracy and F1 score as the core indicators to verify its superiority. Step S5. Accident Severity Prediction: For the target intersection, its corresponding feature data is preprocessed and then input into the trained FL-LightGBM model, which then outputs the predicted category and probability distribution of the accident severity. Step S6. SHAP-based causal analysis: Apply the SHAP framework to calculate the contribution value of each feature in the enhanced feature set to the prediction result, sort them according to the global importance of each feature's SHAP value, identify key causal factors, and analyze their influence patterns in conjunction with the SHAP dependency graph. Step S7. Dynamic Iterative Optimization of the Model: Regularly collect new data, retrain the FL-LightGBM model and update its parameters to achieve dynamic optimization of the model, so as to maintain the accuracy of prediction and causal analysis.

2. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S1: The historical accident data refers to motorcycle traffic accident records collected at the target intersection over a period of 3 to 5 years, with a valid sample size of no less than 7,234 records. The static features in the historical accident data cover four dimensions: driver, vehicle, road, and environment. Static characteristics of a driver include: driver's age, gender, whether the driver fled the scene, and state of distraction. Vehicle static characteristics include: number of vehicles in collision, estimated speed, motion state, and collision type; Static characteristics of a road include: road alignment, control method, speed limit, and shoulder type; Static environmental characteristics include: ambient lighting conditions, weather conditions, and road surface conditions; The severity of the accidents is classified into three levels: serious injury accidents, minor injury accidents, and accidents involving only property damage. The dynamic features extracted from real-time monitoring video data include motorcycle traffic flow, helmet wearing status, and the frequency of at least one high-risk behavior among running red lights, driving against traffic, and speeding.

3. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S1: The process of extracting dynamic features from surveillance video data follows the principle of privacy protection, specifically excluding any facial features, license plate information, and rider biometric data, and retaining only aggregated statistical features or anonymized classification features such as motorcycle traffic statistics, helmet wearing ratio, and frequency of high-risk behaviors.

4. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S2, the data preprocessing and encoding specifically include: (a) Data cleaning: Outlier samples with predicted speed >120 mph and age >120 years were removed using the interquartile range (IQR) method. The missing values ​​of key features are handled by random forest imputation, and samples with more than 30% missing core features are removed. (b) Feature encoding: Label encoding is used for binary classification features, and one-hot encoding is used for multi-class classification features; (c) Discretization of continuous features: Drivers' ages are divided into four ranges: ≤25 years old, 26-40 years old, 41-59 years old, and ≥60 years old. Estimated speeds are divided into three ranges: ≤40 mph, 41-59 mph, and ≥60 mph. (d) The processed enhanced feature set is divided into training set and test set in a 7:3 ratio and normalized using the Min-Max method.

5. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S3, the specific expression of the FocalLoss loss function is as follows: ; Among them, P t α represents the model's predicted probability for the severity category of a real accident. t α is the class weight coefficient (optimal value α=0.24), and γ is the focusing parameter (optimal value γ=2), which is used to increase the loss weight of serious and minor injury accident samples and enhance the model's attention to difficult-to-classify samples.

6. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 5, characterized in that, In step S4: The joint optimization specifically employs a grid search and 5-fold cross-validation method to optimize the model hyperparameters and FocalLoss function parameters. The optimized parameter range includes: Learning rate 0.01-0.2, number of iterations 50-200, number of leaf nodes 15-63, class weight coefficient α 0.1-0.5, focus parameter 1-5; The final optimal parameter combination is: learning rate 0.1, number of iterations 100, number of leaf nodes 31, α=0.24, γ=2; In step S4: The trained and optimized FL-LightGBM model achieved a prediction accuracy of no less than 78.58% and an F1 score of no less than 0.5406 on the test set. Its F1 score was improved by 2% to 50% compared to the LightGBM baseline model, XGBoost model and random forest model without using the FocalLoss loss function.

7. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S5: The predicted severity of the accident output includes the probability distributions of three categories: serious injury, minor injury, and property damage only. The category corresponding to the highest probability is used as the final predicted category.

8. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S6: The feature contribution analysis based on SHAP values ​​is calculated using cooperative game theory, and the expression is as follows: ; Or equivalent to: ; Where, Φ i Let f be the SHAP value of feature i, F be the set of all features, S be the subset of features, and f(∙) be the model prediction function; Global importance is ranked by calculating the mean absolute value of each feature's SHAP value in all samples, and the top 20 key causal factors are identified. The key causal factors include at least the number of vehicles involved in the collision, the estimated speed, the helmet wearing status, the driver's gender and age, and the nonlinear relationship between key features and the predicted probability of accident severity is analyzed using SHAP dependency graphs. Based on the probability distribution and real-time dynamic characteristics, a dynamic risk heat map of traffic safety at the intersection-time period level is generated. Based on the causal analysis results, a tiered prevention and control strategy is generated, which includes real-time law enforcement early warning, engineering modification suggestions, and special publicity and education strategies.

9. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, In step S7: The model is dynamically updated on a quarterly basis, and new accident data and corresponding time period monitoring dynamic characteristics of the target intersection are collected regularly. During updates, the FL-LightGBM model architecture is retained, and the model parameters and feature weights are updated through incremental learning or retraining, so that the prediction accuracy of the updated model is maintained above 78%, and the accuracy fluctuation range is controlled within ±1.5%.

10. The method for predicting the severity and analyzing the causes of motorcycle accidents at intersections according to claim 1, characterized in that, The method is applicable to various intersection scenarios in urban and rural roads. The vehicle types include fuel-powered motorcycles and electric two-wheelers. The entire data processing does not extract or store any information that can directly or indirectly identify a specific natural person or a specific vehicle.