Next Article in Journal
A Review of Artificial Intelligence Techniques in Fault Diagnosis of Electric Machines
Previous Article in Journal
Visual Quantitative Characterization of External Corrosion in 3LPE Coated Pipes Based on Microwave Near-Field Reflectometry and Phase Unwrapping
Previous Article in Special Issue
Transmission Control Protocol (TCP)-Based Delay Tolerant Networking for Space-Vehicle Communications in Cislunar Domain: An Experimental Approach
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Spatio-Temporal Heterogeneity-Oriented Graph Convolutional Network for Urban Traffic Flow Prediction

1
School of Information and Software Engineering, East China Jiaotong University, Nanchang 330013, China
2
School of Information Engineering, Nanchang University, Nanchang 330031, China
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(16), 5127; https://doi.org/10.3390/s25165127
Submission received: 28 June 2025 / Revised: 28 July 2025 / Accepted: 15 August 2025 / Published: 18 August 2025

Abstract

In the realm of urban vehicular ad hoc networks (VANETs), cross-domain data has constituted a multifaceted amalgamation of information sources, which significantly enhances the accuracy and response speed of traffic prediction. However, the interplay between spatial and temporal heterogeneity will complicate the complexity of geographical locations or physical connections in the data normalization. Besides, the traffic pattern differences incurred by dynamic external factors also bring cumulative and sensitive impacts during the construction of the prediction model. In this work, we propose the spatio-temporal heterogeneity-oriented graph convolutional network (SHGCN) to tackle the above challenges. First, the SHGCN analytically employs spatial heterogeneity between urban streets rather than simple adjacency relationships to reveal the spatio-temporal correlations of traffic stream movement. Then, the air quality data is taken as external factors to identify the traffic forecasting trend at the street level. The hybrid model of the graph convolutional network (GCN) and gated recurrent unit (GRU) is designed to investigate cross-correlation characteristics. Finally, with the real-world urban datasets, experimental results demonstrate that the SHGCN achieves improvements, with the RMSE and MAE reductions ranging from 2.91% to 41.26% compared to baseline models. Ablation studies confirm that integrating air quality factors with traffic patterns enhances prediction performance at varying degrees, validating the method’s effectiveness in capturing the complex correlations among air pollutants, traffic flow dynamics, and road network topology.

1. Introduction

With the increasing popularization of urbanization, urban traffic flow forecasting has begun to attract widespread attention in smart cities [1,2]. Urban environments involve complex road network structures and external factors, e.g., weather, holidays, and road maintenance, thereby necessitating the rational utilization of transportation resources to acquire the massive spatio-temporal sequence information to attain accurate predictions [3]. As shown in Figure 1, the vehicular ad hoc networks (VANETs) can enable the comprehensive connectivity among vehicles, roads, people, and services, deemed as an efficient tool to boost vehicle intelligence and autonomous driving in next-generation communication networks [4,5,6]. In particular, IoVs allow for various collections and sharing of data, such as vehicle locations, speeds, and routes, thereby providing traffic managers with rich real-time data and increasing the precision of traffic prediction [7,8,9].
Seeking to sort out the intricate spatio-temporal relationship in traffic flow data, most existing works tend to utilize the derivatives of the convolutional neural network (CNN) or recurrent neural network (RNN) [10,11,12]. Despite the significant advances in applying neural networks to capture traffic flow features, the effectiveness is still limited in non-Euclidean spaces [13]. In [14,15], the graph convolutional network (GCN) is built to describe connectivity between different roads and associated traffic flows via mapping the road network topology into graphs, vertex weights, and edge weights. It is demonstrated that blending the physical with semantic data from the road network can offer a deeper insight into traffic dynamics, and the graph-based models exhibit that fluctuations in traffic flow are highly related to road topologies [16,17].
As shown in the traffic scenario of Figure 1, there are five streets, labeled from A to E. The traffic congestion occurs in street D, and the upstream of street D (i.e., streets A and B) and the downstream (i.e., street E) are affected due to the adjacency. Also note that the traffic of streets B and E still exhibits a notable correlation even without any connection, whereas the adjacent street C is uncongested. Also hinted at by Figure 1 is that existing works tend to merely consider the traffic relationship between adjacent streets, failing to describe the intricate correlations across different street blocks, especially those non-adjacent ones.
Moreover, it is acknowledged that the traffic volume is also related to regional features where roads are located [18,19]. In Figure 1, different regions, i.e., residential, industrial, or commercial, are typically characterized by distinct and varying traffic flows. Heieh et al. in [20] showed that the urban air quality is closely associated with traffic conditions in proximity. Nevertheless, such an illuminating relationship has not been explicitly considered in existing works regarding traffic flow forecasting. Actually, this type of spatial–temporal dynamical correlation between road networks, air quality, and regional traffic flows would pose the following two significant challenges for accurate predictions:
  • The traffic flow in cities tends to follow a radial pattern along the road network, which is typically non-linear, implying the correlation of traffic flows between non-adjacent roads, but not between adjacent ones, e.g., between street C and D in Figure 1. Therefore, how to describe such uncertain correlations with the graph-based topology poses challenges.
  • The correlation between air quality and traffic flow manifests in both spatial and temporal dimensions. A bidirectional interaction exists where vehicle emissions directly affect pollutant concentrations, while air quality changes (e.g., visibility) reciprocally influence traffic flow—particularly during rush hours. More importantly, different air pollution components (e.g., particulate matter [PM], oxides, and sulfides) exhibit strong regional characteristics. The superposition of these temporal, spatial, and compositional correlations intuitively leads to more complex and unstable predictions.
Inspired by the above challenges, we design a new traffic flow model, spatio-temporal heterogeneity-oriented graph convolutional network (SHGCN), to effectively capture the distinct traffic patterns stemming from the dynamic interactions between spatial heterogeneity and external factors. We first model the graph-based topological structure by characterizing the spatial heterogeneity between road segments and then propose a method of horizontally expanding the traffic feature matrix, facilitating the integration of air quality factors with enhanced road topologies. Finally, a convolution mechanism is used to fuse spatio-temporal correlations into the prediction across varying scales as well as pollutant components. The contributions are summarized as follows:
  • The SHGCN is designed to capture dynamics and intricate relationships among versatile factors in the urban traffic flow by exploring the spatial–temporal heterogeneity between domains for the cross-mode traffic flow prediction, in which the correlations and dynamics among factors (e.g., urban road networks, air quality, and traffic data) are captured.
  • Involving the space heterogeneity, a temporal encoder using temporal convolutions and gating mechanisms is devised, and an enhanced graph convolutional network is designed to explore the hierarchical correlations between traffic patterns and road topology, where the similarity clusters of heterogeneity degrees are deduced via the Bernoulli distribution.
  • A K-means-based strategy is established to analyze the relationships between traffic flow and air composition by integrating the traffic with air quality features in order to enhance the stability of the hybrid prediction model which combines the gated recurrent unit (GRU) with the convolutional neural network (GCN).
  • Extensive experiments are conducted with two real-world datasets, and numerous results are provided to demonstrate the performance improvement in the SHGCN over eight existing baseline methods, in terms of the root mean square error (RMSE), mean absolute error (MAE), and accuracy metrics.
The rest is organized below. Related works are given in Section 2. Section 3 elaborates on the details of the proposed SHGCN. In Section 4, experiment results are used to show the effectiveness of the proposed SHGCN. Lastly, Section 5 presents the conclusions and further investigation.

2. Related Works

In this section, related works on traffic flow prediction are listed from the perspectives of spatio-temporal and external features, respectively.

2.1. Traffic Flow Prediction on Spatio-Temporal Features

In [21,22], temporal features were only considered in statistical methods, such as the Kalman filtering, auto-regressive integrated moving average (ARIMA) model and its variants. Machine learning models in [23,24] were carried out to capture the non-linear features of historical traffic data, yet posing challenges in handling the issues of shallow architectures, manual feature selection, and separate learning [25]. Further, deep learning is used for predicting the traffic flow, demonstrating its advantages in comprehending the complex data and capturing critical features accurately [26,27]. Nevertheless, these works rely on the independent traffic flow information, without concerning the correlation between time series. In this light, the long short-term memory network (LSTM), RNN, and gated recurrent unit (GRU) were further proposed to conquer the temporal dependency and solve short-term memory issues [11,28,29]. It is acknowledged that the traffic flow links with historical data and exhibits the spatial interconnectedness, especially in the context of an intricate road network structure [30,31]. In particular, the ST-ResNet was proposed in [32], which represents the road network as a graph, to model the spatial topology. Kipf et al. in [33] used the graph convolutional network (GCN) to further depict topological relationships in the feature extraction and propagation. Additionally, hybrid models have also been proposed, e.g., architectures combining a CNN and LSTM [34], or models integrating deep convolutional neural networks (DCNNs) with LSTM (known as SRCN) [35], which can comprehensively characterize the complexity and diversity of urban traffic.
As mentioned above, the hybrid traffic flow prediction model can enable a more accurate prediction of the contributions of different types of vehicles to the traffic flow, thus providing more precise results. However, recall that current graph-based models focus solely on the geographical locations or physical connections of roads, yet neglect the spatial heterogeneity between different roads and traffic flow patterns.

2.2. External Features-Assisted Traffic Flow Prediction

Environmental factors are closely related to the risk of traffic accidents and road congestion, and so it is vital to understand these relationships for predicting traffic flows. Peng et al. in [36] considered the seasonal information with the ARIMA model. Besides, a neural wavelet model was designed in [37] by incorporating the weather data as input to demonstrate the effectiveness of the proposed model. In order to achieve the data fusion of historical traffic flow and weather conditions, the GRU, CNN, and their assembly have been explored for offering potential solutions for the hybrid prediction model [38,39]. It is acknowledged that weather conditions have a uniform impact across the city, which is insufficient for accurately capturing traffic flow variations on specific streets.
Therefore, Blagoiev et al. in [40] evidenced the correlation between traffic flow and air quality, showing that the exhaust emissions generated by traffic flows are recognized as a significant pollution source in the urban air quality. Conversely, changes in the air quality also impact the traffic flow and vehicle operations. Thus, the air quality is related to the traffic flow. Besides, it was demonstrated that the air quality can serve as auxiliary information to obtain more precise predictions [41]. In particular, in 5G communications, the IoV technique (integrating edge computing [42] with digital twin [43]) could monitor traffic flow and the acquisition of air quality data, and the data is transmitted via onboard communication systems to centralized servers or cloud platforms for instantaneous processing, thereby offering possibilities for incorporating the air quality into traffic flow prediction.
In aforementioned works, air pollution conditions are rarely taken as an external factor for traffic flow [44]. In this light, we concentrate on the integration of air quality with spatio-temporal data, and further reveal the correlations between different air pollutants and traffic levels in specific streets.

3. Problem Definition and Methodology

3.1. Problem Definition

We introduce the method to attain precise traffic volume forecasting within a defined time period while taking into account the historical data on traffic speed, air quality, as well as road networks.

3.1.1. Road Topology

We model the road topology as an indirect graph, G = V , E , in which the adjacency between road segments is expressed. V = v 1 , v 2 , v 3 , , v n denotes the vertex set (representing urban roads), with n as the vertices count. Likewise, E = e 1 , e 2 , e 3 , , e m denotes the edge set, with m as the total edge count. An adjacency matrix A is further derived on G to represent the adjacency relationship between any pair of roads in the IoV. For the unweighed matrix A, 1 indicates that the selected pair of road segments is adjacent, and 0 otherwise.

3.1.2. Traffic Feature Matrix

We regard the traffic velocity as an intrinsic feature of each road segment, denoted as matrix X , where the traffic speed of the i-th road at time step t is written by x i t .

3.1.3. External Feature Matrix

Further, we model external factors as the attribute matrix K = K 1 , K 2 , K 3 , , K l , with l as the total number of external factors. We next define a set of type j-specific auxiliary information, i.e., K j = j 1 , j 2 , j 3 , , j t . Then, at the i-th segment of time step t, the j-th auxiliary information is denoted as j i t .
Next, traffic conditions are inclined to be predicted at the next multi-time steps by setting function f with parameters of road topology G , adjacency matrix A, traffic feature matrix X , and attribute matrix K , i.e.,
x t T , x t T + 1 , , x t = f V , E , A , X | K .

3.2. Framework of SHGCN

In Figure 2, the air pollutants, traffic flow information, and spatial data are taken into our framework. More especially, we can decide whether or not to mask the traffic information and relationships between edges (connecting road segments) using a Bernoulli distribution to assess the degree of heterogeneity between road segments. Meanwhile, the K-means method is used to select air pollutants highly correlated with the traffic flow. Finally, the prediction is conducted on the assembly of the GCN and GRU.

3.3. Spatial Heterogeneity

Details of assessing the spatial heterogeneity are provided in terms of the heterogeneity detection and topology enhancement, respectively.

3.3.1. Heterogeneity Detection

To retain the contextual information within the traffic flow graph, it is designed to capture the temporal patterns in traffic data as well as the correlations between them across various time steps and segments. For encoding these temporal traffic patterns, we utilize temporal convolutions followed by a gating mechanism (i.e., a gated linear unit, GLU) [45], by integrating these patterns into each road segment as follows:
B t T out , , B t = TC x t T , , x t ,
where B t R N × D represents the road segment embedding matrix at time step t, in which the n-th column b n t R D corresponds to the embedding of road segment v n . The embedding dimension is denoted as D, and the length of the embedded sequence output after the convolution is denoted as T out in the temporal convolution (TC) encoder. The temporal convolution kernel size in the TC encoder is three.
In particular, a two-aspect topology enhancement scheme is designed on the graph f ( V , E , A , X ) , consisting of traffic flow enhancement and graph enhancement. First, the traffic flow enhancement is to eliminate the connections between weakly correlated traffic flows across different road segments. Second, the graph enhancement is to remove edges between weakly correlated yet adjacent road segments or to add edges between strongly correlated but non-adjacent segments. Both stages adjust the edges of the graph by involving traffic patterns between road segments.
More especially, consider the heterogeneity detection for road segments. For a segment v n , its embedding sequence b n t T , , b n t ) within T time steps is obtained from the overall embedding of B t T , , B t , i.e.,
p n τ = b n τ · ω 0 ,
and
u n = τ = t T t p n τ · b n τ ,
where u n represents the aggregated representation based on the derived aggregation weights p n τ over v n at different time steps. Herein, a time step ranging from t T to t is taken and recorded as τ . The aggregation weight b n τ reflects traffic pattern correlations, with its transpose ( b n τ ) enabling dimension-specific weighting through dot product with the learnable parameter vector ω 0 R D . This vector automatically adapts via gradient descent to capture varying feature dimension contributions to temporal weights. The term p n τ = ( b n τ ) · ω 0 computes temporal attention scores that dynamically adjust to traffic patterns (e.g., peak/non-peak differences). The resulting u n encodes v n ’s dynamic state over [ t T , t ] as an attention-weighted sum of historical embeddings, where high-weight moments correspond to critical transitions like congestion onset or dissipation.
Finally, utilize the cosine similarity coefficient to estimate the degree of heterogeneity between two road segments to reflect the difference in their traffic distribution over time, i.e.,
q m , n = u m u n u m u n ,
which can measure the correlation level between traffic flow patterns of segments v m and v n .

3.3.2. Topology Enhancement

The cosine similarity degree is adopted to estimate heterogeneity between two road segments, reflecting the difference in traffic flow distribution across different periods, and thus distinguishing transportation modes between them. As illustrated in Figure 3, the real-world road network topology and traffic flow information are first input into a traffic feature matrix, where an edge exists between segments A and B once they are adjacent, while there exists no edges between road segments A and D. Then, the similarity of traffic patterns is evaluated via calculating the masking probabilities. In particular, although road segments A and B are adjacent, they have a low correlation in the traffic flow, thus removing the edge between them. Conversely, road segments A and D are connected in the enhanced topology due to the similar traffic patterns with high masking probability. Finally, repeating it for each road segment, we rebuild an enhanced feature matrix that exploits the correlations of traffic patterns instead of the road adjacency.
Traffic Flow Enhancement
In the traffic tensor, the enhancement operator X t T , t (encompassing all historical traffic flows) is devised to characterize the pattern connectivity of each road segment, and to serve as a reference for the traffic flow shielding. As such, the masking probability can be derived via the Bernoulli distribution, i.e., ρ n τ Bern 1 p n τ . Afterwards, we further mask the lower correlated traffic volumes at time step τ of road segment v n to enhance the model generalizability, and the enhanced data by the traffic-level augmentation is denoted as X ^ t T , t .
Graph Enhancement
The enhancement of the traffic flow stems from temporal features, while that at the graph topology pertains to spatial features. Topology-level enhancement is performed on the regional traffic flow graph G to eliminate connections between regions with low interrelated traffic patterns, thereby improving the model’s generalization capability across different regions. Likewise, the enhancement also utilizes a Bernoulli distribution as the basis for shielding. For two adjacent road segments v m and v n , if their traffic patterns are not highly correlated, then their connecting edge v m , v n E will be masked, with the heterogeneity degree q m , n to quantify the traffic pattern difference between two regions. More especially, the masking probability ρ m , n obeys the Bernoulli distribution, i.e., ρ m , n Bern 1 q m , n , provided that traffic patterns between road segments v m and v n are positively correlated; otherwise, they are directly masked. For any two non-adjacent road segments, the lower degree of heterogeneity q m , n would add an edge between v m and v n , based on the masking probability p n τ . Thus, the topology enhancement operation might substantially alter the topology structure.
Next, after two steps in the enhancement, the overall topology enhancement is attained as
f ^ V , E ^ , A ^ , X ^ K ,
where X ^ t T , t represents the enhancement in traffic flow, and both E ^ and A ^ represent the enhancements on the graph, respectively.
Since the adjacency matrix A ^ encompasses both the vertex set V and edge set E ^ , (6) can be further simplified as
f ^ A ^ , X ^ K .

3.4. External Factors

3.4.1. Incorporating External Features

An augmented matrix method [46], which integrates the spatio-temporal GCN with attribute-enhanced units, is used to propose a traffic prediction model involving the external information (e.g., air quality). Besides, the K-means clustering is utilized to identify the air pollutants most correlated with the traffic flow. Note that the injected external feature is dynamic, leading to the traffic feature matrix X and attribute matrix K.
The dynamic attributes are represented as
K t T , t = K t T , K t T + 1 , K t T + 2 , , K t .
Therefore, the enhanced matrix involving the external features and traffic feature information at time t becomes as
P t = X ^ t , K t T , t .
Lastly, using the enhanced matrix P as the input of model f would yield the prediction as y ^ , i.e.,
y ^ = f A ^ , P .
Especially, the traffic flow dataset and air quality dataset we adopted exhibit spatio-temporal alignment, thereby fully supporting the integration of air quality features through the aforementioned method.

3.4.2. Filtering Air Components Correlated with Traffic Flow

The factors influencing road air quality include not only vehicular but also meteorological and industrial emissions. To thoroughly understand the environmental conditions of target roadway segments, it is imperative to identify air components which are highly correlated. Such a holistic analysis facilitates the accurate assessment of the environmental status.
Recall that in the above steps, we employ clustering, so the K-means method is used to conduct the clustering analysis on air pollutants and compare the results with those of traffic flow clustering, which helps to determine which type of air pollutants are more significantly influenced by the traffic flow. For the historical traffic dataset X = x 1 , x 2 , x 3 , , x n and a certain air pollution dataset Y = y 1 , y 2 , y 3 , , y n , a matching matrix M = m i j 1 i k , 1 j q is defined, where m i j represents the number of sample points that have the same clustering label in the i-th class after clustering X , and the j-th class after clustering Y . Finally, a clustering similarity metric [47] B k is defined as
B k = T k P k Q k ,
where T k , P k , and Q k are respectively defined as
T k = i = 1 k j = 1 k m i j 2 n ,
P k = i = 1 k m i · 2 n ,
and
Q k = i = 1 k m · j 2 n ,
respectively. It can be observed from (11) that the value of B k is unrelated to the clustering labels. Besides, from (12) and (13), it can be deduced that T k P k , so 0 B k 1 holds. B k = 1 and B k = 0 indicate the completely similar and the completely dissimilar between the results of two clustering iterations, respectively. In particular, m i · , m · j , and m · · are, respectively, defined as
m i · = j = 1 k m i j ,
m · j = i = 1 k m i j ,
and
m · · = n = i = 1 k j = 1 k m i j .
Equation (15) represents the calculation of the number of matching time steps where a specific category of traffic flow clusters aligns with each category of pollutant clusters, whereas (16) represents the calculation of the number of matching time steps where a specific category of pollutant clusters aligns with each category of traffic flow clusters. By comparing the similar results of traffic flow and air pollution clustering, the relevance between traffic flow and air pollution can be analyzed. The clustering similarity index B K ’s calculation reveals that it defines a matrix to represent the number of shared instances between a class from the first clustering and each class from the second clustering (similar to finding the intersection of both clustering results), indicating that a class from the first clustering is associated with each class from the second clustering. The clustering similarity index B k cannot directly represent causal relationships between traffic flow and air pollutants but serves as a reference metric for indirectly inferring potential associations between specific air pollutants and traffic patterns.

3.5. Spatio-Temporal GCN

The GCN and GRU are used to create a hybrid model f [46], thereby capturing spatio-temporal dependencies in the traffic flow. Especially, GCN units are utilized to acquire the representation for roads with the influence of interconnected ones, and y l + 1 = σ D ˜ 1 2 A ˜ D ˜ 1 2 y l W l represents the modeling, where A ˜ = A ^ + I indicates the self-connected adjacency matrix, the degree matrix is represented as D ˜ , and σ denotes the activation function. The GCN is implemented with a single layer, where the filter dimension matches the number of hidden units in the GRU (64 units)—a configuration that was experimentally validated in our studies. Further, W l denotes the weight matrix for the l-th convolutional layer, y l represents the output prediction, y 0 = P t signifies the representation during the spatial–temporal feature modeling at time t, and both the enhancement matrix P and road adjacency matrix A are used as the inputs of the GCN.
Afterwards, the historical traffic state h t 1 is bonded with the current street representation at time step t, and then the hidden state c t can be derived. Meanwhile, we determine to discard and identify which new information from c t should be included when deriving the final traffic state h t , i.e.,
u t = σ W u · g c ( P t , A ^ ) , h t 1 + b u ,
r t = σ W r · g c ( P t , A ^ ) , h t 1 + b r ,
c t = tanh W c · g c P t , A ^ , ( r t , h t 1 ) + b c ,
and
h t = u t · h t 1 + 1 u t · c t ,
where g c ( · ) represents the graph convolution operation with learnable parameters W and b. Finally, the loss function is defined as
Loss = y t y ^ t + λ · L reg ,
where y t and y ^ t separately denote the actual and predicted values, L r e g denotes the L 2 regularization, and λ is a hyperparameter, respectively.

4. Experiments and Results

4.1. Datasets

Two real-world datasets are used for experiments, i.e.,
  • Traffic flow data in Aarhus, Denmark—the traffic flow data records the average traffic speed every 5 min. For missing values, we employed interpolation methods to ensure data completeness. Data from 100 road segments were selected from 2 August 2014 to 17 August 2014. The connections between urban roads are modeled by a 100 × 100 adjacency matrix, which indexes rows by road segments and columns by timestamps. The air pollution data in Aarhus, Denmark—recorded at 5 min intervals synchronized with traffic measurements—consists of pre-computed Air Quality Index (AQI) values generated by the original dataset authors, integrating PM2.5 and PM10 concentrations with other pollutants (ozone, carbon monoxide, sulfur oxides, and nitrogen oxides). By adopting K-means clustering of these standardized AQI levels, we identify pollution-traffic correlations. Since the dataset contains no AQI scores exceeding 300, we classify air quality into five AQI classification levels: 0–50 (Good), 51–100 (Moderate), 101–150 (Unhealthy for Sensitive Groups), 151–200 (Unhealthy), and 201–300 (Very Unhealthy). Then, the categorized data is structured into a dynamic 100 × 4320 attribute matrix for spatio-temporal analysis.
  • Traffic flow data in Newcastle upon Tyne, UK—the traffic flow data records vehicle counts at 5 min intervals. For missing values, we employed interpolation methods to ensure data completeness. Data from 136 road segments were selected from 20–30 June 2025. The connections between urban roads are modeled by a 136 × 136 adjacency matrix, which indexes rows by road segments and columns by timestamps. The air pollution data in Newcastle upon Tyne, UK—recorded at 5 min intervals and synchronized with traffic flow measurement timestamps—consists of air pollutant concentrations from which we calculated the Air Quality Index (AQI). Our analysis incorporates concentrations of carbon monoxide, ozone, PM2.5, and nitrogen dioxide. For road segments without direct air quality monitoring, we adopted data from the nearest available monitoring locations. The preprocessing methodology for air quality data aligns with that applied to the Aarhus dataset. The categorized data is structured into a dynamic 136 × 2880 attribute matrix for spatio-temporal analysis.

4.2. Evaluation Metrics

The following metrics are employed to evaluate the prediction accuracy.
  • Root mean square error (RMSE), i.e.,
    RMSE = 1 n t = 1 n y t y ^ t 2 ,
    which can represent the model performance, and a smaller value would indicate a better model with the higher accurate prediction level.
  • Mean absolute error (MAE), i.e.,
    MAE = 1 n t = 1 n y t y ^ t ,
    where the smaller the MAE value is, the better the performance of the prediction model becomes.
  • Accuracy, i.e.,
    Accuracy = 1 y y ^ F y F ,
    in which as the value of the Frobenius norm · F gets closer to one, the prediction becomes more accurate.

4.3. Parameter Settings

Our proposed model, the SHGCN, is optimized using Adam for training, with a learning rate of 0.001, a batch size of 64, and a training set proportion of 0.8. Using the Aarhus dataset as an illustrative example, we initially evaluate training epochs from the set [100, 500, 1000, 1500, 2000, 2500] to observe their impact on model performance. Figure 4 shows that, as the training epochs increase, the evaluation metrics would exhibit stability, with a significant inflection point observed at 1000 epochs and the stabilization at 1500 epochs. Subsequently, with the training epochs fixed at 1500, the number of hidden units is selected from [16, 32, 64, 100, 128]. Figure 5 demonstrates that the stability in evaluation metrics is achieved when the number of units is 64. Therefore, to mitigate the potential overfitting, the training epochs are selected as 1500, and the number of hidden units is established as 64. Moreover, the data is divided into training and test sets with an approximate ratio of 8:2.

4.4. Baselines

The proposed SHGCN model is compared with the following baselines: (1) Historical Average (HA) [48], (2) Support Vector Regression (SVR) [49], (3) Graph Convolutional Network (GCN) [33], (4) Gated Recurrent Unit (GRU) [29], (5) Diffusion Convolutional Recurrent Neural Network (DCRNN) [50], (6) Temporal Graph Convolutional Network (TGCN) [16], and (7) Multi-Scale Dynamic Residual Network (MSDR) [51].

4.5. Experiment Results

The experiment is designed to explore three aspects: the impact of the introduced information on different air pollution components, the prediction accuracy comparison with the baseline, and ablation experiments.

4.5.1. Clustering Results of Air Pollutants and Traffic Flow

To filter out the air pollutants most correlated with the traffic flow, two clustering analyses are conducted on both the traffic flow and air pollutants. By comparing the similarity of the clustering results (where a higher value of B k signifies a stronger association between the pollutant component and traffic flow), we find that carbon monoxide exhibits the highest correlation with traffic flow during the learning period in Table 1.
In Table 2, we conduct a set of control experiments and establish another control group without integrating air components. Among them, the group incorporating CO performs the best, consistent with the clustering results. Besides, some pollutant components, such as O 3 , exhibit a relatively low correlation with the traffic flow. Further, the integration of O 3 has a lower prediction accuracy than the control group without air quality integration, indicating that a correlation B k higher than a certain threshold is necessary to improve the prediction results.
Subsequently, in the Newcastle dataset (as presented in Table 3 and Table 4), the experimental group incorporating CO data demonstrates an optimal performance—a finding consistent with both the clustering analysis results and the performance patterns observed in other experimental groups. Our experimental results demonstrate that incorporating CO, O 3 , or PM2.5 concentrations consistently improves the prediction performance across 15 min, 30 min, and 60 min prediction windows, as measured by the RMSE, MAE, and accuracy metrics. In contrast, models integrating NO 2 showed a degraded performance compared to the baseline without air quality inputs. These findings reaffirm that only air pollutants exhibiting strong correlations with traffic flow patterns can enhance prediction accuracy. Notably, this CO-integration superiority is replicated in both the Aarhus and Newcastle datasets, suggesting that vehicular emissions may constitute the predominant source of urban CO pollution.

4.5.2. Comparison Baselines

To validate the effectiveness of the SHGCN, its comparison with baseline models over various prediction horizons is illustrated in Table 5 and Table 6.
As exemplified in Table 5, the experiment evaluates the performance of the SHGCN across different prediction time intervals, including 15 min, 30 min, and 60 min, respectively. The results demonstrate that the deep-learning-based methods (i.e., the SHGCN, GCN, GRU, DCRNN, TGCN, and MSDR) outperform other ones in terms of the prediction accuracy. Within a 15 min prediction window, and compared to the HA and SVR, the SHGCN can reduce the RMSE by approximately 38.19% and 15.76%, respectively, and the MAE by approximately 25.03% and 12.84%, respectively. From a spatio-temporal perspective, the SHGCN can reduce the RMSE by approximately 11.95% and 9.76% compared to the GCN and GRU separately. Compared to the method that only considers the single relationship in space or time, the MAE can also be lowered by approximately 11.30% and 10.08%, respectively. More importantly, by involving air quality factors, the SHGCN also outperforms existing hybrid models, i.e., the DCRNN, TGCN, and MSDR, with an RMSE reduction of approximately 8.08%, 4.58%, and 4.31% and a MAE reduction of approximately 9.07%, 4.05%, and 2.91%, respectively.
Within a 30 min prediction window, the SHGCN could reduce the RMSE by approximately 20.28% and 13.30%, and the MAE by approximately 19.73% and 10.12%, as compared to the HA and SVR, respectively. From a spatio-temporal perspective, the SHGCN could reduce the RMSE by approximately 11.12% and 8.67%, and the MAE by approximately 9.94% and 8.22%, compared to the GCN and GRU, respectively. Considering air quality factors, the SHGCN outperforms the DCRNN, TGCN, and MSDR with an RMSE reduction of approximately 7.78%, 4.55%, and 4.09% and an MAE reduction of approximately 7.16%, 6.62%, and 4.92%, respectively.
Within a 60 min prediction window, the SHGCN reduces the RMSE by approximately 11.63% and 12.46% and the MAE by approximately 15.65% and 10.86% compared to the HA and SVR, respectively. From a spatio-temporal perspective, the SHGCN reduces the RMSE by approximately 10.43% and 7.67% and the MAE by approximately 10.71% and 9.22% compared to the GCN and GRU, respectively. Considering air quality factors, the SHGCN outperforms the DCRNN, TGCN, and MSDR, with an RMSE reduction of approximately 7.35%, 5.05%, and 4.67% and an MAE reduction of approximately 9.03%, 5.73%, and 5.15%, respectively. It is shown that the SHGCN exhibits superiority, with a better forecasting performance and long-term predictive capabilities across different horizons.
As shown in Table 6, the SHGCN achieves an 8.63–41.26% improvement over existing models in both the RMSE and MAE metrics on the Newcastle dataset, further demonstrating its superior predictive performance. Notably, the SHGCN demonstrates significant improvements over traditional single-prediction models and outperforms existing advanced deep learning models, achieving RMSE reductions of 17.97%, 15.81%, and 9.69% compared to the DCRNN, TGCN, and MSDR at the 15 min prediction window; 16.26%, 8.85%, and 9.10% at the 30 min window; and 20.44%, 13.87%, and 8.63% at the 60 min window, respectively, further confirming its superior performance in prediction tasks.

4.5.3. Ablation Experiments

Ablation experiments demonstrate that both air quality factors and topology enhancement could impact the traffic prediction. The experimental settings are divided into three scenarios, i.e, one where only air quality factors are integrated, one where only the topology enhancement is applied, and one where both air quality factors and topology enhancement are incorporated. In Table 7, the results with integrated air quality factors are listed in the fourth column, those with the topology enhancement are in the fifth column, and those involving both air quality factors and topology enhancement are in the sixth column.
Within a 15 min forecasting horizon and only involving air quality factors (e.g., CO), the RMSE of the SHGCN is 4.48% and 0.15% lower than that of the DCRNN and TGCN, respectively. Compared to the DCRNN, TGCN, and MSDR, the SHGCN (only enhanced) could reduce the RMSE by 5.64%, 2.05%, and 1.77%, respectively. Although the MSDR achieves a 0.13% reduction in the RMSE compared to the SHGCN (CO), when simultaneously incorporating air quality factors and applying the graph enhancement, the SHGCN (CO + enhanced) model reduces the RMSE by 8.08%, 4.58%, and 4.31%, respectively, compared to the DCRNN, TGCN, and MSDR.
Within a 30 min forecasting horizon and only involving air quality factors, the RMSE of the SHGCN (CO) model is, respectively, 3.39% and 0.01% lower than that of the DCRNN and TGCN. With only the topology enhancement, compared to the DCRNN, TGCN, and MSDR, the SHGCN (enhanced) reduces the RMSE by 4.92%, 1.59%, and 1.12%, respectively. Although the MSDR achieves a 0.47% reduction in the RMSE compared to the SHGCN (CO), when simultaneously incorporating air quality factors and applying the graph enhancement, the SHGCN (CO + enhanced) model exhibits an RMSE reduction of 7.78%, 4.55%, and 4.09%, respectively, compared to the DCRNN, TGCN, and MSDR.
Within a 60 min forecasting horizon and only involving air quality factors, the RMSE of the SHGCN (CO) is, respectively, 2.30% lower than that of the DCRNN. With only the topology enhancement, compared to the DCRNN, TGCN, and MSDR, the SHGCN (enhanced) reduces the RMSE by 3.59%, 1.20%, and 0.80%, respectively. Although the TGCN and MSDR achieve a 0.12% and 0.52% reduction in the RMSE compared to the SHGCN (CO), when simultaneously incorporating air quality factors and applying the graph enhancement, the SHGCN (CO + enhanced) model exhibits the RMSE reduction of 7.35%, 5.05%, and 4.67%, respectively, compared to the DCRNN, TGCN, and MSDR.
It is worth noting that when simultaneously incorporating both air quality factors and the graph enhancement, the model dominates that with only the single heterogeneity information. In particular, the prediction errors are reduced by 4.43% and 2.58% within a 15 min prediction horizon, by 4.55% and 3.01% within a 30 min horizon, and by 5.17% and 3.90% within a 60 min horizon, indicating that the temporal and spatial heterogeneity are mutually complemented. In particular, while the baseline TGCN model employs a GRU for temporal feature extraction and a GCN for spatial feature extraction, the SHGCN similarly utilizes a GRU-GCN architecture. This parallel structure demonstrates that either air quality factors alone or graph enhancement alone can improve the prediction performance, but their synergistic integration yields optimal results.
Similarly, the results in Table 8 demonstrate that both air quality factors and topological enhancement influence traffic flow prediction. In this dataset, both the individual incorporation of air quality factors and the standalone topological enhancement demonstrate a superior predictive performance compared to the GCN+GRU-based TGCN model, reaffirming that either approach—integrating air quality parameters or implementing topological enhancement alone—can effectively improve forecasting accuracy. And, the SHGCN (CO+enhance) model demonstrates a superior predictive performance compared to both the SHGCN (CO) and SHGCN (enhance), achieving RMSE reductions of 11.17% and 10.59%, respectively, at the 15 min prediction horizon, 5.93% and 1.32% at the 30 min horizon, and 8.59% and 3.12% at the 60 min horizon. Specifically, either air quality factors alone or topological enhancement alone can improve the prediction performance, while their synergistic integration yields optimal results.

4.6. Interpretation of SHGCN

The explanation of the SHGCN is divided into two parts: the prediction horizon, as well as the impact of topology enhancement and air quality factors on prediction accuracy.

4.6.1. Long-Term and Short-Term Forecasting

We select a road from the dataset in Aarhus, Denmark. We give the visualization of 6 h predictions, 24 h predictions, and predictions for the entire dataset in Figure 6, Figure 7 and Figure 8, respectively. The horizontal and vertical axes represent the prediction duration and traffic speed, respectively. Further, the red lines denote predicted values, while the blue lines denote actual values.
As depicted in Figure 6, the trend prediction is relatively accurate within the first 15 min, with predicted values closely aligned with the actual values. However, after the prediction duration reaches 1 h, some discrepancies emerge between the predicted and actual values. Nevertheless, the SHGCN could effectively capture the changing trends in traffic flow. The short-term forecasting performance may be attributed to the topology enhancement and adjustments made to the relationships between road segments, coupled with the relatively limited influencing factors within a short time-frame.
Figure 7 illustrates that the discrepancy between predicted and actual values arises over a longer prediction period. Yet, the overall trend performs similarly, and predictions are relatively accurate during some time intervals. That might be attributed to the periodic nature of traffic flow, to which the SHGCN adapts, thereby enhancing the model’s performance during some specific time intervals.
In Figure 8, noticeable deviations exist between predicted and actual values for a very long prediction duration, possibly due to the complexity of long-term prediction, where the model may struggle to adapt to sudden changes. However, due to the inclusion of air quality factors, where external elements act as the supplementary information to improve the performance effectively.
As described above, the SHGCN struggles to capture the inflection points in the speed variation trend, resulting in significant deviations between the predicted and actual values. The discrepancy may arise from the abrupt change, impacted by the spatial heterogeneity and air quality factors, as well as other contributing factors.

4.6.2. Importance of Incorporating Topology Enhancement and Air Quality Factors

We also illustrate the ablation results to evaluate the impact of dynamic external data. Figure 9 exhibits the visualization results by considering various factors, showing that the integration of topology enhancement with air quality factors can perform better. Moreover, Figure 10 shows the visualization results by incorporating different air pollution components, where each component has varying degrees of correlation with the traffic flow, contributing to the prediction. In particular, in some specific periods, the prediction may not align with the clustering results due to the significant variations in clustering results in the proximity. The results indicate that air quality factors are more sensitive to changes in urban traffic flow, providing a more precise trend prediction on individual streets.

5. Conclusions

In this work, the urban traffic flow prediction problem was investigated in VANETs, whereby the spatial heterogeneity incurred by traffic patterns and the temporal heterogeneity brought by environmental factors were jointly considered. In particular, we first proposed the SHGCN prediction model to optimize the road topology, and then detected the heterogeneity of traffic information stored in the TC encoder. More especially, the air pollutants highly correlated with the traffic flow were filtered out via the K-means clustering method, and then were incorporated into the traffic flow information as an enhanced matrix. Experimental results demonstrated that the SHGCN achieves a 2.91–41.26% lower RMSE and MAE compared to baseline models. Ablation experimental results verified that incorporating both air quality factors and traffic patterns improves the prediction performance to varying degrees, confirming its effectiveness in capturing the correlations among air pollutants, traffic flow, and road topology. Our method effectively integrates dynamic external factors but shows limitations in processing stochastic events (e.g., accidents), which lack consistent spatio-temporal correlations with traffic patterns. This limitation represents a significant research challenge that necessitates further model refinement and constitutes a primary focus for our future work.

Author Contributions

Conceptualization, X.L. and M.H.; methodology, M.H.; investigation, T.Z.; resources, D.Q.; data curation, M.H.; writing—original draft preparation, M.H.; writing—review and editing, X.L.; visualization, M.H.; supervision, N.J.; project administration, D.Q.; funding acquisition, X.L. and N.J. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Natural Science Foundation of China (62361026, 62261020, 62362030, 62461036, and 61761030), the Jiangxi Provincial Natural Science under grant no. 20242BAB25050 and 20232ACB212005, Double Thousand Plan of Jiangxi Province under grant no. JXSQ2023201010, and Jiangxi Province Key Laboratory of Advanced Network Computing under grant no. 2024SSY03071.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The Aarhus datasets analyzed in this study are openly available in the CityPulse Smart City Datasets repository: http://iot.ee.surrey.ac.uk:8080/datasets.html (accessed on 10 August 2025). The Newcastle datasets are similarly available through the Urban Observatory repository: https://newcastle.urbanobservatory.ac.uk/ (accessed on 10 August 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Xie, P.; Li, T.; Liu, J.; Du, S.; Yang, X.; Zhang, J. Urban Flow Prediction from Spatiotemporal Data Using Machine Learning: A Survey. Inform. Fusion 2020, 59, 1–12. [Google Scholar] [CrossRef]
  2. Gu, X.; Wu, Q.; Fan, P.; Cheng, N.; Chen, W.; Letaief, K.B. DRL-Based Federated Self-Supervised Learning for Task Offloading and Resource Allocation in ISAC-Enabled Vehicle Edge Computing. Digit. Commun. Netw. 2024. [Google Scholar] [CrossRef]
  3. Ye, J.; Sun, L.; Du, B.; Fu, Y.; Xiong, H. Coupled Layer-wise Graph Convolution for Transportation Demand Prediction. Proc. AAAI Conf. Artif. Intell. 2021, 35, 4617–4625. [Google Scholar] [CrossRef]
  4. Taslimasa, H.; Dadkhah, S.; Neto, E.C.P.; Xiong, P.; Ray, S.; Ghorbani, A.A. Security issues in Internet of Vehicles (IoV): A comprehensive survey. Internet Things 2023, 22, 100809. [Google Scholar] [CrossRef]
  5. Narsimhulu, P.; Chithaluru, P.; Al-Turjman, F.; Guda, V.; Inturi, S.; Stephan, T.; Kumar, M. An intelligent fl-based vehicle route optimization protocol for green and sustainable iot connected iov. Internet Things 2024, 27, 101240. [Google Scholar] [CrossRef]
  6. Xie, Y.; Wu, Q.; Fan, P.; Cheng, N.; Chen, W.; Wang, J.; Letaief, K.B. Resource Allocation for Twin Maintenance and Task Processing in Vehicular Edge Computing Network. IEEE Internet Things J. 2025, 12, 32008–32021. [Google Scholar] [CrossRef]
  7. Wang, X.; Zhu, H.; Ning, Z.; Guo, L.; Zhang, Y. Blockchain intelligence for internet of vehicles: Challenges and solutions. IEEE Commun. Surv. Tutor. 2023, 25, 2325–2355. [Google Scholar] [CrossRef]
  8. Dong, Y.; Zhang, H.; Li, C.; Guo, S.; Leung, V.; Hu, X. Fine-tuning and deploying large language models over edges: Issues and approaches. arXiv 2024, arXiv:2408.10691. [Google Scholar] [CrossRef]
  9. Zhang, Z.; Wu, Q.; Fan, P.; Cheng, N.; Chen, W.; Letaief, K.B. DRL-Based Optimization for AoI and Energy Consumption in C-V2X Enabled IoV. IEEE Trans. Green Commun. Netw. 2025. [Google Scholar] [CrossRef]
  10. LeCun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 2002, 86, 2278–2324. [Google Scholar] [CrossRef]
  11. Van Lint, J.; Hoogendoorn, S.P.; van Zuylen, H.J. Freeway Travel Time Prediction with State-Space Neural Networks: Modeling State-Space Dynamics with Recurrent Neural Networks. Transport. Res. Rec. 2002, 1811, 30–39. [Google Scholar] [CrossRef]
  12. Dong, Y.; Wang, L.; Wang, J.; Hu, X.; Zhang, H.; Yu, F.R.; Leung, V.C.M. Accelerating Wireless Federated Learning via Nesterov’s Momentum and Distributed Principal Component Analysis. IEEE Trans. Wirel. Commun. 2024, 23, 5938–5952. [Google Scholar] [CrossRef]
  13. Wang, P.; Zhang, T.; Zheng, Y.; Hu, T. A Multi-View Bidirectional Spatiotemporal Graph Network for Urban Traffic Flow Imputation. Int. J. Geogr. Inf. Sci. 2022, 36, 1231–1257. [Google Scholar] [CrossRef]
  14. Zhong, R.; Hu, B.; Wang, F.; Feng, Y.; Li, Z.; Song, X.; Wang, Y.; Lou, S.; Tan, J. Multi-factor embedding GNN-based traffic flow prediction considering intersection similarity. Neurocomputing 2025, 620, 129193. [Google Scholar] [CrossRef]
  15. Ali, A.; Zhu, Y.; Zakarya, M. Exploiting Dynamic Spatio-temporal Graph Convolutional Neural Networks for Citywide Traffic Flows Prediction. Neural Netw. 2022, 145, 233–247. [Google Scholar] [CrossRef]
  16. Zhao, L.; Song, Y.; Zhang, C.; Liu, Y.; Wang, P.; Lin, T.; Deng, M.; Li, H. T-GCN: A Temporal Graph Convolutional Network for Traffic Prediction. IEEE Trans. Intell. Transp. Syst. 2019, 21, 3848–3858. [Google Scholar] [CrossRef]
  17. Ma, H.; Qin, X.; Jia, Y.; Zhou, J. Dynamic spatio-temporal graph fusion convolutional network for urban traffic prediction. Appl. Sci. 2023, 13, 9304. [Google Scholar] [CrossRef]
  18. Cui, Z.; Zhang, J.; Noh, G.; Park, H.J. Adstgcn: A dynamic adaptive deeper spatio-temporal graph convolutional network for multi-step traffic forecasting. Sensors 2023, 23, 6950. [Google Scholar] [CrossRef]
  19. Cai, Z.; Tan, C.; Zhang, J.; Zhu, L.; Feng, Y. DBSTGNN-Att: Dual Branch Spatio-Temporal Graph Neural Network with an Attention Mechanism for Cellular Network Traffic Prediction. Appl. Sci. 2024, 14, 2173. [Google Scholar] [CrossRef]
  20. Hsieh, H.P.; Lin, S.D.; Zheng, Y. Inferring Air Quality for Station Location Recommendation Based on Urban Big Data. In Proceedings of the ACM SIGKDD, Sydney, NSW, Australia, 10–13 August 2015; pp. 437–446. [Google Scholar]
  21. Williams, B.M.; Hoel, L.A. Modeling and Forecasting Vehicular Traffic Flow as a Seasonal ARIMA Process: Theoretical Basis and Empirical Results. J. Transp. Eng 2003, 129, 664–672. [Google Scholar] [CrossRef]
  22. Xie, Y.; Zhang, Y.; Ye, Z. Short-Term Traffic Volume Forecasting Using Kalman Filter with Discrete Wavelet Decomposition. Comput.-Aided Civ. Infrastruct. Eng. 2007, 22, 326–334. [Google Scholar] [CrossRef]
  23. Fu, H.; Ma, H.; Liu, Y.; Lu, D. A Vehicle Classification System Based on Hierarchical Multi-SVMs in Crowded Traffic Scenes. Neurocomputing 2016, 211, 182–190. [Google Scholar] [CrossRef]
  24. Lopez-Martin, M.; Carro, B.; Sanchez-Esguevillas, A. Neural network architecture based on gradient boosting for IoT traffic prediction. Future Gener. Comput. Syst. 2019, 100, 656–673. [Google Scholar] [CrossRef]
  25. Djenouri, Y.; Michalak, T.P.; Lin, J.C.W. Federated deep learning for smart city edge-based applications. Future Gener. Comput. Syst. 2023, 147, 350–359. [Google Scholar] [CrossRef]
  26. Huang, W.; Song, G.; Hong, H.; Xie, K. Deep Architecture for Traffic Flow Prediction: Deep Belief Networks with Multitask Learning. IEEE Trans. Intell. Transp. Syst. 2014, 15, 2191–2201. [Google Scholar] [CrossRef]
  27. Lv, Y.; Duan, Y.; Kang, W.; Li, Z.; Wang, F.Y. Traffic Flow Prediction with Big Data: A Deep Learning Approach. IEEE Trans. Intell. Transp. Syst. 2014, 16, 865–873. [Google Scholar] [CrossRef]
  28. Ma, X.; Tao, Z.; Wang, Y.; Yu, H.; Wang, Y. Long Short-Term Memory Neural Network for Traffic Speed Prediction using Remote Microwave Sensor Data. Transp. Res. Part C Emerg. Technol. 2015, 54, 187–197. [Google Scholar] [CrossRef]
  29. Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical Evaluation of Gated Recurrent Neural Networks on Sequence Modeling. arXiv 2014, arXiv:1412.3555. [Google Scholar] [CrossRef]
  30. Singh, V.; Sahana, S.K.; Bhattacharjee, V. Integrated spatio-temporal graph neural network for traffic forecasting. Appl. Sci. 2024, 14, 11477. [Google Scholar] [CrossRef]
  31. Li, W.; Zhan, X.; Liu, X.; Zhang, L.; Pan, Y.; Pan, Z. SASTGCN: A self-adaptive spatio-temporal graph convolutional network for traffic prediction. ISPRS Int. J. Geo-Inf. 2023, 12, 346. [Google Scholar] [CrossRef]
  32. Zhang, J.; Zheng, Y.; Qi, D. Deep Spatio-Temporal Residual Networks for Citywide Crowd Flows Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, San Francisco, CA, USA, 4–9 February 2017; Volume 31. [Google Scholar]
  33. Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. arXiv 2016, arXiv:1609.02907. [Google Scholar]
  34. Wu, Y.; Tan, H. Short-Term Traffic Flow Forecasting with Spatial-Temporal Correlation in a Hybrid Deep Learning Framework. arXiv 2016, arXiv:1612.01022. [Google Scholar]
  35. Yu, H.; Wu, Z.; Wang, S.; Wang, Y.; Ma, X. Spatiotemporal Recurrent Convolutional Networks for Traffic Prediction in Transportation Networks. Sensors 2017, 17, 1501. [Google Scholar] [CrossRef] [PubMed]
  36. Peng, H.; Bobade, S.U.; Cotterell, M.E.; Miller, J.A. Forecasting traffic flow: Short term, long term, and when it rains. In Proceedings of the International Conference on Big Data, Seattle, WA, USA, 25–30 June 2018; pp. 57–71. [Google Scholar]
  37. Dunne, S.; Ghosh, B. Weather Adaptive Traffic Prediction Using Neurowavelet Models. IEEE Trans. Intell. Transp. Syst. 2013, 14, 370–379. [Google Scholar] [CrossRef]
  38. Zhang, D.; Kabuka, M.R. Combining Weather Condition Data to Predict Traffic Flow: A GRU Based Deep Learning Approach. IET Intel. Transport. Syst. 2018, 12, 578–585. [Google Scholar] [CrossRef]
  39. Hou, Y.; Deng, Z.; Cui, H. Short-Term Traffic Flow Prediction with Weather Conditions: Based on Deep Learning Algorithms and Data Fusion. Complexity 2021, 2021, 6662959. [Google Scholar] [CrossRef]
  40. Blagoiev, M.; Gruicin, I.; Ionascu, M.E.; Marcu, M. A Study on correlation between air pollution and traffic. In Proceedings of the 2018 26th Telecommunications Forum (TELFOR), Belgrade, Serbia, 20–21 November 2018; pp. 420–425. [Google Scholar]
  41. Alruwaili, O.; Kostanic, I.; Al-Sabbagh, A.; Almohamedh, H. IoT based: Air quality index and traffic volume correlation. In Proceedings of the 2020 11th IEEE Annual Ubiquitous Computing, Electronics & Mobile Communication Conference (UEMCON), New York, NY, USA, 28–31 October 2020; pp. 0143–0147. [Google Scholar]
  42. Liu, L.; Feng, J.; Wu, C.; Chen, C.; Pei, Q. Reputation management for consensus mechanism in vehicular edge metaverse. IEEE J. Sel. Areas Commun. 2023, 42, 919–932. [Google Scholar] [CrossRef]
  43. Feng, J.; Liu, L.; Hou, X.; Pei, Q.; Wu, C. QoE fairness resource allocation in digital twin-enabled wireless virtual reality systems. IEEE J. Sel. Areas Commun. 2023, 41, 3355–3368. [Google Scholar] [CrossRef]
  44. He, M.; Li, X.; Zhao, H.; Yao, Y.; Zhou, T. A Topology-Enhanced Graph Convolutional Network for Urban Traffic Prediction. In Proceedings of the 2024 7th International Conference on Electronics Technology (ICET), Chengdu, China, 17–20 May 2024; pp. 1093–1097. [Google Scholar]
  45. Ji, J.; Wang, J.; Huang, C.; Wu, J.; Xu, B.; Wu, Z.; Zhang, J.; Zheng, Y. Spatio-Temporal Self-Supervised Learning for Traffic Flow Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; Volume 37, pp. 4356–4364. [Google Scholar]
  46. Zhu, J.; Wang, Q.; Tao, C.; Deng, H.; Zhao, L.; Li, H. AST-GCN: Attribute-Augmented Spatiotemporal Graph Convolutional Network for Traffic Forecasting. IEEE Access 2021, 9, 35973–35983. [Google Scholar] [CrossRef]
  47. Fowlkes, E.B.; Mallows, C.L. A Method for Comparing Two Hierarchical Clusterings. J. Am. Stat. Assoc. 1983, 78, 553–569. [Google Scholar] [CrossRef]
  48. Liu, J.; Guan, W. A Summary of Traffic Flow Forecasting Methods. J. Highw. Transp. Res. Dev. 2004, 21, 82–85. [Google Scholar]
  49. Su, H.; Zhang, L.; Yu, S. Short-Term Traffic Flow Prediction Based on Incremental Support Vector Regression. In Proceedings of the Third International Conference on Natural Computation (ICNC 2007), Haikou, China, 24–27 August 2007; Volume 1, pp. 640–645. [Google Scholar]
  50. Li, Y.; Yu, R.; Shahabi, C.; Liu, Y. Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting. arXiv 2017, arXiv:1707.01926. [Google Scholar]
  51. Liu, D.; Wang, J.; Shang, S.; Han, P. Msdr: Multi-step dependency relation networks for spatial temporal forecasting. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Washington, DC, USA, 14–18 August 2022; pp. 1042–1050. [Google Scholar]
Figure 1. An example that illustrates the relationship between the traffic flow, road topology, and environmental factors. Different regions exhibit distinct traffic patterns, which are further influenced by localized air pollution components with strong regional characteristics.
Figure 1. An example that illustrates the relationship between the traffic flow, road topology, and environmental factors. Different regions exhibit distinct traffic patterns, which are further influenced by localized air pollution components with strong regional characteristics.
Sensors 25 05127 g001
Figure 2. Overall frame diagram of the SHGCN model. The framework includes data preprocessing, graph enhancement, traffic information enhancement, and prediction parts, respectively.
Figure 2. Overall frame diagram of the SHGCN model. The framework includes data preprocessing, graph enhancement, traffic information enhancement, and prediction parts, respectively.
Sensors 25 05127 g002
Figure 3. Illustration of the enhancement of road topology. The vertices represent streets, and the edges indicate traffic correlations between vertices. This method filters out connections between less correlated road segments while adding connections between highly correlated ones.
Figure 3. Illustration of the enhancement of road topology. The vertices represent streets, and the edges indicate traffic correlations between vertices. This method filters out connections between less correlated road segments while adding connections between highly correlated ones.
Sensors 25 05127 g003
Figure 4. The impact of epoch selection on prediction performance.
Figure 4. The impact of epoch selection on prediction performance.
Sensors 25 05127 g004
Figure 5. The impact of units selection on prediction performance.
Figure 5. The impact of units selection on prediction performance.
Sensors 25 05127 g005
Figure 6. Visual results over the 6 h prediction horizon.
Figure 6. Visual results over the 6 h prediction horizon.
Sensors 25 05127 g006
Figure 7. Visual results for the 24 h prediction horizon.
Figure 7. Visual results for the 24 h prediction horizon.
Sensors 25 05127 g007
Figure 8. Visual results for the prediction horizon.
Figure 8. Visual results for the prediction horizon.
Sensors 25 05127 g008
Figure 9. Comparison between results with and without considering heterogeneous factors.
Figure 9. Comparison between results with and without considering heterogeneous factors.
Sensors 25 05127 g009
Figure 10. Comparison between results with and without incorporating air pollution components.
Figure 10. Comparison between results with and without incorporating air pollution components.
Sensors 25 05127 g010
Table 1. Clustering results of air pollution components in the Aarhus dataset. Carbon monoxide has the highest correlation with traffic flow.
Table 1. Clustering results of air pollution components in the Aarhus dataset. Carbon monoxide has the highest correlation with traffic flow.
Aarhus
Cluster Similarity Metric CO O 3 SO 2 PM NO 2
B k 0.5169 0.21820.26030.26190.3497
Table 2. Performance comparison of models incorporating various air pollutants in the Aarhus dataset.
Table 2. Performance comparison of models incorporating various air pollutants in the Aarhus dataset.
Aarhus
TimeMetric CO O 3 SO 2 PM NO 2 Not Integrated
RMSE 12.5275 13.130413.102113.110312.774512.8598
15 minMAE 9.4828 9.88549.88019.87639.64929.6927
Accuracy 0.7912 0.77570.77680.77660.78630.7842
RMSE 13.3529 14.053114.036414.022313.702813.7672
30 minMAE 10.1531 10.823710.816810.809710.372610.4289
Accuracy 0.7775 0.76030.76150.76200.77220.7701
RMSE 14.8012 15.712915.685915.669415.401915.4021
60 minMAE 10.6697 11.606411.590211.589111.076511.0827
Accuracy 0.7631 0.74590.74660.74740.75580.7554
Table 3. Clustering results of air pollution components in the Newcastle dataset. Carbon monoxide has the highest correlation with traffic flow.
Table 3. Clustering results of air pollution components in the Newcastle dataset. Carbon monoxide has the highest correlation with traffic flow.
Newcastle
Cluster Similarity Metric CO O 3 PM 2.5 NO 2
B k 0.5185 0.40240.33330.2708
Table 4. Performance comparison of models incorporating various air pollutants in the Newcastle dataset.
Table 4. Performance comparison of models incorporating various air pollutants in the Newcastle dataset.
Newcastle
TimeMetric CO O 3 PM 2.5 NO 2 Not Integrated
RMSE 13.0786 13.633114.205115.248714.6272
15 minMAE 8.4707 8.79349.24349.85749.2638
Accuracy 0.8331 0.82600.81860.80550.8104
RMSE 14.2845 14.601714.400815.420715.0536
30 minMAE 9.2185 9.24169.297310.059410.0118
Accuracy 0.8178 0.81290.81220.80350.8096
RMSE 14.7128 14.996515.173616.131815.1864
60 minMAE 9.4474 9.34419.661110.38769.7246
Accuracy 0.8126 0.80650.80620.79410.8040
Table 5. Comparison of performance between SHGCN and baselines with various prediction horizons in the Aarhus dataset.
Table 5. Comparison of performance between SHGCN and baselines with various prediction horizons in the Aarhus dataset.
Aarhus
TimeMetricHASVRGCNGRUDCRNNTGCNMSDRSHGCN
RMSE16.749814.870914.227413.882313.629113.128413.0921 12.5275
15 minMAE12.649010.879510.690310.546210.42869.88279.7672 9.4828
Accuracy0.74060.76300.76570.77030.77220.77630.7791 0.7912
RMSE16.749815.402115.023814.619714.480113.990113.9229 13.3529
30 minMAE12.649011.295811.273711.062110.935910.872610.6782 10.1531
Accuracy0.74060.74820.75200.75620.75780.76050.7642 0.7775
RMSE16.749816.908516.523916.030815.976215.589215.5265 14.8012
60 minMAE12.649011.969811.950111.753611.728911.318411.2494 10.6697
Accuracy0.74060.73520.74110.74220.74320.74810.7501 0.7631
Table 6. Comparison of performance between SHGCN and baselines with various prediction horizons in the Newcastle dataset.
Table 6. Comparison of performance between SHGCN and baselines with various prediction horizons in the Newcastle dataset.
Newcastle
TimeMetricHASVRGCNGRUDCRNNTGCNMSDRSHGCN
RMSE19.875317.431217.153316.612915.943115.533814.4815 13.0786
15 minMAE13.128412.348612.056211.728110.115610.18919.8861 8.4707
Accuracy0.75310.77490.77950.78130.79630.80170.7985 0.8331
RMSE19.875318.986418.624517.953117.058215.671315.7153 14.2845
30 minMAE13.128412.951512.563112.312410.121910.343110.2541 9.2185
Accuracy0.75310.75830.76120.76850.78150.80010.8111 0.8178
RMSE19.875321.253320.558219.982418.493617.082916.1024 14.7128
60 minMAE13.128416.082115.749815.153213.148111.486910.8135 9.4474
Accuracy0.75310.72250.72880.73450.75880.78240.7952 0.8126
Table 7. Ablation experiments under different experiment settings in the Aarhus dataset.
Table 7. Ablation experiments under different experiment settings in the Aarhus dataset.
Aarhus
TimeMetricDCRNNTGCNMSDRSHGCN
COEnhancedCO + Enhanced
RMSE13.629113.128413.092113.108712.8598 12.5275
15 minMAE10.42869.88279.76729.81269.6927 9.4828
Accuracy0.77220.77630.77910.77800.7842 0.7912
RMSE14.480113.990113.922913.989313.7672 13.3529
30 minMAE10.935910.872610.678210.805610.4289 10.1531
Accuracy0.75780.76050.76420.76270.7701 0.7775
RMSE15.976215.589215.526515.608215.4021 14.8012
60 minMAE11.728911.318411.249411.295711.0827 10.6697
Accuracy0.74320.74810.75010.74890.7554 0.7631
Table 8. Ablation experiments under different experiment settings in the Newcastle dataset.
Table 8. Ablation experiments under different experiment settings in the Newcastle dataset.
Newcastle
TimeMetricDCRNNTGCNMSDRSHGCN
COEnhancedCO + Enhanced
RMSE15.943115.533814.481514.723314.6272 13.0786
15 minMAE10.115610.18919.88619.43619.2638 9.4707
Accuracy0.79630.80170.79850.80960.8104 0.8331
RMSE17.058215.671315.715315.185615.0536 14.2845
30 minMAE10.121910.343110.254110.075510.0118 9.2185
Accuracy0.78150.80010.81110.80370.8096 0.8178
RMSE18.493617.082916.102416.094915.1864 14.7128
60 minMAE13.148111.486910.813510.15079.7246 9.4474
Accuracy0.75880.78240.79520.79910.8040 0.8126
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, X.; He, M.; Qin, D.; Zhou, T.; Jiang, N. Spatio-Temporal Heterogeneity-Oriented Graph Convolutional Network for Urban Traffic Flow Prediction. Sensors 2025, 25, 5127. https://doi.org/10.3390/s25165127

AMA Style

Li X, He M, Qin D, Zhou T, Jiang N. Spatio-Temporal Heterogeneity-Oriented Graph Convolutional Network for Urban Traffic Flow Prediction. Sensors. 2025; 25(16):5127. https://doi.org/10.3390/s25165127

Chicago/Turabian Style

Li, Xuan, Muyang He, Dong Qin, Tianqing Zhou, and Nan Jiang. 2025. "Spatio-Temporal Heterogeneity-Oriented Graph Convolutional Network for Urban Traffic Flow Prediction" Sensors 25, no. 16: 5127. https://doi.org/10.3390/s25165127

APA Style

Li, X., He, M., Qin, D., Zhou, T., & Jiang, N. (2025). Spatio-Temporal Heterogeneity-Oriented Graph Convolutional Network for Urban Traffic Flow Prediction. Sensors, 25(16), 5127. https://doi.org/10.3390/s25165127

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop