A method and system for evaluating expressway traffic accident risk based on a traffic large model
By constructing multi-source heterogeneous data sequences and performing deep feature fusion, combined with anomaly detection and risk visualization, the problem of inaccurate risk assessment under severe weather conditions in existing technologies has been solved, enabling precise early warning and management support for highway traffic accidents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUALU YIYUN TECH CO LTD
- Filing Date
- 2026-07-01
- Publication Date
- 2026-07-31
AI Technical Summary
The existing highway traffic safety management system cannot dynamically adjust safety thresholds under adverse weather or slippery road conditions, resulting in a decrease in the accuracy and adaptability of risk assessment. It also makes it difficult to distinguish between normal driving fluctuations and risky behaviors, which can easily lead to false alarms or missed alarms.
A traffic model-based approach is adopted, which constructs multi-source heterogeneous data sequences through DBSCAN clustering and timestamp interpolation alignment mechanism, combines cross-attention mechanism and bidirectional GRU time encoder to fuse micro and macro features, uses Transformer encoder for anomaly detection, and uses Gaussian kernel density estimation to generate road segment risk heatmaps.
It enables accurate risk assessment of vehicle behavior in complex environments, improves the accuracy and interpretability of early warnings, can dynamically adjust safety thresholds, reduce accident rates, and provide intuitive road segment risk situation awareness.
Smart Images

Figure CN122493666A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, and in particular to a method and system for assessing highway traffic accident risks based on a large traffic model. Background Technology
[0002] Currently, highway traffic safety management mainly relies on single sensing methods such as video surveillance and radar speed measurement, combined with simple threshold rules (such as speeding and following too closely) for risk warnings. The shortcomings of this approach are twofold: First, its risk assessment models typically analyze vehicle behavior in isolation, failing to fully consider the impact of dynamically changing macro-environmental factors such as visibility, road surface friction coefficient, and water depth on driving safety thresholds. This results in a significant decrease in the accuracy and adaptability of warnings under adverse weather conditions such as rain, fog, and snow, or on slippery road surfaces. For example, when the road surface friction coefficient decreases in rainy weather, the original safe following distance threshold may no longer be applicable, but the existing system cannot dynamically adjust, thus failing to fully meet the needs of accurate risk assessment under all weather and road conditions.
[0003] Secondly, existing technologies have limited ability to characterize abnormal vehicle behavior, relying mostly on shallow features (such as speed and position) for judgment, lacking the ability to deeply integrate vehicle micro-motion sequences (such as acceleration change rate and lateral offset trend) with the macro-environmental context. This makes it difficult for the system to distinguish between normal driving fluctuations and genuine risky behaviors, especially in areas with dense traffic flow and complex behaviors, easily leading to numerous false alarms or failure to identify hidden, gradual risks. Therefore, there is an urgent need for a traffic accident risk assessment method and system that can deeply integrate micro-behavior and macro-state under complex and changing macro-environmental conditions, achieving dynamic, accurate, and interpretable results, in order to improve the accuracy of early warnings and reduce the accident rate. Summary of the Invention
[0004] To address the aforementioned technical shortcomings, the purpose of this invention is to propose a method and system for assessing highway traffic accident risks based on a large traffic model. This aims to solve the technical problem that existing technologies rely on video surveillance for vehicle risk identification, especially in highway scenarios with heavy fog or rain, where timely and graded early warnings of high-risk driving behaviors are impossible.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: The present invention provides a method for assessing the risk of highway traffic accidents based on a large traffic model.
[0006] The aforementioned method for assessing highway traffic accident risk based on a large traffic model includes: Step S10: Obtain multi-source heterogeneous data of highway segments. Based on the multi-source heterogeneous data of highway segments, use the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism to perform the vehicle target sequence construction task and output the time-aligned vehicle target sequence and macro-state sequence. Step S20: Based on the vehicle target sequence and macroscopic state sequence, perform the vehicle microscopic motion feature extraction task and output the microscopic feature sequence of all vehicles; Step S30: Based on the micro-feature sequence and macro-state sequence, a cross-attention mechanism and a bidirectional GRU temporal coding mechanism are used to perform the macro- and micro-feature fusion task, and output the fused temporal feature vector of all vehicles; Step S40: Based on the fused temporal feature vector, anomaly detection is performed using Mahalanobis distance calculation based on Transformer encoder, and the risk level and corresponding behavior classification label of each vehicle are output. Step S50: Based on the risk level and the corresponding behavior classification label, use Gaussian kernel density estimation and hierarchical early warning mechanism to perform road segment risk visualization and early warning decision-making tasks, and output road segment risk heat map.
[0007] Preferably, step S10, which involves acquiring multi-source heterogeneous data of highway segments, using the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism based on the multi-source heterogeneous data of highway segments to perform a vehicle target sequence construction task, and outputting time-aligned vehicle target sequences and macroscopic state sequences, specifically includes: Step S101: Collect raw 77GHz millimeter-wave radar point cloud sequence, weather station data, road surface sensor data, and high-precision map data; wherein, the weather station data includes at least visibility, rainfall intensity, and wind speed, and the road surface sensor data includes at least road surface friction coefficient and water depth; Step S102: Perform point cloud denoising and coordinate transformation on the original 77GHz millimeter-wave radar point cloud sequence, and use the DBSCAN clustering algorithm to cluster vehicle targets in the continuous radar point cloud to obtain the vehicle target set corresponding to each time moment. Step S103: Adjust the neighborhood radius parameter in the DBSCAN clustering algorithm according to the real-time visibility, and perform target association on the vehicle target sets at adjacent time points to obtain the vehicle target sequence; Step S104: Interpolate and align the meteorological station data, road surface sensor data, and high-precision map data according to the timestamp of the vehicle target sequence to generate a macroscopic state sequence synchronized with the vehicle target sequence.
[0008] Preferably, step S20, which involves performing a vehicle micro-motion feature extraction task based on the vehicle target sequence and macro-state sequence, and outputting the micro-feature sequence of all vehicles, specifically includes: Step S201: Based on the vehicle target sequence, extract the position, velocity, acceleration and radar cross section of each vehicle target in a continuous T frames to form a continuous vehicle motion trajectory; Step S202: Based on the continuous motion trajectory of the vehicle, calculate the headway, relative speed and time distance between the current vehicle and the vehicle in front, and calculate the dynamic safe time distance threshold according to the road friction coefficient, visibility and water depth in the macro state sequence to obtain the following distance characteristics; Step S203: Based on the continuous motion trajectory of the vehicle and the lane centerline in the high-precision map data, calculate the lateral offset and yaw angle of the vehicle target relative to the lane centerline to obtain the lane keeping feature; Step S204: Calculate the acceleration change and jerk change based on the continuous motion trajectory of the vehicle, and combine the following distance feature, lane keeping feature, acceleration change and jerk change in time order to output the micro-feature sequence of all vehicles.
[0009] Preferably, step S202, the step of calculating the dynamic safe distance threshold based on the road surface friction coefficient, visibility, and water depth in the macroscopic state sequence, includes: calculating the dynamic safe distance threshold according to the following formula: ; in, Indicates time The corresponding dynamic safety time interval threshold, Indicates the basic safe distance under standard road conditions. Indicates time The corresponding road surface friction coefficient, This represents the reference friction coefficient for a standard dry road surface. Indicates time Corresponding visibility, Indicates reference visibility. Indicates time The corresponding water depth, Table for reference water depth, , , These represent the adjustment coefficients corresponding to the road surface friction coefficient, visibility, and water depth, respectively. When the actual following distance is less than the dynamic safe following distance threshold, it is determined that the corresponding vehicle has an abnormal following distance risk.
[0010] Preferably, step S30, which involves performing the macro- and micro-feature fusion task based on the micro-feature sequence and macro-state sequence using a cross-attention mechanism and a bidirectional GRU temporal coding mechanism to output the fused temporal feature vectors for all vehicles, specifically includes: Step S301: Input the macroscopic state sequence into a preset fully connected layer to obtain an environmental context vector corresponding to the time dimension of the microscopic feature sequence; Step S302: Using the micro-feature sequence as the query vector and the environmental context vector as the key vector and value vector, calculate the environmental weighted features using a cross-attention mechanism; Step S303: Perform residual connection and layer normalization on the environmental weighted features and the micro feature sequence to obtain a normalized fused feature sequence; Step S304: Input the normalized fused feature sequence into the bidirectional GRU time encoder to extract the forward and backward change relationships of the vehicle target in continuous time steps, and output the fused time feature vector of all vehicles.
[0011] Preferably, step S40, which involves performing anomaly detection based on the fused temporal feature vector using Mahalanobis distance calculation using a Transformer encoder, and outputting the risk level and corresponding behavior classification label for each vehicle, specifically includes: Step S401: Input the fused temporal feature vector into the large traffic model based on the Transformer architecture, and output the vehicle behavior representation vector through the Transformer encoder; Step S402: Perform feature reconstruction based on the vehicle behavior representation vector, and calculate the reconstruction error between the reconstructed features and the fused temporal feature vector; Step S403: Based on the vehicle behavior representation vector and the normal driving behavior feature distribution obtained in the pre-training stage, calculate the Mahalanobis distance corresponding to the vehicle behavior representation vector; Step S404: Assign weights to the reconstruction error and Mahalanobis distance based on real-time visibility, and calculate the comprehensive anomaly score; Step S405: Determine the vehicle risk level based on the comprehensive anomaly score, and determine the corresponding behavior classification label based on the contribution distribution of the reconstruction error and Mahalanobis distance to the following distance feature, lane keeping feature, acceleration change and jerk change. Step S406: Output the risk level and corresponding behavior classification label for each vehicle; wherein the behavior classification label includes at least following too closely, lane departure, rapid acceleration, rapid deceleration, and abnormal lateral sway.
[0012] Preferably, in step S50, the comprehensive anomaly score is calculated according to the following formula: ; The dynamic weights are calculated according to the following formula: ; in, Indicates vehicle target At any moment The overall abnormal score, Indicates vehicle target The corresponding reconstruction error, Indicates vehicle target The corresponding Mahalanobis distance, Indicates time The corresponding dynamic weights, Indicates the basic weight. This represents the visibility adjustment factor. Indicates time Corresponding visibility, Indicates reference visibility; When the comprehensive abnormal score is within the first score range, the vehicle risk level is determined to be low risk; When the comprehensive anomaly score falls within the second score range, the vehicle risk level is determined to be medium risk. When the comprehensive abnormal score is in the third score range, the vehicle risk level is determined to be high risk.
[0013] This invention also provides a highway traffic accident risk assessment system based on a large traffic model, comprising: The data acquisition and preprocessing module is used to acquire multi-source heterogeneous data of highway segments. Based on the multi-source heterogeneous data of highway segments, the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism are used to perform the vehicle target sequence construction task, and output the time-aligned vehicle target sequence and macro state sequence. The micro-feature extraction module is used to perform the task of extracting micro-motion features of vehicles based on the vehicle target sequence and macro-state sequence, and output the micro-feature sequence of all vehicles. The feature fusion encoding module is used to perform macro- and micro feature fusion tasks based on the micro-feature sequence and macro-state sequence, using a cross-attention mechanism and a bidirectional GRU temporal encoding mechanism, and output the fused temporal feature vector of all vehicles. The risk assessment and detection module is used to perform anomaly detection based on the fused temporal feature vector and the Mahalanobis distance calculation method based on the Transformer encoder, and output the risk level and corresponding behavior classification label of each vehicle. The risk visualization and early warning module is used to perform road segment risk visualization and early warning decision-making tasks based on the risk level and corresponding behavior classification label, using Gaussian kernel density estimation and hierarchical early warning mechanism, and outputting a road segment risk heat map.
[0014] The present invention also provides a highway traffic accident risk assessment device based on a large traffic model. The highway traffic accident risk assessment device based on a large traffic model includes: a memory, a processor, and a highway traffic accident risk assessment program based on a large traffic model stored in the memory and executable on the processor. When the highway traffic accident risk assessment program based on a large traffic model is executed by the processor, a highway traffic accident risk assessment method based on a large traffic model is implemented.
[0015] The present invention also provides a computer program product, which includes a highway traffic accident risk assessment program based on a large traffic model. When the highway traffic accident risk assessment program based on the large traffic model is executed by a processor, it implements a highway traffic accident risk assessment method based on a large traffic model.
[0016] The beneficial effects of this invention are as follows: 1. This invention constructs a time-aligned sequence integrating multi-source heterogeneous data (radar, meteorological, road surface, and high-precision map) and employs DBSCAN clustering and dynamic parameter adjustment mechanisms to ensure robustness of vehicle target tracking and adaptability to adverse weather conditions, laying a high-quality data foundation for subsequent accurate feature extraction and fusion. Simultaneously, through a cross-attention mechanism and bidirectional GRU encoding, it achieves deep and dynamic fusion of vehicle micro-motion features and macro-environmental features, enabling the risk assessment model to fully understand the impact of the environment on the safety boundaries of driving behavior and significantly improving the accuracy of risk identification under complex conditions.
[0017] 2. This invention employs Mahalanobis distance calculation based on a Transformer encoder for anomaly detection. This not only captures long-range dependencies and nonlinear patterns in vehicle behavior sequences but also achieves refined and interpretable scoring of abnormal behavior through a dual metric of reconstruction error and Mahalanobis distance, combined with dynamic visibility weighting. Finally, a road segment risk heatmap is generated using Gaussian kernel density estimation and a hierarchical early warning mechanism. This effectively aggregates individual vehicle risks into a macro-level risk situation at the road segment level, providing traffic management departments with intuitive and scientific decision support and realizing a closed-loop chain from micro-behavior detection to macro-risk early warning. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the first embodiment of a highway traffic accident risk assessment method based on a large traffic model according to the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0020] Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Example 1: As Figure 1 The diagram shown is a flowchart of the first embodiment of a highway traffic accident risk assessment method based on a large traffic model according to the present invention. The first embodiment of the highway traffic accident risk assessment method based on a large traffic model according to the present invention is presented.
[0022] In the first embodiment, the highway traffic accident risk assessment method based on a large traffic model includes: Step S10: Obtain multi-source heterogeneous data of highway segments. Based on the multi-source heterogeneous data of highway segments, use the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism to perform the vehicle target sequence construction task and output the time-aligned vehicle target sequence and macro-state sequence. The "multi-source heterogeneous data of highway sections" in this step specifically includes point cloud sequences collected by 77GHz millimeter-wave radar, visibility, rainfall intensity, and wind speed data provided by weather stations, friction coefficient and water depth data provided by road surface sensors, and lane-level geometric and attribute information provided by high-precision maps. The "DBSCAN clustering algorithm" is used to cluster radar point clouds into independent vehicle targets. The neighborhood radius parameter is dynamically adjusted according to real-time visibility to address the point cloud sparsity problem caused by reduced visibility. The "timestamp interpolation alignment mechanism" refers to uniformly aligning macroscopic data such as meteorological and road surface data from different sampling frequencies and times to each timestamp of the vehicle target sequence using interpolation methods, thereby generating a "macroscopic state sequence" that strictly corresponds to the time of each vehicle target. The output "vehicle target sequence" is a tracking sequence of the position, speed, and other states of each vehicle at consecutive times, while the "macroscopic state sequence" is an environmental state sequence synchronized with these times. Both serve as inputs for subsequent steps.
[0023] This step, serving as the data preprocessing and foundational building phase of the entire methodology, effectively transforms the raw, chaotic, asynchronous, and heterogeneous multi-source data into standardized sequence data that is strictly synchronized in time and has clearly defined spatial objectives. This provides a unified and reliable data foundation for all subsequent analysis steps, ensuring that microscopic vehicle behavior and macroscopic environmental factors can be correlated and integrated within the same spatiotemporal framework.
[0024] Compared to traditional techniques that often use only single radar or video data, or simply treat environmental data as a static background, this step significantly improves the stability and continuity of vehicle target detection and tracking under adverse conditions such as low visibility through dynamic parameter DBSCAN and refined timestamp alignment. Simultaneously, it achieves millisecond-level synchronization between microscopic traffic flow and macroscopic environmental conditions, overcoming the mismatch of environmental factors caused by data asynchrony in traditional methods. This allows for more accurate modeling of the impact of the environment on driving behavior. For example, in foggy weather, visibility drops sharply to 50 meters. Traditional fixed-parameter clustering algorithms may fail to effectively cluster vehicles due to the sparse point cloud, leading to target loss. In this step, the neighborhood radius of DBSCAN automatically expands according to the reduced visibility, thus successfully clustering point clouds of distant vehicles. Furthermore, the visibility data reported by the weather station is precisely aligned to the timestamp of each frame of radar data through interpolation, ensuring that when calculating subsequent features, the system "knows" that the accurate visibility at the current moment is 50 meters, rather than the average of the previous minute.
[0025] Step S20: Based on the vehicle target sequence and macroscopic state sequence, perform the vehicle microscopic motion feature extraction task and output the microscopic feature sequence of all vehicles; The "Vehicle Micro-motion Feature Extraction Task" in this step refers to calculating a series of quantitative indicators from the vehicle target sequence output in step S10 to characterize the motion state of an individual vehicle and its relative relationship with other vehicles and lanes. Specifically, these include: basic motion features calculated based on continuous trajectory (position, speed, acceleration, radar cross section); "following distance features" reflecting following risk, such as headway, relative speed, and time distance, with a "dynamic safe time distance threshold" calculated based on road friction coefficient, visibility, and water depth for comparison; "lane keeping features" reflecting vehicle control stability, such as lateral deviation and yaw angle; and "acceleration change" and "jerk change" reflecting the degree of driving aggression. All these features are combined in chronological order to form the "micro-feature sequence" for each vehicle, which is the direct input for subsequent deep feature fusion.
[0026] Compared to traditional technologies that rely solely on fixed thresholds for following distance or speed exceeding limits as risk characteristics, this step calculates a dynamic safe following distance threshold, allowing the risk assessment to adaptively adjust based on road surface slippage and visibility. For example, on flooded roads, even if the actual following distance is the same as on dry roads, the increased braking distance allows for risk identification by lowering the dynamic safe following distance threshold. Furthermore, by combining high-precision maps to calculate accurate lateral offsets, this method is more precise and stable than traditional visual lane line estimation methods, effectively identifying slow lane departures.
[0027] For example, a car is following another vehicle on a highway in rainy weather (where the road surface friction coefficient is low). Traditional methods might only determine if the distance between the two vehicles is less than 100 meters. However, in this step, the system reads the current road surface friction coefficient and visibility, and calculates the dynamic safe following distance threshold under the current conditions, which might be equivalent to 150 meters. If the calculated actual following distance corresponds to 120 meters, although this is greater than the fixed threshold of 100 meters, it is less than the dynamic threshold of 150 meters. Therefore, the "following distance feature" will mark it as having a potential risk. Simultaneously, the system will calculate the vehicle's lateral deviation relative to the lane centerline. If a continuous, slow tendency to drift to the right is detected (with a consistently positive yaw angle), the "lane keeping feature" will also give an abnormal signal.
[0028] Step S30: Based on the micro-feature sequence and macro-state sequence, a cross-attention mechanism and a bidirectional GRU temporal coding mechanism are used to perform the macro- and micro-feature fusion task, and output the fused temporal feature vector of all vehicles; The "cross-attention mechanism" in this step is a deep learning model component used here to fuse micro- and macro-features. Specifically, the "micro-feature sequence" output from step S20 is used as the query, and the "environmental context vector" obtained by mapping the "macro-state sequence" output from step S10 through a fully connected layer is used as the key and value. By calculating the similarity between the query and the key, attention weights are obtained, and then these weights are used to perform a weighted sum of the values to generate "environment-weighted features." This is equivalent to making the model "consciously" refer to the current environmental context (such as visibility and road surface slipperiness) when analyzing each micro-action of the vehicle. Subsequently, the model is stabilized through "residual connections" and "layer normalization" and then input into a "bidirectional GRU temporal encoder." The bidirectional GRU can simultaneously capture the temporal dependencies and change patterns of the vehicle feature sequence from both forward and backward directions, ultimately outputting a "fused temporal feature vector" that integrates micro-behavioral details, macro-environmental influences, and temporal evolution patterns. This invention achieves deep, dynamic fusion and high-order encoding of vehicle micro-behavior and macro-environmental factors. The cross-attention mechanism ensures that environmental information is not simply pieced together, but rather dynamically influences the interpretation of micro-features through soft selection. The bidirectional GRU further extracts robust temporal representations containing past and future contextual information from the fused sequence. The final output, the "fused temporal feature vector," is a high-dimensional, dense vector that comprehensively represents "the overall behavioral pattern of a vehicle over a period of time under a specific environmental sequence."
[0029] Compared to traditional techniques that simply concatenate environmental parameters as static features with vehicle features, or completely ignore environmental factors, this step achieves adaptive modulation of vehicle features by environmental factors through cross-attention. For example, in low visibility conditions, the model automatically increases the weight given to following distance features; in slippery road conditions, it pays more attention to the stability of acceleration and jerk features. The introduction of bidirectional GRUs allows the model to not only judge current risks based on historical behavior, but also perceive the predictive effect of current behavior on future risks (e.g., slow acceleration may be a precursor to rapid acceleration), achieving temporal modeling of risk evolution, which is impossible with simple sliding window statistical methods. For example, for the same micro-feature of "slightly increased acceleration," in a macro-environment with good visibility and a dry road, the cross-attention mechanism may consider this normal overtaking behavior and assign it a low abnormal weight. However, in a dense fog (low visibility) environment, the same acceleration feature will be re-evaluated by the model in conjunction with the environmental context of "low visibility," and the attention mechanism may increase its weight because the risk of accelerating and overtaking is higher in low visibility. The bidirectional GRU will analyze whether this acceleration is an isolated fluctuation in the entire driving process or the beginning of a continuous acceleration trend, and thus output different fused timing features.
[0030] Step S40: Based on the fused temporal feature vector, anomaly detection is performed using Mahalanobis distance calculation based on Transformer encoder, and the risk level and corresponding behavior classification label of each vehicle are output. The "Mahavioran distance calculation method based on Transformer encoder" in this step is the core of anomaly detection. First, the "fused temporal feature vector" output from step S30 is input into a "large traffic model" encoder based on the Transformer architecture. This encoder further refines the features through a self-attention mechanism, outputting a deeper "vehicle behavior representation vector". Anomaly detection is performed in two ways: one is "feature reconstruction", which attempts to reconstruct the original fused temporal features from the behavior representation vector and calculates the "reconstruction error". The larger the error, the more the behavior pattern deviates from the normal pattern learned by the model. The second is "Mahavioran distance" calculation, which calculates the distance between the current behavior representation vector and the multivariate Gaussian distribution formed by a large number of normal driving behavior features collected in the pre-training stage. The larger the distance, the more abnormal it is. The key innovation is that the final "comprehensive anomaly score" is a weighted sum of the reconstruction error and the Mahavioran distance, and the weights "dynamic weights" are dynamically adjusted according to the real-time visibility (the lower the visibility, the more it relies on the distribution-based method of Mahavioran distance, which may be more robust to unknown anomalies). Based on this score, "risk levels" (low, medium, high) are assigned, and specific "behavioral classification labels" are determined according to the contribution distribution of reconstruction error and Mahalanobis distance in each micro-feature dimension (following distance, lane keeping, etc.).
[0031] The technical advantage of this step lies in achieving refined and interpretable detection and classification of abnormal driving behaviors. The Transformer encoder can capture long-range dependencies and patterns in complex behavioral sequences. Reconstruction error excels at detecting local, novel anomalous patterns, while Mahalanobis distance excels at detecting global patterns that deviate from normal distributions; the two complement each other. The dynamic weighting mechanism enables the detection strategy to adapt to different visibility conditions, improving robustness. Ultimately, it not only provides a risk score but also indicates, through contribution distribution analysis, whether "following too closely" or "lane departure" caused the high risk, making the warning information actionable.
[0032] Compared to traditional techniques that use fixed thresholds or single statistics (such as mean and variance) for anomaly detection, the deep anomaly detection method employed in this step has stronger representational capabilities and adaptability. The Transformer model can learn highly complex spatiotemporal patterns in normal driving behavior. Mahalanobis distance considers the correlation between features and is more reasonable than Euclidean distance. Most importantly, traditional methods typically only output a binary judgment of "abnormal," while this method can output continuous risk scores, levels, and specific behavior classifications, enabling graded early warnings and targeted interventions. The dynamic weighting mechanism also overcomes the performance degradation problem of single detection methods in specific environments (such as extreme weather). For example, when detecting a vehicle's behavior, the Transformer encoder processes it and calculates its Mahalanobis distance, finding it slightly deviates from the normal distribution with a small reconstruction error. Individually, it might only be considered low to medium risk. However, visibility is very low, and the weight of the Mahalanobis distance is increased according to the formula. Since the distribution of normal driving behavior is more concentrated in low visibility (drivers are generally more cautious), any deviation could mean a greater risk; therefore, the weighted comprehensive anomaly score might reach a "high risk" level. Meanwhile, analysis of the contribution distribution revealed that the contribution of Mahalanobis distance mainly came from the following distance feature dimension, while the contribution of reconstruction error mainly came from the acceleration feature dimension. Therefore, the vehicle was ultimately determined to be "high-risk," and the behavior was classified as "following too closely with sudden acceleration," which is a highly risky combined behavior in low visibility conditions.
[0033] Step S50: Based on the risk level and the corresponding behavior classification label, use Gaussian kernel density estimation and hierarchical early warning mechanism to perform road segment risk visualization and early warning decision-making tasks, and output road segment risk heat map.
[0034] The "Gaussian kernel density estimation" in this step is a non-parametric statistical method used to estimate the risk probability density at any point in the entire road segment based on the "risk level" (specifically, the mapping between spatial location and its risk score) of all vehicles at different locations on the road segment output in step S40. Simply put, it treats the impact of each high-risk vehicle as a "risk heat source" centered on that vehicle's location, and smoothly diffuses its impact to the surrounding area using a Gaussian kernel function. The superposition of the risk diffusion from all vehicles forms a continuous "road segment risk heat map." The "tiered early warning mechanism" sets different thresholds based on the risk density values of different areas in the heat map, corresponding to different warning levels (e.g., blue - low risk warning, yellow - medium risk warning, red - high risk alert). The final output "road segment risk heat map" is a visual image or geographic information data layer that intuitively shows which areas on the road segment are risk clusters and the severity of the risk. This effectively aggregates and elevates discrete, single-vehicle-level risk assessment results into a continuous, road segment-level macro-risk situational awareness, allowing traffic managers to clearly grasp the overall safety status of the entire road segment. The tiered early warning mechanism transforms abstract density values into concrete action guidelines, supporting differentiated control decisions. For example, strong early warnings can be issued through variable message signs for red high-risk areas.
[0035] For example, step S40 detects 5 vehicles marked as high-risk and 10 vehicles as medium-risk on a road segment. Traditionally, only the IDs of these 15 vehicles might be listed. However, in this step, Gaussian kernel density estimation calculates the locations of these vehicles: assuming that 3 high-risk vehicles and 5 medium-risk vehicles are densely distributed within a 1-kilometer radius of a highway exit ramp, kernel density estimation will generate a bright (e.g., red) hotspot in this area. Simultaneously, the other 2 high-risk vehicles are scattered in different locations on the main road, forming two smaller yellow hotspots. The final heatmap clearly shows: the exit ramp area is a red high-risk cluster requiring immediate attention; other locations on the main road have scattered yellow medium-risk points. Based on this map, the traffic management center can prioritize issuing warnings such as "Beware of merging vehicles, maintain a safe distance" via broadcasts and information boards in the red area, and can also dispatch drones or patrol cars to the area to assess the situation.
[0036] Example 2: Furthermore, the present invention provides a highway traffic accident risk assessment system based on a large traffic model, employing a highway traffic accident risk assessment method based on a large traffic model as described in the above embodiments, which can solve the technical problem of highway traffic accident risk assessment based on a large traffic model. The beneficial effects of the highway traffic accident risk assessment system based on a large traffic model provided by the present invention are the same as those of the highway traffic accident risk assessment method based on a large traffic model provided in the above embodiments, and other technical features of the highway traffic accident risk assessment system based on a large traffic model are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0037] Example 3: This invention provides a highway traffic accident risk assessment device based on a large traffic model. The device includes: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which are then executed to enable the at least one processor to perform the highway traffic accident risk assessment method based on a large traffic model described in Example 1. The highway traffic accident risk assessment device based on a large traffic model in this invention may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. This highway traffic accident risk assessment device based on a large traffic model is merely an example and should not limit the functionality or scope of the invention. A highway traffic accident risk assessment device based on a large traffic model may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) that can perform various appropriate actions and processes according to a program stored in read-only memory or a program loaded from a storage device into random access memory. The random access memory also stores various programs and data required for the operation of the highway traffic accident risk assessment device based on the large traffic model. The processing unit, read-only memory, and random access memory are interconnected via a bus. An I / O interface is also connected to the bus. Typically, the following systems can be connected to the I / O interface: input devices including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices including, for example, magnetic tapes, hard disks, etc.; and communication devices. The communication device allows the highway traffic accident risk assessment device based on the large traffic model to communicate wirelessly or wiredly with other devices to exchange data. Although the figures show a highway traffic accident risk assessment device based on a large traffic model with various systems, it should be understood that it is not required to implement or possess all the systems shown. It can be implemented alternatively or with more or fewer systems.
[0038] Example 4: This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the highway traffic accident risk assessment method based on a large traffic model as described above. The computer program product provided by this invention can solve the technical problem of highway traffic accident risk assessment based on a large traffic model. Compared with the prior art, the beneficial effects of the computer program product provided by this invention are the same as those of the highway traffic accident risk assessment method based on a large traffic model provided in the above embodiments, and will not be repeated here.
[0039] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a read-only memory. When the computer program is executed by a processing device, it performs the functions defined in the methods of the embodiments disclosed in this invention.
[0040] It should be understood that the various parts disclosed in this invention can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0041] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of this invention and its equivalents, this invention also intends to include these modifications and variations.
Claims
1. A method for assessing highway traffic accident risk based on a large traffic model, characterized in that, The methods include: Step S10: Obtain multi-source heterogeneous data of highway segments. Based on the multi-source heterogeneous data of highway segments, use the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism to perform the vehicle target sequence construction task and output the time-aligned vehicle target sequence and macro-state sequence. Step S20: Based on the vehicle target sequence and macroscopic state sequence, perform the vehicle microscopic motion feature extraction task and output the microscopic feature sequence of all vehicles; Step S30: Based on the micro-feature sequence and macro-state sequence, a cross-attention mechanism and a bidirectional GRU temporal coding mechanism are used to perform the macro- and micro-feature fusion task, and output the fused temporal feature vector of all vehicles; Step S40: Based on the fused temporal feature vector, anomaly detection is performed using Mahalanobis distance calculation based on Transformer encoder, and the risk level and corresponding behavior classification label of each vehicle are output. Step S50: Based on the risk level and the corresponding behavior classification label, use Gaussian kernel density estimation and hierarchical early warning mechanism to perform road segment risk visualization and early warning decision-making tasks, and output road segment risk heat map.
2. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 1, characterized in that, Step S10 involves acquiring multi-source heterogeneous data of highway segments, and using the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism to construct vehicle target sequences based on this data. The steps include outputting time-aligned vehicle target sequences and macroscopic state sequences. Step S101: Collect raw 77GHz millimeter-wave radar point cloud sequence, weather station data, road surface sensor data, and high-precision map data; wherein, the weather station data includes at least visibility, rainfall intensity, and wind speed, and the road surface sensor data includes at least road surface friction coefficient and water depth; Step S102: Perform point cloud denoising and coordinate transformation on the original 77GHz millimeter-wave radar point cloud sequence, and use the DBSCAN clustering algorithm to cluster vehicle targets in the continuous radar point cloud to obtain the vehicle target set corresponding to each time moment. Step S103: Adjust the neighborhood radius parameter in the DBSCAN clustering algorithm according to the real-time visibility, and perform target association on the vehicle target sets at adjacent time points to obtain the vehicle target sequence; Step S104: Interpolate and align the meteorological station data, road surface sensor data, and high-precision map data according to the timestamp of the vehicle target sequence to generate a macroscopic state sequence synchronized with the vehicle target sequence.
3. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 2, characterized in that, Step S20, based on the vehicle target sequence and macroscopic state sequence, involves performing a vehicle microscopic motion feature extraction task and outputting the microscopic feature sequences of all vehicles. This step specifically includes: Step S201: Based on the vehicle target sequence, extract the position, velocity, acceleration and radar cross section of each vehicle target in a continuous T frames to form a continuous vehicle motion trajectory; Step S202: Based on the continuous motion trajectory of the vehicle, calculate the headway, relative speed and time distance between the current vehicle and the vehicle in front, and calculate the dynamic safe time distance threshold according to the road friction coefficient, visibility and water depth in the macro state sequence to obtain the following distance characteristics; Step S203: Based on the continuous motion trajectory of the vehicle and the lane centerline in the high-precision map data, calculate the lateral offset and yaw angle of the vehicle target relative to the lane centerline to obtain the lane keeping feature; Step S204: Calculate the acceleration change and jerk change based on the continuous motion trajectory of the vehicle, and combine the following distance feature, lane keeping feature, acceleration change and jerk change in time order to output the micro-feature sequence of all vehicles.
4. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 3, characterized in that, Step S202, the step of calculating the dynamic safe distance threshold based on the road surface friction coefficient, visibility, and water depth in the macroscopic state sequence, includes: calculating the dynamic safe distance threshold according to the following formula: ; in, Indicates time The corresponding dynamic safety time interval threshold, Indicates the basic safe distance under standard road conditions. Indicates time The corresponding road surface friction coefficient, This represents the reference friction coefficient for a standard dry road surface. Indicates time Corresponding visibility, Indicates reference visibility. Indicates time The corresponding water depth, Table for reference water depth, , , These represent the adjustment coefficients corresponding to the road surface friction coefficient, visibility, and water depth, respectively. When the actual following distance is less than the dynamic safe following distance threshold, it is determined that the corresponding vehicle has an abnormal following distance risk.
5. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 1, characterized in that, Step S30, based on the micro-feature sequence and macro-state sequence, employs a cross-attention mechanism and a bidirectional GRU temporal coding mechanism to perform the macro- and micro-feature fusion task, outputting the fused temporal feature vectors for all vehicles. This step specifically includes: Step S301: Input the macroscopic state sequence into a preset fully connected layer to obtain an environmental context vector corresponding to the time dimension of the microscopic feature sequence; Step S302: Using the micro-feature sequence as the query vector and the environmental context vector as the key vector and value vector, calculate the environmental weighted features using a cross-attention mechanism; Step S303: Perform residual connection and layer normalization on the environmental weighted features and the micro feature sequence to obtain a normalized fused feature sequence; Step S304: Input the normalized fused feature sequence into the bidirectional GRU time encoder to extract the forward and backward change relationships of the vehicle target in continuous time steps, and output the fused time feature vector of all vehicles.
6. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 1, characterized in that, Step S40, which involves using the fused temporal feature vector to perform anomaly detection based on Mahalanobis distance calculation using a Transformer encoder, and outputting the risk level and corresponding behavior classification label for each vehicle, specifically includes: Step S401: Input the fused temporal feature vector into the large traffic model based on the Transformer architecture, and output the vehicle behavior representation vector through the Transformer encoder; Step S402: Perform feature reconstruction based on the vehicle behavior representation vector, and calculate the reconstruction error between the reconstructed features and the fused temporal feature vector; Step S403: Based on the vehicle behavior representation vector and the normal driving behavior feature distribution obtained in the pre-training stage, calculate the Mahalanobis distance corresponding to the vehicle behavior representation vector; Step S404: Assign weights to the reconstruction error and Mahalanobis distance based on real-time visibility, and calculate the comprehensive anomaly score; Step S405: Determine the vehicle risk level based on the comprehensive anomaly score, and determine the corresponding behavior classification label based on the contribution distribution of the reconstruction error and Mahalanobis distance to the following distance feature, lane keeping feature, acceleration change and jerk change. Step S406: Output the risk level and corresponding behavior classification label for each vehicle; wherein the behavior classification label includes at least following too closely, lane departure, rapid acceleration, rapid deceleration, and abnormal lateral sway.
7. The method for assessing highway traffic accident risk based on a large traffic model as described in claim 6, characterized in that, In step S50, the comprehensive anomaly score is calculated according to the following formula: ; The dynamic weights are calculated according to the following formula: ; in, Indicates vehicle target At any moment The overall abnormal score, Indicates vehicle target The corresponding reconstruction error, Indicates vehicle target The corresponding Mahalanobis distance, Indicates time The corresponding dynamic weights, Indicates the basic weight. This represents the visibility adjustment factor. Indicates time Corresponding visibility, Indicates reference visibility; When the comprehensive abnormal score is within the first score range, the vehicle risk level is determined to be low risk; When the comprehensive anomaly score falls within the second score range, the vehicle risk level is determined to be medium risk. When the comprehensive abnormal score is in the third score range, the vehicle risk level is determined to be high risk.
8. A highway traffic accident risk assessment system based on a large traffic model, applied to the highway traffic accident risk assessment method based on a large traffic model as described in any one of claims 1 to 7, characterized in that, The system includes: The data acquisition and preprocessing module is used to acquire multi-source heterogeneous data of highway segments. Based on the multi-source heterogeneous data of highway segments, the DBSCAN clustering algorithm and timestamp interpolation alignment mechanism are used to perform the vehicle target sequence construction task, and output the time-aligned vehicle target sequence and macro state sequence. The micro-feature extraction module is used to perform the task of extracting micro-motion features of vehicles based on the vehicle target sequence and macro-state sequence, and output the micro-feature sequence of all vehicles. The feature fusion encoding module is used to perform macro- and micro feature fusion tasks based on the micro-feature sequence and macro-state sequence, using a cross-attention mechanism and a bidirectional GRU temporal encoding mechanism, and output the fused temporal feature vector of all vehicles. The risk assessment and detection module is used to perform anomaly detection based on the fused temporal feature vector and the Mahalanobis distance calculation method based on the Transformer encoder, and output the risk level and corresponding behavior classification label of each vehicle. The risk visualization and early warning module is used to perform road segment risk visualization and early warning decision-making tasks based on the risk level and corresponding behavior classification label, using Gaussian kernel density estimation and hierarchical early warning mechanism, and outputting a road segment risk heat map.
9. A highway traffic accident risk assessment device based on a large traffic model, characterized in that, The highway traffic accident risk assessment device based on a large traffic model includes: a memory, a processor, and a highway traffic accident risk assessment program based on a large traffic model stored in the memory and executable on the processor. When the highway traffic accident risk assessment program based on a large traffic model is executed by the processor, it implements a highway traffic accident risk assessment method based on a large traffic model according to any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a highway traffic accident risk assessment program based on a large traffic model. When the highway traffic accident risk assessment program based on a large traffic model is executed by the processor, it implements a highway traffic accident risk assessment method based on a large traffic model as described in any one of claims 1 to 7.