Non-stationary extreme value and bayesian deep learning accident risk prediction method and system

By employing non-stationary extrema and Bayesian deep learning, this approach addresses the issues of fixed parameter correlation functions, insufficient covariate capacity, and lack of time dependence in existing models. It enables real-time prediction and uncertainty quantification of traffic conflict risks, supporting the deployment of proactive traffic safety strategies.

CN122264550APending Publication Date: 2026-06-23HARBIN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610541601.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-23
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing non-stationary GEV models suffer from problems in traffic safety analysis, such as fixed parameter correlation functions, insufficient covariate capacity, lack of time dependence, and inability to quantify uncertainty. These issues result in insufficient model adaptability and low prediction accuracy, failing to meet the needs of intelligent connected vehicles and multi-source traffic data.

Method used

This paper employs a non-stationary extremum and Bayesian deep learning approach. By combining a Bayesian deep learning model with a random generator and a loss function, it extracts the temporal dependency features of traffic states, outputs the generalized extremum distribution parameters, and evaluates the model performance through probability integral transformation, thereby achieving end-to-end parameter estimation and risk prediction.

Benefits of technology

It enables real-time prediction of traffic conflict risks, captures complex nonlinear relationships and time dependencies, provides data-driven uncertainty quantification, and supports the deployment of proactive traffic safety strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122264550A_ABST
    Figure CN122264550A_ABST
Patent Text Reader

Abstract

The present application relates to a non-stationary extreme value and Bayesian deep learning accident risk prediction method and system, belonging to the technical field of traffic engineering. The method comprises data acquisition, data processing after model construction, mapping transformation of original parameters and calculation of collision risk as a quantitative safety index. The system comprises an input module, a deep learning module, a GEV parameter mapping module and an accident risk prediction module. The present application combines deep learning with non-stationary extreme value modeling and proposes a Bayesian deep learning driven non-stationary generalized extreme value distribution (GEV) parameterization method, realizing real-time accident risk prediction based on traffic conflicts. The method can learn the complex nonlinear relationship between the covariates and the distribution parameters, provide a data-driven parameterization method, accommodate more covariates and consider the time dependence of the covariates.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an accident risk prediction method and system, specifically to an accident risk prediction method and system based on non-stationary extrema and Bayesian deep learning, belonging to the field of traffic engineering technology. Background Technology

[0002] Road traffic safety is a major issue affecting public safety and global sustainable development. In recent years, my country's road traffic safety situation has been generally stable, with a continuous decline in the number of fatalities and major road traffic accidents. However, the pressure of preventing and controlling road traffic safety risks remains severe. Road traffic safety remains one of the major issues affecting global sustainable development.

[0003] The development of traffic conflict technology has broken through the limitations of traditional traffic safety analysis methods that rely on accident data, shifting safety management from passive response to proactive prevention. Among the many research methods based on traffic conflict technology, extreme value theory has attracted researchers' attention due to its ability to model extreme conflicts and extrapolate accident risks. Extreme value theory modeling is also constantly advancing in research, from initial safety assessments based on stationary models to real-time prediction of safety levels based on non-stationary models in recent years, continuously highlighting its advantages in traffic safety research. However, current traffic safety analysis and risk prediction technologies based on non-stationary generalized extreme value distributions (GEVs) still have many technical shortcomings that urgently need to be addressed: First, in the construction of existing non-stationary GEV models, the correlation functions between model parameters and covariates are mostly in a pre-defined fixed form. Although this facilitates model inference, it severely limits the model's ability to capture nonlinear correlations and high-order dependencies between covariates and distribution parameters, making it difficult to adapt to complex and highly time-varying traffic dynamics, resulting in insufficient adaptability of non-stationary modeling. Second, existing non-stationary GEV models mostly rely on Bayesian inference for parameter estimation. However, in practical applications, prior knowledge of covariate parameters is generally lacking. Modeling can only employ weak prior distributions such as diffuse normal distribution and Gamma distribution, directly impacting the accuracy of parameter estimation and the model's prediction precision. Third, existing non-stationary GEV models can only include a very limited number of covariates, typically supporting only 1-4 covariates. In the era of big data, with the rapid development of intelligent connected vehicles and vehicle-road cooperative technologies and the availability of high-dimensional, multi-source traffic dynamic data, these models cannot fully utilize multi-dimensional traffic information to depict complex traffic operation states, making it difficult to meet the needs of refined risk prediction. Fourth, existing non-stationary GEV models only consider covariates for the current or a single historical period, completely ignoring the time dependence of traffic dynamic parameters over continuous time periods. Traffic flow itself has strong temporal correlation characteristics; ignoring this characteristic leads to the model's inability to fully capture the evolution of traffic conflicts, directly reducing the reliability of risk prediction. Fifth, most existing models only output point estimates of accident risks, failing to quantify the inherent uncertainty of the prediction results and provide traffic management decision-makers with auxiliary decision-making information such as confidence intervals for risk predictions, making it difficult to support the implementation of proactive traffic safety management strategies.

[0004] To address some of the aforementioned shortcomings, some research in the field has attempted to combine machine learning with mathematical statistics methods for traffic safety analysis, such as combining outlier detection algorithms with extreme value theory modeling. However, such research still has significant limitations: it often employs a sequential, step-by-step modeling approach, failing to achieve end-to-end coupling between deep feature extraction and GEV distribution parameter estimation; the research results are mostly limited to post-event traffic safety level assessments, unable to achieve real-time prediction of accident risks; and it has not yet overcome the inherent limitations of existing non-stationary GEV modeling, such as fixed correlation functions, insufficient covariate capacity, lack of time dependence, and inability to quantify uncertainty. Summary of the Invention

[0005] To overcome the aforementioned shortcomings of existing technologies, this invention proposes a method and system for accident risk prediction based on non-stationary extrema and Bayesian deep learning. By combining deep learning with non-stationary extrema modeling, real-time accident risk prediction based on traffic conflicts can be achieved.

[0006] The technical solution adopted in this invention is: A method for predicting accident risk using non-stationary extrema and Bayesian deep learning includes the following steps: S1: Obtain historical traffic operation data, extract traffic state features corresponding to each time unit, and extract block extreme values ​​within each time unit based on traffic conflict indicators to construct extreme value response variables corresponding to each time unit, forming a sample dataset.

[0007] S2: According to the preset sliding window length, the traffic state features of multiple consecutive historical time units are organized into time-series input samples, and the extreme response variable of the corresponding next time unit is used as the prediction target to construct supervised learning samples.

[0008] S3: Input the time-series input samples and the random perturbation information generated by the random generator into the Bayesian deep learning model, extract the time-series dependency features of historical traffic states, and output the original parameters of the generalized extreme value distribution corresponding to the target time unit. The generalized extreme value distribution parameters include at least location parameters, scale parameters, and shape parameters. Parameter range constraints and / or distribution validity constraints are applied to the original parameters of the generalized extreme value distribution to ensure that the generalized extreme value distribution parameters meet the preset feasible region requirements. The Bayesian deep learning model is iteratively trained based on the supervised learning samples and a specific loss function to establish the mapping relationship between historical traffic states and the generalized extreme value distribution parameters of the target time unit.

[0009] S4: Based on the generalized extreme value distribution parameters output by the trained Bayesian deep learning model, construct the non-stationary generalized extreme value distribution corresponding to the target time unit, and calculate the exceedance probability of the target index exceeding the preset risk threshold according to the non-stationary generalized extreme value distribution, and use the exceedance probability as the risk prediction result of the target time unit.

[0010] Furthermore, the loss function described in S3 is a minimized composite loss function, which is the sum of the negative log-likelihood function of the generalized extreme value distribution and the violation penalty term, expressed as:

[0011] In the formula, The negative log-likelihood function is expressed as:

[0012] in, , The maximum value observed in the block. , , These are the position parameter, scale parameter, and shape parameter at time t, respectively; To violate the preset penalty, the expression is:

[0013] in, To prevent A minimal constant approaching 0 is the penalty strength coefficient, and ReLU is the linear rectified activation function.

[0014] Furthermore, in S3, applying parameter range constraints and / or distribution validity constraints to the original parameters of the generalized extreme value distribution specifically includes position parameter transformation, scale parameter transformation, and shape parameter transformation. The position parameter transformation maps the original position parameters to the minimum and maximum values ​​of the extreme values ​​in the training set interval. The scale parameter transformation converts the original scale parameters into positive values. The shape parameter transformation maps the original shape parameters to the interval obtained by expanding the 95% confidence interval of the shape parameters of the stationary generalized extreme value distribution fitted to the training set.

[0015] Furthermore, the expression for the position parameter transformation is:

[0016] In the formula, These are the observations from the training set. The global minimum and maximum values, It is the minimum constant. These are the original location parameters output by the Bayesian deep learning model.

[0017] Furthermore, the scale parameter transformation expression is as follows:

[0018] In the formula, It is the minimum constant. This is the softplus activation function. The original scale parameters output by the Bayesian deep learning model.

[0019] Furthermore, the shape parameter transformation expression is as follows:

[0020] In the formula, This represents the value of the left boundary of the 95% confidence interval for the shape parameters of the stationary GEV distribution obtained by fitting the training set, rounded down. For positive numbers less than or equal to 0.5 , The original shape parameters output by the Bayesian deep learning model.

[0021] Furthermore, the formula for calculating the exceedance probability exceeding the preset risk threshold mentioned in S4 is as follows:

[0022] In the formula, As an extreme indicator of traffic conflict / collision, The collision threshold, The probability of a collision / conflict. S3 is the predicted nonstationary generalized extreme value distribution function, and exp(.) is the natural exponential function e x , It is the boundary that distinguishes between accidents and conflicts.

[0023] Furthermore, the method also includes model performance evaluation, which specifically involves evaluating the predicted non-stationary generalized extreme value distribution obtained in S3 using probability integral transformation. First, the probability integral transformation value of the observed block maximum value under the predicted non-stationary generalized extreme value distribution is calculated. Then, the deviation of the probability integral transformation value distribution from the standard uniform distribution is examined through at least one diagnostic plot among the probability integral transformation histogram, quantile-quantile plot, and calibration curve. Finally, the probability integral transformation distance is calculated as a quantitative indicator of the model calibration quality.

[0024] Furthermore, the formula for calculating the probability integral transform distance is as follows:

[0025] In the formula, n is the number of observed maximum values ​​in the blocks. These are the sorted probability integral transform values. , , It represents the ideal uniform quantile.

[0026] A non-stationary extremum and Bayesian deep learning-based accident risk prediction system, operating using the aforementioned non-stationary extremum and Bayesian deep learning-based accident risk prediction method, includes: The input module is used to acquire time-series data of dynamic traffic parameters within a historical time period and to generate or introduce random noise data that characterizes unobserved heterogeneity. The Bayesian deep learning module is used to build and train a Bayesian deep learning model. It takes the time series data and random noise data as input, extracts the time-series dependency features of dynamic traffic parameters, and outputs the original parameters of the non-stationary generalized extreme value distribution. The GEV parameter mapping module is used to perform mapping constraint transformation on the original parameters to obtain non-stationary generalized extreme value distribution parameters that meet the preset feasible region requirements, and to determine the non-stationary generalized extreme value distribution corresponding to the prediction period based on the non-stationary generalized extreme value distribution parameters. The accident risk prediction module is used to calculate the exceedance probability corresponding to the target risk threshold based on the non-stationary generalized extreme value distribution parameters, and output the exceedance probability as the real-time accident risk prediction value.

[0027] The beneficial effects of this invention are: 1. This invention achieves end-to-end coupling between statistical distribution parameters and deep feature extractors by directly integrating the GEV likelihood function into the loss function. This parameterization mechanism enables the neural network to automatically learn the complex mapping relationship between traffic flow states and extreme value distribution parameters, thereby accurately capturing the time-varying patterns of traffic conflict risks in non-stationary environments.

[0028] 2. This invention fully leverages the learning capabilities of deep learning for nonlinear relationships and the risk extrapolation capabilities of extreme value theory based on traffic conflicts. With the development of vehicle-road cooperative technology, this invention can effectively address a wide range of multi-source traffic dynamic parameters, achieve effective accident risk prediction, and support the deployment of proactive traffic safety strategies.

[0029] 3. In order to capture the unobserved heterogeneity in the original data, this invention embeds a random generator in the input layer and uses a Bayesian deep learning scheme to achieve standardized and data-driven uncertainty quantification, providing decision-makers with richer accident risk prediction information. Attached Figure Description

[0030] Figure 1 This is a flowchart illustrating one implementation of the accident risk prediction method based on non-stationary extrema and Bayesian deep learning of the present invention.

[0031] Figure 2 This is a schematic diagram of MTTC calculation; Figure 3 This is a schematic diagram of the posterior distribution of the GEV parameters of this invention; Figure 4 This is a schematic diagram of the PIT distribution diagnosis of the present invention; Figure 5 This is a schematic diagram illustrating the prediction of accident risk fluctuations according to the present invention. Detailed Implementation

[0032] Specific implementation method one: as follows Figure 1 As shown in this embodiment, the accident risk prediction method based on non-stationary extrema and Bayesian deep learning is a parameterization method for non-stationary generalized extreme value distribution (GEV) driven by Bayesian deep learning. It combines deep learning with unstable extreme value modeling to achieve real-time accident risk prediction based on traffic conflicts. This method can learn the complex nonlinear relationship between covariates and distribution parameters, providing a data-driven parameterization method that accommodates more covariates and considers the time dependence of covariates. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning includes the following steps: S1: Historical traffic operation data acquisition and extreme value variable construction. Traffic operation data within a historical time period is acquired, and the traffic operation data is divided according to a preset time unit. Traffic state features corresponding to each time unit are extracted. Based on traffic conflict indicators, block extreme values ​​are extracted within each time unit to construct extreme value response variables corresponding to each time unit, thereby forming a sample dataset. The traffic state features include at least one of the following: traffic flow, number of large vehicles, proportion of large vehicles, number of queuing vehicles, queue length, queue ratio, number of vehicles arriving during green light, platoon ratio, shock wave area, shock wave speed, average vehicle spacing, average static spacing of queuing vehicles, and average dynamic spacing of non-queuing vehicles.

[0033] S2: Construction of time-series input samples. Based on the sample dataset, the traffic state features corresponding to each time unit are truncated according to a preset sliding window length. The traffic state features of multiple consecutive historical time units are organized into time-series input samples in sequence. The extreme value response variable corresponding to the next time unit adjacent to each time-series input sample is used as the prediction target to construct supervised learning samples. The sliding window moves gradually along the time axis to generate multiple supervised learning samples.

[0034] S3: Bayesian deep learning modeling and training. In road safety analysis, unobserved heterogeneity is an inherent challenge, stemming from factors that influence the occurrence and severity of traffic conflict events but are not measured or fully observed. Preferably, random variables are generated by a random generator based on a normal distribution. This random generator simulates random noise data representing unobserved heterogeneous factors in the original data. The random noise data is a sequence of random numbers following a normal distribution, and it is input along with a time series of dynamic traffic parameters.

[0035] Traditional deep learning models often provide deterministic point estimates, ignoring potential uncertainties and easily leading to model overconfidence. To overcome this shortcoming, this invention applies Bayesian deep learning to capture prediction uncertainty, thereby providing more comprehensive prediction information.

[0036] The Bayesian deep learning model is trained using a loss function that minimizes a composite loss function, which integrates the negative log-likelihood function of GEV and a violation penalty term. This design ensures that the estimated GEV parameters are both statistically valid and numerically stable during optimization. Given the observed maximum value of a block... and the corresponding predicted GEV parameters The negative log-likelihood function of GEV is as follows: (1) In equation (1), It is a negative log-likelihood function. , The likelihood term is modeled and learned by Bayesian deep learning to drive the modeling of non-stationary GEV structures.

[0037] To ensure that the support conditions of the GEV distribution are strictly met during deep learning optimization. An additional penalty term (i.e., violation penalty term) is introduced. A violation is determined to have occurred when the supporting condition approaches 0 or is less than 0. To suppress such occurrences, the penalty mechanism is as follows: (2) In equation (2), To violate the preset penalty term, ReLU is a linear rectified activation function. To prevent The smallest constant approaching 0 is usually taken as a very small positive number, for example... To ensure that the support condition does not approach 0 excessively, Adjust the severity of the penalty item to adjust the penalty severity coefficient. The larger the size, the stricter the constraints. The loss function fails when the likelihood value is 0. This constraint improves training stability by preventing undefined states in the likelihood value.

[0038] The final loss function is the sum of two parts: (3) By directly integrating the GEV likelihood function into the loss function, end-to-end coupling between statistical distribution parameters and the deep feature extractor is achieved. This parameterization mechanism enables the neural network to automatically learn the complex mapping relationship between traffic flow states and extreme value distribution parameters, thereby accurately capturing the time-varying patterns of traffic conflict risk in non-stationary environments.

[0039] The time-series input samples and random perturbation information generated by the random generator are jointly input into the Bayesian deep learning model to extract the time-series dependent features of historical traffic states and output the generalized extreme value distribution parameters corresponding to the target time unit. The generalized extreme value distribution parameters include at least location parameters, scale parameters, and shape parameters. Among them, parameter range constraints and / or distribution validity constraints are applied to the generalized extreme value distribution parameters to ensure that the generalized extreme value distribution parameters meet the preset feasible region requirements.

[0040] The original output parameters of the non-stationary generalized extremum distribution obtained by a conventional deep learning model Since the mathematical constraints of the GEV parameters cannot be guaranteed to be fully satisfied, transformations are necessary to ensure the validity of the distribution. To ensure numerical stability during the optimization process and prevent undefined states in the likelihood function, three customized transformations are employed for the position, scale, and shape parameters: Position parameter transformation, position parameters Mapping to interval

[0041] This may result in an invalid likelihood function; therefore, a position parameter transformation is used to map the position parameters to the interval. .

[0042] The expression for the position parameter transformation is: (4) In equation (4), The values ​​are from the training set observations. The global minimum and maximum values, To ensure a minimum value ,For example =10 -6 =10 -3 .

[0043] These are the original location parameters output by the Bayesian deep learning model.

[0044] Scale parameter transformation, scale parameter Performing a softplus conversion ensures strict positive values.

[0045] In GEV parameters, scale parameter It must be strictly greater than 0. For stability, the model uses the softplus function for transformation, calculated as follows: (5) In equation (5), To prevent local minima by using extremely small constants, thus avoiding instability of the likelihood function, for example... =10 -6 =10 -4 . The original scale parameters output by the Bayesian deep learning model.

[0046] Shape parameter transformation, shape parameter Mapping to interval .

[0047] The shape parameter significantly affects the tail shape of the GEV distribution. To obtain a reasonable mapping interval, we first fit the stable GEV values ​​to the observations in the training set, extracting the 95% confidence interval of the shape parameter in this stable distribution. The left boundary of this interval is then rounded down to determine the value. Upper limit Drawing on previous similar studies, an empirical value is set. In past studies, the shape parameter of GEV was mostly less than 0, with only a few studies showing positive values. This is determined by the distribution characteristics of traffic conflict extrema. Therefore... It is set to a small positive number to cover the occurrence of various distribution scenarios, usually a positive number less than or equal to 0.5. Finally, the shape parameter mapping is as follows: (6) In equation (6), The original shape parameters output by the Bayesian deep learning model.

[0048] Ultimately, the three parameters achieve the following mapping: (7) The method further includes model performance evaluation, which specifically involves evaluating the predicted non-stationary generalized extreme value distribution obtained in S3 using probability integral transform. First, the probability integral transform value of the observed block maximum value under the predicted non-stationary generalized extreme value distribution is calculated. Then, at least one diagnostic plot among the probability integral transform histogram, quantile-quantile plot, and calibration curve is used to examine the deviation of the probability integral transform value distribution from the standard uniform distribution. Finally, the probability integral transform distance is calculated as a quantitative indicator of the model calibration quality.

[0049] The predicted GEV distribution is evaluated using the Probability Integral Transform (PIT). Given the observed maximum value of the block... and the corresponding predicted GEV cumulative distribution function , The PIT value is calculated as follows: (7) Under reasonable model predictions, the resulting PIT values ​​should theoretically follow a standard uniform distribution. Therefore, the deviation of the PIT value distribution from the standard uniform distribution can reflect the accuracy of the framework's prediction of the GEV distribution.

[0050] Deviation is examined using three diagnostic plots for the PIT distribution: the PIT histogram, which visually examines deviations from the uniform distribution; quantile-quantile plots, which provide a sensitive assessment of model calibration by comparing empirical PIT quantiles with theoretical uniform quantiles; and calibration curves, which evaluate the consistency between nominal and empirical quantile coverage, thereby highlighting systematic overestimations or underestimations across the entire probability range.

[0051] The probability integral transform distance (PIT distance) is a quantitative method for measuring differences. Let... This represents the sorted PIT values. To represent the ideal uniform quantile, we usually take... To avoid boundary deviation, the PIT distance is defined as follows: (8) In equation (8), n is the number of observed maximum values ​​of blocks.

[0052] This metric provides a concise summary of calibration quality and enables quantitative comparisons between models. A smaller PIT distance indicates better agreement between the estimated distribution and the true conditional distribution of traffic conflict extrema.

[0053] S4: Construction of Non-Stationary GEV Distribution and Risk Prediction. Based on the generalized extreme value distribution parameters output by the trained Bayesian deep learning model, a non-stationary generalized extreme value distribution corresponding to the target time unit is constructed, the exceedance probability exceeding the preset risk threshold is calculated, and the risk prediction result is output.

[0054] Based on the predicted GEV distribution, collision risk is further calculated as a quantitative safety indicator. Collision risk quantifies the probability that an extreme value exceeds a specific collision threshold, and is calculated as follows: (9) In equation (9), As an extreme indicator of traffic conflict / collision, The collision threshold, The probability of a collision / conflict. The predicted GEV distribution, and exp(.) is the natural exponential function e x , It is the boundary that distinguishes between accidents and conflicts.

[0055] A non-stationary extremum and Bayesian deep learning-based accident risk prediction system, operating using the aforementioned non-stationary extremum and Bayesian deep learning-based accident risk prediction method, includes: The input module executes the input processing operations of S1 and S2. It is used to acquire time-series data of dynamic traffic parameters within a historical time period and generate or introduce random noise data representing unobserved heterogeneity. Preferably, a random generator is added to the input module to simulate unobserved factors in the original data. This random generator is constructed based on a normal distribution and inputs both the time-series data of dynamic traffic parameters and the random noise data representing unobserved heterogeneity into the next module. To capture the unobserved heterogeneity in the original data, this invention embeds a random generator in the input layer and employs a Bayesian deep learning scheme to achieve standardized and data-driven uncertainty quantification, providing decision-makers with richer accident risk prediction information.

[0056] The Bayesian deep learning module is used for building and training Bayesian deep learning models. It processes the data acquired by the input module using the trained Bayesian deep learning model, taking the time-series data and random noise data as input, extracting the temporal dependency features of dynamic traffic parameters, and outputting the original parameters of the non-stationary generalized extreme value distribution. The deep learning module also enables deep feature mining of historical dynamic traffic parameter time series, thereby obtaining a high-dimensional potential representation reflecting real-time collision risk.

[0057] The GEV parameter mapping module applies parameter range constraints and / or distribution validity constraints to the original parameters output by the Bayesian deep learning module, generating effective non-stationary generalized extreme value distribution parameters. This results in non-stationary generalized extreme value distribution parameters that satisfy a preset feasible region requirement. Based on these effective non-stationary generalized extreme value distribution parameters, the module determines the non-stationary generalized extreme value distribution corresponding to the prediction period. The parameters of the non-stationary GEV are generated by deep learning. This framework no longer relies on a fixed correlation function form and can utilize a flexible deep learning framework to learn how the time series of traffic states affects the changes in the GEV distribution. It is worth noting that the original output of the deep learning module... Since the mathematical constraints of the GEV parameters cannot be guaranteed to be fully satisfied, a transformation must be performed to ensure the validity of the distribution. Through integration with the deep learning module, the model building, training, feature mining, and GEV parameter output operations described in S3 are jointly performed.

[0058] The accident risk prediction module is used to calculate the exceedance probability corresponding to the target risk threshold based on the non-stationary generalized extreme value distribution parameters obtained by the GEV parameter mapping module, output the exceedance probability as the real-time accident risk prediction value, and perform distribution assessment and collision risk calculation operations.

[0059] Example This invention is applied to a signalized intersection for real-time prediction and analysis of traffic accident risks.

[0060] Implementation Step 1: Data Processing The data was sourced from a signalized intersection in a certain city. The acquisition device was a LiDAR scanner. The scanner was positioned at the southwest corner of the intersection, and the three through lanes (lanes 2-4) at the west entrance, which offered the best coverage, were selected as the research focus. Data was collected during the daytime (07:00–17:00) for 7 days, resulting in approximately 70 hours of data. This signalized intersection has two signal timing schemes: 140 seconds during off-peak hours (09:32 to 16:05) and 190 seconds during peak hours. Vehicle trajectories were extracted from the LiDAR point cloud data using the Robosense SDK, and various traffic dynamic parameters at the signal cycle level were further extracted. Traffic parameter information and statistical data for each lane are shown in Table 1.

[0061] Table 1 Overview of Traffic Dynamic Parameter Data

[0062] Considering that rear-end collisions are the primary type of conflict occurring on approach lanes, the Median Traffic Conflict Rate (MTTC) is selected as the traffic conflict indicator. The MTTC calculation method is as follows: Figure 2 As shown.

[0063]

[0064] After calculation, the most severe conflict in each lane during each signal cycle is extracted as the maximum value of the interval. Based on the relevant knowledge of extreme value theory, this maximum value theoretically conforms to a generalized extreme value distribution, and the signal cycle naturally acts as an interval separator in this application scenario. Finally, the statistical results of the extreme values ​​of each interval for different days and different lanes are shown in Table 2.

[0065] Table 2. Statistics on extreme values ​​in the interval

[0066] Ultimately, for each signal cycle, the input of this invention consists of 13 dynamic traffic parameters listed in Table 1, 2 signal cycle-related parameters, the maximum value of the cycle-level interval, and a random generator, totaling 17 input variables. This feature set is significantly larger than that of traditional non-stationary modeling methods, thus capturing richer traffic information. The sliding window length (defined as the number of consecutive signal cycles used for prediction) is fixed at 5 cycles. In subsequent modeling, two days of observation data are randomly selected as the validation set and test set, respectively, and the data from the remaining five days are used for model training. This data partitioning strategy helps to observe the evolution of predicted accident risk within a given day, which is more in line with the intended application scenario of this invention.

[0067] Implementation Step 2: Model Deployment The commonly used Long Short-Term Memory (LSTM) neural network model was selected as the deep learning framework, which can overcome the gradient vanishing and gradient exploding problems of traditional recurrent neural networks. The Bayesian neural network was implemented using Monte Carlo dropout. The deep learning framework consists of a two-layer LSTM architecture and two fully connected layers; the settings of some key parameters are shown in Table 3.

[0068] Table 3 Overview of Hyperparameter Tuning

[0069] The GEV parameter mapping range is set by data-driven and experience-dependent methods. For the positional parameters, the final range is determined based on the maximum and minimum values ​​of the interval extremes in the training set. 3.446, 0.022). When determining the mapping range of the shape parameters, the empirical distribution of the extreme values ​​of the training set interval is first determined, and the 95% confidence interval of the GEV shape parameters is calculated as [ 0.655, [0.604], therefore -0.7 is used as the lower bound for mapping. Simultaneously, based on modeling experience from related studies, a small positive value of 0.1 is used as the upper bound for mapping, resulting in a final mapping interval of [...]. 0.7, 0.1].

[0070] Implementation Step 3: Model Performance Analysis The three parameters and their confidence intervals of the final model output are as follows: Figure 3 As shown, the parameters output by the model consistently exhibit a clear fluctuation trend throughout the day, showing a distinct difference between peak and off-peak periods, which is in line with expectations. Meanwhile, Figure 4 The three diagnostic plots show that the predicted distribution fits well, and the quantitative index PIT distance of 0.013 also supports this conclusion.

[0071] Implementation Step 4: Accident Risk Prediction and Analysis Furthermore, the temporal characteristics of the accident risks predicted by this invention are examined. Figure 5 The temporal evolution of accident risk is illustrated, represented by its posterior mean and 95% confidence interval in the figure. The results show that accident risk exhibits significant temporal heterogeneity, with marked risk spikes occurring at specific times of the day. These high-risk periods closely coincide with peak hours, indicating that this invention effectively captures dynamic safety conditions related to surges in traffic demand and interactive complexity. In contrast, off-peak hours are characterized by consistently lower risk levels, reflecting relatively stable traffic conditions and fewer serious conflicts.

[0072] This invention effectively addresses the time dependence of high-dimensional traffic dynamic parameters, enabling in-depth analysis of the microscopic traffic conflict evolution logic at signalized intersections. By establishing a data-driven and experience-dependent GEV parameter mapping method, the robustness of the system under extreme data fluctuations is significantly improved. Combined with a Bayesian inference mechanism, this invention not only produces intuitive collision risk probabilities but also outputs confidence intervals for risk prediction. Experiments demonstrate that this invention can accurately identify risk surges during peak hours, providing a directly deployable real-time safety evaluation index for Intelligent Transportation Systems (ITS). It fully leverages the learning capabilities of deep learning for nonlinear relationships and the risk extrapolation capabilities of extreme value theory based on traffic conflicts. With the development of vehicle-road cooperative technology, this invention can effectively address a wide range of multi-source traffic dynamic parameters, achieving effective accident risk prediction and supporting the deployment of proactive traffic safety strategies.

[0073] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent substitutions, and improvements made to the above embodiments without departing from the scope of the present invention, based on the technical essence of the present invention and within the spirit and principles of the present invention, shall still fall within the protection scope of the present invention.

Claims

1. A method for predicting accident risk using non-stationary extrema and Bayesian deep learning, characterized in that... Includes the following steps: S1: Historical traffic operation data acquisition and extreme value variable construction. Historical traffic operation data is acquired, traffic state features corresponding to each time unit are extracted, and block extreme values ​​are extracted within each time unit based on traffic conflict indicators to form a sample dataset. S2: Construction of time-series input samples: According to the preset sliding window length, the traffic state features of multiple consecutive historical time units are organized into time-series input samples, and the extreme response variable of the next time unit is used as the prediction target to construct supervised learning samples; S3: Bayesian deep learning modeling and training, the time-series input samples and random perturbation information generated by the random generator are input into the Bayesian deep learning model, the time-series dependency features of historical traffic states are extracted, the original parameters of the generalized extreme value distribution corresponding to the target time unit are output, parameter range constraints and / or distribution validity constraints are applied to the original parameters of the generalized extreme value distribution, and the Bayesian deep learning model is iteratively trained based on the supervised learning samples and a specific loss function; S4: Construction of Non-Stationary GEV Distribution and Risk Prediction. Based on the generalized extreme value distribution parameters output by the trained Bayesian deep learning model, a non-stationary generalized extreme value distribution corresponding to the target time unit is constructed, the exceedance probability exceeding the preset risk threshold is calculated, and the risk prediction result is output.

2. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 1, characterized in that... The loss function described in S3 is a minimized composite loss function, which is the sum of the negative log-likelihood function of the generalized extreme value distribution and the violation penalty term, expressed as: In the formula, The negative log-likelihood function is expressed as: in, , The maximum value observed in the block. , , These are the position parameter, scale parameter, and shape parameter at time t, respectively; To violate the preset penalty, the expression is: in, To prevent A minimal constant approaching 0 is the penalty strength coefficient, and ReLU is the linear rectified activation function.

3. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 2, characterized in that... S3 applies parameter range constraints and / or distribution validity constraints to the original parameters of the generalized extreme value distribution, specifically including position parameter transformation, scale parameter transformation, and shape parameter transformation. The position parameter transformation maps the original position parameters to the minimum and maximum values ​​of the extreme values ​​in the training set interval. The scale parameter transformation converts the original scale parameters into positive values. The shape parameter transformation maps the original shape parameters to the interval obtained by expanding the 95% confidence interval of the shape parameters of the stationary generalized extreme value distribution fitted to the training set.

4. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 3, characterized in that... The expression for the position parameter transformation is: In the formula, These are the observations from the training set. The global minimum and maximum values, It is the minimum constant. These are the original location parameters output by the Bayesian deep learning model.

5. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 4, characterized in that... The expression for the scale parameter transformation is: In the formula, It is the minimum constant. This is the softplus activation function. The original scale parameters output by the Bayesian deep learning model.

6. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 5, characterized in that... The shape parameter transformation expression is: In the formula, This represents the value of the left boundary of the 95% confidence interval for the shape parameters of the stationary GEV distribution obtained by fitting the training set, rounded down. For positive numbers less than or equal to 0.5 , The original shape parameters output by the Bayesian deep learning model.

7. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 6, characterized in that... The formula for calculating the exceedance probability of the preset risk threshold is as follows: In the formula, As an extreme indicator of traffic conflict / collision, The collision threshold, The probability of a collision / conflict. S3 is the predicted nonstationary generalized extreme value distribution function, and exp(.) is the natural exponential function e x , It is the boundary that distinguishes between accidents and conflicts.

8. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 7, characterized in that... It also includes model performance evaluation, which specifically involves evaluating the predicted non-stationary generalized extreme value distribution obtained in S3 using probability integral transformation. First, the probability integral transformation value of the observed block maximum value under the predicted non-stationary generalized extreme value distribution is calculated. Then, the deviation of the probability integral transformation value distribution from the standard uniform distribution is examined by at least one of the following diagnostic plots: probability integral transformation histogram, quantile-quantile plot, and calibration curve. Finally, the probability integral transformation distance is calculated as a quantitative indicator of model calibration quality.

9. The accident risk prediction method based on non-stationary extrema and Bayesian deep learning according to claim 8, characterized in that... The formula for calculating the distance of the probability integral transform is: In the formula, n is the number of observed maximum values ​​in the blocks. These are the sorted probability integral transform values. , , It represents the ideal uniform quantile.

10. An accident risk prediction system using non-stationary extrema and Bayesian deep learning, characterized in that... The accident risk prediction method based on non-stationary extrema and Bayesian deep learning as described in any one of claims 1 to 9 is operated, comprising: The input module is used to acquire time-series data of dynamic traffic parameters within a historical time period and to generate or introduce random noise data that characterizes unobserved heterogeneity. The Bayesian deep learning module is used to build and train a Bayesian deep learning model. It takes the time series data and random noise data as input, extracts the time-series dependency features of dynamic traffic parameters, and outputs the original parameters of the non-stationary generalized extreme value distribution. The GEV parameter mapping module is used to apply parameter range constraints and / or distribution validity constraints to the original parameters to obtain non-stationary generalized extreme value distribution parameters that meet the preset feasible region requirements, and to determine the non-stationary generalized extreme value distribution corresponding to the prediction period based on the non-stationary generalized extreme value distribution parameters. The accident risk prediction module is used to calculate the exceedance probability corresponding to the target risk threshold based on the non-stationary generalized extreme value distribution parameters, and output the exceedance probability as the real-time accident risk prediction value.