A smart road traffic warning method
By constructing a smart road traffic warning method based on graph convolutional neural network and extracting road and weather features, the problem of low traffic warning accuracy in complex urban traffic environments is solved, and accurate prediction and real-time prompts of potential traffic threats are achieved.
Patent Information
- Application Number
- CN202411030559.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
In complex urban traffic environments, it is difficult for existing technologies to effectively conduct traffic early warning in real time, especially due to the difficulty of target feature extraction processing and the complexity of the spatio-temporal correlation process caused by dense vehicles and scene complexity, resulting in low accuracy of traffic accident early warning.
A smart road traffic early warning method is designed. By generating a road traffic network, extracting road, weather and traffic accident characteristics to form a feature vector, and constructing a graph convolutional neural network model, using the gradient descent algorithm to train the model, and extract features in real time to predict Traffic accident probability. If it reaches the threshold, it will prompt the driver that there is a traffic threat.
It achieves accurate prediction and real-time prompts of potential traffic threats, improves the accuracy and timeliness of traffic accident warnings, and is of great significance to social stability and the safety of life and property.
Smart Images

Figure CN118571019B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic warning, and in particular to an intelligent road traffic warning method. Background Art
[0002] Traffic warnings in complex urban traffic environments face many challenges: urban traffic scenes have many densely packed vehicles, and there are occlusions and small-sized targets, which increases the difficulty of target feature extraction and processing; urban traffic scenes are complex, and the spatiotemporal correlation process based on a single target is complex, time-consuming and has low accuracy, making it difficult to conduct effective and real-time traffic warnings.
[0003] The present invention focuses on analyzing the problem of intelligent road traffic warning and proposes a set of intelligent road traffic warning methods. Summary of the invention
[0004] The present invention provides an intelligent road traffic early warning method, the purpose of which is to (1) design a traffic accident early warning model; and (2) achieve real-time early warning of traffic accidents.
[0005] To achieve the above object, the present invention provides a smart road traffic warning method, comprising the following steps:
[0006] S1: Generate a road traffic network and collect a data set related to road traffic to form a road traffic data set;
[0007] S2: extracting features from the collected data set and forming feature vectors with the extracted features, wherein the features include road features, weather features, and traffic accident features;
[0008] S3: Taking the feature vector as input and the traffic accident prediction probability value as output, a graph convolutional neural network model based on the road traffic network is constructed;
[0009] S4: construct the objective function of the graph convolutional neural network model based on the feature vectors in the collected data set, and train the graph convolutional neural network model using the gradient descent algorithm;
[0010] S5: Based on the trained graph convolutional neural network model, feature extraction is performed on real-time traffic road data. The feature vector after feature extraction is used as the model input to obtain the traffic accident prediction probability value. If the prediction probability value reaches the accident threshold, the driver is prompted that there is a traffic threat.
[0011] As a further improvement method of the present invention:
[0012] Optionally, in step S1, a road traffic network is generated, and data related to road traffic is collected to form a road traffic data set, including:
[0013] The road traffic network is represented by an undirected graph Indicates that represents a set of road nodes in a road traffic network, where the road nodes are intersections of roads, and N represents the number of road nodes in the road traffic network. Represents a set of roads connected by road nodes. Represents the adjacency matrix of the road traffic network G. The adjacency matrix is The matrix of is the element in the i-th row and j-th column of the adjacency matrix. If the road node combination Connected to form roads, then the adjacency matrix The value of is 1, otherwise The value of is 0;
[0014] Obtain road data, POI data, traffic accident data, taxi GPS data, and meteorological data in the road traffic network, and generate the location of characteristic places in the undirected graph of the road traffic network based on the POI data. The road data includes the length, direction, and location information data of the road; the POI data is the location information data of a specific place, and the specific place includes the location data of shopping malls, restaurants, companies, residential buildings, government agencies, public facilities, hospitals, schools, and airports; the traffic accident data is the timestamp and location data of the traffic accident; the time interval of the taxi GPS data is 5 minutes, including the timestamp, location data, and speed information of the taxi; the meteorological data is the meteorological information data, including the temperature and weather type at different timestamps.
[0015] Optionally, extracting road features from the collected data set includes:
[0016] For any road in the road traffic network , extract roads from road data Static characteristics of , where the static characteristics of the road This includes the length, direction and location of the road;
[0017] Extract any road POI distribution characteristics ,in Indicates by road The type and location information of the nth POI data in the circular area with a diameter of n, where n represents the number of POI data in the circular area;
[0018] Extract any road Taxi speed characteristics ,in Indicates the timestamp When, road The average speed of taxis, where the timestamp range is is the time series information range of the traffic data in the collected road traffic data set, timestamp is the current real time;
[0019] The static characteristics of the road, the distribution characteristics of POIs and the speed characteristics of taxis are used as road features.
[0020] Optionally, weather features are extracted from the collected data set, including:
[0021] Set up an M-bit status register to encode M-1 weather states. Each weather state has its own independent register bit, and at any time, only one of them is valid, that is, only one bit is 1, and the rest are zero values;
[0022] Extract any road from the meteorological data in the road traffic data set Weather characteristics ;
[0023] in , Indicates the road In timestamp The weather characteristics of Indicates the road In timestamp The weather status code is as follows: Indicates the road In timestamp The temperature below.
[0024] Optionally, traffic accident features are extracted from the collected data set, including:
[0025] Extract any road from the traffic accident data in the road traffic data set Traffic accident characteristics ,in Indicates the road In timestamp Whether a traffic accident has occurred, the value is binary code:
[0026] ;
[0027] The traffic accident characteristics are taken as the actual accident values.
[0028] Optionally, in step S2, the extracted features are formed into feature vectors, including:
[0029] The extracted road features and weather features are formed into a feature vector X:
[0030] ;
[0031] ;
[0032] in:
[0033] Indicates the timestamp When, road The eigenvector of
[0034] Indicates the road Static characteristics of
[0035] Indicates the road POI distribution characteristics;
[0036] Indicates the timestamp When, road Taxi speed characteristics;
[0037] Indicates the timestamp When, road weather characteristics;
[0038] Indicates the road The time series feature vector of .
[0039] Optionally, constructing a graph convolutional neural network model based on a road traffic network in step S3 includes:
[0040] The input of the graph convolutional neural network model is the feature vector of the road at different timestamps, and the output is the traffic accident probability prediction value of the road at the timestamp. The graph convolutional neural network model includes an input layer, a transformation feature extraction layer, a multi-layer graph convolution layer and a fully connected layer. The input layer is used to receive the feature vectors of the road at different timestamps and the undirected graph of the road. The transformation feature extraction layer is used to extract the transformation features of the road from the undirected graph of the road traffic network. The multi-layer graph convolution layer is used to perform multi-layer graph convolution processing on the feature vector to generate a feature map corresponding to the feature vector. The fully connected layer is used to output the traffic accident probability prediction value.
[0041] Optionally, in step S4, constructing an objective function of a graph convolutional neural network model based on feature vectors in the collected data set includes:
[0042] The objective function of the graph convolutional neural network model is constructed based on the feature vectors in the collected data set, where the construction process of the objective function is:
[0043] The input layer receives the undirected graph of the road traffic network and the feature vectors of the roads at different timestamps, performs Laplace matrix decomposition on the undirected graph G of the road traffic network, and obtains the Laplace matrix decomposition features of the undirected graph G of the road traffic network. ;
[0044] The transformation feature extraction layer combines the Laplace matrix decomposition features to transform the adjacency matrix A of the undirected graph G of the road traffic network to obtain the transformation features of the feature vector :
[0045] ;
[0046] in:
[0047] * indicates convolution operation;
[0048] T stands for transpose;
[0049] The multi-layer graph convolution layer of H layers is expanded, where each graph convolution layer contains weight matrix parameters and bias parameters. The weight matrix parameters and bias parameters of H layers of graph convolution layers are initialized to generate the weight matrix parameters and bias parameters of the hth layer of graph convolution layer. ;
[0050] The multi-layer graph convolution layer takes the feature vectors of the roads at different time stamps in the collected data set as input and the feature map after multi-layer graph convolution as output, where the feature vector The calculation formula of the h-th graph convolution layer with input is:
[0051] ;
[0052] ;
[0053] in:
[0054] Represents model parameters based on The output of the h-th graph convolutional layer constructed, ;
[0055] , x represents The input value of the function;
[0056] represents the identity matrix;
[0057] The output of the Hth graph convolutional layer is used as the feature vector The corresponding feature map after multi-layer convolution ;
[0058] The fully connected layer outputs the traffic accident prediction probability value, where the feature vector The corresponding traffic accident prediction probability value is:
[0059] ;
[0060] ;
[0061] in:
[0062] Represents the model parameter vector initialized with The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time;
[0063] Represents the matrix parameters in the fully connected layer;
[0064] The objective function is constructed based on the traffic accident prediction probability value and the actual accident value extracted in step S2:
[0065] ;
[0066] in:
[0067] K represents the number of timestamp information in the road traffic data set;
[0068] N represents the number of road nodes in the undirected graph of the road traffic network;
[0069] Indicates the road In timestamp The actual accident value of a traffic accident when Indicates a traffic accident. It means that no traffic accident occurred;
[0070] The independent variable of the constructed objective function is the model parameter vector, and the dependent variable is the gap between the predicted probability value of traffic accidents and the actual accident value.
[0071] Optionally, in step S4, the graph convolutional neural network model is trained using a gradient descent algorithm, including:
[0072] The graph convolutional neural network model is trained using the gradient descent algorithm, and the multi-layer graph convolution layer in the graph convolutional neural network model is constructed according to the model parameter vector obtained through training. The training process of the model parameter vector is as follows:
[0073] S41: Set the current iteration number of the model parameter vector to d, the initial value of d is 0, and the maximum value is D. Then the d-th iteration result of the model parameter vector is :
[0074] ;
[0075] in:
[0076] represents the d-th iteration result of the weight matrix parameters of the h-th graph convolutional layer, Represents the d-th iteration result of the bias parameter of the h-th graph convolutional layer;
[0077] S42: Iterate the parameters in the model parameter vector based on the objective function, where the iteration formula is:
[0078] ;
[0079] ;
[0080] ;
[0081] ;
[0082] ;
[0083] in:
[0084] Represents the model parameter vector The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time;
[0085] Represents the model parameter vector The multi-layer convolutional layer in the graph convolutional neural network model constitutes the feature vector The calculation process of
[0086] Indicates that the objective function The weight matrix parameters of the h-th graph convolutional layer are taken as unknown variables, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result;
[0087] Indicates that the objective function The bias parameter of the hth graph convolution layer is taken as an unknown variable, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result;
[0088] Repeat step S42 until the iteration results of all weight matrix parameters and bias parameters of the H-layer graph convolutional layer are obtained;
[0089] S43: Order , return to step S42 until the maximum number of iterations is reached, and the model parameter vector that reaches the maximum number of iterations is used as the model parameter vector obtained by training.
[0090] Optionally, in step S5, feature extraction is performed on the real-time traffic road data, and the feature vector after feature extraction is used as a model input to obtain the traffic accident prediction probability value, including:
[0091] Obtain real-time road traffic data for each road, extract features from the real-time traffic road data, and use the feature vector after feature extraction as the input of the graph convolutional neural network model to obtain the traffic accident prediction probability value of the road. If the traffic accident prediction probability value is higher than , it will remind drivers on the road that there is a traffic threat, among which is the preset accident threshold, which is set to 0.7.
[0092] Compared with the prior art, the present invention proposes a smart road traffic warning method, which has the following advantages:
[0093] First, this scheme establishes an undirected graph of road traffic network ,in represents a set of road nodes in a road traffic network, where the road nodes are intersections of roads, and N represents the number of road nodes in the road traffic network. Represents a set of roads connected by road nodes. represents the adjacency matrix of the road traffic network G, is the element in the i-th row and j-th column of the adjacency matrix. If the road node combination Connected to form roads, then the adjacency matrix The value of is 1, otherwise The value of is 0, so the undirected graph is used to represent urban road traffic, and the factors affecting road traffic accidents are comprehensively considered. The static characteristics of the road, the distribution characteristics of POIs near the road, the speed characteristics of taxis on the road, and the weather characteristics of the road are extracted respectively, and the extracted road characteristics and weather characteristics are formed into a feature vector X:
[0094] ;
[0095] ;
[0096] in: Indicates the timestamp When, road The eigenvector of Indicates the road Static characteristics of Indicates the road POI distribution characteristics; Indicates the timestamp When, road Taxi speed characteristics; Indicates the timestamp When, road weather characteristics; Indicates the road The features extracted by this scheme include spatial features of roads, such as static features of roads and POI distribution features, temporal features of roads, such as taxi speed features, and external weather features. They can represent whether a traffic accident occurs on the road from the perspectives of time, space, and externality, which is helpful for the accurate establishment of subsequent traffic warning models.
[0097] At the same time, this scheme proposes a graph convolutional neural network model, the input of the graph convolutional neural network model is the feature vector of the road at different timestamps, and the output is the traffic accident probability prediction value of the road at the timestamp, wherein the graph convolutional neural network model includes an input layer, a transformation feature extraction layer, a multi-layer graph convolution layer and a fully connected layer, the input layer is used to receive the feature vectors of the road at different timestamps and the road, the transformation feature extraction layer is used to extract the transformation features of the road from the road traffic network undirected graph, the multi-layer graph convolution layer is used to perform multi-layer graph convolution processing on the feature vector to generate a feature map corresponding to the feature vector, and the fully connected layer is used to output the traffic accident probability prediction value. In order to obtain better model parameters through training, the objective function of the graph convolutional neural network model is constructed based on the feature vectors in the collected data set, so that the gap between the predicted probability value of traffic accidents and the actual accident value is minimized, and the gradient descent algorithm is used for training. According to the model parameters obtained through training and the graph convolutional neural network model, the model parameters obtained through training are used as the parameters of the graph convolutional neural network model; by extracting features from real-time traffic road data, the feature vector after feature extraction is used as the input of the graph convolutional neural network model to obtain the real-time traffic accident prediction probability value. If the predicted probability value reaches the accident threshold, the driver is prompted to have a traffic threat. Therefore, this solution can predict potential traffic threats and prompt the driver, thereby avoiding the occurrence of traffic accidents, which is of great significance to social stability and the safety of people's lives and property. At the same time, applying artificial intelligence technology to real life is of great significance to the creation of smart cities. BRIEF DESCRIPTION OF THE DRAWINGS
[0098] Figure 1A schematic diagram of a flow chart of a smart road traffic warning method provided by one embodiment of the present invention;
[0099] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0100] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention. Example 1
[0101] S1: Generate a road traffic network and collect a data set related to road traffic to form a road traffic data set.
[0102] In step S1, a road traffic network is generated, and data related to road traffic is collected to form a road traffic data set, including:
[0103] The road traffic network is represented by an undirected graph Indicates that represents a set of road nodes in a road traffic network, where the road nodes are intersections of roads, and N represents the number of road nodes in the road traffic network. Represents a set of roads connected by road nodes. Represents the adjacency matrix of the road traffic network G. The adjacency matrix is The matrix of is the element in the i-th row and j-th column of the adjacency matrix. If the road node combination Connected to form roads, then the adjacency matrix The value of is 1, otherwise The value of is 0;
[0104] Obtain road data, POI data, traffic accident data, taxi GPS data, and meteorological data in the road traffic network, and generate the location of characteristic places in the undirected graph of the road traffic network based on the POI data. The road data includes the length, direction, and location information data of the road; the POI data is the location information data of a specific place, and the specific place includes the location data of shopping malls, restaurants, companies, residential buildings, government agencies, public facilities, hospitals, schools, and airports; the traffic accident data is the timestamp and location data of the traffic accident; the time interval of the taxi GPS data is 5 minutes, including the timestamp, location data, and speed information of the taxi; the meteorological data is the meteorological information data, including the temperature and weather type at different timestamps.
[0105] S2: extracting features from the collected data set, and forming feature vectors with the extracted features, wherein the features include road features, weather features, and traffic accident features.
[0106] Extract road features from the collected data set, including:
[0107] For any road in the road traffic network , extract roads from road data Static characteristics of , where the static characteristics of the road This includes the length, direction and location of the road;
[0108] Extract any road POI distribution characteristics ,in Indicates by road The type and location information of the nth POI data in the circular area with a diameter of n, where n represents the number of POI data in the circular area;
[0109] Extract any road Taxi speed characteristics ,in Indicates the timestamp When, road The average speed of taxis, where the timestamp range is is the time series information range of the traffic data in the collected road traffic data set, timestamp is the current real time;
[0110] The static characteristics of the road, the distribution characteristics of POIs and the speed characteristics of taxis are used as road features.
[0111] Extract weather features from the collected data set, including:
[0112] Set up an M-bit status register to encode M-1 weather states. Each weather state has its own independent register bit, and at any time, only one of them is valid, that is, only one bit is 1, and the rest are zero values;
[0113] Extract any road from the meteorological data in the road traffic data set Weather characteristics ;
[0114] in , Indicates the road In timestamp The weather characteristics of Indicates the road In timestamp The weather status code is as follows: Indicates the road In timestamp The temperature below.
[0115] The extracted features are formed into feature vectors, including:
[0116] The extracted road features and weather features are formed into a feature vector X:
[0117] ;
[0118] ;
[0119] in:
[0120] Indicates the timestamp When, road The eigenvector of
[0121] Indicates the road Static characteristics of
[0122] Indicates the road POI distribution characteristics;
[0123] Indicates the timestamp When, road Taxi speed characteristics;
[0124] Indicates the timestamp When, road weather characteristics;
[0125] Indicates the road The time series feature vector of .
[0126] S3: With the feature vector as input and the traffic accident prediction probability value as output, a graph convolutional neural network model based on the road traffic network is constructed.
[0127] In the step S3, a graph convolutional neural network model based on a road traffic network is constructed, including:
[0128] The input of the graph convolutional neural network model is the feature vector of the road at different timestamps, and the output is the traffic accident probability prediction value of the road at the timestamp. The graph convolutional neural network model includes an input layer, a transformation feature extraction layer, a multi-layer graph convolution layer and a fully connected layer. The input layer is used to receive the feature vectors of the road at different timestamps and the undirected graph of the road. The transformation feature extraction layer is used to extract the transformation features of the road from the undirected graph of the road traffic network. The multi-layer graph convolution layer is used to perform multi-layer graph convolution processing on the feature vector to generate a feature map corresponding to the feature vector. The fully connected layer is used to output the traffic accident probability prediction value.
[0129] S4: Construct the objective function of the graph convolutional neural network model based on the feature vectors in the collected data set, and train the graph convolutional neural network model using the gradient descent algorithm.
[0130] In the step S4, the objective function of the graph convolutional neural network model is constructed based on the feature vectors in the collected data set, including:
[0131] The objective function of the graph convolutional neural network model is constructed based on the feature vectors in the collected data set, where the construction process of the objective function is:
[0132] The input layer receives the undirected graph of the road traffic network and the feature vectors of the roads at different timestamps, performs Laplace matrix decomposition on the undirected graph G of the road traffic network, and obtains the Laplace matrix decomposition features of the undirected graph G of the road traffic network. ;
[0133] The transformation feature extraction layer combines the Laplace matrix decomposition features to transform the adjacency matrix A of the undirected graph G of the road traffic network to obtain the transformation features of the feature vector :
[0134] ;
[0135] in:
[0136] * indicates convolution operation;
[0137] T stands for transpose;
[0138] The multi-layer graph convolution layer of H layers is expanded, where each graph convolution layer contains weight matrix parameters and bias parameters. The weight matrix parameters and bias parameters of H layers of graph convolution layers are initialized to generate the weight matrix parameters and bias parameters of the hth layer of graph convolution layer. ;
[0139] The multi-layer graph convolution layer takes the feature vectors of the roads at different time stamps in the collected data set as input and the feature map after multi-layer graph convolution as output, where the feature vector The calculation formula of the h-th graph convolution layer with input is:
[0140] ;
[0141] ;
[0142] in:
[0143] Represents model parameters based on The output of the h-th graph convolutional layer constructed, ;
[0144] , x represents The input value of the function;
[0145] represents the identity matrix;
[0146] The output of the Hth graph convolutional layer is used as the feature vector The corresponding feature map after multi-layer convolution ;
[0147] The fully connected layer outputs the traffic accident prediction probability value, where the feature vector The corresponding traffic accident prediction probability value is:
[0148] ;
[0149] ;
[0150] in:
[0151] Represents the model parameter vector initialized with The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time;
[0152] Represents the matrix parameters in the fully connected layer;
[0153] The objective function is constructed based on the traffic accident prediction probability value and the actual accident value extracted in step S2:
[0154] ;
[0155] in:
[0156] K represents the number of timestamp information in the road traffic data set;
[0157] N represents the number of road nodes in the undirected graph of the road traffic network;
[0158] Indicates the road In timestamp The actual accident value of a traffic accident when Indicates a traffic accident. It means that no traffic accident occurred;
[0159] The independent variable of the constructed objective function is the model parameter vector, and the dependent variable is the gap between the predicted probability value of traffic accidents and the actual accident value.
[0160] In step S4, the graph convolutional neural network model is trained using a gradient descent algorithm, including:
[0161] The graph convolutional neural network model is trained using the gradient descent algorithm, and the multi-layer graph convolution layer in the graph convolutional neural network model is constructed according to the model parameter vector obtained through training. The training process of the model parameter vector is as follows:
[0162] S41: Set the current iteration number of the model parameter vector to d, the initial value of d is 0, and the maximum value is D. Then the d-th iteration result of the model parameter vector is :
[0163] ;
[0164] in:
[0165] represents the d-th iteration result of the weight matrix parameters of the h-th graph convolutional layer, Represents the d-th iteration result of the bias parameter of the h-th graph convolutional layer;
[0166] S42: Iterate the parameters in the model parameter vector based on the objective function, where the iteration formula is:
[0167] ;
[0168] ;
[0169] ;
[0170] ;
[0171] ;
[0172] in:
[0173] Represents the model parameter vector The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time;
[0174] Represents the model parameter vector The multi-layer convolutional layer in the graph convolutional neural network model constitutes the feature vector The calculation process of
[0175] Indicates that the objective function The weight matrix parameters of the h-th graph convolutional layer are taken as unknown variables, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result;
[0176] Indicates that the objective function The bias parameter of the hth graph convolution layer is taken as an unknown variable, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result;
[0177] Repeat step S42 until the iteration results of all weight matrix parameters and bias parameters of the H-layer graph convolutional layer are obtained;
[0178] S43: Order , return to step S42 until the maximum number of iterations is reached, and the model parameter vector that reaches the maximum number of iterations is used as the model parameter vector obtained by training.
[0179] S5: Based on the trained graph convolutional neural network model, feature extraction is performed on real-time traffic road data. The feature vector after feature extraction is used as the model input to obtain the traffic accident prediction probability value. If the prediction probability value reaches the accident threshold, the driver is prompted that there is a traffic threat.
[0180] In step S5, feature extraction is performed on the real-time traffic road data, and the feature vector after feature extraction is used as a model input to obtain the traffic accident prediction probability value, including:
[0181] Obtain real-time road traffic data for each road, extract features from the real-time traffic road data, and use the feature vector after feature extraction as the input of the graph convolutional neural network model to obtain the traffic accident prediction probability value of the road. If the traffic accident prediction probability value is higher than , it will remind drivers on the road that there is a traffic threat, among which is the preset accident threshold, which is set to 0.7. Example 2
[0182] This embodiment is basically the same as Embodiment 1, except that:
[0183] S2: Extract features from the collected data set to form a feature vector.
[0184] The step S2 extracts traffic accident features from the collected data set, including:
[0185] Extract any road from the traffic accident data in the road traffic data set Traffic accident characteristics ,in Indicates the road In timestamp Whether a traffic accident has occurred, the value is binary code:
[0186] ;
[0187] The traffic accident characteristics are taken as the actual accident values.
[0188] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0190] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A smart road traffic warning method, characterized in that: The method comprises: S1: Generate a road traffic network and collect data related to road traffic to form a road traffic data set; S2: extracting features from the collected data set and forming feature vectors with the extracted features, wherein the features include road features, weather features, and traffic accident features; S3: Taking the feature vector as input and the traffic accident prediction probability value as output, a graph convolutional neural network model based on the road traffic network is constructed; S4: constructing the objective function of the graph convolutional neural network model based on the feature vectors in the collected data set, and training the graph convolutional neural network model using the gradient descent algorithm; The construction process of the objective function is: The input layer receives the undirected graph of the road traffic network and the feature vectors of the roads at different timestamps, performs Laplace matrix decomposition on the undirected graph G of the road traffic network, and obtains the Laplace matrix decomposition features of the undirected graph G of the road traffic network. ; The transformation feature extraction layer combines the Laplace matrix decomposition features to transform the adjacency matrix A of the undirected graph G of the road traffic network to obtain the transformation features of the feature vector ; ; in: * indicates convolution operation; T stands for transpose; The multi-layer graph convolution layer of H layers is expanded, where each graph convolution layer contains weight matrix parameters and bias parameters. The weight matrix parameters and bias parameters of H layers of graph convolution layers are initialized to generate the weight matrix parameters and bias parameters of the hth layer of graph convolution layer. ; The multi-layer graph convolution layer takes the feature vectors of the roads at different time stamps in the collected data set as input and the feature map after multi-layer graph convolution as output, where the feature vector The calculation formula of the h-th graph convolution layer with input is: ; ; in: Represents model parameters based on The output of the h-th graph convolutional layer constructed, ; , x represents The input value of the function; represents the identity matrix; The output of the Hth graph convolutional layer is used as the feature vector The corresponding feature map after multi-layer convolution ; The fully connected layer outputs the traffic accident prediction probability value, where the feature vector The corresponding traffic accident prediction probability value is: ; ; in: Represents the model parameter vector initialized with The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time; Represents the matrix parameters in the fully connected layer; The objective function is constructed based on the traffic accident prediction probability value and the actual accident value extracted in step S2: ; in: K represents the number of timestamp information in the road traffic data set; N represents the number of road nodes in the undirected graph of the road traffic network; Indicates the road In timestamp The actual accident value of a traffic accident when Indicates a traffic accident. It means that no traffic accident occurred; The independent variable of the constructed objective function is the model parameter vector, and the dependent variable is the gap between the predicted probability value of traffic accidents and the actual accident value; Use the gradient descent algorithm to train the graph convolutional neural network model; S5: Based on the trained graph convolutional neural network model, feature extraction is performed on real-time traffic road data. The feature vector after feature extraction is used as the model input to obtain the traffic accident prediction probability value. If the prediction probability value reaches the accident threshold, the driver is prompted that there is a traffic threat.
2. A smart road traffic warning method as claimed in claim 1, characterized in that: In the step S1, a road traffic network is generated, and data related to road traffic is collected to form a road traffic data set, including: The road traffic network is represented by an undirected graph Indicates that represents a set of road nodes in a road traffic network, where the road nodes are intersections of roads, and N represents the number of road nodes in the road traffic network. Represents a set of roads connected by road nodes. Represents the adjacency matrix of the road traffic network G. The adjacency matrix is The matrix of is the element in the i-th row and j-th column of the adjacency matrix. If the road node combination Connected to form roads, then the adjacency matrix The value of is 1, otherwise The value of is 0; Obtain road data, POI data, traffic accident data, taxi GPS data, and weather data in the road traffic network, and generate the location of feature places in the undirected graph of the road traffic network based on the POI data.
3. The intelligent road traffic warning method according to claim 1, characterized in that: Extract road features from the collected data set, including: For any road in the road traffic network , extract roads from road data Static characteristics , where the static characteristics of the road This includes the length, direction and location of the road; Extract any road POI distribution characteristics ,in Indicates by road The type and location information of the nth POI data in the circular area with a diameter of n, where n represents the number of POI data in the circular area; Extract any road Taxi speed characteristics ,in Indicates the timestamp When, road The average speed of taxis, where the timestamp range is is the time series information range of the traffic data in the collected road traffic data set, timestamp is the current real time; The static characteristics of the road, the distribution characteristics of POIs and the speed characteristics of taxis are used as road features.
4. The intelligent road traffic warning method according to claim 1, characterized in that: Extract weather features from the collected data set, including: Set up an M-bit status register to encode M-1 weather states. Each weather state has its own independent register bit, and at any time, only one of them is valid, that is, only one bit is 1, and the rest are zero values; Extract any road from the meteorological data in the road traffic data set Weather characteristics ; in , Indicates the road In timestamp The weather characteristics of Indicates the road In timestamp The weather status code is as follows: Indicates the road In timestamp The temperature below.
5. The intelligent road traffic warning method according to claim 1, characterized in that: Extract traffic accident features from the collected data set, including: Extract any road from the traffic accident data in the road traffic data set Traffic accident characteristics ,in Indicates the road In timestamp Whether a traffic accident has occurred, the value is binary code: ; The traffic accident characteristics are taken as the actual accident values.
6. The intelligent road traffic warning method according to claim 1, characterized in that: The extracted features are formed into feature vectors in step S2, including: The extracted road features and weather features are formed into a feature vector X: ; ; in: Indicates the timestamp When, road The eigenvector of Indicates the road Static characteristics of Indicates the road POI distribution characteristics; Indicates the timestamp When, road Taxi speed characteristics; Indicates the timestamp When, road weather characteristics; Indicates the road The time series feature vector of .
7. The intelligent road traffic warning method according to claim 1, characterized in that: In the step S3, a graph convolutional neural network model based on a road traffic network is constructed, including: The input of the graph convolutional neural network model is the feature vector of the road at different timestamps, and the output is the traffic accident probability prediction value of the road at the timestamp. The graph convolutional neural network model includes an input layer, a transformation feature extraction layer, a multi-layer graph convolution layer and a fully connected layer. The input layer is used to receive the feature vectors of the road at different timestamps and the undirected graph of the road. The transformation feature extraction layer is used to extract the transformation features of the road from the undirected graph of the road traffic network. The multi-layer graph convolution layer is used to perform multi-layer graph convolution processing on the feature vector to generate a feature map corresponding to the feature vector. The fully connected layer is used to output the traffic accident probability prediction value.
8. The intelligent road traffic warning method according to claim 1, characterized in that: In step S4, the graph convolutional neural network model is trained using a gradient descent algorithm, including: The graph convolutional neural network model is trained using the gradient descent algorithm, and the multi-layer graph convolution layer in the graph convolutional neural network model is constructed according to the model parameter vector obtained through training. The training process of the model parameter vector is as follows: S41: Set the current iteration number of the model parameter vector to d, the initial value of d is 0, and the maximum value is D. Then the dth iteration result of the model parameter vector is : ; in: represents the d-th iteration result of the weight matrix parameters of the h-th graph convolutional layer, Represents the d-th iteration result of the bias parameter of the h-th graph convolutional layer; S42: Iterate the parameters in the model parameter vector based on the objective function, where the iteration formula is: ; ; ; ; ; in: Represents the model parameter vector The graph convolutional neural network model constructed is used to predict traffic accidents, In timestamp The predicted probability value of a traffic accident occurring at the time; Represents the model parameter vector The multi-layer convolutional layer in the graph convolutional neural network model constitutes the feature vector The calculation process of Indicates that the objective function The weight matrix parameters of the h-th graph convolutional layer are taken as unknown variables, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result; Indicates that the objective function The bias parameter of the hth graph convolution layer is taken as an unknown variable, and the other parameters are taken as known variables for derivation, and the model parameter vector Substitute the parameters in into the derivative result; Repeat step S42 until the iteration results of all weight matrix parameters and bias parameters of the H-layer graph convolutional layer are obtained; S43: Order , return to step S42 until the maximum number of iterations is reached, and the model parameter vector that reaches the maximum number of iterations is used as the model parameter vector obtained by training.
9. The intelligent road traffic warning method according to claim 1, characterized in that: In step S5, feature extraction is performed on the real-time traffic road data, and the feature vector after feature extraction is used as a model input to obtain the traffic accident prediction probability value, including: Obtain real-time road traffic data for each road, extract features from the real-time traffic road data, and use the feature vector after feature extraction as the input of the graph convolutional neural network model to obtain the traffic accident prediction probability value of the road. If the traffic accident prediction probability value is higher than , it will remind drivers on the road that there is a traffic threat, among which is the preset accident threshold, which is set to 0.7.
