Urban vehicle speed prediction method and system based on graph attention network and weather weight
By combining the graph attention network and weather weights, the spatial and temporal characteristics of urban roads are captured, which solves the problem of insufficient accuracy of vehicle speed prediction in existing technologies and achieves more efficient vehicle speed prediction results.
Patent Information
- Application Number
- CN202210821384.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2042-07-13
AI Technical Summary
Existing technologies for predicting vehicle speed on urban roads use graph convolutional neural networks combined with linear splicing methods, but this method suffers from insufficient feature processing accuracy and is unable to accurately reflect the spatial and temporal characteristics of urban roads.
A graph attention network is used to capture the spatial features of urban roads, and a recurrent gate unit is used to capture the temporal features. The external weather features and vehicle speed features are weightedly fused through a feature fusion method to construct a W2-GAT model for prediction.
The model's convergence speed and prediction accuracy were improved, the root mean square error was reduced by an average of 7.5%, and the accuracy was increased by 4%, which can better reflect the actual road speed conditions.
Smart Images

Figure CN115204489B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent transportation, and in particular to a method and system for predicting urban vehicle speed based on a graph attention network and weather weights. Background Art
[0002] The large number of motor vehicles in use poses a significant challenge to transportation systems, leading to numerous problems such as traffic congestion and environmental pollution. Appropriate governance measures and travel guidance programs are needed to promote the positive development of urban transportation systems. In today's era of big data and artificial intelligence, intelligent transportation systems (ITS) have emerged in the field of urban transportation. ITS encompasses a wide range of areas, including urban road traffic control and public transportation passenger flow analysis.
[0003] Among them, road speed prediction is the basis for practical applications such as traffic signal control and public transportation organization, which helps decision makers formulate appropriate strategies to guide citizens' travel and improve the quality of urban transportation services.
[0004] To achieve more accurate vehicle speed prediction, the current mainstream approach in the industry is to use deep learning technology. However, most of these methods currently use graph convolutional neural networks to capture spatial features and direct linear splicing methods for feature processing, which has certain limitations in accuracy. Summary of the Invention
[0005] The main purpose of this invention is to propose a method and system for urban vehicle speed prediction based on a graph attention network and weather weights. The graph attention network is used to capture the spatial features of urban roads, and the recurrent gate unit is used to capture the temporal features. In terms of feature processing, a feature fusion method is designed to fuse external weather features with vehicle speed features, thereby improving the convergence speed and prediction accuracy of the model.
[0006] The present invention adopts the following technical solutions:
[0007] On the one hand, a method for predicting urban vehicle speed based on graph attention network and weather weights includes the following steps:
[0008] Construct a spatial structure graph G consisting of the target road segment p and its related road segments p =(V p ,E p ); where V p is the vertex set, E p is an edge set;
[0009] Based on the spatial structure diagram, construct the vehicle speed matrix C p,t,l and weather factor matrix D p,t,k,l; Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l time periods before the current time t, and the matrix D represents the weather factors of the target road section p to be predicted l time periods before the current time t and k time periods after t;
[0010] Use a weighted method to perform weighted fusion of the vehicle speed matrix and the weather factor matrix to obtain the feature fusion matrix A p,t,k,l ;
[0011] The matrix after feature fusion is input into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p in k time periods after the current time t.
[0012] Preferably, the vertex set V p and edge set E p is represented as follows:
[0013]
[0014] Preferably, the vehicle speed matrix C p,t,l and weather factor matrix D p,t,k,l It is expressed as follows:
[0015]
[0016] Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l periods before the current time t, the matrix D represents the weather factors of the target road section p to be predicted l periods before the current time t and k periods after t, m,j represents the historical vehicle speed data of the mth time period and the jth monitoring point, m∈[t-1,tl]; d o,j Respectively represent the weather factor data of the oth time period and the jth monitoring point, o∈[tl,t+k-1]; n=|V p |, is V p The number of vertices in .
[0017] Preferably, the matrix A after feature fusion p,t,k,l It is expressed as follows:
[0018]
[0019] Among them, the matrix B k+l,n (1) represents a (k+l)×n dimensional matrix with all values 1, B k,n (0) represents a k×n dimensional matrix with all values 0, The operator represents the Hadamard product.
[0020] Preferably, the W2-GAT model specifically includes:
[0021] There are two layers, the lower layer is the Cell-X module, which includes three components: graph attention network GAT, residual connection Res-Conn and full connection FC, which is used to capture spatial features; the upper layer is the GRU model, which is used to capture temporal features.
[0022] Preferably, the matrix after feature fusion is input into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p for k time periods after the current time t, specifically including:
[0023] Get the target road segment p and related road segments p j The attention coefficient e 0,j ,as follows:
[0024] e 0,j =μ(W GAT a0,W GAT a j )j=0,1,…n-1 (2)
[0025] Among them, e 0,j Represents the relevant road segment p j The importance of the target road section p; a0, a j Indicates road segments p0, p j The input feature vector, A p,t,k,l The 0th and jth columns of ; μ represents a single hidden layer feedforward neural network, the transformation completed; For the transformation between input features and output features, m in is the number of input features, m out is the number of output features;
[0026] For e 0,j Perform normalization operation and use softmax function for normalization. Before normalization, first perform normalization on e 0,j After activation processing, the normalized attention coefficient e' 0,j is calculated as follows:
[0027]
[0028] Among them, LeakyReLU is the activation function, is a parameterized weight vector of a single hidden layer feedforward neural network μ, and || represents the vector concatenation operation as shown below:
[0029] v r×1 ||v 1×s =v r×1 ×B 1×s (1) +B r×1 (1) ×v 1×s
[0030] After that, use e' 0,j Perform weighted summation on the input feature vectors to obtain the output feature o0 of the target road section after GAT processing, as follows:
[0031]
[0032] Where σ represents a nonlinear activation function;
[0033] The output feature o0 of GAT is processed by the residual connection as shown in the following formula to obtain the output result o′0:
[0034]
[0035] Among them, |v| represents the dimension of vector v, and conv1d is a one-dimensional convolution;
[0036] Transform o'0 through the fully connected neural network Full-C and become the input x processed by the next stage GRU layer t ;
[0037] Predict the vehicle speed characteristics of the target road section p for k time periods after the current time t.
[0038] On the other hand, a city vehicle speed prediction system based on graph attention network and weather weights includes:
[0039] Spatial structure graph construction module, used to construct a spatial structure graph G consisting of the target road segment p and its related road segments p =(V p , E p ); where V p is the vertex set, E p is an edge set;
[0040] The vehicle speed matrix and weather factor matrix construction module is used to construct the vehicle speed matrix C based on the spatial structure diagram. p,t,l and weather factor matrix D p,t,k,l ; Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l time periods before the current time t, and the matrix D represents the weather factors of the target road section p to be predicted l time periods before the current time t and k time periods after t;
[0041] The feature fusion matrix acquisition module is used to use a weighted method to fuse the vehicle speed matrix and the weather factor matrix to obtain the feature fusion matrix A. p,t,k,l ;
[0042] The prediction module is used to input the matrix after feature fusion into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p in k time periods after the current time t.
[0043] From the above description of the present invention, it can be seen that the present invention has the following beneficial effects:
[0044] This paper proposes a short-term urban road speed prediction model (W2-GAT) that integrates a graph attention network, a gated recurrent unit, and weather weighting factors. The model consists of two components: a lower-layer model employing a graph attention network (GAT) to capture the spatial characteristics of the road network; and an upper-layer model employing a gate recurrent unit (GRU) to capture the temporal characteristics of road speed. Furthermore, a feature fusion method is designed for data processing. In addition to considering road speed itself, weather factors are weighted and abstractly integrated into the speed prediction. This allows the weighting of various weather factors to be adjusted based on the actual regional conditions of the city, better reflecting road conditions and achieving more accurate prediction results, which is beneficial for practical applications. Experimental results show that compared to existing prediction models, the W2-GAT achieves an average 7.5% reduction in root mean square error and an average 4% improvement in accuracy. It can better reflect the short-term future speed characteristics under actual road conditions, providing data support for specific traffic data applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flowchart of a method for predicting urban vehicle speed based on graph attention network and weather weights according to an embodiment of the present invention;
[0046] Figure 2 This is a structural diagram of the W2-GAT model according to an embodiment of the present invention;
[0047] Figure 3 Figure 1 shows the W2-GAT parameter selection results for an embodiment of the present invention; (a) shows the structure for selecting the heavy rain weight for the sz-taxi dataset; (b) shows the results of selecting the heavy rain weight for the xm-bus-road dataset.
[0048] Figure 4 This is a structural block diagram of a city vehicle speed prediction system based on graph attention network and weather weights according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] Below in conjunction with specific embodiment, further set forth the present invention.Should be understood that these embodiments are only used to illustrate the present invention and are not used in limiting the scope of the present invention.In addition, should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall equally within the scope limited by the appended claims of the application.
[0050] See also Figure 1As shown, the urban vehicle speed prediction method based on graph attention network and weather weight of the present invention includes the following steps:
[0051] S101: Construct a spatial structure graph G consisting of the target road segment p and its related road segments. p =(V p ,E p ); where V p is the vertex set, E p is an edge set;
[0052] S102: Construct vehicle speed matrix C based on the spatial structure diagram p,t,l and weather factor matrix D p,t,k,l ; Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l time periods before the current time t, and the matrix D represents the weather factors of the target road section p to be predicted l time periods before the current time t and k time periods after t;
[0053] S103, using a weighted method to perform weighted fusion of the vehicle speed matrix and the weather factor matrix to obtain a feature fusion matrix A p,t,k,l ;
[0054] S104: Input the matrix after feature fusion into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p for k time periods after the current time t.
[0055] The entire implementation process is described in detail below.
[0056] Step 1: Problem definition of urban vehicle speed prediction
[0057] A road segment is defined as an abstract point on a road segment in an urban traffic network that is divided by a road intersection or bus stop, and has corresponding attributes such as speed and weather conditions. Therefore, the vehicle speed of a certain road segment in the future at a certain time period in the city is closely related to the spatial structure of the urban road traffic network. On the other hand, the relevant internal connection can also be obtained from the historical vehicle speed data characteristics of the road segment and its surrounding related sections. In addition, other external factors such as weather and holidays will also affect the vehicle speed on the road to a certain extent. Therefore, the problem of urban road speed prediction is essentially a mapping problem from the spatiotemporal characteristics of urban roads to vehicle speed, which can be formally expressed as formula (1):
[0058] v p,t,k,l =f(G p ,C p,t,l ,D p,t,k,l ) (3)
[0059] As shown in formula (1), v p,t,k,lis a multidimensional vector that represents the vehicle speed of the target road segment p in the future k time periods after the current time t, and l is the number of time periods that have passed before the current time t. In order to construct this mapping function, it is necessary to construct a spatial structure graph Gp=(V p ,E p ). Among them, V p is the vertex set, E p is an edge set, and its related definition is shown in formula (2).
[0060]
[0061] C p,t,l represents the historical vehicle speed matrix, D p,t,k,l represents the external factor matrix, and its structure is shown in formula (3). m,j represents the historical vehicle speed data of the mth time period and the jth monitoring point, m∈[t-1,tl]; d o,j Respectively represent the weather factor data of the oth time period and the jth monitoring point, o∈[tl,t+k-1]; n=|V p | for V p The number of vertices in .
[0062]
[0063] Step 2: Construction of W2-GAT model
[0064] See also Figure 2 As shown in (a), the model diagram of W2-GAT is shown. The model consists of two parts, the lower layer is the Cell-X module, which includes three components: graph attention network GAT, residual connection Res-Conn and full connection FC, which is mainly used to capture spatial features; the upper layer is the GRU model, which is mainly used to capture temporal features.
[0065] Cell-X layer
[0066] The core of W2-GAT is Cell-X, such as Figure 2 As shown in (b), it consists of three parts: graph attention network GAT, residual connection Res-Conn and full connection layer FC (Full Connection).
[0067] Based on real-life experience, the speed of a road segment is often highly correlated with its neighboring segments and less correlated with more distant segments. This characteristic aligns with the principles of GAT model design, so incorporating GAT into the speed prediction model helps better capture the spatial characteristics of the road being predicted.
[0068] In GAT, each road segment in Vp corresponds to a processing node, and a shared linear transformation weight matrix needs to be trained for all nodes. Used for the transformation between input features and output features. in is the number of input features, m out is the number of output features. Figure 2 As shown in (c), GAT first combines the target node p0 with the related nodes p j The input features are passed through W GAT The transformed data are then concatenated and passed through a single hidden layer neural network before being output through an activation function.
[0069] GAT's attention mechanism is divided into Mask mode and Global mode. When calculating the attention coefficient of a node, the Mask mode only focuses on its adjacent nodes. Compared with the Global mode that focuses on any node in the graph, this not only better preserves the local graph structure but also reduces the computational cost. In the Mask mode, the target node p0 and the related nodes p j The attention coefficient e 0,j It is calculated by formula (4).
[0070] e 0,j =μ(W GAT a0,W GAT a j )j=0,1,…n-1 (6)
[0071] e 0,j Represents the relevant node p j The importance of the target node p0. Among them, a0, a j Represents nodes p0, p j The input feature vector (i.e. A p,t,k,l 0th column, jth column); μ represents a single hidden layer feedforward neural network, which completes the transformation. In order to facilitate subsequent calculations, it is necessary to 0,j Perform normalization operation. Here we use the softmax function for normalization. Before normalization, we first 0,j Then the activation process is performed. The normalized attention coefficient e' 0,j The calculation method of is shown in formula (5).
[0072]
[0073] Among them, LeakyReLU is the activation function, is a parameterized weight vector of the single hidden layer feedforward neural network μ, and || represents the vector concatenation operation as shown in Equation (6).
[0074] v r×1 ||v1×s =v r×1 ×B 1×s (1) +B r×1 (1) ×v 1×s (8)
[0075] After that, use e' 0,j The input feature vectors are weighted and summed to obtain the output feature o0 of the target node p0 after GAT processing, as shown in Equation (7). Where σ represents a nonlinear activation function.
[0076]
[0077] like Figure 2 As shown in (b), the residual connection Res-C is used in Cell-X to prevent network degradation. The output feature o0 of GAT is processed by the residual connection according to the method shown in Equation (8) to obtain the output result o′0. Here, |v| represents the dimension of vector v, and conv1d is a one-dimensional convolution.
[0078]
[0079] Finally, o'0 is transformed into the input x processed by the next stage GRU layer through the fully connected neural network Full-C. t .
[0080] GRU layer
[0081] The network cell structure of GRU is as follows Figure 2 (d) Compared to LSTM, GRU has similar performance while taking less time to train. GRU contains two modules: a reset gate and an update gate, which selectively forget information from the previous moment when updating the current hidden state.
[0082] After the GRU network is introduced, the calculation formula for its internal processing is shown in formula (9).
[0083]
[0084] In formula (6), r t Represents the reset gate, z t represents the update gate, h' t represents the information at time t after being processed by the reset gate, h t W represents the hidden state at time t. r 、W z 、W h are the weight matrices of the corresponding parts respectively.
[0085] Step 3: Construction of model input
[0086] In W2-GAT, weather is considered an external factor. Based on the actual conditions of the city being tested and local experience, combined with relevant experiments, the weights of different weather types can be adaptively set. For example, if severe weather has a significant impact on urban road conditions, a higher weight can be assigned to it. This pre-set weather factor gives the model an initial prediction direction, helping to accelerate the convergence of model training.
[0087] According to the definition in step 1, the initial input of W2-GAT is related to historical vehicle speed data, historical weather data, and future weather data, and these data need to be fused and represented. Define the initial input matrix A of W2-GAT p,t,k,l The construction method of is shown in formula (10).
[0088]
[0089] Step 4: Model parameter adjustment
[0090] In this example, two datasets are used:
[0091] The sz-taxi dataset contains vehicle driving and weather data on 156 major streets in Luohu District, Shenzhen from January 1 to January 31, 2015, with a data collection interval of 10 minutes.
[0092] The xm-bus-road dataset contains road section, vehicle driving, and weather data between 691 valid bus stop pairs in Siming District, Xiamen from May 24 to June 24, 2021, with a data collection interval of 15 minutes.
[0093] In this example, the following evaluation indicators are used, as shown in Equations 11-14:
[0094] RMSE (Root Mean Squared Error)
[0095]
[0096] MAE (Mean Absolute Error)
[0097]
[0098] ACC (Accuracy), which represents the extent to which the predicted results can reflect the actual results
[0099]
[0100] R2 (Coefficient of Determination), which indicates the generalization ability of the model
[0101]
[0102] The selection of model parameters primarily considers weather factors, with heavy rain and rainstorms, which have a significant impact on road traffic, being a key focus. During the experiment, different weather weights were used for inclement weather, and parameter combinations with relatively good evaluation indicators were selected for subsequent experiments.
[0103] In order to better select parameters, the normalization method is used to set the value range of each evaluation index to [0,1]. The normalization method is shown in formula (15):
[0104]
[0105] In the above formula, x nor Represents the normalized value, x o represents the value before normalization, X MAX Indicates the maximum value of the data to be normalized, X MIN Indicates the minimum value in the data to be normalized.
[0106] For the sz-taxi dataset, there are five weather types: sunny, cloudy, foggy, light rain, and heavy rain, of which heavy rain is considered bad weather. For the xm-bus-road dataset, there are seven weather types: sunny, cloudy, overcast, light rain, moderate rain, heavy rain, and showers, of which heavy rain is considered bad weather. The optional weight set for heavy rain weather is set to {0.5, 0.6, 0.7, 0.8, 0.9}, and the weights for other weather types are set to 0.5. The most suitable weight for heavy rain weather is determined through experiments. The results are as follows Figure 3 As shown in the figure, it can be found that on both data sets, when the weight is 0.6, the RMSE, MAE and ACC indicators all reach the relative optimal value. Therefore, in the subsequent experiments, the weight of heavy rain weather is set to 0.6. p,t,k,l Each element in represents the corresponding weather weight.
[0107] Based on the above experimental results, the core parameters for training the W2-GAT model were set as follows: a weight of 0.6 for heavy rain and 0.5 for other weather conditions. The number of GRU neurons was 100 for the xm-bus-road dataset and 64 for the sz-taxi dataset. Furthermore, considering the difference in data quality between the two datasets, the learning rate was set to 0.001 for the sz-taxi dataset and 0.01 for the xm-bus-road dataset. Furthermore, experiments comparing the effects of weather feature fusion before and after fusion, as well as comparing W2-GAT with related models, were conducted to verify the effectiveness of W2-GAT.
[0108] Step 5: Model effect analysis
[0109] In this step, two experiments will be used to test the prediction effect of the model: a comparison experiment before and after weather feature fusion and a performance comparison experiment with other models.
[0110] Comparative experiment before and after weather feature fusion
[0111] Using the experimental parameters from step 4 and the model structure of this invention, we conducted experiments on two feature processing scenarios: one in which weather features were directly concatenated onto the velocity matrix without feature fusion; and the other in which weather features were processed using a weighted fusion method. The experimental results for the model on the two datasets are shown in Table 1.
[0112] Experimental results show that, under the same experimental parameters, the RMSE and MAE of the sz-taxi dataset decreased by approximately 35%, while the ACC and R² increased by an average of approximately 4.4%. For the xm-bus-road dataset, the RMSE and MAE decreased by an average of approximately 32%, while the ACC increased by an average of approximately 4.2%, and the R² increased by an average of approximately 5.1%. This demonstrates that, under the same parameter settings, weather weight fusion converges faster and produces better forecasting results than without fusion.
[0113] Table 1 Comparison of model performance before and after weather weight fusion
[0114]
[0115] Performance comparison experiments with other models
[0116] The comparative experimental results of W2-GAT and other related models are shown in Tables 2 and 3.
[0117] First, the overall experimental results show that the overall prediction performance of different models is ranked from best to worst: W2-GAT > deep learning-based models (AST-GCN, T-GCN) > machine learning-based model (SVR) > statistical-based model (ARIMA). This demonstrates the effectiveness of W2-GAT in extracting neighbor node features and introducing weather weights.
[0118] Further analysis shows that compared to AST-GCN, which has the closest overall performance, W2-GAT has an advantage in the three indicators of RMSE, MAE, and ACC, but the R2 indicator is not stable enough on the Xiamen dataset. From the design perspective of W2-GAT, this performance is normal. The R2 indicator represents the generalization ability of the model, and when W2-GAT constructs the spatial structure diagram of the urban road network, it actually selects the spatial characteristics of the localization of urban traffic. At the same time, when integrating weather weights, W2-GAT sets weather weights through experiments based on local weather data, and uses it as a hyperparameter to preset a direction for the training and learning of the model to accelerate convergence; while the external feature weights of AST-GCN are obtained through model training and learning, so it has better generalization ability.
[0119] Table 2. Comparison results of Shenzhen dataset models
[0120]
[0121] Table 3 Comparison results of Xiamen dataset models
[0122]
[0123]
[0124] See also Figure 4 As shown in Figure 1, a city vehicle speed prediction system based on graph attention network and weather weights includes:
[0125] The spatial structure graph construction module 401 is used to construct a spatial structure graph G consisting of the target road segment p and its related road segments. p = (V p ,E p ); where V p is the vertex set, E p is an edge set;
[0126] The vehicle speed matrix and weather factor matrix construction module 402 is used to construct the vehicle speed matrix C based on the spatial structure diagram. p,t,l and weather factor matrix D p,t,k,l; Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l time periods before the current time t, and the matrix D represents the weather factors of the target road section p to be predicted l time periods before the current time t and k time periods after t;
[0127] The feature fusion matrix acquisition module 403 is used to perform weighted fusion of the vehicle speed matrix and the weather factor matrix in a weighted manner to obtain the feature fusion matrix A. p,t,k,l ;
[0128] The prediction module 404 is used to input the matrix after feature fusion into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p for k time periods after the current time t.
[0129] A specific implementation of a city vehicle speed prediction system based on a graph attention network and weather weights. The present invention will not repeat the same city vehicle speed prediction method based on a graph attention network and weather weights.
[0130] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited to this. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.
Claims
1. A method for predicting urban vehicle speed based on graph attention network and weather weights, characterized in that: The steps include: Construct a spatial structure graph G consisting of the target road segment p and its related road segments p =(V p ,E p ); Among them, V p is the vertex set, E p is an edge set; Based on the spatial structure diagram, construct the vehicle speed matrix C p,t,l and weather factor matrix D p,t,k,l ; Among them, the matrix C p,t,l The matrix D represents the historical vehicle speed of the target road section p before the current time t. p,t,k,l represents the weather factors of the target road segment p to be predicted l periods before the current time t and k periods after t; Use a weighted method to perform weighted fusion of the vehicle speed matrix and the weather factor matrix to obtain the feature fusion matrix A p,t,k,l ; The matrix after feature fusion is input into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p in k time periods after the current time t; The W2-GAT model specifically includes: The lower layer is the Cell-X module, which includes three components: the graph attention network GAT, the residual connection Res-Conn and the fully connected FC, which is used to capture spatial features; the upper layer is the GRU model, which is used to capture temporal features; The matrix after feature fusion is input into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p for k time periods after the current time t, including: Get the target road segment p and related road segments p j The attention coefficient e 0,j ,as follows: e 0,j =μ(W GAT a0,W GAT a j )j=0,1,…n-1 Among them, e 0,j Represents the relevant road segment p j The importance of the target road section p; a0, a j Indicates road segments p0, p j The input feature vector, A p,t,k,l The 0th and jth columns of ; μ represents a single hidden layer feedforward neural network, the transformation completed; For the transformation between input features and output features, m in is the number of input features, m out is the number of output features; For e 0,j Perform normalization operation and use softmax function for normalization. Before normalization, first perform normalization on e 0,j After activation processing, the normalized attention coefficient e' 0,j is calculated as follows: Among them, LeakyReLU is the activation function, is a parameterized weight vector of a single hidden layer feedforward neural network μ, and || represents the vector concatenation operation as shown below: v r×1 ||v 1×s =v r×1 ×B 1×s (1) +B r×1 (1) ×v 1×s After that, use e' 0,j Perform weighted summation on the input feature vectors to obtain the output feature o0 of the target road section after GAT processing, as follows: Where σ represents a nonlinear activation function; The output feature o0 of GAT is processed by the residual connection as shown in the following formula to obtain the output result o′0: Among them, |v| represents the dimension of vector v, and conv1d is a one-dimensional convolution; Transform o'0 through the fully connected neural network Full-C and become the input x processed by the next stage GRU layer t ; Predict the vehicle speed characteristics of the target road section p for k time periods after the current time t.
2. The urban vehicle speed prediction method based on graph attention network and weather weight according to claim 1 is characterized in that: Vertex set V p and edge set E p is represented as follows:
3. The urban vehicle speed prediction method based on graph attention network and weather weight according to claim 2 is characterized in that: Vehicle speed matrix C p,t,l and weather factor matrix D p,t,k,l It is expressed as follows: Among them, c m,j represents the historical vehicle speed data of the mth time period and the jth monitoring point, m∈[tl,t-1]; d o,j Respectively represent the weather factor data of the oth time period and the jth monitoring point, o∈[tl,t+k-1]; n=|V p |, is V p The number of vertices in .
4. The urban vehicle speed prediction method based on graph attention network and weather weight according to claim 3 is characterized in that: Matrix A after feature fusion p,t,k,l It is expressed as follows: Among them, the matrix B k+l,n (1) represents a (k+l)×n dimensional matrix with all values 1, B k,n (0) represents a k×n dimensional matrix with all values 0, The operator represents the Hadamard product.
5. A city vehicle speed prediction system based on graph attention network and weather weights, characterized by: The urban vehicle speed prediction method based on a graph attention network and weather weights according to any one of claims 1 to 4 comprises: Spatial structure graph construction module, used to construct a spatial structure graph G consisting of the target road segment p and its related road segments p =(V p ,E p ); where V p is the vertex set, E p is an edge set; The vehicle speed matrix and weather factor matrix construction module is used to construct the vehicle speed matrix C based on the spatial structure diagram. p,t,l and weather factor matrix D p,t,k,l ; Among them, the matrix C represents the historical vehicle speed of the target road section p to be predicted l time periods before the current time t, and the matrix D represents the weather factors of the target road section p to be predicted l time periods before the current time t and k time periods after t; The feature fusion matrix acquisition module is used to use a weighted method to fuse the vehicle speed matrix and the weather factor matrix to obtain the feature fusion matrix A. p,t,k,l ; The prediction module is used to input the matrix after feature fusion into the constructed W2-GAT model to predict the vehicle speed characteristics of the target road section p in k time periods after the current time t.