Online Spatio-Temporal Correlation-Based Federated Learning for Traffic Flow Forecasting

Qingxiang Liu, Sheng Sun, Min Liu, Yuwei Wang, Bo Gao · DOI

Abstract

Traffic Flow Forecasting (TFF) is a critical component of Intelligent Transportation Systems (ITS), yet it faces significant challenges regarding data privacy and real-time adaptability. This paper introduces FedOSTC, a novel framework that integrates Online Learning (OL) with Federated Learning (FL). By employing Online Gradient Descent (OGD) at the edge and a period-aware aggregation mechanism at the server, FedOSTC adapts to real-time traffic volatility while maintaining strict privacy. Experimental results on the PEMS-BAY and METR-LA datasets demonstrate that FedOSTC significantly outperforms existing batch-based FL methods, particularly in long-term forecasting horizons, while ensuring robust generalization across heterogeneous clients.

1. Introduction

Accurate Traffic Flow Forecasting enables efficient route planning and congestion management. Traditionally, centralized deep learning models required aggregating massive amounts of sensitive traffic data, raising privacy concerns and creating communication bottlenecks. Federated Learning (FL) offers a decentralized alternative; however, most existing FL approaches rely on "batch learning," which struggles with the high volatility and "concept drift" inherent in real-time traffic. Furthermore, capturing dynamic spatial correlations—how traffic conditions in one area affect another—without sharing raw data remains a significant hurdle in the field.

2. The FedOSTC Framework

FedOSTC addresses these challenges through a three-pronged approach: real-time local updates, privacy-preserving spatial modeling, and period-aware global aggregation.

System architecture of the FedOSTC framework, illustrating the interaction between edge clients and the central server.

2.1 Online Gradient Descent (OGD)

Unlike traditional FL that trains on historical batches, FedOSTC clients utilize OGD to update model weights incrementally as new data arrives. This allows the model to continuously adapt to current traffic conditions, ensuring that the forecasting remains relevant even during sudden shifts in traffic patterns, such as accidents or unexpected rush hours.

2.2 Privacy-Preserving Spatial Correlation

To model spatial dependencies, the central server employs a Graph Attention Network (GAT). Crucially, the GAT does not operate on raw traffic data. Instead, it analyzes hidden temporal patterns (embeddings) generated by the clients' GRU encoders. This approach allows the system to identify spatial relationships based on temporal similarities without exposing raw speed or volume data, effectively using embeddings as privacy proxies.

2.3 Period-Aware Aggregation

Traffic patterns are inherently periodic (e.g., morning commutes on consecutive Mondays). FedOSTC leverages this by using a weighted aggregation mechanism. The server calculates correlation coefficients from previous periods to weight local model updates, resulting in a global model that is better generalized across heterogeneous client data.

3. Experimental Evaluation

The framework was evaluated using two gold-standard traffic datasets: PEMS-BAY (325 sensors in the California Bay Area) and METR-LA (207 sensors in Los Angeles). The study focused on 50 randomly selected sensors acting as FL clients. Performance was measured using Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) across various forecasting horizons ($F=1, 6, 12$, corresponding to 5, 30, and 60 minutes).

4. Results and Discussion

FedOSTC demonstrated superior performance against both centralized and federated baselines, including state-of-the-art models like CNFGNN.

4.1 Long-Term Accuracy and Generalization

As the forecasting horizon increases, the advantage of FedOSTC becomes more pronounced. For a 1-hour forecast ($F=12$) on the PEMS-BAY dataset, FedOSTC achieved an RMSE of 1.601, significantly outperforming the best FL baseline (FedAvgOn at 2.661) and even the centralized batch-learning model (CenterOff at 4.693).

RMSE heatmaps across 50 clients for different methods and forecasting horizons (F=1, 6, 12) on PEMS-BAY and METR-LA datasets.

As shown in the heatmaps above, FedOSTC (bottom row of each subplot) consistently maintains lower and more uniform error rates across all 50 clients compared to baselines. This indicates not only higher accuracy but also better generalization, ensuring the global model performs reliably for all local nodes despite data heterogeneity.

4.2 Efficiency and Feasibility

The model achieves these gains with relatively few local epochs ($E=5$), making it feasible for deployment on resource-constrained edge devices. This balance between local computation and global accuracy is vital for real-world ITS applications.

5. Conclusion

FedOSTC represents a significant advancement in privacy-preserving traffic forecasting by successfully merging online learning with federated architectures. By focusing on real-time adaptability and periodic correlations, it overcomes the inherent limitations of static batch-based models. Future research will explore communication compression techniques to reduce the overhead of frequent online updates and further optimize forecasting latency for high-speed traffic environments.

Summary updated

BibTeX
@article{liu2024online,
  author = {Qingxiang Liu and Sheng Sun and Min Liu and Yuwei Wang and Bo Gao},
  title = {{Online Spatio-Temporal Correlation-Based Federated Learning for Traffic Flow Forecasting}},
  journal = {IEEE Trans. Intell. Transp. Syst.},
  year = {2024},
  doi = {10.1109/tits.2024.3429533},
}
Figure