Traffic flow prediction-oriented spatio-temporal data deep learning analysis system
By constructing a spatiotemporal correlation graph and utilizing a spatiotemporal graph neural network model, the problem of insufficient modeling of the dynamic spatiotemporal correlation of traffic participants in existing technologies is solved, enabling high-precision prediction of traffic flow and dynamic assessment of conflict risks, thereby improving traffic safety and management efficiency at intersections without traffic lights.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-13
AI Technical Summary
Existing traffic flow prediction schemes lack in-depth modeling of the dynamic spatiotemporal relationships among traffic participants, resulting in insufficient accuracy of prediction results in complex scenarios and an inability to effectively identify potential trajectory conflicts and generate reliable early warnings.
A spatiotemporal correlation graph is constructed to integrate the motion data of traffic participants and environmental data. A spatiotemporal graph neural network model is used to predict future trajectories, and the probability of trajectory conflict is assessed by calculating Euclidean distance and safe distance thresholds to generate early warning instructions.
It enables high-precision, end-to-end prediction of the future movement of traffic participants, dynamically assesses potential conflict risks, and improves traffic safety and management efficiency at intersections without traffic lights.
Smart Images

Figure CN121661831A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic prediction and safety early warning technology based on deep learning, and more specifically, this application relates to a spatiotemporal data deep learning analysis system for traffic flow prediction. Background Technology
[0002] With the development of intelligent transportation systems, traffic flow prediction is increasingly being applied in urban traffic management, autonomous driving, and traffic safety. Especially at intersections without traffic lights, the lack of traffic signals leads to complex interactions between traffic participants (such as vehicles and pedestrians), resulting in a high risk of conflict. How to predict potential trajectory conflicts in real time and generate effective early warnings has become a key problem to be solved.
[0003] Most existing traffic flow prediction solutions are based on a single data source or a simple model. For example, some systems rely on cameras, radar, or GPS sensors to collect location and speed data of traffic participants, and then use linear regression, time series analysis, or traditional machine learning methods (such as support vector machines) to predict short-term trajectories. The advantage of such existing technologies is that the system structure is simple, the computational overhead is low, and they can identify immediate hazards to a certain extent and trigger basic warnings.
[0004] However, existing prediction mechanisms lack in-depth modeling of the dynamic spatiotemporal relationships among traffic participants. They typically consider only the historical trajectories of individual participants, ignoring the relative motion relationships between participants (such as relative distance, relative speed, and relative angle), and also fail to effectively integrate environmental data (such as weather conditions and road topology), resulting in insufficient accuracy of predictions in complex scenarios. Therefore, this paper proposes a spatiotemporal data deep learning analysis system for traffic flow prediction to address this problem. Summary of the Invention
[0005] To address the aforementioned technical problems, this technical solution provides a deep learning analysis system for spatiotemporal data for traffic flow prediction, resolving the issues raised in the background section.
[0006] To achieve the above objectives, the technical solution of the present invention is as follows:
[0007] Firstly, this application provides a spatiotemporal data deep learning analysis system for traffic flow prediction, used for conflict early warning at intersections without traffic lights, including:
[0008] The data acquisition module is used to acquire traffic participant type identification, motion data, and environmental data in real time. The type identification includes vehicles and pedestrians, the motion data includes coordinates, speed, and heading angle, and the environmental data includes weather conditions and road topology data.
[0009] The spatiotemporal graph construction module is used to construct graph nodes based on the traffic participants, construct node attributes of graph nodes based on the corresponding motion data, calculate the relative distance, relative speed and relative angle between graph nodes, generate edge attributes between graph nodes based on the calculated data, construct global attributes of the graph based on the environmental data, and construct a spatiotemporal graph based on graph nodes, node attributes, edge attributes and global attributes.
[0010] The model processing module is used to input the spatiotemporal correlation graph into a pre-trained spatiotemporal graph neural network model to obtain node prediction data containing future predicted trajectories.
[0011] The Euclidean distance calculation module is used to extract the predicted position data of each graph node in the node prediction data for multiple future time steps. For any two graph nodes, it calculates the Euclidean distance between their predicted position data at the same future time step.
[0012] The conflict probability acquisition module is used to compare the Euclidean distance with a preset safety distance threshold, and obtain the predicted trajectory conflict probability based on the comparison results of all time steps.
[0013] The warning instruction generation module is used to generate and output a warning instruction when the trajectory conflict probability is greater than a preset conflict probability threshold.
[0014] Secondly, this application provides a computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, it implements the spatiotemporal data deep learning analysis system for traffic flow prediction as described above.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0016] This application is based on a spatiotemporal graph input pre-trained spatiotemporal graph neural network model, which outputs node prediction data containing future predicted trajectories. It solves the limitations of low accuracy and poor adaptability of trajectory prediction based on fixed rules or simple linear models, and realizes high-precision, end-to-end prediction of the future movement state of traffic participants, providing a reliable data foundation for conflict early warning.
[0017] This application calculates the Euclidean distance between predicted trajectories and compares it with a safety threshold. Based on the comparison results of multiple time steps, it obtains the probability of trajectory conflict, which solves the problem of missed detection or false detection in single-moment detection or static distance judgment. It realizes dynamic probabilistic assessment of potential conflicts and uses the conflict probability as an objective real-time risk indicator for intersections without traffic lights to generate early warning instructions to improve traffic safety. Attached Figure Description
[0018] The disclosure of this invention is illustrated with reference to the accompanying drawings. It should be understood that the drawings are for illustrative purposes only and are not intended to limit the scope of protection of this invention. Wherein:
[0019] Figure 1 This is a block diagram of the spatiotemporal data deep learning analysis system for traffic flow prediction proposed in this invention.
[0020] Figure 2 This is a flowchart illustrating the specific implementation method of the system in this invention;
[0021] Figure 3 This is a data flow diagram for dynamically adjusting the conflict probability threshold in this invention. Detailed Implementation
[0022] It is readily understood that, based on the technical solution of this invention, those skilled in the art can propose various interchangeable structural methods and implementations without altering the essential spirit of the invention. Therefore, the following detailed embodiments and accompanying drawings are merely illustrative examples of the technical solution of this invention and should not be considered as the entirety of the invention or as limitations or restrictions on the technical solution of this invention.
[0023] In existing technologies, traffic flow prediction at unsignalized intersections suffers from problems such as a single modeling dimension and a lack of in-depth analysis of dynamic spatiotemporal relationships. It typically relies on a single data source or a simple model (such as linear regression or traditional machine learning methods), considering only the historical trajectories of individual participants while ignoring relative motion relationships between participants (such as relative distance, relative speed, and relative angle) and environmental data (such as weather conditions and road topology). This results in insufficient accuracy of predictions in complex scenarios. This limitation prevents the system from effectively predicting potential trajectory conflicts in real time, and the early warning mechanism lacks adaptability, still heavily relying on basic threshold judgments, potentially increasing traffic safety risks due to false alarms or missed alarms.
[0024] To address the aforementioned issues, this application integrates the motion data of traffic participants with environmental data by constructing a spatiotemporal correlation graph, and uses a spatiotemporal graph neural network model to predict future trajectories. Subsequently, the Euclidean distance between the predicted positions of any two participants at multiple future time steps is calculated and compared with a safe distance threshold to obtain the probability of trajectory conflict. When the probability exceeds a preset threshold, a warning instruction is generated and output. This application deeply models the dynamic interaction relationships between participants through a spatiotemporal graph neural network and comprehensively evaluates the conflict probability at multiple time steps by considering environmental factors. This overcomes the shortcomings of existing technologies in adapting to complex scenarios, achieving more accurate and adaptive conflict warnings and improving traffic safety and management efficiency at intersections without traffic lights.
[0025] Example 1
[0026] like Figure 1 As shown, a spatiotemporal data deep learning analysis system for traffic flow prediction is introduced for conflict early warning at unsignalized intersections, including:
[0027] The data acquisition module 100 is used to acquire in real time the type identification, motion data and environmental data of traffic participants. The type identification includes vehicles and pedestrians, the motion data includes coordinates, speed and heading angle, and the environmental data includes weather conditions and road topology data.
[0028] The spatiotemporal graph construction module 200 is used to construct graph nodes based on traffic participants, construct node attributes of graph nodes based on corresponding motion data, calculate the relative distance, relative speed and relative angle between graph nodes, generate edge attributes between graph nodes based on the calculated data, construct global attributes of the graph based on environmental data, and construct a spatiotemporal graph based on graph nodes, node attributes, edge attributes and global attributes.
[0029] The model processing module 300 is used to input the spatiotemporal correlation graph into a pre-trained spatiotemporal graph neural network model to obtain node prediction data containing future predicted trajectories.
[0030] The Euclidean distance calculation module 400 is used to extract the predicted position data of each graph node in the node prediction data in the future multiple time steps. For any two graph nodes, it calculates the Euclidean distance between their predicted position data in the same future time step.
[0031] The collision probability acquisition module 500 is used to compare the Euclidean distance with a preset safety distance threshold, and obtain the predicted trajectory collision probability based on the comparison results of all time steps.
[0032] The warning instruction generation module 600 is used to generate and output a warning instruction when the probability of trajectory conflict is greater than a preset conflict probability threshold.
[0033] like Figure 2 As shown, the method and process of implementing a spatiotemporal data deep learning analysis system for traffic flow prediction are introduced.
[0034] Regarding data acquisition module 100:
[0035] The data acquisition module is used to collect and perform preliminary processing of relevant data on traffic participants in real time.
[0036] The system utilizes various sensor devices (such as cameras, radar, and GPS receivers) and external data interfaces to collect real-time data on the type identification, motion data, and environmental data of traffic participants within the target area. Type identification distinguishes traffic participant categories, including vehicles and pedestrians; motion data includes each participant's real-time coordinates, velocity vector, and heading angle; and environmental data covers current weather conditions (such as rain, snow, and fog), road topology data (such as the number of lanes, curvature, and slope), time period, and traffic density. All collected data is timestamped to ensure temporal consistency.
[0037] The collected raw data is verified and fused. First, outlier detection and filtering are performed on the motion data to eliminate sensor noise. Second, data from different types of sensors are aligned with a coordinate system and spatiotemporally to form a standardized data format. Finally, traffic participants are classified and indexed according to their type identifiers and associated with corresponding environmental data to construct a preliminary dataset.
[0038] The processed data is packaged in a preset format and transmitted to the spatiotemporal relational graph construction module, providing input for subsequent graph structure generation. Data output includes type identifier streams, motion data streams, and environmental data streams, ensuring that downstream modules can obtain highly reliable, multi-dimensional data sources in real time.
[0039] Regarding the spatiotemporal relation graph construction module 200:
[0040] The spatiotemporal correlation graph construction module is used to transform multi-source traffic data into a graph structure that can represent spatiotemporal dependencies. Its specific implementation process is as follows:
[0041] Receive standardized data streams from the data acquisition module, including traffic participant type identification, motion data (coordinates, speed, heading angle), and environmental data (weather conditions, road topology data, time period, and traffic density).
[0042] Perform multi-level data fusion and graph structure generation operations, specifically including:
[0043] Graph node construction: Instantiate each traffic participant as an independent node in the graph structure.
[0044] Node attribute assignment: Based on the received motion data, construct node attributes for each graph node. Node attributes include at least the instantaneous coordinates, velocity vector, and heading angle of the participant.
[0045] Edge attribute calculation: For any two graph nodes, calculate the dynamic relationship characteristics between them to generate the edge attributes of the connecting edges. The calculation includes: calculating the relative distance based on the node coordinates, calculating the relative velocity based on the node's velocity vector, and calculating the relative angle based on the node's heading angle.
[0046] Global attribute integration: Based on the received environmental data, global attributes describing the overall macroscopic state of the intersection are constructed. Global attributes include weather condition codes, road topology feature vectors, time period vectors, and traffic density vectors.
[0047] The generated graph nodes, attached node attributes, connected edge attributes, and integrated global attributes are encapsulated to form a complete spatiotemporal relational graph. This graph structure, as a standardized data object, is output to the model processing module, providing direct input for subsequent deep learning model inference.
[0048] Specifically, the forms of nodes, edges, and global feature vectors can be defined as follows:
[0049] (1) Node feature vectors
[0050] Each traffic participant (such as a vehicle or pedestrian) is treated as a node, and its feature vector... It contains its motion state information, in the following format:
[0051] ;
[0052] in, Represents the current position coordinates (2D). Represents the velocity vector (2-dimensional). Indicates the heading angle (in radians or degrees). Indicates the type of traffic participant (e.g., vehicle=1, pedestrian=0, or using one-hot encoding). Example: A vehicle node might be represented as: [10.2, 5.6, 1.2, 0.3, 0.78, 1].
[0053] (2) Edge feature vectors
[0054] edge attributes To represent the interaction between two nodes, the feature vector contains their relative motion states:
[0055] ;
[0056] in, Indicates the difference in relative position. It represents the magnitude of relative velocity (scalar). Indicates the relative heading angle difference. This represents the Euclidean distance. For example, the edge between two vehicles could be: [2.1, -1.3, 0.5, 0.2, 2.5].
[0057] (3) Global feature vectors
[0058] global properties Describe the environmental state of the entire scene, including:
[0059] ;
[0060] in, Indicates weather conditions (e.g., sunny = 0, rain = 1, snow = 2). Indicates the road type (e.g., crossroads = 0, T-junctions = 1). Indicates a time period (e.g., morning = 0, noon = 1, night = 2). This represents traffic density (normalized value). Example: A crossroads on a rainy night might have a density of [1, 0, 2, 0.8]. The table below provides an example feature vector:
[0061] Table 1: Example Table of Feature Vectors
[0062] Components Feature vector dimension illustrate node 6D Position + Speed + Heading Angle + Type side 5D Relative position + relative velocity + relative angle + distance Global 4D Weather + Road type + Time of day + Traffic density
[0063] In one optional implementation, after constructing the spatiotemporal correlation graph, the method further includes dynamically correcting the spatiotemporal correlation graph, specifically including:
[0064] Obtain historical trajectory data of historical traffic events;
[0065] Calculate trajectory smoothness parameters and prediction uncertainty parameters based on historical trajectory data;
[0066] The trajectory smoothness parameter is mapped to the weight adjustment of the edge attribute, and the prediction uncertainty parameter is mapped to the confidence adjustment of the node attribute.
[0067] The spatiotemporal correlation graph is reconstructed based on the weight adjustment and confidence adjustment to generate a corrected spatiotemporal correlation graph.
[0068] In one optional implementation, the process of calculating the trajectory smoothness parameter and the prediction uncertainty parameter specifically includes:
[0069] The trajectory smoothness parameter, which characterizes the degree of trajectory jitter, is obtained by calculating the standard deviation of the second derivative of historical trajectory data.
[0070] The prediction uncertainty parameter, which characterizes the reliability of the prediction result, is obtained by using the confidence value of the output layer of the spatiotemporal graph neural network model.
[0071] Piecewise function mapping is performed on the trajectory smoothness parameter and the prediction uncertainty parameter to generate adjustment amounts.
[0072] The trajectory smoothness parameter is obtained by analyzing the motion continuity characteristics of historical trajectory data. Its calculation process includes:
[0073] Numerical differentiation of the velocity vector sequence yields the jerk sequence. Calculate the accelerometer sequence Standard deviation within the preset time window :
[0074] ;
[0075] in, The average value of jerk. The length of the time window;
[0076] Normalization is performed, mapping the standard deviation to the [0, 1] interval to obtain the trajectory smoothness parameter. :
[0077] ;
[0078] in, This is the preset maximum permissible standard deviation of jerk.
[0079] The uncertainty parameter is obtained by quantifying the reliability of the output of the spatiotemporal graph neural network model, and the uncertainty is estimated based on the output variance:
[0080] Probability distribution modeling: The output layer parameterization of the spatiotemporal graph neural network model is a multivariate Gaussian distribution.
[0081] ;
[0082] This formula represents the probability distribution of the output of the spatiotemporal graph neural network model, where the output... Given input Under the given conditions, it follows a multivariate Gaussian distribution (normal distribution). Indicates the given input Time output The conditional probability density function, Gaussian distribution symbol, This represents the predicted mean vector, which is the model's prediction of the output. The expected value represents the average position of the predicted trajectory. This represents the prediction covariance matrix, indicating the uncertainty of the model prediction. The diagonal elements are the variances of each output dimension, and the off-diagonal elements are the covariances.
[0083] Uncertainty extraction involves calculating the variance trace of the predicted distribution as an uncertainty parameter.
[0084] ;
[0085] This formula is used to quantify the uncertainty of model predictions and is obtained by calculating the trace of the prediction covariance matrix.
[0086] The uncertainty parameter is a scalar value representing the total variance of the predicted output. A larger value indicates that the model's predictions are less reliable. The trace operation represents the operation on a matrix, which calculates the sum of the diagonal elements. For a covariance matrix... Its trace reflects the overall degree of fluctuation in the predicted output.
[0087] Parameter mapping and adjustment generation:
[0088] For trajectory smoothness parameters and prediction uncertainty parameters Perform piecewise function mapping to generate the corresponding adjustment amount:
[0089] Edge attribute weight adjustment Based on trajectory smoothness parameters, this is used to correct the strength or importance of edges in the graph:
[0090]
[0091] in , , These are preset linear coefficients used to adjust the slope of different segmented intervals. , These are preset constants used for offset adjustment. , The segmentation threshold is used to divide the trajectory smoothness parameters. Different ranges (e.g., low smoothness, medium smoothness, high smoothness).
[0092] Node attribute confidence adjustment Calculated based on prediction uncertainty parameters, used to correct the reliability or confidence level of nodes in the graph:
[0093]
[0094] in, , , The preset linear coefficients are used to adjust the slope of different segmented intervals. , These are preset constants used for offset adjustment. , The segmentation threshold is used to divide the prediction uncertainty parameters. Different ranges (e.g., low uncertainty, medium uncertainty, high uncertainty);
[0095] The adjustment amount generation process is implemented by looking up a pre-configured mapping table, which is obtained based on statistical analysis of historical data. Using regression analysis or clustering methods, the parameter range is divided into low, medium, and high intervals, and piecewise functions are fitted for each interval to ensure that the non-linear relationship between the adjustment amount and the original parameters meets the requirements of the actual traffic scenario.
[0096] Verify the significance of the non-linear relationship between the parameters and the adjustment amount through statistical hypothesis testing (such as chi-square test or ANOVA), and use the actual traffic scenario to test the performance of the mapping table to ensure that the adjustment amount can effectively improve the accuracy of conflict prediction and reduce the false alarm rate.
[0097] Regularly incorporate new historical data, recalculate the parameter distribution and piecewise function coefficients, and maintain the adaptability of the mapping table to traffic scenario changes.
[0098] Example mapping table values (based on typical traffic scenarios):
[0099] For the trajectory smoothness parameter S: when the smoothness is low (S ≤ 0.3), Δw takes 0.1×S; when the smoothness is medium (0.3 < S ≤ 0.7), Δw takes 0.3×S + 0.05; when the smoothness is high (S > 0.7), Δw takes 0.5×S + 0.1.
[0100] For the prediction uncertainty parameter U: when the uncertainty is low (U ≤ 0.2), Δc takes 0.8×(1 - U); when the uncertainty is medium (0.2 < U ≤ .....
[0096] 通过统计假设检验(如卡方检验或ANOVA)验证参数与调整量之间的非线性关系显著性,并使用实际交通场景测试映射表性能,确保调整量能有效提升冲突预测准确率并降低误报率。
[0097] 定期纳入新历史数据,重新计算参数分布和分段函数系数,保持映射表对交通场景变化的适应性。
[0098] 示例映射表值(基于典型交通场景):
[0099] 轨迹平滑度参数S:低平滑度(S≤0.3)时,Δw取0.1×S;中平滑度(0.3<S≤0.7)时,Δw取0.3×S+0.05;高平滑度(S>0.7)时,Δw取0.5×S+0.1。
[0100] 预测不确定性参数U:低不确定性(U≤0.2)时,Δc取0.8×(1-U);中不确定性(0.2<U≤0.6)时,Δc取0.5×(1-U)+0.1;高不确定性(U>0.6)时,Δc取0.2×(1-U)+0.3。
[0101] 通过上述技术方案,本申请实现了多源交通数据向结构化时空关联图的高效转化。通过节点、边、全局属性 的多层次融合建模,系统能够完整保留交通参与者的个体运动特征、交互关系及环境上下文,为深度学习模型提供了富含时空语义的标准化输入。进一步地,通过引入基于历史轨迹数据的动态修正机制,系统能够依据轨迹平滑度与预测不确定性自适应调整图结构属性,有效提升了所构建图数据的表征质量与可靠性。该设计不仅增强了图结构对真实交通场景的刻画能力,也为下游轨迹预测模块的准确推理奠定了坚实的数据基础。
[0102] 关于模型处理模块300:
[0103] 模型处理模块用于利用预训练的深度学习模型对时空关联图进行推理,以预测交通参与者的未来轨迹,其具体实现过程如下:
[0104] 接收由时空关联图构建模块输出 的时空关联图数据。
[0105] The spatiotemporal graph is input into a pre-trained spatiotemporal graph neural network model. This model captures the spatial interaction dependencies between traffic participants through its graph convolutional layers and learns the temporal evolution of each participant's motion state through its time-series processing units (such as recurrent neural networks or temporal convolutional networks). The model performs forward propagation computation on the input graph structure, deeply fusing its node attributes, edge attributes, and global attributes, and finally generates the predicted state of each graph node at multiple future time steps in the output layer.
[0106] The system receives and parses the output of the spatiotemporal graph neural network model, extracts the predicted location coordinates of each graph node in the future series of time steps, and encapsulates them in a structured manner as node prediction data. This node prediction data clearly represents the future predicted trajectories of each traffic participant and is output to the downstream Euclidean distance calculation module as the data basis for conflict probability assessment.
[0107] Specifically, the process of processing spatiotemporal correlation graph data is as follows:
[0108] Spatial message passing mechanism: The graph convolutional layer uses a multi-head graph attention network to implement spatial message passing. The specific mechanism includes:
[0109] (1) Calculation of attention coefficient:
[0110] For nodes Its neighboring nodes Attention coefficient The calculation is as follows:
[0111] ;
[0112] in, This is a trainable attention vector, a parameter vector used to calculate the correlation between nodes. This is the weight matrix, used for linear transformation of node features. , For nodes and eigenvectors, This represents vector concatenation. To activate the function, a non-linearity is introduced, allowing negative values to have a small slope output;
[0113] (2) Normalized attention weights :
[0114] ;
[0115] in, Indicates the neighboring nodes of node i. Let represent the set of neighbors of node i, which includes all nodes connected to node i in the graph. This represents an exponential function, converting the attention score into a positive number for easier normalization.
[0116] (3) Multi-headed attention convergence:
[0117] ;
[0118] in, This represents the updated node features, the new features after multi-head attention aggregation. To focus on the number of heads, This represents the weight of the m-th attention head, where the attention weight is calculated independently for each head. This represents the weight matrix for the m-th head, and the independent linear transformation matrix for each head. Indicates feature splicing, This is the ELU activation function.
[0119] Time Series Processing Unit: The time series processing unit employs a hierarchical temporal convolutional network, specifically including:
[0120] (1) Temporal convolutional block structure:
[0121] Each temporal convolutional block contains:
[0122] Causal dilated convolution: Ensures temporal causality by using only historical information.
[0123] ;
[0124] in, This indicates the output at the current time step. This represents the weight of the k-th convolutional kernel. This represents the historical time step in the input sequence. The coefficient of thermal expansion is 1 / 3. This represents the kernel size.
[0125] Gating mechanism: Controlling the flow of information.
[0126] ;
[0127] in, Indicates gated output, This represents the convolution operation. This represents element-wise multiplication. This represents the Sigmoid activation function.
[0128] Residual connections: alleviate gradient vanishing.
[0129] ;
[0130] in, This represents the final output, which is the sum of the input and the transformed residual. This represents the input characteristics, i.e., the original input or the output of the previous layer. This indicates that a 1D convolution is performed on h, and the output is further transformed and gated.
[0131] (2) Layered temporal architecture:
[0132] Establish a three-layer temporal convolutional network:
[0133] First layer: kernel size K=3, dilation coefficient d=1, number of channels 64;
[0134] Second layer: kernel size K=3, dilation coefficient d=2, number of channels 128;
[0135] Third layer: kernel size K=3, dilation coefficient d=4, number of channels 256.
[0136] Decoder Structure and Output Strategy: The decoder employs a dual-path architecture combining a Gaussian mixture model and deterministic regression.
[0137] (1) Multimodal decoder design
[0138] Deterministic path: Direct regression of future trajectory coordinates:
[0139] ;
[0140] in, This represents the future trajectory coordinates obtained through direct regression, representing a deterministic predicted trajectory. These are spatiotemporal coding features, i.e., the comprehensive spatiotemporal features output by the encoder. It is a fully connected neural network, that is, a neural network used for regression prediction;
[0141] Probabilistic path: Output Gaussian mixture model parameters:
[0142] ;
[0143] in, Let represent the mean of the k-th Gaussian distribution, and let represent the center of a possible trajectory. Let represent the covariance matrix of the k-th Gaussian distribution, and let represent the uncertainty of the trajectory. Let be the mixture weights of the k-th Gaussian distribution, representing the probability that this distribution is selected. The number of components in a Gaussian mixture model represents the number of mixed components. This represents a probabilistic decoding network that outputs Gaussian mixture model parameters.
[0144] Final trajectory prediction results Fusion:
[0145] ;
[0146] in, To adaptively fuse weights and balance the contributions of deterministic and probabilistic paths, For the direct regression prediction results of the deterministic path, Let K be the expectation of the Gaussian mixture model for the probabilistic path, and K be the number of components in the Gaussian mixture model. The mixed weights (selection probabilities) of the k-th Gaussian distribution. Let be the mean vector (center of the trajectory) of the k-th Gaussian distribution.
[0147] (2) Multi-step prediction strategy: Employing a sequence-to-sequence parallel prediction framework:
[0148] Encoder-decoder architecture:
[0149] Encoder: Processes historical timing data :
[0150] ;
[0151] in, The dataset consists of historical time series data (T time steps), H is the hidden state output by the encoder, containing spatiotemporal feature representations, and the encoder is a spatiotemporal graph neural network, which includes a graph attention network (spatial encoding) and a temporal convolutional network (temporal encoding).
[0152] Decoder: Parallel Generation of Future Predictions :
[0153] ;
[0154] in, Given the prediction results for the next τ time steps, Decoder is a decoder network that generates future trajectories based on encoded features.
[0155] Forced training for teachers:
[0156] During the training phase, real trajectories are used as input to the decoder, while during the testing phase, autoregressive generation is employed.
[0157] Output formulas and data structures
[0158] (1) Trajectory prediction output formula
[0159] For each node ,future Predicted output at each time step for:
[0160] ;
[0161] in for Predicted coordinates at time, These are the predicted values for two-dimensional plane coordinates.
[0162] (2) Output data structure specifications: The node prediction data adopts the following structured format:
[0163] Tensor Dimensions:
[0164] Batch size: B;
[0165] Number of nodes: N;
[0166] Prediction step size: τ;
[0167] Coordinate dimension: 2;
[0168] Confidence dimension: K (number of mixture components).
[0169] Data fields:
[0170] Node prediction data = {
[0171] "Trajectory coordinates": Tensor[B, N, τ, 2],
[0172] "Confidence level": Tensor[B, N, τ, K]
[0173] "Uncertainty": Tensor[B, N, τ],
[0174] "Timestamp": List[τ]
[0175] }
[0176] (3) Quantification of uncertainty
[0177] Calculating prediction uncertainty based on Gaussian mixture model :
[0178] ;
[0179] in, Let be the trace of the covariance matrix, representing the variance within the distribution. The squared distance between the mean and the population mean represents the degree of dispersion between the distributions. This is the weighted average.
[0180] Specifically, the process of building a pre-trained spatiotemporal graph neural network model includes:
[0181] (1) Spatiotemporal graph neural network model structure
[0182] The spatiotemporal graph neural network model employs a hierarchical encoding architecture, including:
[0183] The spatial coding layer, implemented based on a graph attention network, is used to capture the spatial interaction dependencies among traffic participants. Its node feature update formula is as follows:
[0184] ;
[0185] in, Indicates the first Layer nodes eigenvectors, This indicates an activation function (such as LeakyReLU) used to introduce nonlinearity. Represents a node The set of neighboring nodes, The attention coefficients are calculated using the LeakyReLU activation function and softmax normalization. For trainable weight matrix, Indicates the first Layer nodes eigenvectors;
[0186] The temporal coding layer is implemented based on a temporal convolutional network. It uses dilated causal convolution to capture the temporal evolution of motion states. The kernel size is set to 3, and the dilation coefficients are 1, 2, and 4 respectively, forming a multi-scale temporal feature extraction.
[0187] The decoding output layer maps spatiotemporal features into trajectory coordinates for future time steps using a fully connected neural network, and gradually predicts the future positions of each node using an autoregressive generation method.
[0188] (2) Input and output tensor dimension specification
[0189] The model's input and output follow these dimensional specifications:
[0190] The input spatiotemporal correlation graph includes:
[0191] Node feature tensor, dimension 1 ,in, For batch size, For the number of nodes, For historical time steps, =6 represents the node feature dimension, including coordinates, velocity, heading angle, and type identifier;
[0192] The edge feature tensor has dimension 1. ,in, =5 represents the edge feature dimension, including relative distance, relative speed, and relative angle;
[0193] Global feature tensor, dimension ,in, =4 represents the global feature dimension, including weather conditions, road topology, time period, and traffic density;
[0194] The output node prediction data is a trajectory coordinate tensor with dimension 1. ,in, The number of time steps for future prediction is 2, where 2 represents the two-dimensional plane coordinates.
[0195] (3) Model training methods
[0196] The model training employs a multi-stage optimization strategy, specifically including:
[0197] During the pre-training phase, model parameters are initialized based on supervised learning on a large public trajectory dataset;
[0198] During the fine-tuning phase, a course learning strategy is adopted on the target no-signal-light intersection scenario data to progressively train from simple traffic flow patterns to complex interaction scenarios.
[0199] During the online learning phase, the model parameters are dynamically adjusted based on the prediction error within the sliding time window, and an exponentially weighted moving average update strategy is used to balance historical knowledge with adaptation to new scenarios.
[0200] The training process uses the AdamW optimizer, with a learning rate set to... The weight decay coefficient is set to It is used in conjunction with a cosine annealing learning rate scheduler.
[0201] (4) Multi-objective loss function
[0202] The model is trained using a multi-objective loss function, the expression of which is:
[0203] ;
[0204] in, Represents the total loss function. This represents the trajectory prediction loss. , These represent weighting coefficients used to balance different loss terms. This represents the loss due to physical constraints, ensuring that the trajectory conforms to the laws of kinematics. This represents the interaction constraint loss, which strengthens the spatial relationship between nodes through edge features.
[0205] Trajectory prediction loss Employing a multi-scale smoothing L1 loss function:
[0206] ;
[0207] in, For the time scale quantity. These are the weighting coefficients for each scale. and These are the predicted trajectory and the actual trajectory, respectively.
[0208] (5) Dataset construction and sampling strategy
[0209] The datasets used for training and validation were constructed using a multi-source fusion strategy:
[0210] Real trajectory data is collected by roadside sensing devices to capture the movement trajectories of traffic participants at intersections without traffic lights, including various weather conditions and traffic density scenarios.
[0211] Data sampling employs a spatiotemporal sliding window strategy, with the historical observation window set to 10 time steps (corresponding to a duration of 3 seconds), the prediction window set to 5 time steps (corresponding to a duration of 1.5 seconds), and the sampling step size being 5 time steps.
[0212] The hard sample mining technique is used to repeatedly train the model on scene samples with large prediction errors, thereby improving the model's performance on critical cases.
[0213] Data augmentation techniques include coordinate translation, trajectory rotation, velocity perturbation, and random node discarding to enhance the model's generalization ability and robustness.
[0214] (6) Model validation and performance metrics
[0215] The model's performance was validated using the following metrics:
[0216] Average Displacement Error (ADE): Measures the average accuracy of trajectory prediction over the entire prediction period;
[0217] Final Displacement Error (FDE): Evaluates the accuracy of the predicted endpoint location;
[0218] Conflict prediction accuracy: The proportion of times a statistical model correctly predicts an actual conflict.
[0219] False alarm rate: The proportion of false alarms issued by the statistical system.
[0220] Through the synergistic effect of the aforementioned technical features, the model processing module achieves high-precision prediction of the future trajectories of traffic participants, providing a reliable data foundation for subsequent conflict risk assessment.
[0221] In one optional implementation, the model processing module further includes a dynamic update mechanism for the spatiotemporal graph neural network model, specifically including:
[0222] Obtain the error sequence between historical predicted trajectories and actual trajectories, and calculate the average error within the calibration time window. :
[0223]
[0224] in, To determine the length of the time window, and They are respectively The predicted trajectory and actual trajectory coordinates at each moment;
[0225] Based on the average error, the model performance is divided into three ranges: high, medium, and low.
[0226] High model performance range: ;
[0227] Mid-model performance range: ;
[0228] Low model performance range: ;
[0229] in, and The preset error threshold is used;
[0230] The activation frequencies of the spatiotemporal graph neural network model under different traffic scenarios were statistically analyzed. Meanwhile, the number of effective times the error was reduced after the statistical parameters were updated. ;
[0231] The ratio of activation frequency to the total number of traffic scenarios is used as the utilization rate. :
[0232] ;
[0233] in, This represents the total number of traffic scenarios;
[0234] The ratio of effective counts to activation frequency is used as the stability coefficient. :
[0235] ;
[0236] usage rate and stability coefficient The min-max method is used for normalization to ensure that the value is in the range [0,1].
[0237] The parameters of the spatiotemporal graph neural network model are sorted in descending order of usage rate and ascending order of stability coefficient to generate a parameter priority sequence. The sorting rule is: prioritize updating parameters that have high usage rates but low stability.
[0238] Perform differential updates based on model performance range:
[0239] If the average error is in the high model performance range, retain all current model parameters;
[0240] If the average error is within the mid-model performance range, only the parameter priority sequence is updated. Center front The parameters of the ratio, where For a preset fixed ratio (e.g.) =0.3);
[0241] If the average error falls within the low model performance range, reset the parameter priority sequence. Usage rate is lower than preset update threshold The parameters.
[0242] In one optional implementation, the differentiated update also includes an anomaly detection and recovery mechanism, specifically including:
[0243] For the same traffic scenario type, key nodes are extracted from all historical predicted trajectories, and clustering algorithms (such as DBSCAN or K-means) are used to cluster their trajectory patterns based on trajectory geometric features (such as curvature and velocity profile).
[0244] If a certain trajectory pattern is different from the trajectory patterns in the high model performance range, and at least The usage rate exceeded the preset mode threshold within a specified time window. If so, the pattern will be included in the parameter update set corresponding to the high model performance range;
[0245] For the medium and low model performance ranges, if the difference in the usage rate of parameters under at least two different weather conditions exceeds a preset tolerance threshold... If so, then remove the parameter from the parameter update set;
[0246] Determine if the number of parameters in the parameter update set corresponding to each performance interval is zero. If so, include the parameter with the highest usage rate in the current calibration time window into the parameter update set.
[0247] Through the above technical solutions, this module achieves accurate trajectory prediction of traffic participants based on a deep learning model. By using a spatiotemporal graph neural network to collaboratively model the spatial interaction and temporal evolution between nodes, the system can extract effective motion patterns from complex traffic scenarios and generate reliable future trajectory predictions. Furthermore, by introducing a performance-based dynamic parameter update mechanism and anomaly recovery strategy, the prediction accuracy of the model under different traffic scenarios is ensured, while enhancing the system's ability to discover and adapt to emerging motion patterns. This differentiated parameter maintenance strategy effectively balances model stability and self-evolution requirements, improving the long-term robustness and scenario generalization ability of the trajectory prediction module.
[0248] Regarding the Euclidean distance calculation module 400:
[0249] The Euclidean distance calculation module is used to quantify the spatial proximity between the future trajectories of traffic participants. Its specific implementation process is as follows:
[0250] Receive node prediction data from the model processing module, which contains the predicted location coordinates of each graph node (traffic participant) in a series of discrete time steps in the future.
[0251] Extract the predicted position data of all graph nodes at the same future time step; for any two distinct graph nodes, calculate the Euclidean distance between their predicted positions at that time step. This process is iterated over all future time steps, thereby generating a sequence of Euclidean distances across future time steps for each pair of participants.
[0252] The calculated Euclidean distance results for all node pairs at all future time steps are structured and output as a spatiotemporal distance matrix. This matrix is sent to the conflict probability acquisition module as the basic data for potential conflict analysis.
[0253] Through the aforementioned technical solution, this application achieves precise quantification of the spatial proximity between future trajectories. By traversing and calculating the Euclidean distances of the predicted positions of all node pairs at different time steps, the system can comprehensively capture the potential interaction relationships between traffic participants. This process transforms discrete trajectory prediction data into a structured spatiotemporal distance matrix, preserving the temporal characteristics of the original trajectories while providing a directly interpretable quantitative basis for downstream conflict analysis. Furthermore, the matrix-based output structure enhances the system's scalability and data compatibility in multi-participant scenarios, laying a reliable spatial relationship data foundation for collaborative early warning at intersections without traffic lights.
[0254] Regarding the conflict probability acquisition module 500:
[0255] The conflict probability acquisition module is used to assess the potential risk of trajectory conflicts based on spatiotemporal distance. Its specific implementation process is as follows:
[0256] It receives the spatiotemporal distance matrix from the Euclidean distance calculation module and obtains the preset safe distance threshold from the system.
[0257] Each Euclidean distance value in the spatiotemporal distance matrix is compared with the currently valid safe distance threshold to determine if it exceeds the threshold, thus identifying a potential conflict risk at that time step. Subsequently, for any pair of nodes, the proportion of times the risk marker appears in all future observation time steps out of the total number of time steps is calculated, and this proportion is defined as the trajectory conflict probability of that node pair.
[0258] Output the trajectory conflict probability value corresponding to all nodes that need to be monitored. This probability value is transmitted to the early warning instruction generation module as a continuous risk indicator between 0 and 1.
[0259] In one optional implementation, the process of calculating the safe distance threshold specifically includes:
[0260] Obtain historical conflict data of past traffic accidents and construct safety distance benchmarks associated with traffic participant types accordingly;
[0261] Obtain the velocity and heading angle from the current motion data, and calculate the relative motion parameters;
[0262] Calculate the environmental risk coefficient based on weather conditions and road topology data from environmental data;
[0263] The relative motion parameters and environmental risk coefficients are mapped to correction values for the safety distance benchmark, and a dynamic safety distance threshold is generated by weighted summation.
[0264] The formula for calculating the safe distance threshold is:
[0265] ;
[0266] in, For safe distance threshold, This is the baseline value for safe distance. and These are the weighting coefficients. These are relative motion parameters. This represents the environmental risk coefficient.
[0267] In one optional implementation, the process of calculating the relative motion parameters and environmental risk coefficient specifically includes:
[0268] Relative motion parameters The formula is obtained by calculating the magnitude of the velocity difference and heading angle difference between two graph nodes:
[0269] ;
[0270] in, The speed difference This represents the difference in heading angles.
[0271] The environmental risk coefficient is assigned a value by looking up a preset table based on weather conditions and road topology data.
[0272] The environmental risk mapping table is constructed based on historical traffic accident databases (such as the National Traffic Accident Reporting System and traffic meteorological datasets), and is a weather-road topology-risk coefficient mapping table. The construction of the mapping table is based on historical data statistical analysis, and the specific process includes:
[0273] Data collection and preprocessing:
[0274] A large number of records were extracted from historical traffic accident data, including accident location, time, weather conditions (such as sunny, rainy, snowy, and foggy days), road topology type (such as intersections, T-junctions, straight roads, and curves), and accident severity indicators (such as the number of casualties and property damage).
[0275] Standardize and encode weather conditions and road topology data:
[0276] Weather conditions: Use discrete value encoding (e.g., sunny = 0, rain = 1, snow = 2, fog = 3).
[0277] Road topology: Use discrete value encoding (e.g., crossroads = 0, T-junctions = 1, straight roads = 2, curves = 3).
[0278] Calculate the environmental risk baseline for each weather-road topology combination, based on the frequency and severity of accidents occurring under that combination. For example, using a weighted average method:
[0279] ;
[0280] Among them, the severity score of the accident can be assigned according to the level of injury or death (e.g., no injury or death = 1, minor injury = 2, serious injury = 3, death = 4).
[0281] Parameter partitioning and risk coefficient assignment:
[0282] Combined analysis of weather conditions and road topology data identifies key risk zones. Clustering methods (such as K-means) are then used to divide the combinations into low, medium, and high risk groups.
[0283] An environmental risk coefficient is assigned to each combination, and the risk baseline value is mapped to the [0,1] interval through normalization:
[0284] ;
[0285] The risk coefficients are fine-tuned based on expert knowledge or statistical models (such as logistic regression) to ensure that the nonlinear relationship conforms to actual traffic scenarios. For example, the risk coefficient at an intersection on a rainy day is usually higher than the risk coefficient on a straight road on a sunny day.
[0286] Mapping table creation:
[0287] Construct a two-dimensional lookup table where row indices are weather condition codes, column indices are road topology codes, and cell values are environmental risk coefficients. See the table below:
[0288] Table 2: Example Mapping Table
[0289] Weather conditions / Road topology Crossroads (0) T-junction (1) Straight road (2) Curve (3) Sunny (0) 0.1 0.2 0.05 0.15 Rainy day (1) 0.3 0.4 0.1 0.25 Snowy day (2) 0.5 0.6 0.2 0.4 Foggy day (3) 0.4 0.5 0.15 0.35
[0290] Verification of nonlinear relationships:
[0291] The effectiveness of the mapping table was verified using historical data, and significance (p-value < 0.05) was ensured by calculating the correlation coefficient between predicted risks and actual accidents (such as the Pearson correlation coefficient).
[0292] Test the performance of the mapping table in real traffic scenarios. For example, compare the accuracy of conflict warnings before and after using the mapping table in a simulator to ensure that the environmental risk coefficient can effectively reflect the real risks.
[0293] Mapping table update mechanism:
[0294] Regularly (e.g., quarterly) incorporate new traffic accident and meteorological data, recalculate risk baselines and environmental risk coefficients, and employ a sliding window statistical method to maintain the mapping table's adaptability to climate change and road network changes.
[0295] The relative motion parameters and environmental risk coefficients were normalized using the min-max method.
[0296] Through the above technical solution, this application achieves efficient quantification of trajectory conflict risk based on spatiotemporal distance, providing a reliable probabilistic basis for the generation of subsequent early warning instructions. By comparing the real-time calculated Euclidean distance with a dynamic safety distance threshold and statistically analyzing the risk identification ratio, a continuous conflict probability index between 0 and 1 is formed, achieving an accurate characterization of potential collision risks. By integrating historical accident data, real-time motion parameters, and environmental factors, a dynamically adjustable safety distance threshold is constructed, which not only improves the objectivity and adaptability of threshold setting but also enhances the system's accuracy in different traffic scenarios.
[0297] Regarding the warning instruction generation module 600:
[0298] The early warning command generation module is used to generate the final early warning command based on the conflict risk, and it specifically includes:
[0299] Receive trajectory conflict probability values from the conflict probability acquisition module and obtain a preset conflict probability threshold from the system.
[0300] The received trajectory conflict probability is compared with the conflict probability threshold in real time. When the trajectory conflict probability is greater than the preset conflict probability threshold, the early warning instruction generation process is triggered to generate a structured early warning instruction that includes the early warning object, the early warning level, and the recommended measures.
[0301] The final generated warning command will be output to the designated warning execution device, such as a roadside display device, vehicle terminal, or traffic management center, through the system's communication interface.
[0302] In one alternative implementation, such as Figure 3 As shown, after obtaining the conflict probability threshold, it is dynamically adjusted:
[0303] Obtain real-time traffic flow density and synchronize timestamps with node prediction data;
[0304] Calculate the correlation coefficient between traffic flow density and node prediction data;
[0305] If the correlation coefficient exceeds the preset correlation threshold, the conflict probability threshold is adjusted according to the direction of the correlation coefficient.
[0306] When the correlation coefficient is positive, the conflict probability threshold is reduced proportionally.
[0307] When the correlation coefficient is negative, the conflict probability threshold is increased proportionally.
[0308] For example, the correlation coefficient can be calculated using either the Pearson correlation coefficient or the Spearman correlation coefficient, with the type of correlation coefficient adaptively selected based on the characteristics of the traffic scenario:
[0309] Pearson correlation coefficient This formula is applicable to traffic flow scenarios with significant linear relationships and is as follows:
[0310] ;
[0311] in, Indicates the first Traffic flow density in a time slice, This represents the node prediction data for the corresponding time slice. , These are the means of their respective sequences. This represents the number of sampling points within the synchronization time window.
[0312] Spearman correlation coefficient Applicable to traffic scenarios with nonlinear monotonic relationships, the calculation process includes:
[0313] Data rank transformation converts the original observations into ranks. , :
[0314] ;
[0315] in, This indicates the sorted position number.
[0316] Spearman correlation coefficient calculate:
[0317] ;
[0318] in, It represents the difference in rank.
[0319] The cubic spline interpolation method is used to unify data with different sampling rates to the same time reference.
[0320] The conflict probability threshold is adjusted based on the direction and amplitude of the correlation coefficient. The threshold adjustment formula is as follows:
[0321] ;
[0322] in, This is the adjusted conflict probability threshold. Based on the basic conflict probability threshold, To adjust the strength coefficient ( ), For a symbolic function, take The plus or minus sign, for or , The nonlinear adjustment index (usually taken as...) =1.5).
[0323] In one optional implementation, the process of generating and outputting the warning instruction specifically includes:
[0324] When the probability of trajectory conflict is greater than the adjusted conflict probability threshold, the baseline value of the early warning level is extracted.
[0325] Calculate conflict severity parameters based on traffic participant type identification and movement data;
[0326] The conflict severity parameter is mapped to a correction factor for the warning level baseline value;
[0327] The warning level baseline value is adjusted by a correction factor, and a warning command is output based on the adjusted warning level baseline value.
[0328] Specifically, firstly, based on the numerical range of the probability of trajectory conflict, the corresponding warning level benchmark value is extracted from the pre-set four-level warning system. This benchmark value divides the conflict probability into four increasing risk intervals, corresponding to the attention level, warning level, alert level, and critical level, respectively, providing a preliminary basis for subsequent warning level determination.
[0329] Subsequently, considering the type identification of traffic participants and their real-time movement data, a conflict severity parameter was obtained through weighted calculation.
[0330] The calculated conflict severity parameters are transformed into warning level correction coefficients using a piecewise linear mapping function. The warning level baseline value is then added to the correction coefficients, and the result is rounded up to obtain the preliminary final warning level. To ensure system stability, this level must not exceed the maximum warning level limit set by the system.
[0331] Specifically, conflict severity parameters The calculation is as follows:
[0332] Establish a type weight mapping table:
[0333] ;
[0334] The weights satisfy: ;
[0335] Relative velocity factor:
[0336] ;
[0337] in, , For the participant's velocity vector, The maximum allowed speed for the scene;
[0338] Collision angle factor :
[0339] ;
[0340] in, , For the participant's heading angle;
[0341] Conflict severity parameters synthesis:
[0342] ;
[0343] in, , Let be the weighting coefficient, satisfying .
[0344] The severity parameter was normalized using the min-max method.
[0345] Through the above technical solution, this application achieves efficient generation of early warning commands based on real-time trajectory conflict probability in traffic conflict scenarios, providing timely and structured early warning information for roadside equipment, vehicle terminals, or traffic management centers. By dynamically comparing and adjusting the conflict probability threshold with real-time data, the system's adaptability to changes in the traffic environment and the accuracy of early warnings are improved. Through correlation analysis between traffic flow density and node prediction data, Pearson or Spearman correlation coefficients are adaptively selected, and the threshold is dynamically adjusted based on the direction and amplitude of the correlation coefficients, effectively reducing the risk of false alarms and missed alarms.
[0346] To facilitate understanding of the above embodiments, a specific application scenario of the above embodiments will be used as an example for explanation below:
[0347] Implementation scenario setting: Time: A rainy evening with moderate traffic flow; Location: An intersection without traffic lights; Traffic participants: A vehicle traveling from east to west (Vehicle1); a vehicle traveling from north to south (Vehicle2); a pedestrian crossing the road from south to north (Pedestrian1).
[0348] The system workflow is as follows:
[0349] (1) Data acquisition module 100:
[0350] Data on traffic participants is acquired in real time through roadside sensors (cameras, radar, etc.).
[0351] For Vehicle1, obtain its type identifier as vehicle, current position coordinates (assumed to be (10, 5)), velocity vector (2, 0) (indicating that it is traveling west at a speed of 2 m / s), and heading angle of 270 degrees (westward).
[0352] For Vehicle2, the type is identified as vehicle, the current position coordinates are assumed to be (5, 10), the velocity vector is (0, -2) (indicating that it is traveling south at a speed of 2 m / s), and the heading angle is 180 degrees (south).
[0353] For Pedestrian1, the type is identified as pedestrian, the current position coordinates are assumed to be (5, 5), the velocity vector is (0, 1) (indicating walking north at a speed of 1 m / s), and the heading angle is 0 degrees (north).
[0354] Environmental data: The weather was rainy, the road topology was a crossroads, the time was evening, and the traffic density was 0.6 (normalized value).
[0355] (2) Spatiotemporal Relationship Graph Construction Module 200:
[0356] The three traffic participants are represented as three graph nodes.
[0357] Vehicle1: [10, 5, 2, 0, 270, 1] (assuming vehicle type is 1);
[0358] Vehicle2: [5, 10, 0, -2, 180, 1];
[0359] Pedestrian1: [5, 5, 0, 1, 0, 0] (assuming pedestrian type is 0).
[0360] Edge attribute: Calculates the relative relationship between any two nodes.
[0361] Taking Vehicle1 and Vehicle2 as examples:
[0362] The relative positions Δx = 10 - 5 = 5, Δy = 5 - 10 = -5;
[0363] relative speed ;
[0364] Relative heading angle Δθ = |270 - 180| = 90 degrees;
[0365] Euclidean distance ;
[0366] Therefore, Edge12 = [5, -5, 2.828, 90, 7.07] (Note: In practice, radians may be used, but degrees are used here for convenience).
[0367] Similarly, calculate the other edges.
[0368] Global attributes: Based on environmental data, the global feature vector is [1, 0, 2, 0.6] (rainy day = 1, intersection = 0, evening = 2, traffic density 0.6).
[0369] Model processing module (300):
[0370] The constructed spatiotemporal relation graph is input into a pre-trained spatiotemporal graph neural network model (e.g., a hybrid model using GAT and TCN).
[0371] The model outputs the predicted trajectory of each node over a future period of time (e.g., 5 time steps, each time step 0.3 seconds).
[0372] Vehicle1: The coordinate sequence of the next 5 time steps, for example [(10, 5), (9.4, 5), (8.8, 5), (8.2, 5), (7.6, 5)] (uniform linear motion).
[0373] Vehicle2: The coordinate sequence of the next 5 time steps, for example [(5, 10), (5, 9.4), (5, 8.8), (5, 8.2), (5, 7.6)].
[0374] Pedestrian1: The coordinate sequence of the next 5 time steps, for example [(5, 5), (5, 5.3), (5, 5.6), (5, 5.9), (5, 6.2)] (uniform linear motion).
[0375] Euclidean distance calculation module (400):
[0376] For each pair of nodes, calculate their Euclidean distance at each future time step.
[0377] Vehicle1 and Vehicle2:
[0378] Time step 1: Distance 7.07; Time step 2: Distance 6.22; Time step 3: Distance 5.37; Time step 4: Distance 4.52; Time step 5: Distance 3.67.
[0379] Vehicle1 and Pedestrian1:
[0380] Time step 1: Distance 5; Time step 2: Distance 4.4; Time step 3: Distance 3.8; Time step 4: Distance 3.2; Time step 5: Distance 2.6.
[0381] Vehicle2 and Pedestrian1:
[0382] Time step 1: distance 5; Time step 2: distance 4.1; Time step 3: distance 3.2; Time step 4: distance 2.3; Time step 5: distance 1.4.
[0383] Conflict probability acquisition module (500):
[0384] Safe distance threshold calculation: Based on historical data, the baseline value for safe distance between vehicles is set at 5 meters, and the baseline value for safe distance between vehicles and pedestrians is set at 3 meters. Relative motion and environmental risks are also considered.
[0385] For Vehicle1 and Vehicle2 (vehicle-to-vehicle):
[0386] The relative motion parameter is 2.828, which is assumed to be 0.5 after normalization.
[0387] Environmental risk coefficient Er: For rainy days and intersections, the value is assigned as 0.2 by looking up a table, and then normalized to 0.2.
[0388] The safe distance threshold Dsafe = 5 + α * 0.5 + β * 0.2. Assuming α = 1 and β = 1, then Dsafe = 5.7 meters.
[0389] For Vehicle1 and Pedestrian1 (vehicle-pedestrian):
[0390] The baseline value for safe distance is 3 meters, and Dsafe is calculated similarly to be 3.7 meters (assuming the same α and β).
[0391] For Vehicle2 and Pedestrian1 (vehicle-pedestrian): Dsafe = 3.7 meters.
[0392] Comparing Euclidean distance with the safe distance threshold:
[0393] For Vehicle1 and Vehicle2: Comparing the distances of 5 time steps [7.07, 6.22, 5.37, 4.52, 3.67] with 5.7 meters, only the 4th and 5th time steps are less than the threshold, so the number of conflict time steps is 2, and the conflict probability = 2 / 5 = 0.4.
[0394] For Vehicle1 and Pedestrian1: The distance [5, 4.4, 3.8, 3.2, 2.6] is compared with 3.7 meters. The distances at time steps 3, 4, and 5 are less than the threshold, and the collision probability is 3 / 5 = 0.6.
[0395] For Vehicle2 and Pedestrian1: The distance [5, 4.1, 3.2, 2.3, 1.4] is compared with 3.7 meters. The time steps 2, 3, 4, and 5 are less than the threshold, and the collision probability = 4 / 5 = 0.8.
[0396] Warning instruction generation module (600):
[0397] The preset conflict probability threshold is 0.5.
[0398] Comparison: The collision probability between Vehicle1 and Vehicle2 is 0.4 < 0.5, so no warning is issued.
[0399] The collision probability between Vehicle1 and Pedestrian1 is 0.6 > 0.5, so an early warning is generated.
[0400] The collision probability between Vehicle2 and Pedestrian1 is 0.8 > 0.5, so an early warning is generated.
[0401] For warnings of Vehicle1 and Pedestrian1, calculate the conflict severity parameter:
[0402] Type weight: Vehicles - Pedestrians (Assumption);
[0403] Relative velocity factor: (Assuming) =10m / s);
[0404] Collision angle factor: However, note that the angle difference should be [0, 180], so we take min(270, 360-270) / 180=90 / 180=0.5;
[0405] The conflict severity parameter S = 0.8 × (α × 0.224 + β × 0.5). Assuming α = 0.5 and β = 0.3, then S = 0.8 × (0.112 + 0.15) = 0.8 × 0.262 = 0.2096. After normalization, the assumed value is 0.27.
[0406] Warning level baseline value: Which range does a conflict probability of 0.6 fall into? Assuming the alert level is 0.5-0.6, the warning level is 0.6-0.7, the alert level is 0.7-0.8, and the critical level is >0.8, then 0.6 falls into the warning level, with a baseline value of 2.
[0407] Correction factor: The severity parameter 0.27 is mapped to a correction factor. Assuming the mapping function is linear, 0.27 corresponds to a correction factor of 0.27.
[0408] The final warning level = baseline value 2 + correction factor 0.27 = 2.27, which is rounded down to level 2 (warning level).
[0409] Generate warning instructions: For Vehicle1 and Pedestrian1, output a warning level warning and suggest the action of "vehicles slow down and pedestrians be careful".
[0410] Similarly, warnings are generated for Vehicle2 and Pedestrian1, and their conflict severity parameters are calculated. The final warning level may be higher (because the conflict probability is 0.8 and the relative distance is closer), possibly at the warning level.
[0411] Example 2
[0412] This application also provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the above-described spatiotemporal data deep learning analysis system for traffic flow prediction.
[0413] The technical scope of this invention is not limited to the content described above. Those skilled in the art can make various modifications and variations to the above embodiments without departing from the technical concept of this invention, and all such modifications and variations should fall within the protection scope of this invention.
Claims
1. A deep learning analysis system for spatiotemporal data for traffic flow prediction, characterized in that, Conflict warning systems for intersections without traffic lights include: The data acquisition module is used to acquire in real time the type identifiers, motion data, and environmental data of traffic participants. The type identifiers include vehicles and pedestrians, and the motion data includes coordinates, speed, and heading angle. The spatiotemporal graph construction module is used to construct graph nodes based on the type identifier, construct node attributes of graph nodes based on the corresponding motion data, calculate the relative distance, relative speed and relative angle between graph nodes, generate edge attributes between graph nodes based on the calculation results, construct global attributes of the graph based on the environmental data, and construct a spatiotemporal graph based on graph nodes, node attributes, edge attributes and global attributes. The model processing module is used to input the spatiotemporal correlation graph into a pre-trained spatiotemporal graph neural network model to obtain node prediction data containing future predicted trajectories. The Euclidean distance calculation module is used to extract the predicted position data of each graph node in the node prediction data for multiple future time steps. For any two graph nodes, it calculates the Euclidean distance between their predicted position data at the same future time step. The conflict probability acquisition module is used to compare the Euclidean distance with a preset safety distance threshold, and obtain the predicted trajectory conflict probability based on the comparison results of all time steps. The warning instruction generation module is used to generate and output a warning instruction when the trajectory conflict probability is greater than a preset conflict probability threshold.
2. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 1, characterized in that, After constructing the spatiotemporal correlation graph, the process also includes dynamically correcting the spatiotemporal correlation graph, specifically including: Obtain historical trajectory data of historical traffic events; Calculate trajectory smoothness parameters and prediction uncertainty parameters based on historical trajectory data; The trajectory smoothness parameter is mapped to the weight adjustment of the edge attribute, and the prediction uncertainty parameter is mapped to the confidence adjustment of the node attribute. The spatiotemporal correlation graph is reconstructed based on the weight adjustment and confidence adjustment to generate a corrected spatiotemporal correlation graph.
3. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 2, characterized in that, The process of calculating trajectory smoothness parameters and prediction uncertainty parameters specifically includes: The trajectory smoothness parameter, which characterizes the degree of trajectory jitter, is obtained by calculating the standard deviation of the second derivative of historical trajectory data. The prediction uncertainty parameter, which characterizes the reliability of the prediction result, is obtained by using the confidence value of the output layer of the spatiotemporal graph neural network model. Piecewise function mapping is performed on the trajectory smoothness parameter and the prediction uncertainty parameter to generate adjustment amounts.
4. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 1, characterized in that, The model processing module also includes dynamic updates to the spatiotemporal graph neural network model, specifically including: Obtain the error sequence between the historical predicted trajectory and the actual trajectory, and calculate the average error within the calibration time window; The model performance is divided into three ranges: high, medium, and low, based on the average error. For the parameters of the spatiotemporal graph neural network model, the activation frequency under different traffic scenarios is statistically analyzed, and the effective number of times the error is reduced after the parameter is updated is also statistically analyzed. The ratio of activation frequency to total number of traffic scenarios is used as the utilization rate, and the ratio of effective number of times to activation frequency is used as the stability coefficient. The utilization rate and stability coefficient are then normalized. The parameters of the spatiotemporal graph neural network model are sorted in descending order of usage rate and ascending order of stability coefficient to generate a parameter priority sequence. Perform differential updates based on model performance range: The average error is located in the high model performance range, and all current model parameters are retained; The average error is located in the mid-model performance range, and only the first fixed proportion of parameters in the parameter priority sequence are updated; The average error is located in the low model performance range, and the parameters whose usage rate in the reset parameter priority sequence is lower than the preset update threshold are reset.
5. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 4, characterized in that, The differentiated update also includes an anomaly detection and recovery mechanism, specifically including: For the same traffic scenario type, key nodes are extracted from all historical predicted trajectories and clustered according to trajectory patterns; If a certain trajectory pattern is different from the trajectory patterns in the high model performance range, and its usage rate exceeds the preset pattern threshold within at least n calibration time windows, then the pattern will be included in the parameter update set corresponding to the high model performance range. For the medium-performance range and the low-performance range of the model, if the difference in the usage rate of a parameter under at least two different weather conditions exceeds a preset tolerance threshold, then the parameter is removed from the parameter update set. Determine if the number of parameters in the parameter update set corresponding to each performance interval is zero. If so, include the parameter with the highest usage rate in the current calibration time window into the parameter update set.
6. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 1, characterized in that, The process of calculating the safe distance threshold specifically includes: Obtain historical conflict data of past traffic accidents and construct safety distance benchmarks associated with traffic participant types accordingly; Obtain the velocity and heading angle from the current motion data, and calculate the relative motion parameters; Calculate the environmental risk coefficient based on weather conditions and road topology data from environmental data; The relative motion parameters and environmental risk coefficients are mapped to correction values for the safety distance benchmark, and a dynamic safety distance threshold is generated by weighted summation. The formula for calculating the safe distance threshold is: ; in, For safe distance threshold, This is the baseline value for safe distance. and These are the weighting coefficients. These are relative motion parameters. This represents the environmental risk coefficient.
7. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 6, characterized in that, The process of calculating relative motion parameters and environmental risk coefficients specifically includes: Relative motion parameters The formula is obtained by calculating the magnitude of the velocity difference and heading angle difference between two graph nodes: ; in, The speed difference This represents the difference in heading angles. The environmental risk coefficient is assigned a value by looking up a preset table based on weather conditions and road topology data. The relative motion parameters and environmental risk coefficients were normalized using the min-max method.
8. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 1, characterized in that, After obtaining the conflict probability threshold, the process also includes dynamically adjusting it, specifically including: Obtain real-time traffic flow density and synchronize timestamps with node prediction data; Calculate the correlation coefficient between traffic flow density and node prediction data; If the correlation coefficient exceeds the preset correlation threshold, the conflict probability threshold is adjusted according to the direction of the correlation coefficient. When the correlation coefficient is positive, the conflict probability threshold is reduced proportionally. When the correlation coefficient is negative, the conflict probability threshold is increased proportionally.
9. The spatiotemporal data deep learning analysis system for traffic flow prediction according to claim 8, characterized in that, The process of generating and outputting warning instructions specifically includes: When the probability of trajectory conflict is greater than the adjusted conflict probability threshold, the baseline value of the early warning level is extracted. Calculate conflict severity parameters based on traffic participant type identification and movement data; The conflict severity parameter is mapped to a correction factor for the warning level baseline value; The warning level baseline value is adjusted by a correction factor, and a warning command is output based on the adjusted warning level baseline value.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the spatiotemporal data deep learning analysis system for traffic flow prediction as described in any one of claims 1-9.