# Lane-Level Traffic Flow Prediction with Heterogeneous Data and Dynamic Graphs
## 2 Methodology
### Internal Graph Convolution Network  
Since traffic information can be regarded as graph signals, many researchers apply graph neural networks in traffic flow prediction to capture spatial characteristics in road networks. In this paper, we utilize the graph convolution network based on a spectral domain to mine the deep spatial dependency in static adjacency graphs and dynamic graphs. First, according to the road topology, we define an undirected and weighted graph \(G=(V,E)\), where \(V=\{v_{1},v_{2},\cdots,v_{N}\}\) is the set of nodes, \(N\) is the number of nodes, and \(E\) is the set of links, representing the connectivity between nodes. The weights and static adjacency matrix of \(G\) are calculated as follows:  
\[\mathbf{A_{i,j}^{I}}=\mathbf{A_{j,i}^{I}}=\left\{ \begin{array}{ll}\frac{1}{ d_{ij}},&d_{ij}\
eq 0\\ 0,&d_{ij}=0\end{array} \right. \tag{1}\]  
where \(d_{ij}\) denotes the distance between \(i\) and \(j\). \(\mathbf{A^{I}}\in R^{N\times N}\) is the static adjacency matrix, which has only two types of values: zero represents the fact that two nodes do not correlate and a non-zero value represents the correlation degree (i.e., the weight) between two nodes. Thus, \(\mathbf{A^{I}}\) means that the smaller the distance between two nodes, the greater the correlation degree. We apply Chebyshev polynomials to greatly reduce the operation convolution time:  
\[g_{\theta}(\Lambda)=\sum_{k=0}^{K-1}\partial_{k}T_{k}(\tilde{\Lambda}) \tag{2}\]  
where \(\partial_{k}\) is the coefficient of the Chebyshev polynomials and \(\tilde{\Lambda}\) is the maximum eigenvalue of the Laplace matrix. The recursive form of Chebyshev polynomials can be expressed as \(T_{k}(x)=2T_{k-1}(x)-T_{k-2}(x)\), where \(T_{0}=1\) and \(T_{1}=x\). Graph convolution networks based on Chebyshev polynomials help to improve the efficiency but cannot sense dynamic changes in traffic patterns through the static adjacency matrix in Equation (1). Taking the change in traffic flow in the morning and evening peaks as an example, during the early peak, the traffic flow on main roads between the suburbs and cities tends to increase sharply, and the traffic direction is from the suburbs to the cities. In contrast, during the evening peak, the number of vehicles driving from cities to the suburbs shows a growth trend. The static adjacency matrix only focuses on the influence of  
Figure 2: Architecture of the heterogeneous graph convolution model. the distance between two nodes and ignores the dynamics caused by the change in vehicle flow at different times. Figure 3 shows the correlation degree between nodes changing over time, where different colors denote different correlation degrees. Apart from ignoring temporal variability, Equation (1) also overlooks the impact of similar traffic patterns between nodes. As shown in Figure 4, S3 is closest to S1, S2, and S4, and in consequence these links have higher weights in subfigure A. We assume that after the analysis of traffic patterns, the pattern of S3 is the most similar to that S6, i.e., their traffic flows are related during the morning and evening peaks, and congestion at S6 will spread to S3 in a short time. Then, we are able to draw the dynamic graph in subfigure B. Although S3 is far away from S6, they have the highest link weight. Considering the dynamic changes with time and traffic patterns, we innovatively propose the internal graph convolutional network based on dynamic graph generation. Figure 5 shows the architecture of the network. Before model training, in terms of the adjacency relationship with the target lane, we divide all participating lanes into same-intersection adjacency lanes \(X_{s}\) and different-intersection adjacency lanes \(X_{d}\). Traffic flow parameters have the ability to reflect the congestion degree of the road network and the probability of accidents occurring. Therefore,  
Figure 4: Static and dynamic links between nodes. Subfigure (**A**) shows the static graph calculated by node distances.