Road transport vehicle crash risk prediction method and system

By using the FTT-TS deep learning model and the SHAP interpretation mechanism, the accuracy and interpretability issues of the road transport vehicle collision risk prediction model are solved, and technical support for short-term risk prediction and dynamic intervention is achieved.

CN121093070BActive Publication Date: 2026-05-15BEIJING JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING JIAOTONG UNIV
Filing Date
2025-08-15
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing road transport vehicle collision risk prediction models suffer from problems such as low prediction accuracy, poor real-time warning, and insufficient model interpretability. In particular, they are difficult to effectively analyze the influencing factors and mechanisms of accident occurrence under complex multi-source data conditions.

Method used

We employ the FTT-TS deep learning model, combined with the FT-Transformer model and the Time2Vec timestamp vector representation module, to construct a multi-source database. We capture feature interaction relationships through the self-attention mechanism of the Transformer model and introduce the SHAP interpretation mechanism to quantify the contribution and interaction of multidimensional variables on the model's prediction results.

Benefits of technology

It enables short-term and accurate prediction of collision risks of road transport vehicles, improves the reliability and real-time performance of early warning, reveals the nonlinear influence mechanism of multidimensional factors on collision risks, and provides theoretical support for dynamic intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121093070B_ABST
    Figure CN121093070B_ABST
Patent Text Reader

Abstract

The application provides a road transport vehicle collision risk prediction method and system, and belongs to the technical field of deep learning, wherein trajectory data and alarm data of a road transport vehicle are acquired; a collision risk prediction model that is pre-trained is used to process the acquired trajectory data and alarm data, so that a collision risk prediction result is obtained. The application considers the influence of multi-dimensional factors such as drivers, vehicles, trips, environments, roads and time sequences, realizes accurate short-time prediction of vehicle driving risk, and provides strong technical support for improving the reliability and real-time performance of vehicle driving risk early warning. A SHAP explanation mechanism effectively reveals the nonlinear influence mechanism of multi-dimensional factors on collision risk, and provides theoretical support for dynamic intervention of collision risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of deep learning technology, specifically to a method and system for predicting collision risks of road transport vehicles. Background Technology

[0002] In the road traffic system, road transport vehicles face higher accident risks due to the complex differences in vehicle type and cargo type, especially under adverse weather and high-risk road conditions. Furthermore, accidents involving road transport vehicles can cause larger-scale casualties and environmental pollution. Therefore, the safety supervision of road transport vehicles has become a key and challenging aspect of traffic safety management.

[0003] The scarcity of accident data makes it difficult to obtain statistically significant conclusions from studies on vehicle-on-the-road risks. However, with the development of the internet and mobile devices, the vast amounts of alarm and trajectory data recorded by onboard monitoring systems for road transport vehicles provide rich training data for risk prediction models, enabling the widespread application of deep learning models. In the quantification and analysis of risk causation, researchers are increasingly focusing on integrating multi-source data and multi-dimensional features, comprehensively considering various external factors such as people, vehicles, roads, and the environment, and delving into the mechanisms of vehicle-on-the-road risks under multi-dimensional factors and the complex interaction mechanisms between these factors.

[0004] A recent research focus has been on constructing risk prediction models to achieve real-time risk assessment and factor analysis for road transport vehicles. These models are generally based on historical road traffic accident data; however, the rarity and lag of this data severely impact training efficiency and generalization ability, resulting in problems such as low prediction accuracy, poor real-time warnings, unreasonable time window settings, and insufficient model interpretability. Furthermore, prediction models are typically based on deep learning architectures, which also have weak interpretability, making it difficult to deeply analyze the influencing factors and mechanisms of accident occurrence. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for predicting collision risks of road transport vehicles, so as to solve at least one of the technical problems existing in the background art.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for predicting collision risks of road transport vehicles, comprising:

[0008] Acquire trajectory data and alarm data of road transport vehicles;

[0009] A pre-trained collision risk prediction model is used to process the acquired trajectory data and alarm data to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises road transport vehicle collision risk time series from multiple historical time steps, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, with a variable system constructed using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations to capture linear trends and periodic patterns in time features, and leveraging the Transformer model's self-attention mechanism to capture the complex interactions between features.

[0010] As a further limitation of the first aspect of this invention, the construction of a variable system includes: acquiring trajectory data and alarm data of road transport vehicles, defining the research scope, and constructing a grid map; using a trip segmentation algorithm to divide sub-trips and trips from continuous trajectory data; constructing time series samples, setting the time step to 5 minutes, and taking the six time steps before and after the occurrence of collision risk to form positive samples, while sequences without collision risk are negative samples; collecting DEM elevation data and topographic data to construct an environmental and road information database; using the K-means++ algorithm to classify drivers into three categories: aggressive, average, and conservative, and constructing a driver information database; distinguishing road transport vehicles from four dimensions according to relevant laws and regulations, and constructing a vehicle information database; and building a variable system of factors influencing road vehicle collision risk using 5-minute time slices as units.

[0011] As a further limitation of the first aspect of the present invention, FT-Transformer introduces a feature token mechanism to unify numerical features and categorical features into representations in the embedding space, and uses the self-attention mechanism of the Transformer model to capture the complex interaction relationships between features; Time2Vec embeds scalar time variables into vector representations to capture linear trends and periodic patterns in time features; the FTT-TS model combines FT-Transformer and Time2Vec to add time features on the basis of numerical features and categorical features.

[0012] As a further definition of the first aspect of the present invention, the construction of environmental and road information includes: taking each grid in the grid map as a unit, obtaining the average elevation of the grid based on DEM elevation data and topographic data; obtaining the land use mixing degree and the number of POIs of the grid; obtaining the weather and temperature information of the grid after processing based on the weather data of the region; obtaining the density of four levels of roads in the grid, namely highways and arterial roads, urban main roads, urban secondary arterial roads and urban branch roads, as well as bridge density and tunnel density, after processing based on the road network data of different levels in the study area; identifying the grid paths traversed by vehicles within a 5-minute time slice, and calculating the average elevation, average land use mixing degree, total POIs, total road length of each level, total bridge length, and total tunnel length.

[0013] As a further limitation of the first aspect of the present invention, the vehicle information construction includes: distinguishing road transport vehicles from four dimensions: vehicle type, vehicle specifications, approved load capacity, and cargo type.

[0014] As a further limitation of the first aspect of the present invention, accuracy, sensitivity, specificity, G-Mean, precision, F1-score, and two types of curve integral-based metrics, AUC-ROC and PR-AUC, are selected as evaluation metrics to assess model performance.

[0015] Secondly, the present invention provides a road transport vehicle collision risk prediction system, comprising:

[0016] The acquisition module is used to acquire trajectory data and alarm data of road transport vehicles;

[0017] The processing module is used to process the acquired trajectory data and alarm data using a pre-trained collision risk prediction model to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises multiple historical time steps of road transport vehicle collision risk time series, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, constructing a variable system using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embeds scalar time features into vector representations, captures linear trends and periodic patterns in time features, and utilizes the Transformer model's self-attention mechanism to capture the complex interactive relationships between features.

[0018] Thirdly, the present invention provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the road transport vehicle collision risk prediction method as described in the first aspect.

[0019] Fourthly, the present invention provides a computer device including a memory and a processor, the processor and the memory communicating with each other, the memory storing program instructions executable by the processor, and the processor calling the program instructions to execute the road transport vehicle collision risk prediction method as described in the first aspect.

[0020] Fifthly, the present invention provides an electronic device comprising: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the road transport vehicle collision risk prediction method as described in the first aspect.

[0021] The beneficial effects of this invention are as follows: By considering the influence of multiple dimensions such as driver, vehicle, trip, environment, road, and time series, it achieves accurate short-term prediction of vehicle driving risks, providing strong technical support for improving the reliability and real-time performance of vehicle driving risk warnings. The SHAP interpretation mechanism effectively reveals the nonlinear influence mechanism of multidimensional factors on collision risk, providing theoretical support for dynamic intervention in collision risks.

[0022] The advantages of additional aspects of the invention will be set forth more clearly in the following description or will be learned by practice of the invention. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 This is a flowchart of the vehicle collision risk prediction and causation quantification method based on deep learning and SHAP interpretation mechanism as described in an embodiment of the present invention.

[0025] Figure 2 This is a schematic diagram of the FTT-TS model structure according to an embodiment of the present invention.

[0026] Figure 3 This is a graph showing the feature importance based on SHAP values ​​and the percentage distribution of the five types of features according to an embodiment of the present invention.

[0027] Figure 4 This is the SHAP dependency graph of the key variables' impact on collision warning as described in the embodiments of the present invention.

[0028] Figure 5 This is the SHAP dependency graph of bivariate interaction as described in the embodiments of the present invention. Detailed Implementation

[0029] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.

[0030] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0031] It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless defined as here.

[0032] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, and / or groups thereof.

[0033] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0034] To facilitate understanding of the present invention, the present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments. However, the specific embodiments do not constitute a limitation on the embodiments of the present invention.

[0035] Those skilled in the art should understand that the accompanying drawings are merely schematic diagrams of embodiments, and the components in the drawings are not necessarily essential for implementing the present invention.

[0036] This invention provides a method for short-term prediction and factor quantification of collision risk for road transport vehicles, including: constructing a multi-source database and a multi-dimensional feature system based on real-time vehicle trajectory and alarm data exported from the vehicle's onboard monitoring system, while considering driver attributes, vehicle type, road structure, and environmental factors. An improved time series modeling method, FTT-TS (FT-Transformer for Time Series), is proposed, integrating Time2Vec time embedding and the FT-Transformer structure to effectively capture the time dependence of collision risk. Based on this, a SHAP interpretation mechanism is introduced to quantify the contribution and interaction of multi-dimensional variables to the model's prediction results. The nonlinear influence of driving behavior, cargo type, vehicle load, and environment on collision risk is revealed in depth. The study finds a complex interaction between individual driver differences and cargo type, which is a core factor influencing collision risk, with "aggressive driver + mixed cargo" being a high-risk combination. Furthermore, the generation of collision risk also exhibits spatiotemporal heterogeneity. The research results provide theoretical support and technical methods for accurate short-term prediction and dynamic intervention of road transport collision risk.

[0037] Example 1

[0038] In this embodiment 1, a road transport vehicle collision risk prediction system is provided, including: an acquisition module for acquiring trajectory data and alarm data of road transport vehicles; and a processing module for processing the acquired trajectory data and alarm data using a pre-trained collision risk prediction model to obtain collision risk prediction results.

[0039] In this embodiment, the above-described system is used to implement a method for predicting collision risks of road transport vehicles, including: acquiring trajectory data and alarm data of road transport vehicles using an acquisition module; and processing the acquired trajectory data and alarm data using a pre-trained collision risk prediction model to obtain collision risk prediction results. The training of the collision risk prediction model includes: acquiring training data, which includes multiple historical time steps of road transport vehicle collision risk time series, comprising a multi-source database with six modules: driver, vehicle, trip, environment, road, and time series, using fixed time slices as units to construct a variable system; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module, which unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations, capturing linear trends and periodic patterns in time features, and using the self-attention mechanism of the Transformer model to capture the complex interaction relationships between features.

[0040] In this embodiment, the variable system is constructed as follows: acquiring trajectory data and alarm data of road transport vehicles, defining the research scope, and constructing a grid map; using a trip segmentation algorithm to divide sub-trips and trips from continuous trajectory data; constructing time series samples, setting the time step to 5 minutes, and taking the 6 time steps before and after the occurrence of collision risk to form positive samples, while the sequences without collision risk are negative samples; collecting DEM elevation data and topographic data to construct an environmental and road information database; using the K-means++ algorithm to classify drivers into three categories: aggressive, average, and conservative, and constructing a driver information database; distinguishing road transport vehicles from four dimensions according to relevant laws and regulations, and constructing a vehicle information database; and building a variable system of factors affecting road vehicle collision risk using 5-minute time slices as units.

[0041] FT-Transformer introduces a feature token mechanism to unify numerical and categorical features into representations in the embedding space, and uses the self-attention mechanism of the Transformer model to capture the complex interaction relationships between features; Time2Vec embeds scalar time variables into vector representations to capture linear trends and periodic patterns in time features; the FTT-TS model combines FT-Transformer and Time2Vec to add time features to the numerical and categorical features.

[0042] The construction of environmental and road information includes: taking each grid in the grid map as a unit, obtaining the average elevation of the grid based on DEM elevation data and topographic data; obtaining the land use mixing degree and POI number of the grid; obtaining the weather and temperature information of the grid after processing based on regional weather data; obtaining the density of four levels of roads in the grid, namely highways and arterial roads, urban main roads, urban secondary arterial roads and urban branch roads, as well as bridge density and tunnel density, after processing based on road network data of different levels in the study area; identifying the grid paths traversed by vehicles within a 5-minute time slice, and calculating the average elevation, average land use mixing degree, total POI, total road length of each level, total bridge length, and total tunnel length.

[0043] Vehicle information construction includes differentiating road transport vehicles from four dimensions: vehicle type, vehicle specifications, approved load capacity, and cargo type.

[0044] Accuracy, sensitivity, specificity, G-Mean, precision, F1-score, and two curve integral-based metrics, AUC-ROC and PR-AUC, were selected as evaluation metrics to assess model performance.

[0045] Example 2

[0046] In this second embodiment, a more accurate short-term collision risk prediction scheme for road transport vehicles is provided, and the causal mechanisms of collision risk are explored in depth. This embodiment uses real-time alarm data and trajectory data from the vehicle monitoring system. Addressing the issue of incomplete risk causal dimensions considered in existing research, a multi-source database comprising six modules—driver, vehicle, trip, environment, road, and time series—is constructed, and an influencing factor variable system is established. To address the low accuracy of existing risk prediction models, an improved time series modeling method, FTT-TS, is proposed to achieve accurate short-term collision risk prediction. To address the weak interpretability of existing risk prediction models, the SHAP interpretation mechanism is introduced to quantify the contribution of multidimensional variables to the model prediction results, clearly characterizing the collision risk occurrence mechanism under the combined influence of multiple dimensional factors.

[0047] like Figure 1 , Figure 2As shown, this embodiment proposes a short-term prediction and causation quantification method for road transport vehicle collision risk based on deep learning and SHAP interpretation mechanism. The method includes: acquiring trajectory data and alarm data of road transport vehicles, selecting four alarm types directly related to collision warnings as research objects; selecting a research area and constructing a 1km*1km grid map; analyzing the spatial characteristics of trajectory and alarm distribution, finding that vehicle trajectories are mainly distributed on intercity highways, while many urban centers lack their trajectories; collision warnings are mainly concentrated along intercity highways. A multi-source database containing six modules—driver, vehicle, trip, environment, road, and time series—was constructed. The first step uses a trip segmentation algorithm to divide continuous trajectory data into sub-trips and trips. The second step constructs time series samples, setting the time step to 5 minutes, and taking the six time steps preceding the occurrence of collision risk to form positive samples; sequences without collision risk are negative samples. The third step collects DEM elevation data, topographic data, etc., and constructs an environmental and road information database. The fourth step uses the K-means++ algorithm to classify drivers into three categories, constructing a driver information database. Road transport vehicles are then differentiated from four dimensions to construct a vehicle information database. The fifth step uses 5-minute time slices as units to build a variable system of factors influencing collision risk for road transport vehicles. An improved time series modeling method, FTT-TS (FT-Transformer for Time Series), is proposed, integrating Time2Vec time embedding and the FT-Transformer structure to effectively capture the time dependence of collision risk and achieve accurate short-term collision risk prediction. Comparative experiments show that FTT-TS outperforms traditional statistical models and machine learning methods in multiple performance indicators. Furthermore, the SHAP interpretation mechanism is introduced to quantify the contribution and interaction of multidimensional variables to the model's prediction results, revealing in depth the nonlinear impact of factors such as driving behavior, cargo type, vehicle load, and environment on collision risk.

[0048] The short-term prediction and causation quantification method for road transport vehicle collision risk provided in this embodiment is effective and highly reliable. It considers the influence of multiple dimensions of factors, including driver, vehicle, trip, environment, road, and time series, achieving accurate short-term prediction of vehicle driving risk. This provides strong technical support for improving the reliability and real-time performance of vehicle driving risk warnings. The SHAP interpretation mechanism effectively reveals the nonlinear influence mechanism of multidimensional factors on collision risk, providing theoretical support for dynamic intervention in collision risk.

[0049] This embodiment uses a risk prediction and causation quantification method based on deep learning and SHAP explanation mechanisms, such as... Figure 1 As shown, the method includes the following steps:

[0050] Step 1: Obtain trajectory data and alarm data of road transport vehicles. Four types of alarms directly related to collision warnings were selected as research objects. The alarm information was integrated into the GPS trajectory data through the license plate ID and GPS time field.

[0051] Step 2: The distribution of alarm data for road transport vehicles was visualized. The area with concentrated alarm distribution was selected as the spatial analysis range. A 1km×1km spatial grid map was constructed based on ArcGIS for subsequent geospatial analysis and modeling.

[0052] Step 3: Spatial distribution analysis of the trajectory and alarm data of road transport vehicles. It was found that vehicle trajectories are mainly distributed on intercity highways, while many city centers lack their trajectories. Research indicates that many cities within the study area have regulations regarding restricted areas and times for road transport vehicles; therefore, the obtained trajectory distribution is consistent with the actual situation. Collision warnings are mainly concentrated in areas with high traffic volume, complex road conditions, and along intercity highways.

[0053] Step 4: Further consideration was given to factors such as drivers, environment, and roads, and vehicle information was improved, ultimately resulting in a multi-source fusion database covering six major modules: driver information, vehicle information, trip information, environmental information, road information, and time series information. A variable system for influencing factors of road transport vehicle collision risk was established using 5-minute time slices.

[0054] Step 5: An improved time series modeling method, FTT-TS, is proposed, combining Time2Vec temporal embeddings with the FT-Transformer model to achieve accurate short-term collision risk prediction. Given time series samples, the model can effectively determine whether a collision risk will occur. FTTransformer is a model that can be used for classification and regression tasks on structured (tabular) data. FT stands for Feature Tokenizer, which encodes both discrete and continuous features in structured data into vectors like words, allowing the Transformer to be applied to tabular data for feature extraction, similar to that used for text data. It's worth noting that it makes some subtle modifications to the Transformer to adapt to tabular data.

[0055] Step 6: Introduce the SHAP interpretation mechanism to quantify the contribution of multidimensional variables to the model's prediction results. By drawing and analyzing variable importance ranking charts, variable importance distribution pie charts, SHAP dependency graphs of the model under univariate effects, and SHAP dependency graphs of the model under bivariate interaction effects, the collision risk occurrence mechanism under the combined effect of multidimensional influencing factors is clearly characterized.

[0056] Step 4 involves constructing trip information. A trip segmentation algorithm is proposed. A time threshold of 20 minutes and a distance threshold of 0.5 kilometers are set. If a vehicle's movement distance within 20 minutes does not exceed 0.5 kilometers, it is considered to have stopped. This divides the continuous trajectory data into sub-trips. Furthermore, a 6-hour time threshold is selected; if the time interval between two consecutive sub-trips does not exceed 6 hours, they are considered to be within the same trip. This divides the trajectory data into trips and sub-trips.

[0057] Step 4 involves constructing time-series samples. Setting the time step to 5 minutes, and assuming that the occurrence of collision risk is closely related to the changing trends of relevant features within the preceding 30 minutes (i.e., 6 time steps), a time-series sample containing 7 time steps showing collision warnings is constructed. From the remaining trajectory data, 7 consecutive time slices where no collision warnings occurred are selected to construct a time-series sample without collision warnings.

[0058] Step 4 involves constructing driver information. Driver information includes three items: driver gender, date of birth, and driving habit type. The first two are already provided by the original trajectory data. Using the k-means++ clustering algorithm, considering the proportion of high-speed driving time, maximum acceleration, and average speed during the trip, the elbow rule was used to determine the number of clusters to be 3, ultimately classifying drivers into three categories: aggressive, average, and conservative.

[0059] Step 4 involves constructing vehicle information. The original vehicle information data includes basic fields such as license plate ID, vehicle frame model, and business scope. To further analyze the impact of vehicle-cargo heterogeneity on collision risk, road transport vehicles are distinguished from four dimensions—vehicle type, vehicle specifications, rated load capacity, and cargo type—based on GB 6944-2012 Classification and Numbering of Dangerous Goods and GA 802-2014 Terms and Definitions for Motor Vehicle Types.

[0060] Step 4 involves constructing environmental and road information. Using each grid cell in the grid map as a unit, the average elevation of the cell is obtained based on DEM elevation data and topographic data. Land use mixing and the number of POIs for each cell are obtained based on Gaode POI data and the 7th National Population Census data. Weather and temperature information for each cell are obtained after processing based on weather data from various districts and counties. Road network data of different levels within the study area are processed to obtain the density of four levels of roads in the grid: highways and arterial roads, urban main roads, urban secondary arterial roads, and urban branch roads, as well as bridge and tunnel densities. Furthermore, using 5-minute time slices as units, the grid paths traversed by vehicles within the time slice are identified, and the average elevation, average land use mixing, total number of POIs, total length of roads at each level, total length of bridges, and total length of tunnels are calculated.

[0061] The improved time series modeling method FTT-TS in step 5 has the following framework: Figure 2 As shown, FT-Transformer introduces a feature token mechanism to unify numerical and categorical features into representations in the embedding space, and leverages the Transformer model's self-attention mechanism to capture the complex interactions between features. Time2Vec embeds scalar time variables into vector representations, capturing linear trends and periodic patterns in time features. The FTT-TS model combines FT-Transformer and Time2Vec, adding time features to the numerical and categorical features. Given a three-dimensional time series sample as input, the model can effectively determine the risk of collision.

[0062] The specific calculations of the model are as follows: X num ,X cat ,X time b represents numerical features, categorical features, and temporal features, respectively. j W j These are the embedding parameters corresponding to the j-th input feature, and these parameters are optimized during model training. These represent the embedding representations of three types of features, with the embedding representation of time features specifically including both linear and periodic features. φ f represents a multilayer perceptron (MLP). trans This represents the Transformer layer. O represents the prediction result obtained using the FTT-TS model.

[0063] X = {X num ,X cat ,X time}

[0064]

[0065] T = stack[E num E cat E time

[0066] O = g φ (f trans (T))

[0067] The short-term prediction model for road transport vehicle collision risk in this embodiment is a deep neural network with various hyperparameters, including the learning rate and optimizer. By comparing model performance evaluation metrics, the hyperparameter values ​​that optimize the model's performance are selected. The learning rate is set to 0.00001 by default, and the AdamW optimizer and ReduceLROnPlateau learning rate scheduler are used. The training set, validation set, and test set are divided in an 8:1:1 ratio. The number of input samples per training session is set to 256, and the maximum number of training epochs is 500.

[0068] To describe the predictive performance of the short-time collision risk prediction model for road transport vehicles (FTT-TS model), accuracy, sensitivity, specificity, G-Mean, precision, F1-score, and two curve integral-based metrics, AUC-ROC and PR-AUC, were selected as evaluation metrics to assess model performance. The calculation formulas are as follows:

[0069]

[0070] In the formula: for m positive samples and n negative samples, the model gives a predicted score, and the score for positive samples is: The negative sample score is: A value closer to 1 indicates that the model is better able to distinguish between positive and negative samples. PR-AUC, plotted on the vertical axis with Precision and horizontal axis with Recall, yields a set of points (R1, P1), (R2, P2), ..., (R...). N ,P N This more accurately reflects the model's overall performance in identifying positive class samples.

[0071] Table 1 presents the predictive performance of the FTT-TS model and compares it with statistical models, traditional machine learning models, the baseline transformer model, and the FT-transformer model. It can be seen that the FTT-TS model achieves superior performance across all metrics, with the highest values ​​in Sensitivity and Precision, two metrics directly related to positive class identification (TP). This indicates that the model can accurately identify minority class SCE events, which is the most important significance of the predictive model for risk warning and reflects its practical application value. Furthermore, the model also achieves optimal results in the comprehensive metrics G-Mean and F1-score, reflecting its strong performance in balancing recall and precision. Compared to the baseline model FT-Transformer, FTT-TS also performs better on key metrics, indicating that it has effectively optimized its time series modeling and feature extraction mechanisms, improving the model's predictive performance.

[0072] Table 1 Comparison of prediction performance of different models

[0073]

[0074] The variable importance ranking chart and variable importance distribution pie chart in step 6, as follows: Figure 3 As shown, the SHAP importance of each input feature in the model is illustrated, revealing that the time window ranks first in importance. Following closely are features closely related to driver behavior patterns and vehicle / cargo attributes, such as driving habits, cargo type, and rated load capacity. This indicates that differences in driver driving habits and vehicle-cargo heterogeneity are also significant factors influencing collision risk. Furthermore, land use mixing, reflecting the social environment, also holds considerable importance.

[0075] The SHAP dependency graph of the model under univariate action in step 6, as follows: Figure 4 The diagram illustrates the distribution of SHAP values ​​for several key variables as a function of eigenvalues. Regarding cargo type, the complexity of mixed cargo types leads to the highest collision risk. Flammable liquids and gases have lower collision risks. In terms of the social environment, SHAP values ​​exhibit a non-linear change, initially increasing and then decreasing. Areas with moderate land use mixing experience the highest collision risk due to the mixed flow of different types of vehicles and pedestrians. Regarding driving habits, aggressive driving behavior is more likely to induce collision risks, while cautious driving behavior helps maintain traffic safety. Regarding driver age, younger drivers have the highest collision risk, while older drivers have a certain mitigating effect on collision risk. Regarding driving time, evening rush hour and nighttime are the peak times for collision risk.

[0076] The SHAP dependency graph of the model under the bivariate interaction in step 6 is as follows: Figure 5As shown, the SHAP dependency plot illustrates the pairwise interactions between several key categorical variables. In the interaction between driving habits and cargo type, aggressive drivers carrying flammable liquids and gases face a higher risk than the other two driver types; conservative drivers carrying mixed cargo face a lower risk than the other two driver types. In the interaction between driver age and cargo type and driving habits, younger drivers face a higher risk when carrying mixed cargo and exhibit a higher proportion of aggressive driving behavior, making them a potentially high-risk group for accidents. In the interaction between time of day and age, younger drivers have a significantly higher collision risk at night than middle-aged and older drivers. In the interaction between time type and time period, the collision risk during the evening rush hour on holidays is significantly lower than at other times.

[0077] Example 3

[0078] This embodiment 3 provides a non-transitory computer-readable storage medium for storing computer instructions. When executed by a processor, the computer instructions implement the road transport vehicle collision risk prediction method described above. The method includes:

[0079] Acquire trajectory data and alarm data of road transport vehicles;

[0080] A pre-trained collision risk prediction model is used to process the acquired trajectory data and alarm data to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises road transport vehicle collision risk time series from multiple historical time steps, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, with a variable system constructed using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations to capture linear trends and periodic patterns in time features, and leveraging the Transformer model's self-attention mechanism to capture the complex interactions between features.

[0081] Example 4

[0082] This embodiment 4 provides a computer device, including a memory and a processor, wherein the processor and the memory communicate with each other, and the memory stores program instructions that can be executed by the processor. The processor calls the program instructions to execute the road transport vehicle collision risk prediction method described above, the method including:

[0083] Acquire trajectory data and alarm data of road transport vehicles;

[0084] A pre-trained collision risk prediction model is used to process the acquired trajectory data and alarm data to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises road transport vehicle collision risk time series from multiple historical time steps, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, with a variable system constructed using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations to capture linear trends and periodic patterns in time features, and leveraging the Transformer model's self-attention mechanism to capture the complex interactions between features.

[0085] Example 5

[0086] This embodiment 5 provides an electronic device, including: a processor, a memory, and a computer program; wherein, the processor is connected to the memory, and the computer program is stored in the memory. When the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the road transport vehicle collision risk prediction method as described above, the method including:

[0087] Acquire trajectory data and alarm data of road transport vehicles;

[0088] A pre-trained collision risk prediction model is used to process the acquired trajectory data and alarm data to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises road transport vehicle collision risk time series from multiple historical time steps, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, with a variable system constructed using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations to capture linear trends and periodic patterns in time features, and leveraging the Transformer model's self-attention mechanism to capture the complex interactions between features.

[0089] In summary, the road transport vehicle collision risk prediction method and system described in this invention, based on the trajectory and warning data of road transport vehicles, selected four types of warnings directly related to collision warnings as research objects. A 1km*1km grid map was constructed within the selected research area. Analysis of the spatial characteristics of trajectory and warning distribution revealed that vehicle trajectories are mainly distributed on intercity highways, while many city centers lack their trajectories. Collision warnings are primarily concentrated along intercity highways. A multi-source database comprising six modules—driver, vehicle, trip, environment, road, and time series—was constructed. A variable system of influencing factors of hazardous goods vehicle risk in transit was established using 5-minute time slices. An improved time series modeling method, FTT-TS, was proposed to effectively capture the time dependence of collision risk and achieve accurate short-term collision risk prediction. Furthermore, the SHAP interpretation mechanism was introduced to quantify the contribution and interaction of multidimensional variables to the model prediction results, revealing in depth the nonlinear impact of factors such as driving behavior, cargo type, vehicle load, and environment on collision risk. This provides technical support for practical real-time vehicle risk warning systems and a theoretical basis for improving road traffic safety and implementing accident prevention measures. The improved time series modeling method, FTT-TS, integrates Time2Vec time embedding and the FT-Transformer structure. FT-Transformer introduces a feature token mechanism to unify numerical and categorical features into representations in the embedding space, and uses the Transformer model's self-attention mechanism to capture the complex interactions between features. Time2Vec embeds scalar time variables into vector representations, capturing linear trends and periodic patterns in time features. The FTT-TS model combines FT-Transformer and Time2Vec, adding time features to the numerical and categorical features. Inputting three-dimensional time series samples, the model can effectively determine whether a collision risk has occurred. The SHAP interpretation mechanism can effectively quantify the contribution of multidimensional variables to the model's prediction results. By drawing and analyzing variable importance ranking charts, variable importance distribution pie charts, SHAP dependency graphs of the model under univariate effects, and SHAP dependency graphs of the model under bivariate interactions, the mechanism of collision risk under the combined effect of multidimensional influencing factors is clearly characterized. It reveals in depth the nonlinear impact of factors such as driving behavior, cargo type, vehicle load, and environment on collision risk. The study found that there is a complex interaction between individual driver differences and cargo type, which is the core factor affecting the occurrence of collision risk. Among them, "aggressive driver + mixed cargo" is a high-risk combination. In addition, the occurrence of collision risk also has spatiotemporal heterogeneity. Complex road conditions, areas with moderate land use mixing, and evening rush hours and nighttime are all important factors causing high collision risk.

[0090] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0091] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0092] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0093] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0094] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that, based on the technical solutions disclosed in the present invention, various modifications or variations that can be made by those skilled in the art without creative effort should be included within the scope of protection of the present invention.

Claims

1. A method for predicting collision risk of road transport vehicles, characterized in that, include: Acquire trajectory data and alarm data of road transport vehicles; A pre-trained collision risk prediction model is used to process the acquired trajectory data and alarm data to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises road transport vehicle collision risk time series at multiple historical time steps, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, constructing a variable system using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embedding scalar time features into vector representations to capture linear trends and periodic patterns in time features, and utilizing the Transformer model... This study employs a self-attention mechanism to capture the complex interactions between various features. The variable system includes: acquiring trajectory and alarm data of road transport vehicles, defining the research scope, and constructing a grid map; using a trip segmentation algorithm to divide continuous trajectory data into sub-trips and trips; constructing time series samples, setting the time step to 5 minutes, and taking the six time steps preceding the occurrence of collision risk as positive samples, while sequences without collision risk are considered negative samples; collecting DEM elevation data and topographic data to construct an environmental and road information database; using the K-means++ algorithm to classify drivers into three categories: aggressive, average, and conservative, and constructing a driver information database; distinguishing road transport vehicles from four dimensions based on relevant laws and regulations, and constructing a vehicle information database; and building a variable system of factors influencing road vehicle collision risk, using 5-minute time slices as units. The FT-Transformer model introduces a feature token mechanism to unify numerical and categorical features into representations in the embedding space, and uses the Transformer model's self-attention mechanism to capture the complex interactions between features; Time2Vec embeds scalar time variables into vector representations to capture linear trends and periodic patterns in time features; the FTT-TS model combines FT-Transformer and Time2Vec, adding time features to the numerical and categorical features. The vehicle information construction includes differentiating road transport vehicles from four dimensions: vehicle type, vehicle specifications, approved load capacity, and cargo type.

2. The method for predicting collision risk of road transport vehicles according to claim 1, characterized in that, The construction of environmental and road information includes: taking each grid in the grid map as a unit, obtaining the average elevation of the grid based on DEM elevation data and topographic data; obtaining the land use mixing degree and POI number of the grid; obtaining the weather and temperature information of the grid after processing based on regional weather data; obtaining the density of four levels of roads in the grid, namely highways and arterial roads, urban main roads, urban secondary arterial roads and urban branch roads, as well as bridge density and tunnel density, after processing based on road network data of different levels in the study area; identifying the grid paths traversed by vehicles within a 5-minute time slice, and calculating the average elevation, average land use mixing degree, total POI, total road length of each level, total bridge length, and total tunnel length.

3. The method for predicting collision risk of road transport vehicles according to claim 1, characterized in that, Accuracy, sensitivity, specificity, G-Mean, precision, F1-score, and two curve integral-based metrics, AUC-ROC and PR-AUC, were selected as evaluation metrics to assess model performance.

4. A road transport vehicle collision risk prediction system implementing the method as described in any one of claims 1-3, characterized in that, include: The acquisition module is used to acquire trajectory data and alarm data of road transport vehicles; The processing module is used to process the acquired trajectory data and alarm data using a pre-trained collision risk prediction model to obtain collision risk prediction results. Training the collision risk prediction model includes: acquiring training data, which comprises multiple historical time steps of road transport vehicle collision risk time series, including a multi-source database containing six modules: driver, vehicle, trip, environment, road, and time series, constructing a variable system using fixed time slices; and constructing an FTT-TS deep learning model for short-term risk prediction, consisting of an FT-Transformer model and a Time2Vec timestamp vector representation module. This model unifies numerical and categorical features into representations in an embedding space, embeds scalar time features into vector representations, captures linear trends and periodic patterns in time features, and utilizes the Transformer model's self-attention mechanism to capture the complex interactive relationships between features.

5. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement the road transport vehicle collision risk prediction method as described in any one of claims 1-3.

6. A computer device, characterized in that, The method includes a memory and a processor, the processor and the memory communicating with each other, the memory storing program instructions executable by the processor, and the processor calling the program instructions to execute the road transport vehicle collision risk prediction method as described in any one of claims 1-3.

7. An electronic device, characterized in that, include: The electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to cause the electronic device to execute instructions for implementing the road transport vehicle collision risk prediction method as described in any one of claims 1-3.