A method for urban traffic network accident prediction based on graph representation learning and feature fusion

By using graph representation learning and feature fusion methods, a graph neural network model is constructed, which solves the problem of long-tail distribution data in urban traffic networks, improves the accuracy of accident prediction and the generalization ability of the model, and is suitable for urban traffic safety and planning.

CN120355237BActive Publication Date: 2025-09-30SUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510813232.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-30
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

When dealing with complex urban traffic networks, existing technologies for accident prediction have problems with long-tail distribution data, feature fusion, and insufficient model generalization capabilities.

Method used

A method based on graph representation learning and feature fusion is adopted to construct a graph neural network model by extracting node features, edge features and intersection angle information of the urban traffic network. The message passing mechanism is used for feature learning, and the model parameters are optimized through comparative learning to process long-tail distribution data.

Benefits of technology

It improves the accuracy of accident prediction and the generalization ability of the model, can better handle unbalanced data, and achieve efficient and accurate urban traffic accident prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120355237B_ABST
    Figure CN120355237B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting urban traffic network accidents based on graph representation learning and feature fusion, comprising the following steps: (1) processing urban traffic network accident data to extract node features, edge features, and road direction and intersection angle information; (2) fusing and embedding node features, edge features, road direction features, and intersection angle features to generate graph structure features; (3) constructing a graph neural network model based on a message passing mechanism, learning the graph structure features through a graph convolution layer, and extracting deep features of the traffic network; (4) using a contrastive learning method to train accident data with a long tail distribution and optimize model parameters; (5) using the trained model to predict accidents in the urban traffic network and output classification results of the accident danger level; the present invention provides more powerful tools and methods for urban traffic accident prediction problems and urban traffic road planning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of urban traffic network accident prediction, and in particular to an urban traffic network accident prediction method based on graph representation learning and feature fusion. Background Art

[0002] Traffic accident prediction is a critical and complex issue in urban traffic safety, offering valuable insights into traffic safety and urban traffic planning. However, the complex structure of urban traffic networks, diverse road characteristics, and the diverse and unbalanced nature of accident data present numerous challenges for efficient and accurate accident prediction. Existing technologies primarily include vision-based traffic accident detection, graph neural network-based time-series traffic accident prediction, and graph-based urban traffic accident prediction. However, these approaches still struggle with handling long-tailed data, feature fusion, and model generalization. Summary of the Invention

[0003] Purpose of the invention: The purpose of the present invention is to provide an urban traffic network accident prediction method based on graph representation learning and feature fusion, which utilizes the graph structure characteristics of the urban traffic network to improve the accuracy of accident prediction, enhance the generalization ability of the model, and solve the problems existing in the background technology.

[0004] Technical Solution: The method for predicting urban traffic network accidents based on graph representation learning and feature fusion described in the present invention includes the following steps:

[0005] (1) Processing urban traffic network accident data to extract node features, edge features, road direction, and intersection angle information;

[0006] (2) Fusion embedding of node features, edge features, road direction features, and intersection angle features to generate graph structure features;

[0007] (3) Build a graph neural network model based on the message passing mechanism, learn the graph structure features through the graph convolution layer, and extract the deep features of the traffic network;

[0008] (4) Using contrastive learning method to train long-tail distribution accident data and optimize model parameters;

[0009] (5) Use the trained model to predict accidents in the urban traffic network and output the classification results of the degree of accident danger.

[0010] Furthermore, in step (1), negative sampling and self-supervised data enhancement methods are used to process the accident data with long tail distribution.

[0011] Furthermore, in step (2), the node features, edge features, road direction features, and intersection angle features are fused through tensor concatenation and addition operations, and the angle features are embedded through a multi-layer perceptron.

[0012] Furthermore, in step (3), the graph convolution layer adopts LeakyReLU activation function and batch normalization, and introduces residual connection and skip connection.

[0013] Furthermore, in step (4), the InfoNCE loss function is used for comparative learning to optimize the model parameters by shortening the distance between similar samples and increasing the distance between heterogeneous samples.

[0014] The urban traffic network accident prediction system based on graph representation learning and feature fusion described in the present invention includes:

[0015] Data preprocessing module: used to process urban traffic network accident data and extract node features, edge features, road direction and intersection angle information;

[0016] Feature embedding module: used to fuse and embed node features, edge features, road direction features, and intersection angle features to generate graph structure features;

[0017] Graph neural network model module: used to build a graph neural network model based on the message passing mechanism, learn graph structural features through the graph convolution layer, and extract deep features of the traffic network;

[0018] Model training module: used to train accident data with long-tail distribution using contrastive learning method and optimize model parameters;

[0019] Accident prediction module: used to use the trained model to predict accidents in urban traffic networks and output classification results of the degree of accident danger.

[0020] Furthermore, in the data preprocessing module, negative sampling and self-supervised data enhancement methods are used to process accident data with long-tail distribution to improve the model's prediction accuracy for imbalanced data.

[0021] Furthermore, in the feature embedding module, node features, edge features, road direction features, and intersection angle features are fused through tensor splicing and addition operations, and the angle features are embedded through a multi-layer perceptron.

[0022] Furthermore, in the graph neural network model module, the graph convolution layer adopts the LeakyReLU activation function and batch normalization, and introduces residual connections and skip connections.

[0023] Furthermore, in the model training module, the InfoNCE loss function is used for comparative learning to optimize the model parameters by shortening the distance between similar samples and increasing the distance between heterogeneous samples.

[0024] Beneficial effects: Compared with the existing technology, the present invention has the following significant advantages: according to the rotational symmetry of the intersection (node) angle and the road (edge) direction orientation, the corresponding multiple features are put into the model for learning through the message passing mechanism; through negative sampling and self-supervised data enhancement, a contrastive learning paradigm is introduced, and positive and negative samples are constructed based on the severity of node traffic accidents, which helps to improve the model's perception of category imbalance, thereby better realizing accurate accident prediction; by proposing a deep learning model, urban traffic network data is embedded in the graph and deep graph mining is performed, which helps to improve the efficiency of feature learning in graph data mining, and make full use of graph structure information and local node features to achieve efficient prediction on large-scale urban networks; the present invention has higher efficiency and accuracy in processing large-scale and complex urban traffic accident data, and performing node classification tasks of feature embedding and graph representation learning, providing more powerful tools and methods for urban traffic accident prediction problems and urban traffic road planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 is a feature embedding structure diagram of the present invention;

[0026] Figure 2 This is the traffic accident prediction model architecture based on graph neural network of the present invention. DETAILED DESCRIPTION

[0027] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0028] An embodiment of the present invention provides a method for predicting urban traffic network accidents based on graph representation learning and feature fusion, comprising the following steps:

[0029] (1) Processing urban traffic network accident data, extracting node features, edge features, road direction and intersection angle information; using negative sampling and self-supervised data enhancement methods to process long-tail distribution accident data; the details are as follows:

[0030] We used the open-source TAP traffic accident dataset to extract features and convert them into tensors. We divided data types according to the severity of the traffic accidents and employed negative sampling and self-supervised data augmentation based on the long-tail distribution (imbalance) of the data. We also employed the InfoNCELoss loss function, based on contrastive learning, to improve prediction accuracy for imbalanced data. For negative sampling, the formula is as follows:

[0031] ;

[0032] Where V is the set of all nodes, yes The node weight of .

[0033] Based on the node features data.node obtained from data processing, the global edge attributes edge_attr_all of the road, and the road direction features data.coords obtained from the coordinates, feature fusion is achieved through tensor splicing (Concat) and addition (Add). Feature embedding is performed based on the rotation invariance of the intersection angle features and the differences in the road direction features:

[0034] ;

[0035] ;

[0036] in, The edge, node and direction features are embedded through the multi-layer perceptron feature embedding. Feature embedding for edge, node and angle features through multi-layer perceptron; is the hidden layer of the GNN based on message passing, is a learnable weight; this feature embedding method largely retains the local feature information on the traffic network. The complete embedding process is as follows Figure 1 shown.

[0037] (3) A graph neural network model is constructed based on the message passing mechanism. The graph structure features are learned through the graph convolution layer to extract the deep features of the traffic network. The graph convolution layer uses the LeakyReLU activation function and batch regularization, and introduces residual connections and skip connections, as follows:

[0038] In the interpretability analysis of graph neural networks, it is known that too much graph structure embedding will lead to over-smoothing of the model. Therefore, this paper chooses to use a combination of MLP and graph neural networks to learn the deep feature information of the traffic network and build Figure 2 The model framework shown in Figure 1 is as follows:

[0039] Conv is the graph convolution layer (TP), LeakyReLU is the selected activation function used to introduce nonlinearity, BN represents batch normalization to reduce the risk of overfitting, Concatenate represents tensor concatenation, which is used for feature fusion. FC represents a fully connected layer, which outputs logit scores for subsequent classification. This constructs the model's core convolutional layer, TPConv. Its parameters are initialized using Xavier. Message passing is used to forward propagate the node feature tensor x, the adjacency matrix edge_index, and the edge attributes edge_attr, which are input to [Tensor, OptPairTensor].

[0040] (4) The contrastive learning method is used to train the accident data with long tail distribution and optimize the model parameters. The InfoNCE loss function is used for contrastive learning to optimize the model parameters by shortening the distance between similar samples and increasing the distance between heterogeneous samples. The details are as follows:

[0041] First, when introducing contrastive learning for long-tail distribution data, accurate prediction is achieved by narrowing the distance between similar samples and widening the distance between heterogeneous samples. Based on this, the contrastive InfoNCELoss loss function is constructed:

[0042] ;

[0043] in, Represents the cosine similarity between the positive sample feature vector and other sample feature vectors, is a temperature hyperparameter used to control the smoothness of the distribution and is set to 0.1. When the error function approaches 0, the model fit is better and the overall prediction accuracy is higher.

[0044] Next, we select two evaluation metrics: weighted F1_score and accuracy. Weighted F1_score is a weighted F1 score by category (the F1 score is the harmonic mean of precision and recall), while accuracy is the ratio of the number of correctly predicted samples to the total number of samples. These two evaluation metrics reflect the model's performance on multi-classification tasks.

[0045] (5) Use the trained model to predict accidents in urban traffic networks and output classification results of accident danger levels. Since the distribution of traffic accidents not only has local similarities but also shows a correlation with the global graph structure information, the model trained on traffic data from other cities can effectively predict on unknown test graph data. At the same time, the differences in heterogeneous city network graphs are conducive to enhancing the generalization ability of the model and can further reduce the risk of overfitting.

Claims

1. A method for predicting urban traffic network accidents based on graph representation learning and feature fusion, characterized by: The following steps are involved: (1) Process the accident data of the urban traffic network and extract node features, edge features, road direction and intersection angle information; use negative sampling and self-supervised data enhancement methods to process the accident data with long tail distribution; the negative sampling formula is as follows: ; Where V is the set of all nodes, yes The node weight of (2) Node features, edge features, road direction features, and intersection angle features are fused and embedded to generate graph structure features. Based on the node features data.node obtained from data processing, the global edge attributes edge_attr_all of the road, and the road direction features data.coords obtained based on the coordinates, feature fusion is achieved through tensor concatenation and addition operations. Based on the rotation invariance of the intersection angle features and the differences in the road direction features, the features are embedded: ; ; in, The edge, node and direction features are embedded through the multi-layer perceptron feature embedding. Feature embedding for edge, node and angle features through multi-layer perceptron; is the hidden layer of the GNN based on message passing, is the learnable weight; (3) A graph neural network model is constructed based on the message passing mechanism. The graph structural features are learned through the graph convolution layer to extract the deep features of the traffic network. The graph convolution layer adopts the LeakyReLU activation function and batch regularization, and introduces residual connections and skip connections. (4) The contrastive learning method is used to train the accident data with long tail distribution and optimize the model parameters. The InfoNCE loss function is used for contrastive learning to optimize the model parameters by shortening the distance between similar samples and increasing the distance between heterogeneous samples. (5) Use the trained model to predict accidents in the urban traffic network and output the classification results of the degree of accident danger.

2. A system for predicting urban traffic network accidents based on graph representation learning and feature fusion, wherein the system adopts the method for predicting urban traffic network accidents based on graph representation learning and feature fusion according to claim 1, characterized in that: include: Data preprocessing module: used to process urban traffic network accident data and extract node features, edge features, road direction and intersection angle information; Feature embedding module: used to fuse and embed node features, edge features, road direction features, and intersection angle features to generate graph structure features; Graph neural network model module: used to build a graph neural network model based on the message passing mechanism, learn graph structural features through the graph convolution layer, and extract deep features of the traffic network; Model training module: used to train accident data with long-tail distribution using contrastive learning method and optimize model parameters; Accident prediction module: used to use the trained model to predict accidents in urban traffic networks and output classification results of the degree of accident danger.

3. The urban traffic network accident prediction system based on graph representation learning and feature fusion according to claim 2 is characterized in that: In the data preprocessing module, negative sampling and self-supervised data enhancement methods are used to process accident data with long-tail distribution to improve the model's prediction accuracy for imbalanced data.

4. The urban traffic network accident prediction system based on graph representation learning and feature fusion according to claim 2 is characterized in that: In the feature embedding module, node features, edge features, road direction features, and intersection angle features are fused through tensor splicing and addition operations, and the angle features are embedded through a multi-layer perceptron.

5. The urban traffic network accident prediction system based on graph representation learning and feature fusion according to claim 2 is characterized in that: In the graph neural network model module, the graph convolution layer uses the LeakyReLU activation function and batch normalization, and introduces residual connections and skip connections.

6. The urban traffic network accident prediction system based on graph representation learning and feature fusion according to claim 2 is characterized in that: In the model training module, the InfoNCE loss function is used for comparative learning to optimize model parameters by shortening the distance between similar samples and increasing the distance between heterogeneous samples.