Highway event grade studying and judging method based on dynamic weighted random forest
By constructing a six-dimensional feature vector using a dynamically weighted random forest and calculating dynamic weights, the problems of strong subjectivity and slow response speed in traditional methods are solved. This enables real-time and accurate assessment of highway event levels, adapts to changes in feature importance in different scenarios, and improves the interpretability and practicality of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-08
- Publication Date
- 2026-03-13
AI Technical Summary
Traditional methods for assessing the severity of highway incidents rely on human experience, are highly subjective, have slow response times, are difficult to meet real-time handling needs, and lack scientific quantitative basis. Existing machine learning models cannot adapt to the dynamic changes in the importance of features.
A dynamic weighted random forest-based approach is adopted. By constructing a six-dimensional feature vector, calculating dynamic weights, and introducing weighted Gini impurity as a splitting criterion, multiple decision trees are constructed. The model parameters are optimized by combining hierarchical cross-validation and grid search to achieve automatic and accurate judgment of event levels.
It achieves standardized and automated assessment of highway event levels, with a response speed of up to seconds. It adapts to changes in the importance of features in different scenarios, reduces the risk of secondary accidents, and improves the interpretability and practicality of the model.
Smart Images

Figure CN121660461A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of highway traffic safety control technology, and in particular to a method for assessing the level of highway events based on dynamic weighted random forest. Background Technology
[0002] As the arteries of the transportation network, highways are crucial to socio-economic operation and public travel due to their safety and smooth flow. With the continuous expansion of the highway network and the sustained growth of traffic flow, various emergencies occur frequently, significantly increasing highway traffic safety risks. Highway incidents (such as traffic accidents, vehicle breakdowns, and cargo spills) are characterized by their suddenness, diversity, and complexity. How to quickly, accurately, and systematically assess their severity is a key aspect of emergency response and traffic management decision-making, directly impacting rescue efficiency, traffic recovery speed, and the prevention of secondary accidents. Timely and accurate assessment of highway incident severity levels and the implementation of precise measures can help shift traffic safety management from passive management to proactive control, ensuring the safe operation of highway traffic.
[0003] Traditional event severity assessment relies heavily on human experience, using predefined rules and thresholds for judgment. This method has several significant drawbacks: first, it is highly subjective, with different staff members potentially offering different experiences and conclusions; second, it has a slow response time, failing to meet real-time handling needs; and third, it lacks standardized criteria and scientific quantitative evidence. With the advancement of highway information technology and the gradual improvement of the perception system, acquiring massive amounts of real-time highway event information data provides a foundation for data-driven automatic event severity assessment.
[0004] The focus and objective of this invention is to deeply mine real-time event information on highways, construct an event level assessment model based on machine learning algorithms, and effectively achieve automatic and accurate event level assessment to provide decision-making basis for highway emergency response and traffic management. Currently, there is limited research on highway event level assessment, but event level assessment has certain commonalities. The current state of domestic and international research methods on event level assessment can be mainly categorized into three types:
[0005] First, there are rule-based and traditional model-based methods. The core of these methods relies on domain expert experience to construct a static rule base. Levels are determined by matching specific indicator parameters with predefined thresholds; alternatively, a risk matrix is constructed using risk probability and impact as risk assessment indicators, and risk levels are determined by looking up tables within the matrix. The advantages of these methods are clear and highly interpretable rules, but their disadvantages include rigid rules that are difficult to adapt to the complex and ever-changing realities of highways, and a heavy reliance on subjective expert experience.
[0006] Second, there are methods based on analytic hierarchy process (AHP) and fuzzy evaluation. The basic principle of these methods is to construct a fuzzy comprehensive evaluation matrix using fuzzy functions to comprehensively evaluate the evaluation object using multiple indicators. Some scholars combine AHP and information entropy to determine the indicator weights for the matrix input. The advantages of these methods are their computational simplicity and lack of need for extensive training data. The disadvantages are that AHP algorithms introduce expert subjectivity when determining weights, which can affect the objectivity of the evaluation results. Similarly, fuzzy comprehensive evaluation uses fuzzy mathematics to fuzzify influencing factors, making it susceptible to subjective factors such as experience.
[0007] Third, machine learning-based methods. In recent years, various machine learning algorithms, such as decision trees and neural networks, have been gradually applied to grading models and have achieved some progress. For example, some scholars have used decision trees to establish accident severity grading prediction models and conducted visual analysis of accident influencing factors; others have used neural networks to predict accident levels and rank each influencing factor according to its sensitivity value. In addition, algorithms such as support vector machines, random forests, and clustering methods have also been used for event grading assessment in various industries. These methods train models by inputting sample data to achieve automatic event judgment, which improves the accuracy and efficiency of judgment to a certain extent. However, most models use static weight systems, which cannot adapt to the dynamic changes in feature importance. For example, the same type of event occurring at different times and on different road sections should have different feature importance, but existing static weight models cannot reflect this difference. Summary of the Invention
[0008] The purpose of this invention is to provide a method for judging the event level of highways based on dynamic weighted random forest, so as to solve the problems mentioned in the background art.
[0009] To achieve the above objectives, the present invention provides the following technical solution: a method for determining the event level of a highway based on a dynamically weighted random forest, comprising the following steps:
[0010] S1. Obtain the original information of highway events, construct a six-dimensional feature vector including the degree of safety impact, the degree of traffic impact, the time sensitivity, the road section risk coefficient, the severity of the event, and the reliability of information, and standardize and normalize each feature to obtain the event feature matrix and the level label vector.
[0011] S2. Based on the context information of the event, calculate the dynamic weights of each feature and normalize the dynamic weights to obtain the final weights of each feature.
[0012] S3. Based on the bootstrap sampling method, multiple training subsets are generated from the training dataset. During the node splitting process of each decision tree, weighted Gini impurity is introduced as a splitting criterion. Candidate splitting features and splitting thresholds are traversed to select the optimal splitting point and construct multiple decision trees. The prediction results of all decision trees are integrated through a weighted voting mechanism to form a dynamic weighted random forest model.
[0013] S4. The hierarchical cross-validation method is used to evaluate the generalization ability of the model. The random forest parameters and dynamic weight parameters are systematically tuned through staged grid search to determine the optimal parameter combination.
[0014] S5. Input the six-dimensional feature vector of the highway event to be analyzed into the trained dynamic weighted random forest model. The model outputs the level result corresponding to the event, which includes level 1, level 2, level 3 and level 4.
[0015] Preferably, the degree of security impact The specific construction and calculation steps include:
[0016] The number of deaths d and the number of injuries i caused by the event are used as core factors, where d is a non-negative integer and i is a non-negative integer;
[0017] Based on the principle of prioritizing life in event risk assessment, the weight of death is set at 10, the weight of injury at 2, and the maximum score is set at 10.
[0018] Calculate the initial value for the degree of safety impact, with the initial value range being [0, 1];
[0019] If any of the following conditions are met, Forced adjustment to the maximum value of 1: number of deaths d≥1; number of injuries i>5.
[0020] Preferably, the degree of traffic impact The specific construction and calculation steps include:
[0021] The number of vehicles involved in the incident, v, and the number of lanes affected, l, are used as core factors, where v is a non-negative integer and l is a positive integer;
[0022] Based on highway operation statistics, the maximum reference value for the number of vehicles involved in an accident, Vmax, is set to 4, and the maximum reference value for the lanes affected, Lmax, is set to 3.
[0023] First, constrain the range of the core factors: if v>Vmax, then take v=Vmax; if l>Lmax, then take l=Lmax; calculate the degree of traffic impact, and map the result to the interval [0,1].
[0024] If the incident results in the complete closure of one-way highway, regardless of the above calculation results, the closure will be directly implemented. Revised to 1.
[0025] Preferably, the calculation steps for the dynamic weights specifically include:
[0026] Set initial weights for features Based on the risk priority ranking of highway incidents, the initial weights of the six-dimensional features are determined as follows: degree of safety impact. Seriousness of the incident Traffic impact level Time sensitivity Road section risk coefficient Information reliability ;
[0027] Calculate the safety impact weight adjustment function Traffic impact weighting adjustment function Time sensitivity weight adjustment function Road segment risk weight adjustment function Event severity weight adjustment function Information reliability weight adjustment function ;
[0028] Calculate the initial dynamic weights for each feature; normalize the initial dynamic weights to the [0, 1] interval to obtain the final weights for each feature used in model training. .
[0029] Preferably, the calculation steps for the weighted Gini impurity Gw specifically include:
[0030] Let S be the sample set corresponding to the current decision tree node, C = {1, 2, 3, 4} be the event level category set, and |S| be the total number of samples in the sample set S.
[0031] For each six-dimensional feature j (j=1, 2, ..., 6), count the proportion of samples belonging to category c in the sample set S for feature j. ;
[0032] Calculate the Gini impurity of feature j at the current node S;
[0033] Call the final weights of each feature normalization ;Calculate the weighted Gini impurity of node S.
[0034] Preferably, the selection steps for the optimal splitting feature j* and splitting threshold t* of the decision tree node specifically include:
[0035] For each six-dimensional feature j, based on the value distribution of feature j in the sample set S, a quantile segmentation method is used to generate candidate splitting thresholds t: if feature j is a continuous value, the 25th, 50th, and 75th quantiles of the feature value are taken as candidate thresholds t; if feature j is a discrete value, all different discrete values of the feature are taken as candidate thresholds t; thus forming a set of candidate splitting pairs. ,in Represents the set of candidate thresholds for feature j;
[0036] For each candidate split pair (j, t), the sample set S is divided into a left child node sample set. and right child node sample set Calculate the weighted Gini impurity of parent node S using the weighted Gini impurity method. left child node Weighted Gini impurity right child node Weighted Gini impurity ; Calculate the split gain;
[0037] Iterate through all candidate split pairs and select the split pair (j∗, t∗) with the largest split gain ΔG as the optimal split feature and split threshold for the current node; if multiple split pairs have the same ΔG value, prioritize the initial feature weights. A larger split.
[0038] Preferably, the setting of the random forest parameters specifically includes:
[0039] Based on the scale of the highway event dataset and the principle of balancing model training efficiency and generalization ability, the initial range of parameters is set as follows: number of trees K: 100-500; maximum tree depth: 6-12; minimum number of split samples per node: 10-30; minimum number of samples per leaf node: 5-15; feature subset size: 2.
[0040] Preferably, the specific implementation steps of stratified cross-validation include:
[0041] The training dataset is stratified and sampled according to event level to ensure that the proportion of samples at levels 1, 2, 3, and 4 in the original data remains unchanged after the partitioning; a stratified 5-fold partitioning method is used: the training dataset is evenly divided into 5 mutually exclusive subsets. The deviation of the percentage of samples at each level within each subset from the original training set is ≤ ±2%;
[0042] Multiple training and validation cycles: Round 1 validation: with For the training set, For the validation set, a dynamically weighted random forest model is trained, and the overall accuracy, recall at each level, and macro-average F1 score of the validation set are calculated. Validation rounds 2-5: The validation set is rotated sequentially, and the above training and evaluation process is repeated.
[0043] Calculate the arithmetic mean of each indicator in the 5 rounds of validation results as the core evaluation indicator of the model's generalization ability; if the standard deviation of each indicator is ≤ ±1.5%, the model's generalization ability is considered stable; if the standard deviation of the recall rate of a certain rare level is > ±5%, then after oversampling to supplement the samples of that level, the above stratified cross-validation steps are repeated until the standard deviation of the indicator meets the requirements.
[0044] Preferably, the specific implementation steps of the grid search optimization include:
[0045] A phased optimization strategy is adopted, specifically divided into: Phase 1: Optimize the random forest parameters; Phase 2: Optimize the dynamic weight parameters based on the optimal random forest parameters obtained in Phase 1.
[0046] Stage 1 grid: Number of trees K: [100, 200, 300, 500]; Maximum tree depth: [6, 8, 10, 12]; Minimum number of split samples per node: [10, 20, 30]; Minimum number of samples per leaf node: [5, 10, 15]; Feature subset size: [2]; Total number of parameter combinations for Stage 1: 4×4×3×3=144 groups;
[0047] Stage 2 grid: basic coefficient α: [0.9, 1.0, 1.1]; sensitivity coefficient β: [0.5, 0.6, 0.7, 0.8, 0.9]; eigenvalue feedback coefficient γ: [0.2, 0.3, 0.4, 0.5]; total number of stage 2 parameter combinations: 3 × 5 × 4 = 60 groups;
[0048] For each parameter combination, hierarchical cross-validation was performed, with the highest macro-average F1 score as the primary evaluation criterion and the shortest model training time as the secondary evaluation criterion. Stage 1: Optimal parameter selection: Among 144 random forest parameter combinations, the combination with the highest macro-average F1 score was selected. Stage 2: Optimal parameter selection: Based on the optimal random forest parameters in Stage 1, among 60 dynamic weight parameter combinations, the combination with the highest macro-average F1 score was selected.
[0049] Retrain the dynamic weighted random forest model using all training data and the final optimal parameter combination, and verify the model performance on an independent test set. If the macro-average F1 score on the test set is greater than or equal to 95% of the macro-average F1 score on the training set, then the parameter combination is determined as the final model parameters; otherwise, return to stage 1, expand the parameter search range, and re-optimize.
[0050] Preferably, the dynamically weighted random forest model and the six-dimensional feature vector can be replaced by the following alternatives, and the alternatives must meet preset constraints:
[0051] Model alternatives:
[0052] When replaced by a gradient boosting model: dynamic weights are embedded into the model through a weighted loss function; the optimal split point is selected based on weighted Gini impurity to ensure that the influence of dynamic weights on the splitting process remains unchanged; when replaced by a support vector machine model: dynamic weights are embedded into the model through feature scaling, and the scaling factor of feature j is the normalized dynamic weight. The kernel function is chosen as a radial basis function, and the penalty parameter C is optimized through grid search.
[0053] Feature Alternatives:
[0054] Alternative constraints: Newly added or replaced features must satisfy the correlation constraint, with a Pearson correlation coefficient |r| ≥ 0.3 with the event level; Example of a new feature: event duration. Weather Influence Coefficient Feature replacement rules: The total number of features after replacement should be maintained at 6-8 dimensions, and the new features should be tested for multicollinearity with the original features, with a variance inflation factor (VIF) < 5; When replacing, core risk factors should be retained first, and only spatiotemporal correlation factors or auxiliary factors should be replaced.
[0055] The technical effects and advantages of this invention are as follows:
[0056] (1) This invention transforms the core influencing factors of an event into calculable quantitative indicators through multi-dimensional feature engineering: safety impact level x1 and traffic impact level x2, thereby quantifying the loss of traffic efficiency. All of these indicators are normalized to ensure uniformity of dimensions. Through the calculation of dynamic weights, fuzzy concepts such as road segment type, event type, and information source are transformed into fixed coefficients, avoiding subjective adjustment of thresholds. This makes the final judgment result dependent on feature quantification calculation and automatic output of the model, without any manual intervention. This achieves a unified standard for judging the level of highway events nationwide or within a region, solving the problem of different conclusions given by different people and the lack of scientific quantitative basis.
[0057] (2) This invention optimizes the random forest parameters to control the computational load while ensuring accuracy. The time for single-sample judgment can be compressed to the second level, meeting the handling requirements of minute-level response for highway events. Moreover, the dynamic weight calculation mechanism does not require iterative training and can update feature weights in real time with a simple formula, avoiding the inefficiency of traditional static weights that need to be retrained to adapt to new scenarios. Compared with the 10-30 minute response cycle of traditional manual judgment and the several minutes of single prediction time of complex deep models, this method can directly connect to the highway perception system, receive data in real time and output grade results, saving critical time for rescue resource scheduling and lane closure decisions, and reducing the risk of secondary accidents.
[0058] (3) This invention designs a dedicated dynamic adjustment function for each feature by configuring a dedicated dynamic adjustment function for each feature and adopting a weighted splitting criterion. The safety impact weight is coupled with time sensitivity and road segment risk. When tunnel sections are superimposed during peak hours, the weight will be dynamically increased, so that the model will focus on life safety risks first. The traffic impact weight is also coupled with spatiotemporal features to avoid misjudging minor accidents in off-peak service areas as serious events. At the same time, by using the weighted Gini impurity and optimal splitting point selection mechanism, the high-weight features after dynamic adjustment will participate in decision tree splitting first, ensuring that the model focuses on the most critical risk factors in different scenarios.
[0059] (4) This invention uses a hierarchical cross-validation and a phased parameter grid search method. The hierarchical cross-validation keeps the event level distribution of the training set and the test set consistent, avoiding misjudgment of core level due to data distribution deviation. The phased grid search optimizes the random forest parameters and dynamic weight parameters, so that the model achieves the optimal balance between accuracy and recall. At the same time, it is clear that when the split gain is equal, core features are selected first to ensure that the core features of major and serious events are not interfered with by secondary features.
[0060] (5) The present invention uses a transparent weight calculation logic and a modular model feature extension method. Because the dynamic weight calculation process of the method is completely transparent, the calculation logic of each feature weight is traceable, the random forest tree structure is visualized, and the splitting features and thresholds of each node are clearly available, it is easier for traffic management departments to understand and trust than fuzzy evaluation and neural networks. Attached Figure Description
[0061] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention, but do not constitute a limitation thereof. In the drawings:
[0062] Figure 1 This is a schematic block diagram of the event level assessment method of the present invention;
[0063] Figure 2This is a statistical chart showing the event level distribution of the training and test sets in this invention.
[0064] Figure 3 This is a comparison chart of the various performance indicators of the present invention;
[0065] Figure 4 This is a confidence distribution diagram of correct and incorrect predictions in this invention. Detailed Implementation
[0066] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0067] This invention provides, for example Figures 1-4 The highway event level assessment method based on dynamic weighted random forest, as shown, includes the following steps:
[0068] S1. Obtain the original information of the highway incident (including the number of casualties, the number of vehicles involved, the time of occurrence, the type of road section, etc.), construct a six-dimensional feature vector including the degree of safety impact, the degree of traffic impact, the time sensitivity, the road section risk coefficient, the severity of the incident, and the reliability of information, and standardize and normalize each feature to obtain the event feature matrix and the level label vector (the level labels correspond to four categories: major events, serious events, general events, and minor events).
[0069] S2. Based on the context information of the event (occurrence time, road segment type, event type), the dynamic weights of each feature are calculated and normalized to obtain the final weights of each feature.
[0070] S3. Based on the bootstrap sampling method, multiple training subsets are generated from the training dataset. During the node splitting process of each decision tree, weighted Gini impurity is introduced as a splitting criterion. Candidate splitting features and splitting thresholds are traversed to select the optimal splitting point and construct multiple decision trees. The prediction results of all decision trees are integrated through a weighted voting mechanism to form a dynamic weighted random forest model.
[0071] S4. The hierarchical cross-validation method is used to evaluate the generalization ability of the model. The random forest parameters (number of trees, maximum depth, etc.) and dynamic weight parameters (sensitivity coefficient, feedback coefficient, etc.) are systematically tuned through staged grid search to determine the optimal parameter combination.
[0072] S5. Input the six-dimensional feature vector of the highway event to be assessed into the trained dynamic weighted random forest model. The model outputs the level result corresponding to the event. The event level includes level 1 (major event), level 2 (serious event), level 3 (general event), and level 4 (minor event).
[0073] Among them, the degree of security impact The specific construction and calculation steps include:
[0074] The number of deaths d and the number of injuries i caused by the event are used as core factors, where d is a non-negative integer (takes the value 0, 1, 2, ..., representing the number of people who died in the event), and i is a non-negative integer (takes the value 0, 1, 2, ..., representing the number of people who were injured in the event).
[0075] Based on the principle of prioritizing life in event risk assessment, the weight of death is set at 10 (reflecting the severity of the consequences of death) and the weight of injury is set at 2 (reflecting the degree of impact of the consequences of injury). The maximum score is set at 10 (to normalize the calculation results to the [0, 1] interval to ensure the uniformity of the characteristic dimensions).
[0076] According to the formula Calculate the initial value for the degree of safety impact, with the initial value range being [0, 1];
[0077] If any of the following conditions are met, Forced adjustment to the maximum value of 1 (indicating the highest level of security impact):
[0078] The number of deaths d ≥ 1 (there were deaths in the event);
[0079] The number of injured people i>5 (more than 5 people were injured in the incident).
[0080] Specifically, by quantifying the degree of safety impact as a weighted calculation of the number of deaths and injuries, and adding extreme value correction rules for deaths or multiple injuries, the problem of relying on subjective experience to determine the degree of safety impact of events and lacking unified quantitative standards in traditional assessments has been solved. This has achieved an accurate and objective assessment of the impact of events on life safety, and has given the characteristics of the safety impact dimension clear and calculable judgment criteria, providing core and standardized risk quantification indicators for subsequent model assessments.
[0081] Among them, the degree of traffic impact The specific construction and calculation steps include:
[0082] The core factors are the number of vehicles involved in the incident, v, and the number of lanes affected, l. v is a non-negative integer (with values of 0, 1, 2, ..., representing the total number of vehicles directly involved in the incident), and l is a positive integer (with values of 1, 2, ..., representing the number of one-way lanes of the highway occupied or affected by the incident).
[0083] Based on highway operation statistics (average number of vehicles involved in a single incident, number of lanes in one direction on common road sections), the maximum reference value for the number of vehicles involved is set to Vmax=4 (covering the scale of vehicles involved in more than 90% of regular incidents) and the maximum reference value for the lanes with the greatest impact is set to Lmax=3 (matching the mainstream road section configuration of 1-3 lanes in one direction on highways).
[0084] First, impose range constraints on the core factors: if v > Vmax, then take v = Vmax; if l > Lmax, then take l = Lmax; according to the formula... Calculate the degree of traffic impact, and map the results to the interval [0, 1].
[0085] If the event results in the complete closure of a one-way section of the highway (i.e., l equals the total number of lanes in one direction on that section), regardless of the above calculation results, directly... Revised to 1 (indicating that the traffic impact has reached the highest level).
[0086] Specifically, by setting empirical reference value constraints on the number of vehicles involved and the number of lanes affected, and supplementing the special scenario correction rules for full road closure, the problem of boundless indicator values and lack of targeted consideration for special congestion scenarios in traditional traffic impact assessments has been solved. This has achieved a scientific quantification of the impact of the event on traffic flow, realized a unified dimension assessment of traffic impact under different scales of vehicles involved and different lane occupancy levels, and improved the scenario adaptability of traffic impact characteristics.
[0087] The specific steps for calculating dynamic weights include:
[0088] Set initial weights for features Based on the priority ranking of highway incident risks, the initial weights (static baseline weights) of the six-dimensional features are determined as follows: degree of safety impact. Seriousness of the incident (These two factors are the core risk factors, accounting for a combined 60%); degree of traffic impact (Operational efficiency related factor, accounting for 15%); Time sensitivity Road section risk coefficient (Spatiotemporal correlation factors, each accounting for 10%, totaling 20%); Information reliability (Auxiliary judgment factor, accounting for 5%)
[0089] Define the dynamic weight parameter values as follows: Base coefficient α = 1 (to maintain the stability of the weight benchmark and avoid weight deviation from a reasonable range); Sensitivity coefficient β is dynamically adapted according to road segment type: β = 0.8 for tunnel or interchange segments (high-risk segments, with the highest sensitivity for dynamic adjustment), β = 0.6 for mainline or ramp segments (medium-risk segments, with moderate sensitivity), and β = 0.5 for toll station or service area segments (low-risk segments, with the lowest sensitivity); Eigenvalue feedback coefficient γ = 0.3 (determined based on training with historical event data, balancing the influence of the feature itself and related factors).
[0090] Calculate the dynamic adjustment function for each feature. Safety Impact Weight Adjustment Function (Coupling time sensitivity) Road section risk coefficient (Reflecting the amplifying effect of spatiotemporal factors on safety); Traffic impact weighting adjustment function. (Similar to the spatiotemporal coupling logic described above, reflecting the amplifying effect of spatiotemporal factors on traffic); Time sensitivity weight adjustment function (Risk coefficient of coupled road sections only) (Reflecting the cumulative effect of high-risk road sections on time-limited risks); Road section risk weight adjustment function. (Coupling time sensitivity) Seriousness of the incident (This reflects the combined effect of peak hours and high-risk events on road segment risks); event severity weighting adjustment function. (Risk coefficient of coupled road sections only) (Reflecting the amplifying effect of high-risk road sections on the severity of incidents); Information reliability weight adjustment function. (It relies solely on its own feature value feedback, without coupling with other features, because the reliability of the information is not directly related to time, space, or event type.)
[0091] Perform dynamic weight calculation and normalization: according to the formula Calculate the initial dynamic weights of each feature; according to the formula The initial dynamic weights are normalized to the [0, 1] interval to obtain the final weights for each feature used in model training. And satisfy .
[0092] like Figure 4 As shown, the high confidence level (0.8-1.0) of correctly predicted samples, verified through experiments, stems from the adaptive adjustment of feature importance by the patent's dynamic weighting mechanism. For example, for Level 1 events, the number of deaths d≥1 ( =1) After the features are dynamically weighted, the model's classification confidence for this type of sample is significantly improved; mispredicted samples (such as the boundary samples between level 2 and level 3) are due to the number of vehicles involved being 2 ( =0.5), off-peak hours ( Features such as =0.3) are vague, and the dynamic weights do not form a clear feature focus, resulting in low confidence. (2) Improve the interpretability and practicality of the model: The distribution of prediction confidence in traditional random forests is relatively chaotic (the overlap between correct and incorrect samples is high), while this model makes the confidence highly distinguishable through dynamic weighted splitting criteria. The confidence level <0.7 can be used as the threshold for manual review, which not only ensures the efficiency of automatic processing of correct prediction samples, but also avoids incorrect judgments through low confidence warnings (such as misjudging level 3 as level 2, leading to over-response), which is in line with the characteristics of interpretability and real-time performance.
[0093] Specifically, by presetting initial feature weight benchmarks, dynamically adapting sensitivity coefficients according to road segment types, configuring dedicated dynamic adjustment functions for each feature, and performing weight normalization, the problem that traditional static weights cannot adapt to changes in feature importance under different time, space, and event types is solved. This achieves scenario-based adaptive adjustment of feature weights, strengthens core risk features in high-risk scenarios, maintains a reasonable weight ratio for auxiliary features, and makes the model's judgment logic more in line with the risk correlation patterns of actual events.
[0094] The calculation steps for the weighted Gini impurity Gw (used for decision tree node splitting evaluation) specifically include:
[0095] Let S be the sample set corresponding to the current decision tree node, and C = {1, 2, 3, 4} be the event level category set (where 1 = major event, 2 = serious event, 3 = general event, 4 = minor event). The total number of samples in the sample set S is |S|.
[0096] For each six-dimensional feature j (j=1, 2, ..., 6), count the proportion of samples in the sample set S that belong to category c (c∈C) on feature j. The calculation formula is: ,in This represents a subset of samples in S that belong to category c and have valid feature j values;
[0097] According to the formula Calculate the Gini impurity of feature j at the current node S. The smaller the value, the higher the class discrimination of the feature at node S;
[0098] Call the final weights of each feature normalization According to the formula Calculate the weighted Gini impurity of node S. The smaller the value, the higher the purity of the sample category of node S, and the lower the splitting requirement.
[0099] Specifically, by incorporating the normalized dynamic weights of each feature into the Gini impurity calculation, a weighted Gini impurity evaluation index is constructed. This solves the problem that traditional decision tree node splitting only considers the distribution of sample categories and does not distinguish the importance of features. It achieves the effect of allowing core high-weight features to dominate the node splitting evaluation, improving the focus of the decision tree splitting logic on key risk factors, and laying a solid foundation for node evaluation for accurate event classification.
[0100] The specific steps for selecting the optimal splitting feature j* and splitting threshold t* for a decision tree node include:
[0101] For each six-dimensional feature j, based on the value distribution of feature j in the sample set S, a candidate splitting threshold t is generated using the quantile segmentation method: if feature j is a continuous value (e.g., security impact degree). Traffic impact The 25th, 50th, and 75th quantiles of the feature value are used as candidate thresholds t; if feature j is a discrete value (such as the road segment risk coefficient), ... Seriousness of the incident Take all distinct discrete values of this feature as candidate threshold t; form a set of candidate split pairs. ,in Represents the set of candidate thresholds for feature j;
[0102] For each candidate split pair (j, t), the sample set S is divided into a left child node sample set. and right child node sample set Calculate the weighted Gini impurity of parent node S using the weighted Gini impurity method. left child node Weighted Gini impurity right child node Weighted Gini impurity According to the formula Calculate the split gain, where , These represent the proportions of the number of samples in the left and right child nodes to the total number of samples in the parent node, respectively. The larger the ΔG value, the more significant the improvement in the purity of the node category after the split.
[0103] Iterate through all candidate split pairs and select the split pair (j∗, t∗) with the largest split gain ΔG as the optimal split feature and split threshold for the current node; if multiple split pairs have the same ΔG value (same split gain), prioritize the initial feature weights. Larger split pairs (such as prioritizing j=1 (security impact) or j=5 (event severity) to ensure that core risk factors participate in the split first).
[0104] like Figure 3As shown, the performance of Level 1 events is close to perfect (F1=99.96%): proving the effectiveness of the multi-dimensional feature engineering (core features such as safety impact degree and event severity) of patent claims 2-3, and the number of deaths / injuries in Level 1 events ( Hazardous chemicals / spontaneous combustion type ( Features such as [feature name] have extremely high discriminative power, and the dynamic weighting mechanism further strengthens the weight of these core features, enabling the model to accurately identify major events; Level 2 event performance is excellent (F1=92.86%): indicating that the model can effectively capture 3-4 vehicles involved in the incident. ),peak hours( ), tunnel section ( Typical characteristics of Level 2 events, such as [examples of events not specified], are accurately identified by the weighted Gini impurity splitting criterion of the dynamically weighted random forest, thus avoiding misclassification. The F1 score for Level 3 is only 50%, and the recall for Level 4 is 0: due to the extremely small sample size (26 Level 3 and 4 Level 4 in the test set), the model did not fully learn about minor scratches. =0.7), shoulder parking ( The model exhibits features at levels 3-4 (e.g., 0.4), and the adaptability of dynamic weights to the minority class needs further optimization (weighted sampling can be combined to improve minority class performance). However, this result conforms to common patterns under imbalanced data and does not affect the model's ability to judge core levels (levels 1-2). Compared to existing technologies (such as Wang Quan's fuzzy comprehensive evaluation model with low data utilization and Li Zhihui's ad-gcF model which does not consider traffic flow / road segment factors), this model improves precision and recall for level 1-2 events, demonstrating that the combination of dynamic weights and multi-dimensional features is superior to traditional static models or single-feature models.
[0105] Specifically, by generating candidate split thresholds by category, calculating split gain, and prioritizing core high initial weight features when the gains are the same, the problem of no priority in traditional split point selection and the failure of core risk features to participate in splitting is solved. This achieves accurate screening of the optimal split point, ensuring that the decision tree can effectively classify event levels based on key features and reduce the interference of non-core features on the judgment results.
[0106] The specific settings for random forest parameters include:
[0107] Based on the scale of the highway event dataset (10,000-20,000 samples, covering 4 event levels), and considering the principle of balancing model training efficiency and generalization ability, the initial parameter ranges are set as follows: Number of trees K: 100-500 (avoiding underfitting due to too small a K and excessively large a K leading to a surge in training time); Maximum tree depth: 6-12 (matching the complexity of the six-dimensional features, avoiding underfitting due to too small a depth and overfitting due to too large a depth); Minimum number of split samples per node: 10-30 (ensuring statistical representativeness of split nodes and avoiding meaningless splitting due to too small a sample size); Minimum number of samples per leaf node: 5-15 (avoiding fluctuations in prediction results due to too small a sample size of leaf nodes and ensuring coverage of samples at each level); Feature subset size: 2 (taking the square root of the total number of six-dimensional features). The integer part conforms to the core design principle of random forest characteristics (the randomness of the random forest).
[0108] Specifically, by setting the initial range of random forest parameters in conjunction with the dataset size and determining the default parameter values based on the model fitting effect, the problem of random forest parameter settings lacking reasonable basis and being prone to overfitting or underfitting is solved. This achieves a balance between model accuracy and training efficiency, ensuring the model's ability to judge event levels while avoiding the waste of training resources or prediction fluctuations caused by unreasonable parameters.
[0109] The specific implementation steps of hierarchical cross-validation (used to evaluate the model's generalization ability) include:
[0110] The training dataset was stratified and sampled according to event level to ensure that the sample proportions of level 1 (96.0%), level 2 (2.8%), level 3 (1.1%), and level 4 (0.1%) in the original data remained unchanged after the partitioning. A stratified 5-fold partitioning method was adopted: the training dataset was uniformly divided into 5 mutually exclusive subsets. The deviation of the proportion of samples of each level in each subset from the original training set is ≤ ±2% (to avoid the absence of rare level samples in a certain subset).
[0111] Multiple training and validation cycles: Round 1 validation: with For the training set, For the validation set, a dynamically weighted random forest model is trained, and the overall accuracy, recall at each level, and macro-average F1 score are calculated. Validation rounds 2-5: The validation set is rotated sequentially (the validation set for round 2 is...). The training set is (The same applies to rounds 3-5), repeating the above training and evaluation process;
[0112] Calculate the arithmetic mean of each indicator (overall accuracy, recall of each level, and macro average F1 score) in the 5 rounds of validation results, and use it as the core evaluation indicator of the model's generalization ability. If the standard deviation of each indicator is ≤ ±1.5%, the model's generalization ability is considered stable. If the standard deviation of the recall of a rare level (such as level 4 events) is > ±5%, then after oversampling to supplement the samples of that level, the above stratified cross-validation steps are repeated until the standard deviation of the indicator meets the requirements.
[0113] like Figure 2 As shown, the distribution of event levels in the training and test sets is highly consistent (level 1 accounts for over 95% in both sets, and level 4 accounts for only 0.1%), proving that a stratified cross-validation data preprocessing method was used. Stratified sampling based on event level proportions avoids a decrease in model generalization ability due to data distribution shifts, providing a reliable data foundation for subsequent model performance evaluation. Furthermore, the samples show a distribution where level 1 events are absolutely dominant, and level 4 events are extremely rare, consistent with the actual highway scenario (major / serious events are easily recorded completely due to their significant impact, while minor events may not be reported or are incompletely recorded), indicating that the experimental data is representative of real-world business, and the model training results can be transferred to practical applications. The extremely small sample size of level 3 and 4 events (only 1.1% for level 3 and 0.1% for level 4 in the training set) provides a data-level explanation for the low F1 score for level 3 and the 0% recall for level 4, not a defect in the model itself, but rather due to insufficient learning of minority class samples (which can be optimized through oversampling).
[0114] Specifically, by dividing the dataset into layers according to event levels, performing multiple rounds of cross-validation, and verifying the stability of the metrics, the problems of distorted evaluation of the model's generalization ability and insufficient validation of minority class event samples were solved. This achieved a reliable evaluation of the model's true performance, ensuring that the model has stable judgment performance in different event scenarios and providing a performance credibility guarantee for the actual deployment of the model.
[0115] The specific implementation steps of grid search optimization (used to determine the optimal parameter combination) include:
[0116] A phased optimization strategy is adopted to avoid the coupling effect between parameters. Specifically, it is divided into: Phase 1: Optimize the random forest parameters (fix the dynamic weight parameters to the default values: α=1, β=0.6, γ=0.3); Phase 2: Optimize the dynamic weight parameters based on the optimal random forest parameters obtained in Phase 1.
[0117] Stage 1 (Random Forest Parameters) Grid: Number of trees K: [100, 200, 300, 500] (4 values); Maximum tree depth: [6, 8, 10, 12] (4 values); Minimum number of split samples per node: [10, 20, 30] (3 values); Minimum number of samples per leaf node: [5, 10, 15] (3 values); Feature subset size: [2] (fixed value, not involved in grid traversal); Total number of parameter combinations for Stage 1: 4×4×3×3=144 groups;
[0118] Phase 2 (Dynamic Weight Parameters) Grid: Basic coefficient α: [0.9, 1.0, 1.1] (3 values); Sensitivity coefficient β: [0.5, 0.6, 0.7, 0.8, 0.9] (5 values); Eigenvalue feedback coefficient γ: [0.2, 0.3, 0.4, 0.5] (4 values); Total number of Phase 2 parameter combinations: 3 × 5 × 4 = 60 groups;
[0119] For each parameter combination, stratified cross-validation was performed, with the highest macro-average F1 score as the primary evaluation criterion and the shortest model training time as the secondary evaluation criterion (to break score ties). Phase 1: Optimal parameter selection. From 144 random forest parameter combinations, the combination with the highest macro-average F1 score was selected (experiments verified that the optimal combination was K=200, maximum depth=8, minimum number of split samples per node=20, and minimum number of samples per leaf node=10). Phase 2: Optimal parameter selection. Based on the optimal random forest parameters from Phase 1, the combination with the highest macro-average F1 score was selected from 60 dynamic weight parameter combinations.
[0120] The dynamic weighted random forest model is retrained using all training data and the final optimal parameter combination. The model performance is then validated on an independent test set (which comprises 20% of the total dataset and has no overlap with the training set). If the macro-average F1 score on the test set is greater than or equal to 95% of the macro-average F1 score on the training set, then the parameter combination is determined as the final model parameters. Otherwise, the process returns to stage 1, expands the parameter search range, and re-optimizes the model.
[0121] Specifically, by optimizing the random forest parameters and dynamic weight parameters in stages, constructing a systematic parameter grid, and selecting the optimal combination with core evaluation indicators, the problems of unsystematic tuning of model parameters and inability of parameter combinations to adapt to the judgment needs were solved. This achieved precise matching of model parameters, enabling the model to maximize its performance in event level judgment under the synergy of feature weight mechanism and ensemble learning structure.
[0122] The dynamically weighted random forest model and the six-dimensional feature vector can be replaced by the following alternatives, and the alternatives must meet the preset constraints:
[0123] Model alternative (embedded dynamic weight mechanism):
[0124] When replacing it with a gradient boosting model: dynamic weights are embedded into the model through a weighted loss function, which is defined as follows: ,in For normalized dynamic weights, The classification loss for feature j is determined by the cross-entropy loss function; the optimal split point is selected based on the weighted Gini impurity to ensure that the dynamic weights do not affect the splitting process.
[0125] When replaced with a support vector machine model: dynamic weights are embedded into the model through feature scaling, and the scaling factor of feature j is the normalized dynamic weight. The scaled features are (Ensure that features with high dynamic weights account for a higher proportion in classification); the kernel function is selected as the radial basis function (RBF (short for Radial Basis Function, a commonly used mathematical function for handling nonlinear mapping problems of data)), the penalty parameter C is optimized through grid search (search range is [0.1, 1, 10, 100]), and other parameters remain consistent with the original model;
[0126] Feature alternatives (adding or replacing six-dimensional features):
[0127] Alternative constraints: New or replaced features must meet the correlation constraints, with a Pearson correlation coefficient (Pearson Correlation Coefficient, which is used to quantify the linear correlation between two continuous variables and plays a key role in feature selection) |r| ≥ 0.3 (based on historical event data statistics to ensure that the features are strongly correlated with the judgment target).
[0128] New feature example: Event duration The unit is minutes, and the calculation formula is: (120 represents the average response time for highway incidents; the result is normalized to the interval [0, 1]).
[0129] Weather Influence Coefficient Values are based on weather type: heavy rain or blizzard = 1.0, heavy rain or heavy snow = 0.8, cloudy = 0.6, sunny = 0.4 (reflecting the impact of weather on event risk);
[0130] Feature replacement rules: The total number of features after replacement should be maintained at 6-8 dimensions (to avoid the curse of dimensionality), and the new features should be tested for multicollinearity with the original features, with variance inflation factor (VIF) < 5 (to ensure that there is no serious information redundancy between features); when replacing, core risk factors (degree of safety impact, severity of event) should be retained first, and only spatiotemporal correlation factors or auxiliary factors should be replaced.
[0131] Specifically, by clarifying the dynamic weight embedding rules during model replacement and the correlation and collinearity constraints during feature replacement, the problem of the original model and feature system having limited adaptability and being unable to meet the needs of different regions or data scenarios is solved. This achieves flexible expansion of the technical solution, retaining the core advantages of dynamic weights while adjusting the model architecture or feature system according to actual application scenarios, thus improving the universality and adaptability of the solution.
[0132] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for assessing the event level of highways based on dynamically weighted random forests, characterized in that, Includes the following steps: S1. Obtain the original information of highway events, construct a six-dimensional feature vector including the degree of safety impact, the degree of traffic impact, the time sensitivity, the road section risk coefficient, the severity of the event, and the reliability of information, and standardize and normalize each feature to obtain the event feature matrix and the level label vector. S2. Based on the context information of the event, calculate the dynamic weights of each feature and normalize the dynamic weights to obtain the final weights of each feature. S3. Based on the bootstrap sampling method, multiple training subsets are generated from the training dataset. During the node splitting process of each decision tree, weighted Gini impurity is introduced as a splitting criterion. Candidate splitting features and splitting thresholds are traversed to select the optimal splitting point and construct multiple decision trees. The prediction results of all decision trees are integrated through a weighted voting mechanism to form a dynamic weighted random forest model. S4. The hierarchical cross-validation method is used to evaluate the generalization ability of the model. The random forest parameters and dynamic weight parameters are systematically tuned through staged grid search to determine the optimal parameter combination. S5. Input the six-dimensional feature vector of the highway event to be analyzed into the trained dynamic weighted random forest model. The model outputs the level result corresponding to the event, which includes level 1, level 2, level 3 and level 4.
2. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 1, characterized in that, The degree of security impact The specific construction and calculation steps include: The number of deaths d and the number of injuries i caused by the event are used as core factors, where d is a non-negative integer and i is a non-negative integer; Based on the principle of prioritizing life in event risk assessment, the weight of death is set at 10, the weight of injury at 2, and the maximum score is set at 10. Calculate the initial value for the degree of safety impact, with the initial value range being [0, 1]; If any of the following conditions are met, Forced adjustment to the maximum value of 1: The number of deaths d≥1; the number of injuries i>5.
3. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 1, characterized in that, The extent of traffic impact The specific construction and calculation steps include: The number of vehicles involved in the incident, v, and the number of lanes affected, l, are used as core factors, where v is a non-negative integer and l is a positive integer; Based on highway operation statistics, the maximum reference value for the number of vehicles involved in an accident, Vmax, is set to 4, and the maximum reference value for the lanes affected, Lmax, is set to 3. First, constrain the range of the core factors: if v>Vmax, then take v=Vmax; if l>Lmax, then take l=Lmax; calculate the degree of traffic impact, and map the result to the interval [0,1]. If the incident results in the complete closure of one-way highway, regardless of the above calculation results, the closure will be directly implemented. Revised to 1.
4. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 1, characterized in that, The calculation steps for the dynamic weights specifically include: Set initial weights for features Based on the risk priority ranking of highway incidents, the initial weights of the six-dimensional features are determined as follows: degree of safety impact. Seriousness of the incident Traffic impact level Time sensitivity Road section risk coefficient Information reliability ; Calculate the safety impact weight adjustment function Traffic impact weighting adjustment function Time sensitivity weight adjustment function Road segment risk weight adjustment function Event severity weight adjustment function Information reliability weight adjustment function ; Calculate the initial dynamic weights for each feature; normalize the initial dynamic weights to the [0, 1] interval to obtain the final weights for each feature used in model training. .
5. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 4, characterized in that, The calculation steps for the weighted Gini impurity Gw specifically include: Let S be the sample set corresponding to the current decision tree node, C = {1, 2, 3, 4} be the event level category set, and |S| be the total number of samples in the sample set S. For each six-dimensional feature j (j=1, 2, ..., 6), count the proportion of samples belonging to category c in the sample set S for feature j. ; Calculate the Gini impurity of feature j at the current node S; Call the final weights of each feature normalization ;Calculate the weighted Gini impurity of node S.
6. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 5, characterized in that, The selection steps for the optimal splitting feature j* and splitting threshold t* of the decision tree node specifically include: For each six-dimensional feature j, based on the value distribution of feature j in the sample set S, a quantile segmentation method is used to generate candidate splitting thresholds t: if feature j is a continuous value, the 25th, 50th, and 75th quantiles of the feature value are taken as candidate thresholds t; if feature j is a discrete value, all different discrete values of the feature are taken as candidate thresholds t; thus forming a set of candidate splitting pairs. ,in Represents the set of candidate thresholds for feature j; For each candidate split pair (j, t), the sample set S is divided into a left child node sample set. and right child node sample set Calculate the weighted Gini impurity of parent node S using the weighted Gini impurity method. left child node Weighted Gini impurity right child node Weighted Gini impurity ; Calculate the split gain; Iterate through all candidate split pairs and select the split pair (j∗, t∗) with the largest split gain ΔG as the optimal split feature and split threshold for the current node; if multiple split pairs have the same ΔG value, prioritize the initial feature weights. A larger split pair.
7. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 6, characterized in that, The specific settings for the random forest parameters include: Based on the scale of the highway event dataset and the principle of balancing model training efficiency and generalization ability, the initial range of parameters is set as follows: number of trees K: 100-500; maximum tree depth: 6-12; minimum number of split samples per node: 10-30; minimum number of samples per leaf node: 5-15; feature subset size:
2.
8. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 7, characterized in that, The specific implementation steps of stratified cross-validation include: The training dataset is stratified and sampled according to event level to ensure that the proportion of samples at levels 1, 2, 3, and 4 in the original data remains unchanged after the partitioning; a stratified 5-fold partitioning method is used: the training dataset is evenly divided into 5 mutually exclusive subsets. The deviation of the percentage of samples at each level within each subset from the original training set is ≤ ±2%; Multiple training and validation cycles: Round 1 validation: with For the training set, For the validation set, a dynamically weighted random forest model is trained, and the overall accuracy, recall at each level, and macro-average F1 score of the validation set are calculated. Validation rounds 2-5: The validation set is rotated sequentially, and the above training and evaluation process is repeated. Calculate the arithmetic mean of each indicator in the 5 rounds of validation results as the core evaluation indicator of the model's generalization ability; if the standard deviation of each indicator is ≤ ±1.5%, the model's generalization ability is considered stable; if the standard deviation of the recall rate of a certain rare level is > ±5%, then after oversampling to supplement the samples of that level, the above stratified cross-validation steps are repeated until the standard deviation of the indicator meets the requirements.
9. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 1, characterized in that, The specific implementation steps for grid search optimization include: A phased optimization strategy is adopted, specifically divided into: Phase 1: Optimize the random forest parameters; Phase 2: Optimize the dynamic weight parameters based on the optimal random forest parameters obtained in Phase 1. Stage 1 grid: Number of trees K: [100, 200, 300, 500]; Maximum tree depth: [6, 8, 10, 12]; Minimum number of split samples per node: [10, 20, 30]; Minimum number of samples per leaf node: [5, 10, 15]; Feature subset size: [2]; Total number of parameter combinations for Stage 1: 4×4×3×3=144 groups; Stage 2 grid: basic coefficient α: [0.9, 1.0, 1.1]; sensitivity coefficient β: [0.5, 0.6, 0.7, 0.8, 0.9]; eigenvalue feedback coefficient γ: [0.2, 0.3, 0.4, 0.5]; total number of stage 2 parameter combinations: 3 × 5 × 4 = 60 groups; For each parameter combination, hierarchical cross-validation was performed, with the highest macro-average F1 score as the primary evaluation criterion and the shortest model training time as the secondary evaluation criterion. Stage 1: Optimal parameter selection: Among 144 random forest parameter combinations, the combination with the highest macro-average F1 score was selected. Stage 2: Optimal parameter selection: Based on the optimal random forest parameters in Stage 1, among 60 dynamic weight parameter combinations, the combination with the highest macro-average F1 score was selected. Retrain the dynamic weighted random forest model using all training data and the final optimal parameter combination, and verify the model performance on an independent test set. If the macro-average F1 score on the test set is greater than or equal to 95% of the macro-average F1 score on the training set, then the parameter combination is determined as the final model parameters; otherwise, return to stage 1, expand the parameter search range, and re-optimize.
10. The method for determining the event level of a highway based on a dynamically weighted random forest according to claim 4, characterized in that, The dynamically weighted random forest model and the six-dimensional feature vector can be replaced by the following alternatives, and the alternatives must meet the preset constraints: Model alternatives: When replaced by a gradient boosting model: dynamic weights are embedded into the model through a weighted loss function; the optimal split point is selected based on weighted Gini impurity to ensure that the influence of dynamic weights on the splitting process remains unchanged; when replaced by a support vector machine model: dynamic weights are embedded into the model through feature scaling, and the scaling factor of feature j is the normalized dynamic weight. The kernel function is chosen as a radial basis function, and the penalty parameter C is optimized through grid search. Feature Alternatives: Alternative constraints: Newly added or replaced features must satisfy the correlation constraint, with a Pearson correlation coefficient |r| ≥ 0.3 with the event level; New feature example: Event duration Weather Influence Coefficient Feature replacement rules: The total number of features after replacement should be maintained at 6-8 dimensions, and the new features should be tested for multicollinearity with the original features, with a variance inflation factor (VIF) < 5; When replacing, core risk factors should be retained first, and only spatiotemporal correlation factors or auxiliary factors should be replaced.