**1. Introduction**

Accurate prediction of speed on traffic networks helps improve traffic managemen<sup>t</sup> strategies and generate efficient routing plans. However, precisely estimating the traffic speed in advance has been a non-trivial task since various factors determine traffic flows in many ways.

Various approaches have been used for traffic speed prediction using statistical methods [1–7] and machine learning with neural networks with deep hidden layers [8–18]. However, the existing solutions are mostly limited to estimating traffic speed for either a single road link or a small-scale sub-network with only a handful of traffic links (e.g., a crossroad). In reality, a road system is a large-scale connected graph with the traffic links affecting each other's traffic flow over time in a more complicated fashion that cannot be explained easily with a simple statistical model. The works without a broader view of the traffic links may not adequately unravel the hidden, but critical speed prediction factors.

In this paper, we adapt the node embedding techniques introduced by Hamilton et al. [19]. We represent the relationship between links with a feature vector whose size is invariant even when certain changes are made to the traffic networks' structure, such as the addition or deletion of roads. We analyze how the traffic flows in and out of a link through reachable multi-hop paths computed with the Floyd–Warshall algorithm [20]. How the links impact each other given the traffic flow analysis is quantified through a novel metric we refer to as Traffic Flow Centrality (TFC). We combine the data related to TFC with the external conditions around each link, such as climate and time information (e.g., time of day, the indication of holidays). We use a recurrent neural network algorithm to correlate between the composite feature's temporal transition and the traffic speed of each link. Our method captures the traffic flow dynamics through sub-networks around every link without embedding the entire adjacency matrix. Therefore, our method is much more space efficient, and it can handle large-scale traffic networks with thousands of links. We also do not face the problem of considering irrelevant information such as the hollow points around traffic networks when they are represented either with a sparse adjacency matrix or raster graphics [10,18]. Our solution assesses the impact of the remote links in addition to the adjacent neighbors on traffic flows. Hence, with the broader contextual view and the exclusion of unnecessary information, we expect to outperform the works that based their speed prediction only on the limited view of adjacent links.

This paper is structured as follows: In Section 2, we first review the related work. In Section 3, we introduce the method for inferring traffic speed given the temporal transitions of links' composite contextual features that are modeled with a novel link embedding technique. In Section 4, we benchmark the performance of our approach against existing works, and we conclude in Section 5.

## **2. Related Works**

In this section, we put our work in the context of various related research works on traffic speed prediction. Recently, artificial neural networks with deep hidden layers have gained popularity, as they are effective at modeling the non-linear traffic speed dynamics. Some of the notable works have employed FNNs (Fuzzy Neural Networks) [8,9], DNNs (Deep Neural Networks) [11,21], RNNs (Recurrent Neural Networks) [13,14], DBNs (Deep Belief Networks) [12,15], and the IBCM-DL (Improved Bayesian Combination Model with Deep Learning) [17] models. These works have shown more accurate speed prediction than the approaches that are based on classic statistical methods such as ARIMA (Auto-Regressive Integrated Moving Average) models [1–3], SVR (Support Vector Regression) [4,5], and K-NN (K-Nearest Neighbor) [6,7].

When the models are obtained by learning the pattern on a single specific link [1–3,13–15,17], the distinct features of other links may not be adequately accounted for. Thus, modeling the traffic speed pattern per individual link was discussed in [22]. Nonetheless, the work by Kim et al. [22] still did not reflect the substructure of the traffic network around each link.

The works presented in [10,16,23,24] extracted spatial features from a visual representation of traffic networks. In particular, Zheng et al. [23] used a two-dimensional traffic flow that is embedded in Convolutional Neural Networks (CNN). They also used a Long Short-term Memory (LSTM) [25] algorithm to model long-term historical data. Similarly, Du et al. [16] represented the passenger flows among different traffic lines in a transportation network into multi-channel matrices with deep irregular convolutional networks. Guo et al. [10] analyzed the congestion propagation patterns based on the traffic observations recorded at fixed intervals in time and fixed locations in space. They represented the traffic observation in raster data. Then, all the raster data were fed into a 3D convolutional neural network to model the spatial information. They used a 3 × 3 convolutional kernel that includes the hollow points where no road lies and no traffic flows. The hollow points in the convolutional kernel may accidentally reflect stale traffic flows. Instead, Du et al. [16] used an irregular convolution kernel that refers to the traffic flow values from the adjacent traffic lines to fill in the values of the hollow points. These methods commonly exploit the CNN architecture that effectively models visual imagery [26–28]. Furthermore, a family of RNN algorithms such as GRU [29] and LSTM [25] was used so that repetitive temporal patterns can be discovered. However, these works did not capture the relation between the flow points on the two-dimensional spaces such as junctions, crossroads, and overpasses. Therefore, these models are susceptible to errors by correlating between irrelevant traffic flows. For instance, they may confuse overpasses and overlapping roads as crossroads. Furthermore, these works did not address the impact of the external conditions on the traffic flow. Learning the correlation between traffic flows and weather parameters was useful for flow prediction, as presented in [12,30]. However, they overlooked the impact of the substructure around traffic links on traffic flows.

More recently, modeling the traffic flow based on the graph representation of the traffic networks has emerged. The works presented in [18,31–33] combined GNNs (Graph Neural Networks) [34,35] and RNNs to capture the temporal flow transition patterns given adjacency matrices that explicitly reflect the complex interconnections. These methods do not have to unnecessarily deal with the information irrelevant to the traffic flow, such as the hollow points in the visual traffic networks that Du et al. [16] had to consider forcefully.

ST-TrafficNet [33] used Caltrans PeMS (Performance Measurement System) data from around 20 links between intersection points and predicted traffic speed with stacked LSTM using a spatially-aware multi-diffusion convolution block. This PeMS data were from 350 loop detectors at 5 min intervals from 1 January 2017 to 31 May 2017. This model reflects spatial influence through multi-diffusion convolution with forward, backward, and attentive channels.

TGC-LSTM was used by Cui et al. [18] to predict the traffic speed on four connected freeways in the Greater Seattle Area. They used publicly available traffic state data from 323 sensor stations over the entirety of 2015 at 5 min intervals. With their model, traffic speed was predicted with the RMSE (Root Mean Squared Error) as low as 2.1. However, the GNN architecture has to be restructured whenever the traffic networks undergo some changes. This is because TGC-LSTM uses the entire adjacency matrix as an input to the GNN instead of embedding the features of individual traffic links. Upon any change to the traffic networks, we have to re-train from scratch with the newly updated GNN architecture. Furthermore, since TGC-LSTM uses a very large adjacency matrix, both the time and space complexity of modeling the network structure becomes high. However, more importantly, the larger the adjacency matrix is, the more sparse it becomes. Therefore, TGC-LSTM still faces the problem of incorporating unnecessary data such as the hollow points captured in a regular convolution kernel, as discussed in [10]. The shortcomings of these GNN-based approaches motivated us to devise a new method for embedding the characteristics of the traffic network.

We adapt the node embedding techniques introduced by Hamilton et al. [19]. We represent the relationship between links on the traffic network with a feature vector whose size is invariant even when any part of the network structure changes. We analyze how the traffic routes through a link via reachable lowest cost multi-hop paths that are computed with the Floyd–Warshall algorithm [20]. We compute every link's relative impact on other links based on its inbound/outbound traffic flow patterns and its neighbors' collective conditions. We refer to the relative cross-link impact value as Traffic Flow Centrality (TFC). We combine the features related to TFC with the external conditions around each link, such as climate and time information. We use a recurrent neural network algorithm to learn how such a composite feature change over time determines the traffic speed of each link.

Our method does not involve the process of embedding the entire adjacency matrix. Therefore, our solution is more space efficient and can easily handle large-scale traffic networks with thousands of links. Furthermore, it avoids incorporating irrelevant information such as the hollow points that can be present in traffic networks when they are represented with a sparse adjacency matrix or raster graphics [10,18]. Our solution considers the conditions of the remote links beyond the adjacent neighbors. By ruling out irrelevant information and having the broader contextual view, we expect to outperform the works that base their speed prediction myopically on the conditions of the adjacent links.

The advantage of our work, named TFC-LSTM, is summarized in Table 1, which shows the comparison between existing related works we have discussed so far. The "Traffic Network Structure" refers to the usage of the abstract representation of interconnections between links. The "Surrounding Conditions" refer to the consideration of external situations around links such as climate and time information. The "Traffic Flow Reachability Analysis" refers to the process of analyzing the pattern of traffic flowing in and out of links through reachable paths. The "Centrality Analysis" refers to the usage of the link's relative influence on others. The "Chains of Neighbors" column indicates the consideration of remote neighbors besides the adjacent ones when capturing the substructure around a link.


**Table 1.** Comparison with other models. TFC, Traffic Flow Centrality.

"X" means no, and "O" means yes.
