Abstract
Traditional traffic safety analysis has long suffered from a reliance on retroactive, sparse crash logs, which mathematically struggle to capture the highly stochastic and non-linear dynamics of real-time traffic streams, rendering proactive safety prevention difficult. To bridge this gap, this study introduces an innovative, data-driven Traffic Operational Risk (TOR) assessment framework that integrates unsupervised deep learning with extreme-value statistics to achieve continuous, proactive risk monitoring. By mapping macroscopic traffic flow parameters and microscopic aggressive driving behaviors (ADBs) onto a unified spatiotemporal grid, we deploy a Variational Autoencoder (VAE) to learn the continuous latent “safe traffic manifold”. On this basis, Extreme Value Theory (EVT) is introduced to mathematically calibrate a dynamic, robust safety frontier on a unified scale (0–100), effectively suppressing sensor noise. The evaluation results demonstrate that the VAE-EVT framework robustly quantifies dynamic operational risks, effectively overcoming the linear limitations of traditional surrogate models. Furthermore, spatial frequency mapping reveals that elevated operational risks inherently cluster at geometric bottlenecks, such as merge/diverge zones and sharp curves. This spatial aggregation elucidates a typical “High Risk, Low Crash” phenomenon primarily driven by driver compensatory behaviors. Crucially, the integration of a novel multidimensional risk decoupling mechanism successfully isolates micro-behavioral volatility from macro-flow degradation. By tracing this causal progression, the framework captures the mechanistic evolution of traffic breakdowns, securing a critical 10 to 15 min proactive pre-warning window before systemic crashes or congestion materialize. Ultimately, this methodology liberates risk assessment from retroactive crash logs, providing a mathematically rigorous paradigm for precision-guided highway safety management.
MSC:
62P30
1. Introduction
As one of the most important modes of transportation, road transport plays a crucial role in social development. However, with the continuous increase in traffic volume in recent years, road safety issues have become increasingly prominent and constitute a pressing concern that urgently needs to be addressed. Studies show that road traffic accidents account for 60% or more of total fatalities from national security incidents, and also make up 80% of all accidental deaths [1]. In the United States, by 2020, the fatality rate per 100 million vehicle miles traveled had risen to 1.34, a significant increase of 21% compared to the previous year’s rate of 1.11. Notably, serious traffic accidents often lead to substantial social unrest and negative impacts. Therefore, comprehensive traffic safety analysis and risk assessment within the field of transportation management are of great significance.
Traditional traffic risk assessments center on accident data, relying on accident indicators such as probability, severity, and type [2]. Building upon this foundation, scholars worldwide have employed single/multifactor statistical regression models, including linear regression, Poisson regression, and negative binomial regression, to conduct extensive research on the causes and prediction of road traffic accidents. However, these accident-indicator-based assessment methods exhibit significant limitations, posing key challenges to proactive traffic risk prevention and control: First, some safety analyses treat accident data as the sole criterion for quantifying traffic risk, erroneously equating “zero accidents” with “safety” [3]. Second, traffic accidents exhibit random occurrence—sudden incidents may arise in low-risk environments, while high-risk road conditions may remain incident-free. Accident-based analysis alone fails to reveal latent risks. Third, accident information relies on manual recording, making it difficult to fully reconstruct causal factors [4]. Fourth, accident data is predominantly stored internally by transportation departments, making public access difficult and limiting data availability. Fifth, evaluations based on accident data suffer from randomness and locality issues, often resulting in unreliable outcomes. Sixth, such analyses can only be conducted after accidents occur, making it challenging to support proactive safety prevention and control measures before incidents happen.
Traffic safety is the result of the interaction among four key elements: drivers, vehicles, road infrastructure, and the environment [5]. Among these, road conditions and environmental factors exert a fixed influence on safety, making it difficult for traffic management personnel to significantly reduce traffic safety risks by adjusting such elements [2]. Consequently, current traffic risk assessment research is gradually shifting its focus from accident data to two core dimensions: macro-level traffic flow and micro-level driving behavior. At the traffic flow level, variables such as traffic volume and speed are critical for assessing operational risks. However, quantifying the relationship between traffic flow variables and operational risks remains challenging [6]. Existing studies predominantly use single indicators like speed coefficient of variation, traffic volume, and average speed to describe the relationship between traffic flow factors and accident frequency [7]. At the driving behavior level, current research often focuses on driver characteristics and road traffic attributes, with insufficient attention to the influence of driver state and driving behavior [8]. As the core decision-makers in traffic behavior, drivers’ actions play a decisive role in traffic safety. Data from the U.S. National Highway Traffic Safety Administration indicates that aggressive driving behaviors (ADBs), such as sudden acceleration and deceleration, account for approximately 90% of accident causes, making them a primary driver of traffic risks. Recent studies have demonstrated that accounting for differential driving behaviors and specific operational risk levels (e.g., adaptive warning systems for specialized vehicles like hazmat trucks) significantly enhances the precision and responsiveness of real-time collision warnings [9,10]. Notably, existing research has yet to achieve an integrated analysis of ADBs and traffic flow data within the same spatial-temporal dimension. Few studies have reported on traffic safety risk assessments under their coupled effects, nor have they fully elucidated their synergistic impact mechanisms on dynamic traffic operational risks.
As a core human-factor driver of traffic risks, the definition of aggressive driving behaviors (ADBs) and the quantitative thresholds for sudden acceleration and deceleration have yet to establish uniform standards in existing research. Significant variations exist across different literature in both the scope of definitions and threshold settings. From a definitional perspective, international research adopts a broader scope for ADBs, encompassing multiple hazardous driving behaviors such as abrupt acceleration/deceleration, aggressive lane changes, and speeding [11]. In contrast, domestic studies often simplify ADBs into three core behaviors—abrupt acceleration, abrupt deceleration, and abrupt steering—based on road traffic flow characteristics [12]. Among these, sudden acceleration/deceleration has become a core observation indicator in most road risk assessment studies due to its ease of data collection and strong correlation with accidents on mountainous highways. Regarding quantitative thresholds for sudden acceleration/deceleration, existing studies exhibit substantial variations influenced by data collection methods (vehicle-mounted high-precision sensors/smartphone navigation/floating car data) and research settings (plains highways/mountainous highways/urban roads) [13,14]: Studies using onboard sensors set higher thresholds, typically ≥2.0–3.0 m/s2 for sudden acceleration and ≤−1.5 to −2.5 m/s2 for sudden deceleration; Studies using smartphone navigation data, constrained by device accuracy, employ relatively lower thresholds. This leaves room for future research to define scenario-specific thresholds, which is a key premise for this study’s ADBs threshold setting tailored to western mountainous highway environments.
Additionally, current traffic operation risk assessment methods can be broadly categorized into four types: weighted calculation methods, clustering methods, supervised deep learning methods, and unsupervised reconstruction methods. Each method exhibits varying degrees of adaptability limitations, making it challenging to meet the demands for dynamic, real-time, and interpretable traffic risk evaluation. Among these, weighted calculation methods employ fixed weights across different scenarios, with diverse weighting schemes lacking unified standards [15]; clustering methods can only return final risk category variables, failing to quantify risk severity and thus exhibiting limited risk identification capabilities [16]. Recently, supervised deep learning methods (e.g., LSTM, GCN) have demonstrated remarkable capabilities in traffic state estimation and network-level risk prediction, effectively capturing the spatiotemporal dynamics of traffic data. However, they rely heavily on balanced accident labels—which are notoriously scarce and sparse in real-world scenarios—and suffer from prominent “black box” issues, rendering the risk assessment uninterpretable [17]. Furthermore, although these types of models provide a powerful generation capability for modeling complex spatiotemporal distributions, their iterative reverse denoising process incurs a significant amount of computational overhead, which often makes them unable to meet the strict requirements for real-time monitoring that are crucial for proactive emergency intervention (such as a 10 to 15 min warning window). Deterministic unsupervised models, such as traditional Autoencoders (AEs), attempt to capture risks via reconstruction anomalies [18,19]. Nevertheless, their rigid point-to-point mapping fails to handle the inherent stochastic noise of multi-source sensor data and lacks a rigorous probabilistic boundary to define the normal traffic state, leading to inflated false-alarm rates.
In contrast, Variational Autoencoders (VAEs) provide a powerful probabilistic generative framework that naturally fits the unsupervised paradigm of traffic risk assessment [20]. Instead of treating risk prediction as a supervised classification task, traffic risk can be fundamentally redefined as a deviation from the normal, safe traffic state distribution. By training exclusively on abundant, readily available accident-free routine traffic data, a VAE can map multi-source macro-micro inputs into a continuous, smooth latent space governed by Gaussian distributions. This process effectively learns the underlying “safe traffic manifold” while demonstrating robust tolerance to sensor measurement noise [21]. Under this framework, the reconstruction error or negative log-likelihood generated by the VAE serves as a direct, mathematically rigorous indicator of dynamic traffic risk: a higher discrepancy signifies a deeper deviation from safe patterns. Crucially, VAEs overcome the traditional “black box” limitation of deep learning through a structured anomaly decomposition mechanism. The total reconstruction error can be explicitly and orthogonally decoupled into macro-level traffic flow residuals and micro-level driving behavior residuals [22]. This unique capability allows traffic management authorities to not only detect risks in real time but also precisely trace whether a hazard is triggered by systemic flow disturbances or localized aggressive driving maneuvers, satisfying the dual requirements of high-accuracy identification and physical interpretability.
Another shortcoming in existing traffic risk assessment research is that most studies focus on urban roads or standard sections of expressways, with insufficient attention paid to special sections such as merge/diverge zones, sharp curves, and long steep descents. The risk types and characteristics in these areas remain unclear, making it difficult to support refined operational management of expressways [23].
To bridge these gaps, this study focuses on critical expressway geometries prone to operational instability, specifically including interchange merge/diverge zones, sharp horizontal curves, and long steep downhill grades. Leveraging multi-source crowdsourced navigation telemetry across a representative expressway corridor, anomalous driving behaviors (ADBs) are fused with macroscopic traffic flow parameters via precise spatiotemporal matching to construct a comprehensive, high-dimensional feature database. On this basis, an unsupervised Variational Autoencoder (VAE)-based Traffic Operational Risk (TOR) assessment model is developed to learn the latent normal traffic safety manifold and output quantified, probabilistic risk scores on a unified scale. Crucially, a novel risk-decoupling mechanism is integrated to isolate and trace underlying risk-causative factors across spatiotemporal scales, while Extreme Value Theory (EVT) is utilized to mathematically calibrate rigorous safety frontier thresholds for automated risk-level classification. Finally, empirical cross-validation using independent historical crash data establishes the framework’s external validity. By analyzing the spatiotemporal distribution and hotspot aggregation of TOR, this study uncovers the latent risk evolution mechanisms inherent to infrastructure bottlenecks, thereby providing robust theoretical insights and actionable references for proactive, precision-guided traffic safety management.
2. Data Source
The multi-source spatial-temporal dataset utilized in this study was acquired from AutoNavi Maps, a leading digital navigation and positioning service provider. The underlying data stream is derived from extensive crowdsourced mobile sensing applications and floating car data (FCD), capturing real-time vehicle trajectories, segment-level speed variations, traffic congestion levels, and contextual event logs. From this heterogeneous telemetry, macroscopic traffic flow states and microscopic driving behavioral anomalies were systematically extracted. Following rigorous data filtering, map-matching, and spatial-temporal aggregation, the raw telemetry logs were transformed into structured multi-dimensional indicators to feed the proposed risk assessment framework.
The empirical evaluation was conducted along a 34.42 km continuous corridor of the Mengxiang section of the Hexi Expressway in Guangxi Province, China. The study dataset spans a one-month period from 1 November to 30 November 2024. As illustrated in Figure 1, this expressway corridor serves as an ideal testbed due to its complex alignment and high-risk geometric typologies, explicitly featuring critical infrastructure bottlenecks including interchange merge/diverge areas, sharp horizontal curves, and long steep downhill grades.
Figure 1.
The research route.
2.1. Subsection
This study selects the Congestion Index (CI), Coefficient of Speed Variation (CSV), and upstream-downstream speed difference as parameters to characterize traffic conditions. These three metrics complement each other across three key dimensions—macro-level operational efficiency, micro-level flow stability, and spatial segment correlation—enabling a comprehensive and precise capture of core traffic state characteristics. They directly correlate with traffic risks, providing reliable support for subsequent traffic risk assessments.
- Congestion Index
Traffic congestion negatively impacts road safety [24], yet assessing congestion levels remains a complex task. Levinson et al. [25] proposed the Congestion Index (CI), which comprehensively reflects varying degrees of traffic congestion. This index quantifies congestion through a continuous numerical range. CI is straightforward to calculate and widely applied in transportation fields for congestion forecasting, travel pattern analysis, and other purposes [26,27]. A higher CI value indicates greater traffic congestion and increased potential traffic risks. Traffic flow becomes intermittent, making abrupt deceleration more likely. CI is calculated by comparing the current average speed to the free-flow speed, using the following equation:
where is the speed limit for road segment j, and is the average speed for time and road segment j.
- Coefficient of speed variation
The variability of traffic flow speed is one of the external manifestations of traffic risk, characterized by the coefficient of speed variation (CSV). CSV refers to the coefficient of speed variation over a continuous time period on a given road segment. A higher value indicates greater disorder in traffic flow and a higher level of road risk. The CSV calculation formula is as follows:
where denotes the standard deviation of velocity.
- Speed difference between upstream and downstream
The speed difference between road segments significantly impacts traffic risks, particularly rear-end collisions. The upstream-downstream speed difference is used to directly characterize the degree of speed variation between segments, calculated as follows:
where and are the speed difference between road segment j and its upstream and its downstream segment during time period t, respectively.
2.2. Aggressive Driving Behaviors Data
ADB data is provided by AutoNavi, whose determination thresholds and related metrics are statistically significant, having been calculated and verified by AutoNavi through extensive vehicle testing. When the phone is stationary, the system can identify and record sudden acceleration or deceleration based on whether the vehicle’s linear acceleration exceeds the set threshold. It should be noted that the linear acceleration of sudden deceleration is defined as a negative value in line with physical principles. Thus, this study defines the sudden acceleration threshold as linear acceleration ≥ 2.0 m/s2 and the sudden deceleration threshold as ≤−2.2 m/s2. These settings align with the mainstream threshold range used in domestic ADB research on mountainous expressways based on smartphone navigation data [28], with moderate adjustments made according to the topography and driving behavior characteristics of the study section.
The selection of ≥2.0 m/s2 for sudden acceleration and ≤−2.2 m/s2 for sudden deceleration is specifically tailored to the topographical complexities of the study area. The Mengxiang section is a typical mountainous expressway characterized by long, steep downhills and sharp horizontal curves. In such environments, drivers naturally execute frequent speed adjustments—such as utilizing engine braking on descending grades—which might erroneously register as aggressive maneuvers under the lower thresholds commonly used for urban roads (e.g., ). The adopted thresholds effectively filter out this terrain-adapted driving noise, ensuring that the extracted ADBs represent genuine emergency maneuvers or highly aggressive behavior. Moreover, although slight variations in these thresholds would alter the absolute frequency of recorded ADBs, the proposed unsupervised VAE framework exhibits strong robustness to such shifts: because the VAE learns a continuous probabilistic distribution of the normal traffic state, any baseline change in ADB frequency is simply absorbed into the learned “safe manifold” during training. Consequently, the model’s ability to detect relative deviations (anomalies) remains stable, effectively mitigating the impact of subjective threshold selection on the final operational risk assessment.
Building upon the road network topology, we further utilize AutoNavi Maps to visualize aggressive driving behaviors on the map. Taking sudden acceleration and sudden deceleration behaviors on 17 November 2024 as examples. Overall, aggressive driving behaviors occur more frequently on long, steep downhills, sharp turns, and merge/diverge sections. This indicates that under normal traffic conditions, specific road segments are the primary triggers for aggressive driving. This is closely related to the longitudinal profile of long, steep downhill: frequent, aggressive acceleration and deceleration in these sections can lead to overheated wheel hubs, brake failure, and rear-end collisions. Sharp turns involve both abrupt acceleration and deceleration. Limited visibility and significant centrifugal forces at sharp bends increase the risk of vehicle instability during rapid acceleration, while sudden deceleration represents a risk-mitigation maneuver by drivers. Merge/diverge zones amplify interactions between vehicles, further encouraging abrupt acceleration and deceleration by drivers.
As traffic volume increases, more ADBs occur, necessitating variable unitization. To this end, this paper proposes a frequency event (FE) metric, as shown in Equation (5).
where represents the total number of deceleration or acceleration behavior occurring at time i on road segment j.
2.3. Data Processing
Data indices and spatio-temporal sampling intervals vary across different data sources. Before developing TOR, multi-source data must be fused onto the same spatio-temporal dimension. The main steps are as follows:
- Sampled Data Fusion
To capture and describe traffic risk characteristics with greater precision, the data fusion process requires segmenting the entire study road based on its network topology. By dividing the study corridor according to dimensions such as road network nodes and traffic flow characteristics, 44 sections ranging from 12 m to 5363 m in length were obtained. This enables precise alignment of multi-source data at the road segment level. The setting of the time sampling interval directly impacts the accuracy of data fusion and subsequent computational efficiency. Shorter sampling intervals yield higher precision in the fused data and more accurate feature characterization. According to Equation (2), the speed coefficient of variation requires at least three consecutive time periods of speed data for calculation. Balancing computational feasibility, the time measurement interval was ultimately set to 10 min.
- Data statistics
For all data containing geographic information, a data quality control strategy of “erroneous data filtering + missing value interpolation” was applied: erroneous data were first removed, followed by interpolation of missing values using the average of data from preceding and subsequent time periods. Ultimately, the processed dataset comprised 241,809 samples, with each sample record containing the aforementioned traffic state parameters and ADBs data.
- Training Sample Selection
To ensure that the unsupervised VAE model exclusively learns the probabilistic boundaries of normal, uncorrupted traffic operations, training samples were selected through a rigorous multi-source spatial-temporal filtering protocol. The 10 min fused telemetry and flow dataset was cross-referenced against official traffic management logs, containing verified crash records, emergency response dispatches, and road maintenance events. To prevent secondary shockwaves or incident-induced flow disruptions from contaminating the normal state distribution, a strict spatiotemporal exclusion buffer was enforced: any traffic observation window falling within min and 2 km upstream/downstream of an established incident was purged. Through this process, 193,447 uncorrupted, incident-free time-series samples were isolated (approximately 80% of the aforementioned 241,809 samples) and utilized to train the VAE to represent the true ‘safe traffic manifold.
3. Methodology
This section presents the proposed Variational Autoencoder (VAE)-based traffic risk assessment framework. The overall pipeline consists of three main steps: (1) traffic data preprocessing and feature construction, (2) VAE model architecture design for learning normal traffic patterns, and (3) traffic risk scoring using reconstruction error and probabilistic divergence. Figure 2 illustrates the workflow.
Figure 2.
TOR assessment structure based on VAE.
3.1. Feature Construction
Consider a road network consisting of n directed road segments. For each segment at each 10 min time interval , we observe a 6-dimensional vector:
To incorporate temporal dynamics, we use a sliding time window of length (e.g., T = 6). For a target time period , we construct a spatiotemporal sample by stacking the feature vectors of all n segments over the window:
Alternatively, for easier neural network processing, we flatten each sample into a vector with . Additionally, because the six features have different units and ranges, we apply feature-wise standardization using only normal-condition training data.
3.2. VAE for Normal Traffic Modeling
The VAE assumes that the spatio-temporal characteristics of normal traffic flow are generated by continuous low-dimensional latent variables , and its core consists of a probabilistic inference network (encoder) and a generation network (decoder).
- Probabilistic Encoder
Unlike traditional AE, which maps the input into a deterministic feature vector, the encoder of VAE aims to fit the posterior probability distribution of the latent variables, where represents the encoder network parameters. Assuming that this posterior distribution follows a multivariate Gaussian distribution, the encoder outputs the mean vector and the log-variance vector of this distribution through a deep neural network (DNN):
In this study, the encoder is structured with 3 fully connected hidden layers containing 128 neurons, respectively. To mitigate the vanishing gradient problem, the LeakyReLU activation function is employed across all hidden layers. The final layer of the encoder linearly maps to the latent space, where the dimension is empirically set to = 3. To achieve end-to-end backpropagation, this model employs the reparameterization Trick technique. It samples auxiliary noise from the standard normal distribution, thereby calculating the specific latent feature vector :
where ⊙ represents element-wise multiplication; this design enables the model to retain the randomness of sampling while allowing the gradients to be smoothly back-propagated.
- Generative Decoder
The decoder network is used to fit the conditional likelihood distribution , where represents the parameters of the decoder. It expands and reconstructs the sampled latent variable , and outputs a reconstructed state with the same dimension as the original input:
Symmetrical to the encoder, the decoder utilizes 3 hidden layers with 128 neurons. The output layer employs a Linear activation function to reconstruct the 6-dimensional input vector.
- Unsupervised Training
This study utilized the “incident-free dataset” to train the VAE. Since the true posterior distribution is intractable, the training objective of the VAE is to maximize the Evidence Lower Bound (ELBO). When expressed in the form of a loss function, it consists of two parts:
- Reconstruction Loss: measures the fidelity between the reconstructed output and the original input . Usually, the mean squared error (MSE) is employed:
- KL Divergence: Constrains the posterior distribution generated by the encoder to approximate the prior distribution (standard normal distribution, ) as closely as possible, in order to ensure the continuity and smoothness of the latent space.
The overall loss can be defined as:
where is the balance coefficient, used to adjust the weight between the reconstruction accuracy and the smoothness of the latent space. By minimizing the aforementioned joint loss, VAE can accurately learn the characteristic patterns of normal traffic.
3.3. Traffic Operation Risk Scoring
At time step , the observed risk evaluation vector is input into the VAE. The deterministic reconstruction vector generated by the model is denoted as . The comprehensive reconstruction residual vector is defined as . Based on this, the squared value of the weighted Euclidean norm of the reconstruction residual is defined as the TOR value at time :
The larger the value, the farther the current traffic state deviates from the safe and normal trajectory, and the higher the potential risk of system collapse.
It is worth noting that the VAE is trained exclusively on incident-free, routine traffic data; its latent space geometry encodes a continuous “safe traffic manifold”. Consequently, the multidimensional reconstruction error mathematically quantifies the precise degree of spatial-temporal deviation from this normal safety state. In the context of traffic flow dynamics, such statistical deviations physically manifest as anomalous driver behaviors (e.g., clustered emergency braking) or macroscopic flow instabilities, establishing the reconstruction error as a direct proportional surrogate for real-time operational risk.
4. Numerical Experiment Analyses
4.1. Model Training and Latent Space Manifold Quality
The input layer of the proposed VAE model is designed to process a 6-dimensional feature vector . Based on the macroscopic traffic flow theory and the sensitivity analysis of experience, we chose the time window length T = 6. To mathematically validate this parameter, a sensitivity analysis was conducted across alternative window lengths: T = 3 (30 min), T = 6 (60 min), and T = 9 (90 min). The evaluation revealed that smaller windows (T = 3) fail to absorb micro-level volatility, leading to a high false-positive rate in risk identification. Conversely, extended windows (T = 9) induce severe temporal lag due to over-smoothing, which compromises the model’s capacity to provide early warnings. The chosen parameter T = 6 empirically yields the optimal balance.
During the training phase, exclusively incident-free routine traffic data was fed into the network to learn the continuous distribution of the normal traffic state. The model was optimized using the Adam optimizer with an initial learning rate of 0.001. To ensure stable gradient updates while maintaining computational efficiency, the batch size was set to 256. For the parameter in the VAE Loss Function, a grid search was conducted on its sensitivity within the range of [0.1, 2.0] with a step size of 0.1. When < 1.2, the latent space constraint was insufficient, resulting in discontinuous distribution; when > 1.2, it would lead to over-smoothing, masking the abnormal microscopic driving behaviors. Therefore, = 1.2 yields optimal trade-off performance, maintaining latent space continuity while preserving high reconstruction sensitivity to behavioral anomalies.
The training process demonstrated rapid and stable convergence. The Evidence Lower Bound (ELBO) loss, driven by the balanced optimization of the reconstruction error and the Kullback–Leibler (KL) divergence, stabilized after approximately 150 epochs (the total training duration was set to 200 epochs), indicating that the model successfully avoided overfitting (as shown in Figure 3a). To intuitively evaluate the quality of the learned representations, the 6-dimensional input space was mapped into a low-dimensional latent space and visualized using the t-SNE algorithm. As shown in Figure 3b, normal data clusters around the center in a Gaussian distribution, while risk data lies scattered on the periphery. Unlike traditional AEs, where normal and abnormal samples often exhibit fragmented or overlapping boundaries, the latent variables extracted by the VAE formed a highly dense, cohesive, and smooth Gaussian cluster centered around the origin. This core cluster essentially outlines the “safe traffic manifold”. Conversely, high-risk validation samples (e.g., data preceding recorded crashes) were distinctly repelled to the peripheral regions of this manifold, proving that the VAE inherently possesses a powerful topological discrimination capability for unobserved anomalies.
Figure 3.
Training loss curves and latent space scatters.
4.2. EVT-Based Risk Threshold Calibration
The TOR calculated using the VAE method was computed at 10 min intervals for each road section, yielding a total of 48,362 samples (i.e., 20% of the total sample). It should be noted that, for the sake of clarity, we have mapped the reconstruction error to the range of 0 to 100. Thus, the frequency distribution histogram of TOR is shown in Figure 4. Since the traffic flow variables (e.g., congestion index) and behavioral variables (e.g., sudden deceleration frequency) naturally exhibit stochastic fluctuations, utilizing a rigid threshold based on mean and standard deviation (e.g., the rule) would trigger excessive false alarms. Statistically, while normal traffic reconstruction errors densely concentrate around a low mean, true hazardous anomalies represent rare, extreme deviations that occupy the ‘heavy tail’ of the error distribution. Traditional thresholding algorithms (e.g., fixed standard deviations or K-means) assume normal or symmetrical distribution patterns and consequently fail to accurately capture heavy-tailed phenomena. Therefore, this study employed Extreme Value Theory (EVT), specifically the Peak-Over-Threshold (POT) approach, to scientifically calibrate the risk boundary.
Figure 4.
Risk threshold calibration via EVT.
The TOR values of the 6 features generated by the VAE from the normal dataset were aggregated. A Generalized Pareto Distribution (GPD) was then fitted to the extreme right tail of this error distribution (Red line in Figure 4). It can be illustrated that the empirical distribution of the tail errors aligns almost perfectly with the fitted GPD curve, mathematically validating the applicability of EVT. By setting extreme confidence levels at = 95%, 99%, and 99.9%, the corresponding critical risk thresholds () were calculated. For proactive traffic management, this study adopted the threshold at the 99% confidence level as the trigger for the TOR alert (that is, the reconstruction error is greater than 54.3), ensuring a rigorous mathematical boundary that tolerates regular sensor noise while strictly isolating genuine risk emergence.
4.3. Model Validation and Superiority Comparison
To rigorously validate the efficacy of the VAE-based approach, it was benchmarked against widely used unsupervised and matrix decomposition models, including Non-Negative Matrix Factorization (NMF) and the Vanilla Autoencoder (Vanilla AE). The total dataset (241,809 samples) was partitioned into a training set and an independent testing set according to Section 2.3. The training set, comprising 193,447 purely incident-free samples, was utilized exclusively for unsupervised model fitting. The testing set comprised the remaining 48,362 samples. Within this validation set, historical crash records and confirmed hazardous events were mapped as positive samples (Risk = 1, N = 125), while the remaining random incident-free periods served as negative samples (Risk = 0, N = 48,237).
Figure 5 displays the Receiver Operating Characteristic (ROC) curves for the competing models. The proposed VAE achieved the highest Area Under the Curve (AUC) of 0.89, significantly outperforming the Vanilla AE (0.81) and NMF (0.74). The superiority of the VAE is predominantly attributed to its probabilistic generative mechanism. Specifically, NMF employs a linear dimensionality reduction that struggles to capture the complex, nonlinear spatiotemporal correlations among the 6 mixed features (e.g., how downstream speed differences non-linearly couple with sudden decelerations). Meanwhile, the deterministic point-to-point mapping of Vanilla AE is highly susceptible to sensor noise, leading to a prominent False Alarm Rate (FAR) of 12.4% during purely normal traffic conditions. In contrast, the VAE model effectively absorbs random feature fluctuations via its variance parameters, maintaining a remarkably low FAR of 3.2% while retaining maximum sensitivity to actual crash precursors.
Figure 5.
ROC curves of different methods.
4.4. Spatial Characteristics of the Higher TOR
To systematically localize the chronic safety bottlenecks in the expressway network, this section shifts focus from continuous time-series tracing to the spatial aggregation of critical anomalies. Utilizing the dynamic risk boundary calibrated via EVT in Section 4.2, all traffic state records with a Normalized VAE Risk Score exceeding the 99% confidence threshold were extracted as “high-risk events.” By aggregating the temporal duration of these high-risk events within each segment, the high-risk frequency was quantified. Figure 6 presents a 3D spatial frequency heatmap, cross-referencing the spatial topology and the total occurrence count of high-risk TOR alerts, where warm colors indicate higher risks, while cool colors indicate the opposite. The 3D spatial profiling reveals three distinct areas where high-risk sections occur significantly more frequently than elsewhere: long, steep downhill gradients, sharp turns, and merging/diverging sections. In this study, road sections exhibiting high frequencies of high-risk occurrences are defined as Aggregate Risk Areas (ARA). The spatial distribution of ARAs indicates that ADBs are more likely to occur in areas characterized by greater speed differentials and larger spatial dimensions. Additionally, it also demonstrates a clear distinction between ARAs and non-ARA zones, with a discernible trend towards dispersion.
Figure 6.
The spatial distribution of high-risk level frequency.
The spatial relationship between high-risk level frequency and traffic incidents is illustrated in Figure 7, where warm colors indicate higher risks, while cool colors indicate the opposite. As evident from the figure, most areas experiencing congestion and rear-end collisions exhibit elevated risk levels, indirectly corroborating the reliability of the analytical findings. Notably, a “High Risk, Low Incident” phenomenon emerges from the spatial mapping: several high-risk zones identified by TOR lack actual incident records. This non-linear correlation is primarily driven by driver compensatory behaviors. When navigating perceptibly hazardous geometries—such as long steep downhills, sharp curves, or merge/diverge areas—drivers typically exhibit increased vigilance, reduce speeds, and maintain longer headways. These cautious maneuvers effectively offset latent hazards and prevent crash occurrence. Conversely, crashes can still transpire in non-high-risk zones due to highly random, unobservable factors, such as sudden human errors or unexpected mechanical failures.
Figure 7.
Relationship of high-risk level frequency and traffic incidents’ spatial distribution.
The spatial clustering of high TOR at geometric bottlenecks can be explained by traffic flow theory and surrogate safety concepts. For merge/diverge zones: ramp-induced mandatory lane changes cause turbulence, capacity drops, and kinematic friction, which the VAE captures as clustered spikes in CSV and speed differentials. For sharp horizontal curves, restricted sight distance and lateral forces trigger clustered abrupt decelerations (high FED reconstruction errors) to preserve safe TTC, especially when encountering slow platoons or hidden obstacles. For long, steep downhills, gravitational momentum forces heavy vehicles into repeated braking, producing severe speed heterogeneity between cars and trucks. The resulting excessive deceleration and highspeed variance are decoded by the VAE as a clear deviation from the normal safety manifold. By anchoring anomaly detection in traffic physics, the model identifies not only where risks cluster, but also the geometric reasons behind them.
Therefore, it must be emphasized that elevated TOR indicates potential real-time exposure to danger rather than a deterministic crash prediction. While accident-prone sections consistently exhibit high TOR, the reverse is not inherently true, and no direct causal relationship should be inferred. Ultimately, this discrepancy precisely highlights the fundamental advantage of TOR as a Surrogate Safety Measure (SSM). By evaluating real-time operational states rather than relying on sparse and retroactive historical crash logs, the TOR methodology offers a proactive paradigm to uncover latent vulnerabilities before they materialize into accidents.
4.5. Risk Causality Analysis
The ultimate objective of risk assessment is not only detection but also causal traceability to facilitate targeted interventions. A profound advantage of the VAE framework is that the TOR can be orthogonally decoupled into specific feature residuals. Based on the 6 input variables, the risk was explicitly separated into two dimensions: macro-level flow risk (, integrating the reconstruction errors of the congestion index, speed coefficient of variation, and upstream/downstream speed differences) and micro-level behavior risk (, derived from the sudden acceleration and sudden deceleration frequencies).
To illustrate the temporal traceability of this decoupling mechanism, a representative near-miss event over a 90 min life cycle is detailed in Figure 8. A strict safety boundary was established using the EVT-calibrated threshold at . During the initial phase ( to ), all risk components fluctuated well below the threshold, indicating a stable traffic manifold. However, at , a localized disturbance triggered a sharp spike in , causing it to rapidly pierce the 54.3 critical threshold. This micro-level explosion was predominantly driven by a sudden, intense clustering of emergency decelerations. Strikingly, during this precise moment, the macro-level risk () remained deceptively low (around a score of 20), meaning that the overall section congestion index and average speed variance had not yet exhibited any noticeable deterioration.
Figure 8.
Mechanism of risk decoupling and proactive traceability.
It was not until (13 min after the initial micro-behavioral alert) that surged past the 54.3 boundary. This lag mathematically captures the causal progression of traffic flow breakdown: localized micro-behavioral conflicts (e.g., aggressive braking to avoid an obstacle) act as the catalyst, eventually cascading upstream to cause a systemic macro-level shockwave (manifested as soaring speed variance and severe congestion). Because the VAE isolates these micro-anomalies from the macro-averages, the system successfully secured a 13 min proactive pre-warning window. This precise decoupling not only elucidates the underlying mechanistic evolution of traffic risks but also provides highway management authorities with crucial lead time to activate dynamic speed limits or dispatch emergency patrols before an irreversible crash occurs.
To mathematically solidify this qualitative observation, a quantitative Feature Contribution (FC) analysis was integrated. Given that the VAE reconstructs features independently at the output layer, the total anomaly score can be orthogonally decomposed. The fractional contribution of any individual feature (or feature group) to the total dynamic risk at time is formulated as
Applying this quantitative metric to the critical event timeline in Figure 8 reveals a stark causal shift. At the initial hazard onset (), when the total TOR first pierces the safety threshold, the micro-level behavioral features account for an overwhelming 82.4% of the total reconstruction error, with the FED alone contributing 65.1%. At this specific juncture, the combined contribution of all macro-level traffic flow indicators (CI, CSV, SDU, SDD) remains minimal at only 17.6%. Conversely, as the shockwave propagates and systemic flow breakdown materializes at , a profound quantitative inversion occurs. The feature contribution of macro-level variables surges to 78.3%, driven predominantly by the CSV and CI, which individually contribute 41.2% 25.5%, respectively. This quantitative feature tracking undeniably proves that localized, micro-behavioral volatility acts as the quantitative precursor to systemic, macro-level traffic collapse.
5. Conclusions
This study innovatively proposes a continuous, TOR assessment framework driven by a Variational Autoencoder (VAE) and Extreme Value Theory (EVT). By orthogonally integrating macroscopic traffic flow states with microscopic driving behaviors, this approach successfully overcomes the inherent sparsity of traditional accident-based metrics and the linear representation limitations of baseline models. The proposed framework enables highly interpretable, dynamic risk quantification across expressway networks. The primary conclusions are drawn as follows:
- A comprehensive 6-dimensional feature space was established, effectively capturing both systemic flow dynamics (congestion index, speed coefficient of variation, spatial speed differentials) and microscopic driver volatility (sudden acceleration and deceleration frequencies). This dual-scale integration precisely reflects the core characteristics of complex traffic conditions.
- The VAE model effectively mapped normal traffic states into a dense, continuous “safe manifold”. Rather than relying on static empirical clustering (e.g., K-means), EVT was innovatively applied to the normalized reconstruction errors to scientifically calibrate a dynamic critical risk threshold. This probabilistic generative mechanism significantly outperformed traditional methods, maintaining maximal sensitivity to anomalies while suppressing false alarms caused by natural sensor noise.
- Spatiotemporal frequency mapping verified that elevated TOR values inherently cluster at specific geometric bottlenecks—namely, merge/diverge zones, sharp curves, and long steep downhills. Cross-validation with multi-source historical events elucidated a typical “High Risk, Low Crash” phenomenon. This confirms that elevated TOR indicates potential real-time hazard exposure rather than deterministic crash occurrence, largely due to driver compensatory behaviors, thereby highlighting the fundamental advantage of proactive surrogate safety measures.
- A major breakthrough of this methodology is its capability for multidimensional risk decoupling. By isolating micro-level behavioral risks from macro-level flow risks, the framework mathematically traces the mechanistic evolution of traffic breakdowns. Identifying localized behavioral disturbances (e.g., clustered sudden decelerations) before systemic flow collapse successfully secures a crucial proactive pre-warning window (up to 10–15 min), providing actionable lead time for emergency interventions.
Ultimately, this methodology empowers highway management authorities to pivot from retroactive incident response to proactive hazard prevention, completely independent of historical crash data availability. While empirical verification is currently constrained to a 35 km corridor over a one-month scale, the unsupervised nature of VAE and the self-calibration of EVT thresholds guarantee its high generalizability to other highway systems and urban networks. When applying this framework to urban roads, additional feature dimensions (such as signal timing states or pedestrian/non-motorized vehicle conflicts) can be easily appended to the input vector. The VAE’s deep layers will compress and capture these urban-specific non-linear couplings. Future work will focus on integrating causal inference mechanisms to construct “causal brain maps” for risk evolution, modeling the complex coupling effects of extreme meteorological disasters with traffic states, and expanding the framework’s transferability to enhance intelligent emergency disposal across diverse infrastructure scenarios.
Author Contributions
Conceptualization, W.H. and S.L. (Sen Luan); Validation, Z.L. and P.Z.; Formal analysis, P.Z.; Investigation, S.L. (Sen Luan); Resources, W.H., Z.L. and S.L. (Shanfeng Lu); Data curation, P.Z.; Writing—review & editing, S.L. (Sen Luan); Supervision, WH and S.L. (Sen Luan); Funding acquisition, S.L. (Shanfeng Lu). All authors have read and agreed to the published version of the manuscript.
Funding
This paper is funded by the project “Research and Application of Key Technology for Special Road Traffic Condition Sensing, Warning and Emergency Control Based on Ray-Vision Fusion” (No. XFZ-KY-LSF-20210710).
Data Availability Statement
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to their containing information that could compromise the privacy of research participants.
Conflicts of Interest
Wei Huang and Shanfeng Lu were employed by the Guangxi XinFaZhan Communication Group Co., Ltd. and Zhongbin Luo were employed by the China Merchants Chongqing Communications Research & Design Institute Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
References
- Xiong, X.; Zhang, S.; Shen, Y. Research on urban road traffic accident characteristics and countermeasures: A case study of Ningbo city. J. Phys. Conf. Ser. 2021, 1910, 012008. [Google Scholar] [CrossRef] [Scilit]
- Abdel-Aty, M.; Pande, A. Identifying crash propensity using specific traffic speed conditions. J. Saf. Res. 2005, 36, 97–108. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Miaou, S.P. The relationship between truck accidents and geometric design of road sections: Poisson versus negative binomial regressions. Accid. Anal. Prev. 1994, 26, 471–482. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cheng, Z.; Lu, J.; Li, Y. Freeway crash risks evaluation by variable speed limit strategy using real-world traffic flow data. Accid. Anal. Prev. 2018, 119, 176–187. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Mannering, F.L.; Bhat, C.R. Analytic methods in accident research: Methodological frontier and future directions. Anal. Methods Accid. Res. 2014, 1, 1–22. [Google Scholar] [CrossRef] [Scilit]
- Cai, Q.; Abdel-Aty, M.; Yuan, J.; Lee, J.; Wu, Y. Real-time crash prediction on expressways using deep generative models. Transp. Res. Part C Emerg. Technol. 2020, 117, 102697. [Google Scholar] [CrossRef] [Scilit]
- Zhu, L.; Zhang, Z.; Song, D.; Chen, B. Analysis of traffic accident causes based on data augmentation and ensemble learning with high-dimensional small-sample data. Expert Syst. Appl. 2024, 237, 121782. [Google Scholar] [CrossRef] [Scilit]
- af Wåhlberg, A.E. The relation of acceleration force to traffic accident frequency: A pilot study. Transp. Res. Part F Traffic Psychol. Behav. 2000, 3, 29–38. [Google Scholar] [CrossRef] [Scilit]
- Adavikottu, A.; Velaga, N.R. Analysis of factors influencing aggressive driver behavior and crash involvement. Traffic Inj. Prev. 2021, 22, S21–S26. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Shao, Y.; Shi, X.; Zhang, Y.; Zhang, Y.; Xu, Y.; Chen, W.; Ye, Z. Adaptive forward collision warning system for hazmat truck drivers: Considering differential driving behavior and risk levels. Accid. Anal. Prev. 2023, 191, 107221. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Alkinani, M.H.; Khan, W.Z.; Arshad, Q. Detecting human driver inattentive and aggressive driving behavior using deep learning: Recent advances, requirements and open challenges. IEEE Access 2020, 8, 105008–105030. [Google Scholar] [CrossRef] [Scilit]
- Hong, J.H.; Margines, B.; Dey, A.K. A smartphone-based sensing platform to model aggressive driving behaviors. In Proceedings of the Sigchi Conference on Human Factors in Computing Systems, Toronto, ON, Canada, 26 April–1 May 2014; pp. 4047–4056. [Google Scholar] [CrossRef] [Scilit]
- Jahangiri, A.; Berardi, V.J.; Machiani, S.G. Application of real field connected vehicle data for aggressive driving identification on horizontal curves. IEEE Trans. Intell. Transp. Syst. 2017, 19, 2316–2324. [Google Scholar] [CrossRef] [Scilit]
- Bergasa, L.M.; Araluce, J.; Romera, E.; Barea, R.; López-Guilén, E.; del Egido, J.; Hernanz-Mayoral, C.A. Naturalistic driving study for older drivers based on the DriveSafe app. In 2019 IEEE Intelligent Transportation Systems Conference (ITSC); IEEE: Piscataway, NJ, USA, 2019; pp. 1574–1579. [Google Scholar] [CrossRef] [Scilit]
- Mogyorósi, P.; Szénási, S.; Laufer, E. Fuzzy-based road accident risk assessment. Mathematics 2024, 12, 1144. [Google Scholar] [CrossRef] [Scilit]
- Wang, B.; Zhang, C.; Wong, Y.D.; Hou, L.; Zhang, M.; Xiang, Y. Comparing resampling algorithms and classifiers for modeling traffic risk prediction. Int. J. Environ. Res. Public Health 2022, 19, 13693. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cai, X.; Lei, C.; Peng, B.; Tang, X.; Gao, Z. Road traffic safety risk estimation method based on vehicle onboard diagnostic data. J. Adv. Transp. 2020, 2020, 3024101. [Google Scholar] [CrossRef] [Scilit]
- Salahuddin, M.A.; Bari, M.F.; Alameddine, H.A.; Pourahmadi, V.; Boutaba, R. Time-based anomaly detection using autoencoder. In 2020 16th International Conference on Network and Service Management (CNSM); IEEE: Piscataway, NJ, USA, 2020; pp. 1–9. [Google Scholar] [CrossRef] [Scilit]
- Dutta, V.; Pawlicki, M.; Kozik, R.; Choraś, M. Unsupervised network traffic anomaly detection with deep autoencoders. Logic J. IGPL 2022, 30, 912–925. [Google Scholar] [CrossRef] [Scilit]
- Pu, Y.; Gan, Z.; Henao, R.; Yuan, X.; Li, C.; Stevens, A.; Carin, L. Variational autoencoder for deep learning of images, labels and captions. Adv. Neural Inf. Process. Syst. 2016, 29, 2360–2368. [Google Scholar]
- Montella, A. Safety reviews of existing roads: Quantitative safety assessment methodology. Transp. Res. Rec. 2005, 1922, 62–72. [Google Scholar] [CrossRef] [Scilit]
- Gallina, A.; Garland, S.J.; Wakeling, J.M. Identification of regional activation by factorization of high-density surface EMG signals: A comparison of Principal Component Analysis and Non-negative Matrix factorization. J. Electromyogr. Kinesiol. 2018, 41, 116–123. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kashyap, A.A.; Raviraj, S.; Devarakonda, A.; Nayak K, S.R.; KV, S.; Bhat, S.J. Traffic flow prediction models—A review of deep learning techniques. Cogent Eng. 2022, 9, 2010510. [Google Scholar] [CrossRef] [Scilit]
- You, J.; Wang, J.; Guo, J. Real-time crash prediction on freeways using data mining and emerging techniques. J. Mod. Transp. 2017, 25, 116–123. [Google Scholar] [CrossRef] [Scilit]
- Levinson, H.S.; Lomax, T.J. Developing a travel time congestion index. Transp. Res. Rec. 1996, 1564, 1–10. [Google Scholar] [CrossRef]
- Ashifuddin Mondal, M.; Rehena, Z. Intelligent traffic congestion classification system using artificial neural network. In Companion Proceedings of the 2019 World Wide Web Conference; ACM: New York, NY, USA, 2019; pp. 110–116. [Google Scholar] [CrossRef] [Scilit]
- Guo, M.; Zhao, X.; Yao, Y.; Yan, P.; Su, Y.; Bi, C.; Wu, D. A study of freeway crash risk prediction and interpretation based on risky driving behavior and traffic flow data. Accid. Anal. Prev. 2021, 160, 106328. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, X.; Chen, L.; Shi, H.; Han, J.; Wang, G.; Wang, Q.; Zhong, F.; Li, H. A real-time recognition system of driving propensity based on AutoNavi navigation data. Sensors 2022, 22, 4883. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







