# Federated dynamic modeling and learning for spatiotemporal data forecasting

Thien Pham, Angelo Furno, Faïcel Chamroukhi, Latifa Oukhellou

► To cite this version:

Thien Pham, Angelo Furno, Faïcel Chamroukhi, Latifa Oukhellou. Federated dynamic modeling and learning for spatiotemporal data forecasting. Neurocomputing, 2026, pp.132712. 10.1016/j.neucom.2026.132712. hal-05472368

HAL Id: hal-05472368

https://hal.science/hal-05472368v1

Submitted on 22 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
Federated Dynamic Modeling and Learning
for Spatiotemporal Data Forecasting

Thien Pham<sup>a</sup>, Angelo Furno<sup>b</sup>, Faïcel Chamroukhi<sup>c,*</sup>, Latifa Oukhellou<sup>a</sup>

<sup>a</sup>COSYS-GRETTIA, Gustave Eiffel University, 77420 France

<sup>b</sup>EMob-Lab, ENTPE, University Gustave Eiffel, 69675, Lyon, France

<sup>c</sup>IRT-SystemX, 2 Boulevard Thomas Gobert, 91120 Palaiseau, France

**Abstract**

This paper presents an advanced Federated Learning (FL) framework for forecasting complex spatiotemporal data, improving upon recent state-of-the-art models. In the proposed approach, the original Gated Recurrent Unit (GRU) module within previous Dynamic Spatial-Temporal Graph Convolutional Recurrent Network (DSTGCRN) modeling is first replaced with a Long Short-Term Memory (LSTM) network, enabling the resulting model to more effectively capture long-term dependencies inherent to time series data. The resulting architecture significantly improves the model's capacity to handle complex temporal patterns in diverse forecasting applications. Furthermore, the proposed FL framework integrates a novel Client-Side Validation (CSV) mechanism, introducing a critical validation step at the client level before incorporating aggregated parameters from the central server into local models, ensuring only the most effective updates are retained and improving both the robustness and accuracy of the forecasting model across clients. The efficiency of our approach is demonstrated through extensive experiments on real-world applications, including public datasets for multimodal transport demand forecasting and private datasets for Origin-Destination (OD) matrix forecasting in urban areas. The results demonstrate substantial improvements over conventional methods, highlighting the framework's ability to capture complex spatiotemporal dependencies while preserving data privacy. This work not only provides a scalable and privacy-preserving solution for real-time, region-specific forecasting and management but also underscores the potential of leveraging distributed data sources in a FL context. We provide our algorithms as open-source on GitHub<sup>1</sup>.

**Keywords:** Federated Learning, LSTM, Attention Mechanism, Graph Convolutional Recurrent Network, Time Series Analysis, Transport Demand Forecasting

<footnote>*Corresponding author</footnote>

<footnote>Email addresses: nhat-thien.pham@univ-eiffel.fr (Thien Pham),
angelo.furno@univ-eiffel.fr (Angelo Furno), faicel.chamroukhi@irt-systemx.fr
(Faïcel Chamroukhi), latifa.oukhellou@univ-eiffel.fr (Latifa Oukhellou)</footnote>

<footnote n="1"><sup>1</sup>https://github.com/nhat-thien/Federated-LSTM-DSTGCRN</footnote>
# 1. Introduction

Forecasting spatiotemporal data has become a critical area of research due to the increasing complexity and inter-connectivity of modern systems, such as urban transportation, energy grids, and environmental monitoring. Accurate predictions are essential for efficient planning, resource allocation, and minimizing disruptions. As urban areas and other complex systems continue to grow, the challenges of forecasting spatiotemporal data are exacerbated by the dynamic and heterogeneous nature of these systems.

Numerous models, ranging from traditional statistical methods to sophisticated machine learning techniques, have been employed to capture the intricate spatiotemporal dependencies present in spatiotemporal data. Simple models, such as autoregressive integrated moving average (ARIMA), exponential smoothing, and linear regression, have long been used in forecasting but often struggle to account for the complexities of spatiotemporal interactions. These models typically assume stationarity and linearity, which can limit their effectiveness in dynamic and non-linear environments.

In recent years, the field has seen significant advancements with the introduction of machine learning and deep learning (DL) techniques. These methods have demonstrated remarkable success in capturing complex patterns in spatiotemporal data, offering significant improvements over traditional approaches. Advanced models, including Graph Convolutional Networks (GCN) and Recurrent Neural Networks (RNN), have been increasingly utilized due to their ability to more effectively model spatial relationships and temporal dynamics. Long Short-Term Memory (LSTM), Gated Recurrent Unit (GRU), Convolutional Neural Networks (CNN) tailored for spatiotemporal prediction, and hybrid models that combine them, have demonstrated significant improvements in forecasting accuracy by leveraging the strengths of deep learning architectures. These models are particularly well-suited for capturing the non-linear and complex interactions inherent in spatiotemporal systems.

Graph Convolutional Recurrent Network (GCRN) models have established themselves as one of the most effective approaches for capturing spatial and temporal correlations in spatiotemporal data. By leveraging the strengths of GCNs and RNNs, GCRNs are particularly well-suited for modeling the dynamic interactions that characterize complex systems. Recent advancements in GCRN models have led to several variants tailored to specific aspects of spatiotemporal forecasting.

The Dynamic Spatial-Temporal Graph Convolutional Recurrent Network (DSTGCRN), introduced by Gong et al. (2024), represents a state-of-the-art method for modeling complex spatiotemporal dependencies in multisource time series data. Initially developed for forecasting carbon emissions, the DSTGCRN's adaptable architecture makes it particularly well-suited for spatiotemporal prediction tasks. The model excels at capturing both spatial relationships and temporal dynamics, which are crucial for accurately predicting patterns that vary over time and across different locations. In this paper, we enhance the local forecasting model by integrating an LSTM network with the DSTGCRN, referred to as the LSTM-DSTGCRN model subsequently. This modification strengthens the model's ability to capture long-term temporal dependencies, which commonly occur in spatiotemporal data, thereby improving its effectiveness in the context of dynamic
and evolving systems.

Despite advancements in forecasting, a significant challenge remains: many existing approaches rely on centralized datasets. In numerous cases, however, data are inherently distributed across various locations, making centralized access impractical. Additionally, models that depend on centralized data face several challenges, including privacy concerns, data ownership issues, and the logistical complexities of managing large-scale data repositories. Moreover, each organization's data may not capture all relevant characteristics and patterns, making it essential to collaborate and federate together to improve forecasts and predictions. However, directly sharing these datasets poses significant privacy risks and logistical hurdles, rendering collaborative efforts impractical. These challenges highlight the need for alternative methodologies that address both the practical and ethical limitations of centralized approaches.

Federated Learning (FL) (McMahan et al., 2016; Konecný et al., 2016) presents an effective solution by enabling multiple clients to collaboratively train a model without sharing their raw data. Instead, only model parameters are exchanged and aggregated, thus preserving data privacy while leveraging the advantages of collective learning. This collaborative approach not only enhances the robustness of predictions but also maximizes the benefits derived from diverse data sources.

In this paper, we propose an enhanced FL framework that builds upon the LSTM-DSTGCRN model by incorporating a LSTM network in place of the original GRU. This modification enables the model to better capture long-term temporal dependencies, which are critical in various spatiotemporal forecasting tasks.

To further improve the FL process, we propose a novel Client-Side Validation (CSV) mechanism designed to enhance both model robustness and accuracy. Specifically, after each round of server aggregation, clients validate the aggregated parameters before updating their local models. For each module, clients temporarily replace local parameters with the aggregated ones and compute the validation loss. If the loss improves, the new parameters are kept; otherwise, the original ones are restored. This selective update ensures that only beneficial changes are applied, improving overall model performance. Extensive experiments across various spatiotemporal datasets demonstrate that our approach achieves faster convergence and superior accuracy compared to state-of-the-art methods. This framework is particularly well-suited for tasks requiring privacy-preserving, collaborative learning across heterogeneous data sources.

The main contributions of this work are as follows:

* We enhance the DSTGCRN model by integrating LSTM networks instead of the original GRU. This modification significantly improves the models ability to capture long-term temporal dependencies, making it more effective for spatiotemporal forecasting tasks.

* We design a FL framework based on clients-server interaction, ensuring that the prediction performance for all clients, based on the resulting collaboratively constructed model, is guaranteed to improve over the locally trained models.
* We propose a novel Client-Side Validation (CSV) mechanism that controls the quality of aggregated model parameters at the client level, ensuring that only beneficial updates are incorporated into local models. This mechanism enhances model robustness and accelerates convergence.

* We perform extensive experiments on real-world datasets, in two scenarios of application (multimodal transport demand forecasting and OD matrix forecasting), showcasing the superiority of our approach compared to traditional local models and state-of-the-art FL methods across various spatiotemporal forecasting tasks.

The rest of the paper is organized as follows: Section 2 reviews related work in spatiotemporal forecasting and FL, Section 3 defines the notations, formulates the problems of forecasting and FL with spatiotemporal data. Section 4 provides a detailed description of the LSTM-DSTGCRN model. In Section 5, we outline our FL framework and CSV process. Section 6 presents our experiments for multimodal transport demand and OD matrix forecasting problems. Finally, Section 7 discusses the results and implications, and Section 8 concludes the paper with potential future research directions.

## 2. Related Work

Spatiotemporal data forecasting in transportation has seen significant advancements over the years, driven by the increasing availability of transport data and the development of sophisticated modeling techniques. In recent years, deep learning models have emerged as powerful tools for forecasting tasks due to their ability to learn complex patterns from large datasets. Recurrent neural networks (RNNs), particularly long short-term memory (LSTM) networks and gated recurrent units (GRUs), have been employed to capture temporal dependencies in transport data (Shi et al., 2023; Xu et al., 2017; Shu et al., 2022). However, these models primarily focus on modeling temporal patterns while often ignoring spatial dependencies, which are critical for understanding the interactions between different nodes in the network. This limitation reduces their effectiveness in capturing the full complexity of spatiotemporal data, where both temporal and spatial relationships play a vital role in accurate forecasting.

Graph Convolutional Network (GCN) (Kipf and Welling, 2017; Zhang et al., 2019) is an advanced approach, introduced to model spatial dependencies in graph-structured data by leveraging the inherent relationships between nodes and edges. Although GCNs are not specifically designed for transportation data, their ability to effectively represent networks as graphs, where nodes correspond to locations and edges capture connections or interactions, makes them well suited for analyzing transport networks. Since its introduction, the combination of GCNs and RNNs has led to many advanced developments of spatiotemporal models. These hybrid architectures, known as Graph Convolutional Recurrent Networks (GCRNs), excel at simultaneously capturing spatial and temporal dependencies, making them powerful tools for dynamic network modeling and prediction tasks.

In Yu et al. (2017), the authors introduced a spatio-temporal graph convolutional neural network that laid the groundwork for GCRNs frameworks in traffic forecasting.
Building on this foundation, Guo et al. (2019) proposed an attention-based spatiotemporal GCN to enhance the model's ability to focus on relevant spatial and temporal features, Ge et al. (2019) explored temporal graph convolutional networks that account for external factors in traffic speed prediction. Then, the works of Zheng et al. (2019) with GMAN, Song et al. (2020) with STSGCN, and Chen et al. (2020) with DST-GCNN models incorporate advanced attention mechanisms and GCNs to better capture the dynamic interactions and dependencies in both spatial and temporal dimensions. However, these methods are limited to capturing common patterns across all traffic series and continue to depend on a pre-defined spatial connection graph. Other extensions in this line of development include the LSGCN model proposed by (Huang et al., 2020), which is designed for long short-term traffic prediction, and the OGCRNN model introduced by (Guo et al., 2021), which integrates GCN and GRU to model traffic flow data. These models further demonstrate the effectiveness of GCRNs in capturing spatiotemporal dependencies in traffic systems. Recent works have advanced GCRNs by incorporating more sophisticated modules to enhance their capabilities. For instance, Hu et al. (2022) proposed a model that adaptively fuses geographical proximity and spatial heterogeneity information at each time step, further exploring the potential of GCRNs in traffic forecasting with pre-defined graph structures. Another notable contribution is the Temporal Metrics-Based Aggregated Graph Convolution Network (TMAGCN) introduced by Chen et al. (2023). By incorporating temporal metrics, TMAGCN addresses the limitations of traditional distance-based metrics, offering a more accurate representation of real-world traffic conditions.

To address the limitation of the models based on pre-defined graph, in Bai et al. (2020), the authors introduced the Adaptive Graph Convolutional Recurrent Network (AGCRN) model, designed to capture node-specific patterns to capture fine-grained spatial and temporal correlations in traffic series automatically, making it highly flexible for real-world applications. Building on this foundation, Spatiotemporal Adaptive Gated Graph Convolution Network proposed by Lu et al. (2020) enhances the ability to model complex spatiotemporal dependencies.

Another significant advancement is the Dynamic Spatial-Temporal Graph Recurrent Neural Network (DSTGRNN) proposed by Xia et al. (2024). This framework combines a dynamic graph generator with a dynamic graph recurrent neural network and a novel fusion mechanism, enabling it to capture complex dynamic spatiotemporal dependencies while integrating both static and dynamic graph features. One of the most notable recent developments is the DS-STGCN model by Hu et al. (2024), which further enhances traffic flow prediction by integrating node feature graphs, topology graphs, and time-slot feature graphs. This comprehensive approach effectively captures complex spatiotemporal dependencies, significantly improving prediction accuracy. Other contribution in this line include the work of Zuo et al. (2023), which addresses the issue of missing data—a common challenge in traffic datasets caused by sensor malfunctions or communication errors. Together, these advancements highlight the versatility and effectiveness of GCRN-based models in addressing the challenges of traffic forecasting and advancing the field.
The Dynamic Spatial–Temporal Graph Convolutional Recurrent Network (DST-GCRN) Gong et al. (2024) further extends these ideas by incorporating multihead attention mechanisms and adaptive graph convolutions, enabling the model to dynamically adjust to changing patterns in the data. This makes the DSTGCRN particularly well-suited for multimodal transport demand forecasting, where transport modes and demand patterns can vary significantly over time and space.

FL has recently gained attention as a promising approach to training machine learning models across distributed datasets without requiring raw data sharing, thus preserving privacy and data security McMahan et al. (2016); Konecný et al. (2016). In transport demand forecasting, FL allows multiple stakeholders, such as cities or transport agencies, to collaboratively train a global model while keeping their data decentralized. Various federating schemes have been proposed, including the original FedAvg McMahan et al. (2016), which aggregates model parameters from local clients to form a global model. However, these approaches often assume homogeneous data distributions and may not effectively handle the heterogeneity, particularly, in multimodal transport data. Recent FL methods address various aspects of the heterogeneity problem. Notably, FedDyn (Acar et al., 2021), FedProx (Li et al., 2020), and FedOpt (Reddi et al., 2021) modify the update rule or add regularization to stabilize training across non-IID clients, while MOON (Li et al., 2021) targets client-specific feature gaps via contrastive learning for representation alignment and personalization. FedCurv (Casella et al., 2023) constrains local drifts via curvature penalties through curvature-aware regularization.

In the transportation domain, FL has been successfully applied across various aspects to improve prediction accuracy and operational efficiency. For instance, Liu et al. (2020) developed a privacy-preserving traffic flow prediction framework using FL, demonstrating its effectiveness in enhancing prediction models while safeguarding sensitive data. Similarly, Zeng et al. (2021) explored multi-task FL for traffic prediction, highlighting its application in route planning to optimize travel times. Yuan et al. (2022) proposed FedTSE, a low-cost FL framework for privacy-preserved traffic state estimation in the Internet of Vehicles (IoV), emphasizing the practicality of FL in real-world applications. Additionally, Sepasgozar and Pierre (2022b) presented a network traffic prediction model that incorporates road traffic parameters, illustrating the potential of AI methods in vehicular ad-hoc networks (VANETs). Their subsequent work Sepasgozar and Pierre (2022a) introduced Fed-NTP, a FL algorithm tailored for network traffic prediction in VANETs, further demonstrating FL's adaptability to various transportation contexts.

Moreover, recent advances by Yuan et al. (2023) in graph representation-driven FL for urban traffic flow prediction underline the method's potential for edge computing applications in smart cities. A comprehensive review of FL applications in intelligent transportation systems can be found in Zhang et al. (2023) where the authors outlined recent developments and identified open challenges for future research. Overall, these studies collectively highlight the transformative potential of FL in the transportation sector, effectively addressing the dual challenges of enhancing forecasting accuracy and ensuring data privacy in collaborative environments.
### 3. Problem formulation

#### 3.1. Spatiotemporal data forecasting

Let $M$ be the number of forecasting tasks we wish to address. For multimodal transport demand forecasting problem, these tasks could include, for example, forecasting the taxi demands of company ①, the bike-sharing demand of company ②, the bus demand of company ③, etc. We refer to each entity that manages a specific forecasting task as a client. Each client has their network for service, e.g., pickup and drop-off locations (for taxis) or stations (for public transport), which we refer to as nodes. For OD matrix forecasting problems, these tasks could include, for example, forecasting the flow of trips between zones in the city (a), the flow of trips between zones in the city (b), etc. In this case, we also refer to each entity that own the data as a client, and the pairs of zones as nodes.

For $m \in \{1, \dots, M\}$, let $N_m$ be the number of nodes in client $m$'s data. We denote by $X_{mn}(t), n \in \{1, \dots, N_m\}$, the value (i.e., the demand or the flow) at node $n$ of client $m$ at a time point $t \in \mathcal{T}$. Here, we consider $\mathcal{T}$ as a set of discrete increasing time points (e.g., hourly), denoted by $\mathcal{T} = \{\dots, t_{-1}, t_0, t_1, \dots\}$. We can see that for each $m \in \{1, \dots, M\}$ and $n \in \{1, \dots, N_m\}$, $X_{mn}(\cdot)$ is a time series, i.e., a random function, with values in $\mathbb{N}$. Hence, our problem consists of forecasting such time series for all nodes of all clients given their historical data.

Furthermore, as will be described in the subsequent subsection, in our problem setting, we are subjected to respect the privacy constraints between the clients. In other words, while each client aims to develop a model that delivers the most accurate predictions for future outcomes across their entire network, they must do so without sharing raw data or disclosing any network details, such as the number of nodes or the scale of their data.

We denote by $\mathcal{D}_m = \{(X_{m1}, Y_{m1}), \dots, (X_{mN_m}, Y_{mN_m})\}$ the dataset that client $m$ owns. Here, for each $n \in \{1, \dots, N_m\}$, $X_{mn} = \{X_{mn}(t), t \in \mathcal{T}_{mn}\}$ is an observed time series (e.g., transport demand or OD flows), and $Y_{mn} = \{Y_{mn}(t), t \in \mathcal{T}_{mn}\}$ denotes the vector-valued time series of exogenous data, for example, the temperature, precipitation, hour of day, day of week, etc. The notation $\mathcal{T}_{mn}$ denotes the set of discrete time points that client $m$ observed their data at node $n$. For convenience, we assume $\mathcal{T}_{mn} = \mathcal{T} = \{t_1, \dots, t_T\}$ for all $m$ and $n$, with $t_1 < \dots < t_T$ and $T$ being the historical length of the data. Hence, our goal is to learn a forecasting model $\mathcal{F}_m$ for each client $m$, from their historical data $\mathcal{D}_m$, to forecast the future demands (or flows) across all nodes in their network.

Mathematically, at any time point $t_i$, given $p \in \mathbb{N}$ recent observations at all of $N_m$ nodes, client $m$ forecasts the values in their network for the $q \in \mathbb{N}$ upcoming time points as

$$ \left\{ X_{mn}(t), \begin{array}{l} t \in \{t_{i+1}, \dots, t_{i+q}\}, \\ n \in \{1, \dots, N_m\} \end{array} \right\} = \mathcal{F}_m \left( \left\{ (X_{mn}(t), Y_{mn}(t)), \begin{array}{l} t \in \{t_{i-p+1}, \dots, t_i\}, \\ n \in \{1, \dots, N_m\} \end{array} \right\} ; \mathbf{P}_m \right), \quad (1) $$

where $\mathbf{P}_m$ is the parameter to be learned for the forecasting model $\mathcal{F}_m$.
The model $\mathcal{F}_m$ can take various forms depending on the complexity of the dynamics and the sophistication of the forecasting strategy employed. If $\mathcal{F}_m$ is, e.g., a linear regression model, $\mathbf{P}_m$ might consist of regression coefficients that capture the linear relationships between past and future values. In this case, the model assumes that future values are a weighted sum of past values with some additional bias terms, making it straightforward but potentially limited in capturing complex patterns.

On the other hand, if $\mathcal{F}_m$ is a more advanced model such as a neural network or a graph-based model, $\mathbf{P}_m$ could include the weights and biases of a deep learning architecture, possibly comprising multiple layers and activation functions. For instance, in a Recurrent Neural Network (RNN) or a Graph Convolutional Network (GCN), $\mathbf{P}_m$ would encapsulate the intricate dependencies between nodes over time, enabling the model to capture non-linear and spatiotemporal correlations within the data.

The learning of $\mathbf{P}_m$ is driven by minimizing a suitable loss function, typically a function of the difference between the predicted and actual values. By training $\mathcal{F}_m$ on their respective datasets, each client aims to improve the accuracy and reliability of their forecasts, which are critical for optimizing resource allocation, scheduling, and overall network efficiency.

In this paper, we employ the enhanced LSTM-DSTGCRN model, which builds upon the strengths of the original DSTGCRN model (Gong et al., 2024). By replacing the Gated Recurrent Unit (GRU) module with a Long Short-Term Memory (LSTM) network, the LSTM-DSTGCRN improves the ability to capture long-term temporal dependencies, particularly critical in transport demand forecasting. Unlike carbon emissions forecasting (the original application of the DSTGCRN model), where temporal patterns tend to evolve more gradually, transport demand often exhibits highly dynamic and recurring long-term trends, such as daily commuting patterns, seasonal variations, and event-driven surges. The integration of LSTM enables the model to better handle these complex temporal dynamics, making it more effective for transportation applications. So, in our case, each $\mathcal{F}_m$ in (1) is an LSTM-DSTGCRN model specifically configured for client $m$, and $\mathbf{P}_m$ contains multiple layers of three modules, each playing a vital role in capturing the spatiotemporal patterns in their respective forecasting tasks. The LSTM-DSTGCRN model and its parameter training are detailed in Section 4.

## 3.2. Federated learning in spatiotemporal data forecasting

In real-world scenarios, spatiotemporal data is often distributed across multiple entities or clients, each responsible for managing specific tasks within a designated geographic area or domain. For example, in transportation, clients may oversee different transport modes (e.g., taxis, buses, or bike-sharing systems) or operate in distinct regions. Similarly, in other domains such as energy consumption or environmental monitoring, clients may manage data from different sensors, zones, or systems.

This decentralized setup inherently limits each client's dataset to the specific characteristics of their local environment, leading to fragmented and incomplete data. Consequently, the data collected by any single client often lacks the comprehensive coverage needed to fully capture the diverse range of patterns, seasonal variations, and dynamic
interactions present in spatiotemporal systems. This fragmentation creates a significant
barrier to developing robust and generalizable forecasting models, as the insights derived
from one client's data may not adequately represent the broader system dynamics.

Sharing datasets between clients could significantly enhance forecasting performance by providing access to a broader range of insights and patterns across diverse datasets. For instance, in transportation, combining data from multiple transport modes or regions could lead to more accurate and resilient models. Similarly, in OD matrix forecasting, collaboration between entities managing different zones could improve the prediction of trip flows across the entire network.

However, privacy concerns and data ownership restrictions add complexity to this scenario. Many organizations are unwilling or unable to share raw data due to the sensitive nature of the information, which may include proprietary details, personally identifiable data, or other confidential attributes.

Therefore, it is crucial to develop a method that can leverage the collective knowl-
edge of all clients without requiring them to share their raw data. By doing so, we can
overcome the limitations of individual datasets and create a more holistic and accurate
forecasting model. This is where FL comes into play. FL allows clients to collaboratively
train a global model that captures a wider range of spatiotemporal patterns, improv-
ing the overall predictive performance for each client. This is particularly valuable in
applications such as multimodal transport demand forecasting, OD matrix prediction,
energy demand estimation, and environmental monitoring, where the ability to model
complex spatial and temporal dependencies is critical.

The privacy-preserving constraints of FL necessitate that both the learning and test-
ing processes are conducted independently for each client. This ensures that no sensitive
information, including the scale, structure, or specifics of the data, is revealed. These
constraints are critical in maintaining the confidentiality of each client's data, which can
include proprietary information and personally identifiable data.

Figure 1 illustrates the detailed workflow of a general FL process for spatiotemporal data forecasting. The numbered steps are as follows: In step ①, each client begins with their local training data, specific to their domain or region. The data is pre-processed to clean and prepare it for model training. Pre-processing steps typically include normalization, feature extraction, and handling missing values. In step ②, clients independently train local models using this data, optimizing parameters to fit their unique traffic patterns. After training, clients generate updates (e.g., gradients or model weights) and transmit these to a central server, ensuring privacy by not sharing raw data. The central server aggregates these updates to form a global model (step ③), using aggregating techniques like federated averaging (FedAvg McMahan et al. (2016)) or Attentive scheme (Li and Liu (2024)) to combine local model parameters. This global model benefits from diverse data patterns, enhancing generalization. The global model is then distributed back to all clients (step ④) for further training with local data. The local training, aggregation, and global model distribution steps (steps ② to ④) are generally iterative and repeated over multiple rounds. During each round, clients refine their local models using the updated global model, and the process continues until the global model
<figure><img src="image_2.png" /><figcaption>Figure 1: The workflow of FL in multimodal transport demand forecasting. Annotation of the steps: ① client feeds pre-processed data into its local model; ② client sends trained parameter to server; ③ server aggregates parameters received from clients; ④ server sends aggregated parameter to clients; ⑤ client feeds pre-processed testing/new data into its model; ⑥ client makes prediction and transforms into the required format.</figcaption></figure>

converges. Convergence is typically achieved when performance improvements plateau or a predefined stopping criterion is met, such as reaching a maximum number of rounds or observing no improvement in validation loss over a specified number of iterations. The final global model is then distributed back to all clients (step ④), with an optional final round of local training. Each client then pre-processes its new or testing data (step ⑤) before using the global model to generate predictions. Lastly, the prediction outputs are post-processed and transformed into the required format (step ⑥).

Although simple aggregation techniques like FedAvg have succeeded in tasks such as text prediction and image recognition, their application in transportation often yields suboptimal results. This is due to the significant heterogeneity among clients, not only in the number of nodes but also in the scale of data and various geographic factors. These differences make it challenging to create a well-performing global model, as the data characteristics in transportation are far more diverse and complex compared to more uniform tasks like text prediction or image recognition.

In this paper, we propose to enhance the FL process by introducing an additional validation step on the client side to validate the aggregated parameters received from the server before integrating them into the local model. This validation can be performed at the layer level or module level, particularly in models comprising multiple modules. In each FL round, we aim to validate each layer/module and their combinations to find
an optimal integration between the aggregated and local parameters, ensuring that the quality of the local parameters is not degraded. The details of our proposed federated scheme will be presented in Section 5.

In the next section, we present the proposed LSTM-DSTGCRN model, which serves as the local prediction models for the clients.

# 4. The proposed LSTM-DSTGCRN model

The Dynamic Spatial-Temporal Graph Convolutional Recurrent Network (DST-GCRN), introduced by Gong et al. (2024), was originally developed for forecasting carbon emissions. However, this versatile model is also highly effective for multimodal transport demand prediction. Its strength lies in its ability to capture spatial relationships and temporal dynamics, making it well-suited for complex and evolving datasets, such as those encountered in transport forecasting. This model integrates three core components: a GRU, an Attention mechanism, and an AGCRN module. Each plays a pivotal role in handling the multifaceted interactions within the data.

Despite its strengths, the GRU can struggle to capture the long-term dependencies often observed in transport data. For example, demand patterns related to seasonal tourist inflows during summer or recurring annual festivals may exhibit trends that extend over several weeks or months, influencing transport needs long after the initial surge. GRU's reliance on simpler gating mechanisms may limit its ability to retain and leverage information from earlier in the sequence over extended periods. In contrast, the LSTM has been shown to excel at capturing such long-term patterns due to its more sophisticated gating mechanisms, including the explicit memory cell that allows it to store information over longer intervals. To better model these temporal dependencies, we propose enhancing the architecture by replacing the GRU with an LSTM network. This enables the model to more effectively learn and predict long-term trends in transport demand data. The resulting model will be referred to as LSTM-DSTGCRN model, and it serves as the local model for the clients in our problem. That means the local models $\mathcal{F}_m$ in (1) are now LSTM-DSTGCRN models, and in this section, we present the functioning of the LSTM-DSTGCRN as a forecasting model tailored for a specific client $m$.

Let $\mathbf{X} \in \mathbb{R}^{T \times N \times D}$ represent a multisource time series dataset, where $T$ is the length, $N$ is the number of nodes, and $D$ is the feature dimension. Let $\mathbf{X}_t \in \mathbb{R}^{N \times D}$ denote the slice at time point $t$ of $\mathbf{X}$, and $\mathcal{X}_t = \{\mathbf{X}_{t-p+1}, \dots, \mathbf{X}_t\}$ denote a set of $p$ recent time steps up to $t$. In our context, as defined in Subsection 3.1, $\mathbf{X}$ is the dataset $\mathcal{D}_m$ for a specific mode of transport $m$, and $D$ consists of one dimension (usually the first) for the transport demand series and $D-1$ others for the exogenous data.

The LSTM-DSTGCRN model processes the multisource time series $\mathbf{X}$ through a series of computational steps designed to model both the spatial and temporal dynamics inherent in the data. This proposed model unfolds into three component modules as follows.
4.1. Long Short-Term Memory (LSTM)

The LSTM is a type of RNN designed to address the vanishing gradient problem commonly encountered in traditional RNNs. It achieves this through a set of gating mechanisms that regulate the flow of information, allowing the network to effectively capture long-term dependencies in sequential data.

Denote $H_t \in \mathbb{R}^{N \times d_h}$ as the hidden state and $C_t \in \mathbb{R}^{N \times d_h}$ as the cell state of the previous time step, where $d_h$ is the hidden dimension. The LSTM module in our model operates as follows:

$$
\begin{align}
F_t &= \sigma([\mathcal{X}_t, H_{t-1}]W_f + b_f), \\
I_t &= \sigma([\mathcal{X}_t, H_{t-1}]W_i + b_i), \\
\tilde{C}_t &= \tanh([\mathcal{X}_t, H_{t-1}]W_c + b_c), \\
C_t &= F_t \odot C_{t-1} + I_t \odot \tilde{C}_t, \\
O_t &= \sigma([\mathcal{X}_t, H_{t-1}]W_o + b_o), \\
H_t &= O_t \odot \tanh(C_t),
\end{align}
$$

in which $F_t$ is the forget gate, $I_t$ is the input gate, $\tilde{C}_t$ is the candidate cell state, $C_t$ is the updated cell state, $O_t$ is the output gate, and $H_t$ is the new hidden state. The operator $\sigma$ denotes the sigmoid function, and $\odot$ denotes the Hadamard product. The learnable parameters include the weight matrices $W_f, W_i, W_c, W_o \in \mathbb{R}^{(D+d_h) \times d_h}$ and the bias vectors $b_f, b_i, b_c, b_o \in \mathbb{R}^{d_h}$, where $d_h$ is the hidden dimension of the LSTM network.

The flow of the LSTM module begins with the calculation of the forget gate $F_t$, which regulates the retention of information from the previous cell state $C_{t-1}$. This is followed by the computation of the input gate $I_t$, determining what new information will be added to the cell state. Concurrently, a candidate cell state $\tilde{C}_t$ is created, representing potential updates to the cell state. The updated cell state $C_t$ is then derived by combining the retained previous state and the new candidate values. Subsequently, the output gate $O_t$ is calculated to decide which parts of the updated cell state will contribute to the new hidden state $H_t$. This process allows the LSTM to effectively manage information flow, maintaining relevant data while discarding the unnecessary, thereby enhancing its capacity to model temporal dependencies in sequential data.

To introduce non-linearity, the output sequence of the LSTM network, i.e., $\mathcal{X}_t' := \{H_{t-p+1}, \dots, H_t\} \in \mathbb{R}^{p \times N \times d_h}$, is then passed through a linear transformation followed by a Rectified Linear Unit (ReLU) activation function as

$$ \mathcal{X}_t'' = \text{ReLU}(\mathcal{X}_t'W_h + b_h), \qquad (3) $$

where $W_h \in \mathbb{R}^{d_h \times d_e}$ and $b_h \in \mathbb{R}^{d_e}$ are learnable weight matrix and bias vector, respectively.

In summary, the sequence $\mathcal{X}_t''$ encodes the temporal dependencies within the input $\mathcal{X}_t'$ through the LSTM module, capturing both short and long-term patterns. The LSTM's ability to manage memory through its gating mechanisms makes it particularly effective for learning sequential patterns in multimodal transport demand forecasting, or in OD matrix forecasting, where long-term dependencies, such as hourly or daily patterns, are crucial.
## 4.2. Multihead attention

Similarly as in Gong et al. (2024), the multihead attention mechanism Vaswani et al. (2017) is a pivotal component in the LSTM-DSTGCRN model, enhancing its ability to capture long-range dependencies in multimodal transport demand data. In the context of our model, the attention mechanism operates on the output of the LSTM module, i.e., the sequence $\mathcal{X}_t''$. The idea is to compute the attention scores associated with each time step and spatial feature, allowing the model to focus more heavily on the most relevant elements within the data. This mechanism captures complex dependencies by assigning different weights to the features, highlighting the areas of the input that are more critical for predicting future transport demand.

For each attention head $k$, the mechanism computes three key vectors: the query $Q_k$, the key $K_k$, and the value $V_k$, which are derived from the input sequence $\mathcal{X}_t''$ using learnable weight matrices:

$$Q_k = \mathcal{X}_t'' W_k^Q, \quad K_k = \mathcal{X}_t'' W_k^K, \quad V_k = \mathcal{X}_t'' W_k^V \quad (4)$$

where $W_k^Q$, $W_k^K$, and $W_k^V$ are learnable weight matrices. The attention scores are calculated by taking the scaled dot product of the query and key vectors, followed by applying a softmax function to normalize the weights:

$$\text{Attention}(Q_k, K_k, V_k) = \text{softmax}\left(\frac{Q_k K_k^T}{\sqrt{d_h}}\right) V_k \quad (5)$$

Here, $d_h$ is the dimension of the key vectors, and the softmax function ensures that the attention scores sum to one, enabling the model to attend more to certain time steps.

After calculating the attention scores for each head, the outputs are concatenated and passed through a linear transformation, combining the information from all attention heads:

$$\mathcal{E}_t = \text{Concat}(\text{head}_1, \dots, \text{head}_G)W^O \quad (6)$$

where $\text{head}_k = \text{Attention}(Q_k, K_k, V_k)$ and $W^O$ is a learnable output weight matrix, and $G$ is the number of attention heads. This final output, $\mathcal{E}_t = \{E_{t-p+1}, \dots, E_t\} \in \mathbb{R}^{p \times N \times d_e}$, is then an enhanced temporal embedding representation of the input $\mathcal{X}_t$.

By incorporating the multihead attention mechanism, the LSTM-DSTGCRN model effectively captures the dynamic interactions in transport data, leading to improved forecasting accuracy. This mechanism allows the model to adaptively prioritize different parts of the input sequence, thereby addressing the challenges of heterogeneity and complexity in the whole network of client.

## 4.3. Adaptive Graph Convolutional Recurrent Network (AGCRN)

The AGCRN model Bai et al. (2020) extends the capabilities of traditional graph convolutional networks (GCNs) by incorporating recurrent structures and adapting to dynamic graph structures. Similarly to Gong et al. (2024), in LSTM-DSTGCRN model,
a dynamic embedding AGCRN is used to model the spatial dependencies among different locations in the transport network. The dynamic embedding AGCRN operations can be described as

$$
\begin{align}
\tilde{A} &= \mathrm{softmax}(\mathrm{ReLU}(E_t E_t^\top)) \nonumber \\
R_t &= \sigma(\tilde{A}[\mathbf{X}_t, \tilde{H}_{t-1}]E_t W_r + E_t b_r), \nonumber \\
U_t &= \sigma(\tilde{A}[\mathbf{X}_t, \tilde{H}_{t-1}]E_t W_u + E_t b_u), \nonumber \\
\hat{H}_t &= \tanh(\tilde{A}[\mathbf{X}_t, U_t \odot \tilde{H}_{t-1}]E_t \hat{W}_h + E \hat{b}_h) \nonumber \\
\tilde{H}_t &= R_t \odot \tilde{H}_{t-1} + (1 - R_t) \odot \hat{H}_t, \tag{7}
\end{align}
$$

where $W_r, W_u, \hat{W}_h \in \mathbb{R}^{d_e \times (D+d_h) \times d_h}$, and $b_r, b_u, \hat{b}_h \in \mathbb{R}^{d_e \times d_h}$ are learnable parameters. In this dynamic embedding approach, the original fixed embedding matrix in Bai et al. (2020) has been replaced by a dynamic one, i.e., $E_t$, which dynamically adjusts the adjacency matrix to better capture the evolving spatial dependencies. Specifically, the adjacency matrix $\tilde{A}$ is computed at each time step based on the dynamic embedding $E_t$, which encodes the temporal and spatial features of the data. This allows the model to adapt the graph structure in real time, reflecting changes in the relationships between nodes as the data evolves. For instance, during peak hours, the adjacency matrix may emphasize stronger connections between nodes with high traffic flow, while during off-peak hours, these connections may weaken. This dynamic adjustment ensures that the model remains responsive to the changing spatial dependencies inherent in transport networks.

Output of this module is a sequence $\mathcal{H}_t = \{\tilde{H}_{t-p+1}, \dots, \tilde{H}_t\} \in \mathbb{R}^{p \times N \times d_h}$ which can be viewed as an encoded version of $\mathcal{X}_t$. From the last element of $\mathcal{H}_t$, i.e., $\tilde{H}_t$, which rollingly captures all spatial and temporal information of previous time steps, we make prediction by

$$[\hat{Y}_{i+1}, \dots, \hat{Y}_{i+Q}] = \tilde{H}_t \tilde{W}_o + \tilde{b}_o, \qquad (8)$$

where $\tilde{W}_o \in \mathbb{R}^{d_h \times Q}$ and $\tilde{b}_o \in \mathbb{R}^Q$ are learnable weight matrix and bias vector of this final output, i.e., the prediction.

### 4.4. Summary of the flow of data

The LSTM-DSTGCRN model integrates the LSTM, Multiahead Attention mechanism, and dynamic-embedding AGCRN in a unified framework to simultaneously capture temporal and spatial dependencies in multimodal transport data. The workflow of the LSTM-DSTGCRN can be summarized as follows:

i. Input processing: Transport demand data is preprocessed and fed into the LSTM to capture temporal dependencies.

ii. Attention mechanism: The output of the LSTM is passed through the multiahead attention mechanism to dynamically weight the importance of different time steps and locations.
iii. Spatial modeling: The weighted outputs are then processed by the AGCRN with dynamic embedding to capture spatial dependencies and interactions across the transport network.

iv. Prediction: The final output of AGCRN is used to predict future transport demand via a linear transformation.

The list of the LSTM-DSTGCRN model's parameters is provided in Table 1 for reference.

<table><caption>Table 1: LSTM-DSTGCRN model parameters</caption><thead><tr><th>Module</th><th>Parameters</th><th>Dimension</th></tr></thead><tbody><tr><td>LSTM</td><td>W<sub>f</sub>, W<sub>i</sub>, W<sub>c</sub>, W<sub>o</sub><br>b<sub>f</sub>, b<sub>i</sub>, b<sub>c</sub>, b<sub>o</sub></td><td>(D + d<sub>h</sub>) × d<sub>h</sub><br>d<sub>h</sub></td></tr><tr><td>Multihead Attention</td><td>W<sub>k</sub><sup>Q</sup>, W<sub>k</sub><sup>K</sup>, W<sub>k</sub><sup>V</sup><br>W<sup>O</sup></td><td>d<sub>h</sub> × d<sub>h</sub><br>Gd<sub>h</sub> × d<sub>e</sub></td></tr><tr><td>AGCRN</td><td>W<sub>r</sub>, W<sub>u</sub>, ˆW<sub>h</sub><br>b<sub>r</sub>, b<sub>u</sub>, ˆb<sub>h</sub></td><td>d<sub>e</sub> × (D + d<sub>h</sub>) × d<sub>h</sub><br>d<sub>e</sub> × d<sub>h</sub></td></tr><tr><td>Final Output</td><td>W̃<sub>o</sub><br>b̃<sub>o</sub></td><td>d<sub>h</sub> × Q<br>Q</td></tr></tbody></table>

In the subsequent sections we can see that integration into a FL framework further enhances our model applicability by enabling collaborative learning across distributed datasets while preserving data privacy.

# 5. The proposed federating schemes

## 5.1. Client-Side Validation (CSV) mechanism

As introduced in Subsection 3.2, our proposed FL scheme incorporates a CSV mechanism to enhance model robustness and accuracy. This novel scheme introduces an additional validation step on the client side before updating the local model with the aggregated parameters received from the server, ensuring that only the most beneficial updates are integrated into the local model.

Let $\mathcal{Z}$ denote the set of indices of layers (or modules, depending on the desired level of validation detail) in the architecture of the model $\mathcal{F}$. The power set of $\mathcal{Z}$ is denoted by $\mathcal{P}(\mathcal{Z})$. For each $S \in \mathcal{P}(\mathcal{Z})$, where $S$ represents a subset of indices of layers or modules, let $\mathbf{P}_{m,S}$ represent the portion of $\mathbf{P}_m$ corresponding to $S$. In our proposed FL scheme, at each FL round, each client has the possibility of a partial update of its layer/module weights. The proposed FL approach is detailed in Algorithm 1.
<caption>**Algorithm 1** Pseudo-code of Fed-LSTM-DSTGCRN model.</caption>

**Input:** $\mathcal{D}_m$: dataset of client $m$ ($m = 1, \dots, M$).
$\mathcal{F}$: architecture for LSTM-DSTGCRN model (shared by all clients).
$R_{\max}$: maximum number of FL rounds.
$E_m$: number of epochs for local training.
**Output:** $\mathbf{P}_m^*$: best performing parameter for each client $m$ ($m = 1, \dots, M$).
1: Initialize $\tilde{\mathbf{P}}^{(0)}$ for $\mathcal{F}$.
2: Distribute $\mathcal{F}$ and $\tilde{\mathbf{P}}^{(0)}$ to all clients.
3: $r \leftarrow 0$ (index for FL round).
4: Initialize $L_m^* \leftarrow \infty, \forall m = 1, \dots, M$ (large initial value to ensure proper update).
5: **repeat**
6: &nbsp;&nbsp;&nbsp;&nbsp;**for** $m = 1, \dots, M$ (possibly in parallel) **do**
7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(Receiving)* Client $m$ receives $\tilde{\mathbf{P}}^{(r)}$ from server.
8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**if** $r = 0$ **then** $\mathbf{P}_m^{(0)} \leftarrow \tilde{\mathbf{P}}^{(0)}$ **end if** $\triangleright$ Initializing, only for the first round.
9: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(Validating)* Client $m$ validates $\tilde{\mathbf{P}}^{(r)}$ using Algorithm 2.
10: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$\tilde{\mathbf{P}}_m^{(r)} \leftarrow$ integrated parameter after validation.
11: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(Training)* Client $m$ trains $\mathcal{F}$ with $\tilde{\mathbf{P}}_m^{(r)}$ as the starting point for $E_m$ epochs.
12: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$\mathbf{P}_m^{(r)} \leftarrow$ obtained parameter after training.
13: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(Sending)* Client $m$ sends $\mathbf{P}_m^{(r)}$ to server for aggregation.
14: &nbsp;&nbsp;&nbsp;&nbsp;**end for**
15: &nbsp;&nbsp;&nbsp;&nbsp;*(Collecting)* Server collects $\mathbf{P}_m^{(r)}$ from all clients $m$.
16: &nbsp;&nbsp;&nbsp;&nbsp;*(Aggregating)* $\tilde{\mathbf{P}}^{(r+1)} \leftarrow$ Aggregate($\mathbf{P}_1^{(r)}, \dots, \mathbf{P}_M^{(r)}$) using FedAvg scheme.
17: &nbsp;&nbsp;&nbsp;&nbsp;*(Distributing)* Server distributes $\tilde{\mathbf{P}}^{(r+1)}$ to all clients.
18: &nbsp;&nbsp;&nbsp;&nbsp;$r \leftarrow r + 1$.
19: **until** $r \ge R_{\max}$ or early stopping condition met.
20: **return** $\mathbf{P}_m^*$ for each client $m, m = 1, \dots, M$.

Specifically, the process begins with the initialization of the model architecture $\mathcal{F}$ and an initial weight $\tilde{\mathbf{P}}^{(0)}$ on the server side. This initial weight, along with the model architecture, are distributed to all participating clients.

The FL process proceeds iteratively over a series of rounds, indexed by $r$. During each round, clients receive the current global parameters $\tilde{\mathbf{P}}^{(r)}$ from the server. In the first round ($r = 0$), clients initialize their local parameters $\mathbf{P}_m^{(0)}$ to match the received global parameters.

A crucial step of this FL approach is the CSV mechanism (line 9 in Algorithm 1). Upon receiving the global parameters, each client temporarily integrates them into its local model and validates these parameters using a local validation dataset $\mathcal{D}_m^{\text{val}}$. More specifically, for each $S \in \mathcal{P}(\mathcal{Z})$, client computes the corresponding validation loss $\mathcal{L}(\mathbf{P}_{m,S}^{(r)}; \mathcal{D}_m^{\text{val}})$, then find the optimal integration $\mathbf{P}_{m,S}^{(r)*}$ to continue the training. This
procedure is described in Algorithm 2.

<caption>**Algorithm 2** Client-Side Validation algorithm</caption>

**Input:** $\mathcal{D}_m^{\text{val}}$: validation data of client $m$.
$\mathbf{P}_m^{(r)}$: local parameter after local training at round $r$.
$\tilde{\mathbf{P}}^{(r)}$: aggregated parameter received from the server.
**Output:** $\tilde{\mathbf{P}}_m^{(r)}$: optimal integration for client $m$ in subsequent learning.

1: Let $\mathcal{Z}$ denote the set of layers (or modules) of $\mathbf{P}_m^{(r)}$.
2: **for each** $S \in \mathcal{P}(\mathcal{Z})$ **do**
3: Replace $S$ in $\mathbf{P}_m^{(r)}$ with corresponding part in $\tilde{\mathbf{P}}^{(r)}$, yielding $\mathbf{P}_{m,S}^{(r)}$ (a candidate for integration).
4: Compute $\mathcal{L}(\mathbf{P}_{m,S}^{(r)}; \mathcal{D}_m^{\text{val}})$, validation loss for client $m$ in case using $\mathbf{P}_{m,S}^{(r)}$.
5: **end for**
6: Find the optimal integration $\mathbf{P}_{m,S*}^{(r)} = \arg \min_{S \in \mathcal{P}(\mathcal{Z})} \mathcal{L}(\mathbf{P}_{m,S}^{(r)}; \mathcal{D}_m^{\text{val}})$.
7: $\tilde{\mathbf{P}}_m^{(r)} \leftarrow \mathbf{P}_{m,S*}^{(r)}$.
8: **return** $\tilde{\mathbf{P}}_m^{(r)}$

A diagram of the proposed CSV mechanism is shown in Figure 2.

Following validation, the client uses the integrated parameters $\tilde{\mathbf{P}}_m^{(r)}$ as the starting point for local training over a specified number of epochs $E_m$. The updated parameters $\mathbf{P}_m^{(r)}$, resulting from this local training, are then transmitted back to the server.

The server collects the updated parameters from all clients and aggregates them using Federated Averaging (FedAvg) scheme to generate the new global parameters $\tilde{\mathbf{P}}^{(r+1)}$. These updated parameters are then distributed to all clients, and the process repeats for the next round.

This iterative FL process continues until the maximum number of rounds $R_{\text{max}}$ is reached, or an early stopping condition is met. Upon completion, the algorithm returns the best-performing parameters $\mathbf{P}_m^*$ for each client, ensuring that each client benefits from the FL process while maintaining the privacy of their local data. The CSV step plays a pivotal role in optimizing model performance across diverse and heterogeneous data sources.

## 5.2. Proposed FL scheme tailored for LSTM-DSTGCR model

AS discussed, the LSTM-DSTGCR model has three main modules: LSTM, Multi-head Attention, and AGCRN. Applying the proposed CSV for the LSTM-DSTGCRN model at module level results in an approach that will be referred to as “LSTM-DSTGCRN + FedAvg + CSV”. In summary, this approach consists of the following steps:

1. **Initialization**: The server initializes the global LSTM-DSTGCRN model and distributes it to all clients.
<figure><img src="image_3.png" /><figcaption>Figure 2: Flow of the Client-Side Validation mechanism.</figcaption></figure>

2. **Local training**: Each client trains the local LSTM-DSTGCRN model on its dataset for some local epochs.

3. **Parameter sharing**: Clients send their locally trained model parameters to the server.

4. **Server-side aggregation**: The server aggregates the received parameters using FedAvg scheme.

5. **Client-side validation**: Upon receiving the aggregated parameters, each client performs the following steps for each subset of the three modules of the LSTM-DSTGCRN:

(a) **Temporary update**: Replace the local modules parameters with the corresponding aggregated parameters.

(b) **Validation**: Compute the validation loss using a local validation set.
(c) **Selective update**: If the validation loss improves, retain the aggregated parameters; otherwise, revert to the original local parameters.

6. **Global update**: The validated and selectively updated local models are used for the next round of local training.

By validating the updates, the framework leverages the strengths of each component while mitigating the impact of any suboptimal parameter updates.

# 6. Experiments

In this section, we present the experiments conducted to evaluate the performance of the LSTM-DSTGCRN model within the proposed FL framework. We begin by describing the datasets used in the study, followed by the experimental setup and the evaluation metrics employed. A comprehensive analysis of the results, including a comparison of the LSTM-DSTGCRN model with other state-of-the-art models (with and without the proposed FL scheme), an ablation study, and the impacts of number of FL rounds, is presented in the subsequent sections.

## 6.1. Datasets

### 6.1.1. Transport demand datasets

For the application of multimodal transport demand forecasting, we utilize three real-world public datasets, which include bike and taxi demand data from New York City (NYC) and Chicago (CHI), as described in Table 2.

<table><caption>Table 2: Datasets description</caption><thead><tr><td>Dataset</td><td>Period</td><td>Number of nodes</td></tr></thead><tbody><tr><td>NYC-Bike<sup>2</sup></td><td>From 01/04/2016 to 30/06/2016</td><td>283</td></tr><tr><td>NYC-Taxi<sup>3</sup></td><td>From 01/04/2016 to 30/06/2016</td><td>263</td></tr><tr><td>CHI-Taxi<sup>4</sup></td><td>From 01/04/2024 to 30/06/2024</td><td>77</td></tr></tbody></table>

The datasets were aggregated at an hourly resolution, resulting in 2184 observations for each node. Our hypothesis is that the transport demand patterns from the datasets can mutually enhance each other, whether they represent the same mode of transportation (e.g., NYC-Taxi and CHI-Taxi) or operate within the same city (e.g., NYC-Taxi and NYC-Bike). In our experiments, we forecast the demand for the next hour based on the 12 most recent demand observations.

<footnote n="2">²https://citibikenyc.com/system-data</footnote>

<footnote n="3">³https://www.nyc.gov/site/tlc/about/tlc-trip-record-data.page</footnote>

<footnote n="4">⁴https://data.cityofchicago.org/Transportation/Taxi-Trips-2024/sa9s-wkhk/</footnote>
### 6.1.2. OD matrix datasets

For the application of OD matrix forecasting, we utilize two private datasets capturing trip patterns in the Lyon urban area, the second-largest city in France by population. The data was collected from two distinct entities: the *Criter System*, an automated road traffic regulation system managed by Greater Lyon's Highways Department, and *Orange Telecom*, a leading telecom operator in France. Our objective is to investigate whether collaboration between these two entities can enhance the forecasting of OD trips for each. For simplicity, we refer to these entities as Lyon PT (stands for public transport) and Orange Telecom, respectively.

The data consists of OD matrices aggregated at 2-hour intervals, except during nighttime (1 AM to 7 AM), where a single aggregation is used. As a result, each day is divided into 10 time slots, and the OD matrix of each slot represents the number of passengers traveling between different locations within the city during that period. The OD data covers six zones: 96091, 96092, 96093, 96094, Lyon (an aggregation of the five zones that make up the city of Lyon), and Outside Urban Area (an aggregation of 77 zones located outside the Lyon urban area). The number of OD pairs (i.e., nodes) is therefore $6 \times 6 - 6 = 30$ for each time slot, in which the “-6” is due to the exclusion of self-loops.

The data was collected for March and September in two separate years: 2021 and 2022. Due to the impact of the Covid-19 pandemic in France, mobility patterns in 2021 differ significantly from those in 2022, prompting us to analyze the two years separately.

## 6.2. Experiment setup

*Data pre-processing:* The pre-processing of datasets on local machines is a crucial step to ensure that the data is appropriately prepared for the FL framework. On each local machine, the dataset is first split into three subsets: a training set (70%), a validation set (20%), and a testing set (10%). Since OD data was collected in two non-consecutive months, we apply the splitting to each month separately (for each year).

Following the data split, the training and validation sets are standardized to follow a normal distribution, which is essential for improving the convergence of the model during training. To maintain the fairness and realism of a real-world scenario, the mean and covariance computed from the training set are stored and later used to standardize the testing set, as well as to de-standardize the predictions to obtain the actual values. This approach ensures that the testing set is standardized in a manner consistent with the data that the model was trained on, preventing data leakage and ensuring the integrity of the evaluation process.

To more effectively capture the underlying temporal patterns in the data, we incorporated additional features by encoding the timeslot of the day and the day of the week, which allows the model to recognize and exploit daily and weekly patterns. Additionally, for transport demand datasets, hourly temperature (°C) and precipitation (mm) were also utilized for predictions, as weather is known to significantly impact transportation. Specifically, for each dataset, we collected hourly weather data in the corresponding
periods in Table 2 from Open-Meteo<fnref n="5" /> platform for all nodes based on their coordinates. So, in addition to the primary transport demand time series, each node includes four additional exogenous time series, resulting in a total feature dimension of five for the final inputs. By incorporating these external factors, we provide the model with richer input, enabling it to better understand and forecast the complex behaviors inherent in transport demand data.

*Technical settings:* To accurately replicate real-world scenarios, we simulate each local machine as an independent Python process, with a dedicated server process or- chestrating the FL process. This setup enables us to closely mimic the decentralized nature of FL, where each client operates independently while coordinating with the central server.

All experiments were conducted on a computing setup equipped with a NVIDIA RTX 3090 GPU, with 24 GB of memory, and a system RAM of 32 GB. The experiments were run using Python 3.11, with CUDA 12.2 and PyTorch 2.4.0 handling the computational backend. We select the initial learning rate based on model complexity. For standard time-series models without graph components (i.e., GRU, LSTM and their federated counterparts), we use an initial learning rate of 0.001. For graph-based models and variants that include graph components (i.e., AGCRN, DSTGCRN, LSTM-DSTGCRN and their federated counterparts), we use a smaller initial learning rate of 0.0001 to improve training stability. For the main results, we report runs with batch size 16 across methods for a fair comparison. For FL experiments in the main text, we used 50 FL rounds with 6 local epochs per round for both transport demand datasets and OD-matrix datasets. For centralized training (i.e., local learning without federation), we implemented early stopping with a patience of 10 epochs based on validation loss. For FL approaches, we monitored validation performance after each FL round as well as after each local epoch within rounds, and we restored the model weights corresponding to the best validation performance after each FL round for final evaluation on the test set. Finally, to ensure transparency and reproducibility, we seeded the random number generator with a conventional value of 42.

## 6.3. Metrics

In our experiments, we evaluate the performance of the proposed model using two widely recognized metrics: Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE). These metrics are defined as follows:

$$ 
\begin{aligned}
\text{MAE} &= \frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i|, \\
\text{RMSE} &= \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2},
\end{aligned}
$$

<footnote n="5">⁵https://open-meteo.com/</footnote>
where $y_i$ is the actual value, $\hat{y}_i$ is the predicted value, and $n$ is the number of predictions made. MAE measures the average magnitude of errors in a set of predictions, without considering their direction, provides a straightforward interpretation of the average prediction error. Whereas, RMSE gives more weight to larger errors, making it sensitive to outliers, it is particularly useful when the consequences of large errors are significant.

# 7. Results and Discussion

In this section, we present the results of our experimental studies conducted on the real-world datasets described earlier (the involving application will be mentioned in the titles of the subsections). We provide a comparison between the local and FL models and discuss the performances of the LSTM-DSTGCRN model with the proposed FL scheme. We also provide some insights into the training process and present the results of the ablation study, which aims to analyze the contributions of individual components within the LSTM-DSTGCRN model. Finally, we investigate the impact of the number of FL rounds on the model's performance and discuss the limitations of the proposed FL scheme.

## 7.1. *Comparison of local models and FL approaches on transport demand datasets*

In this study, we first benchmark our proposed LSTM-DSTGCRN model against several baseline models commonly used in time series analysis and transport demand forecasting. The baselines include:

* Gated Recurrent Unit (GRU): In this baseline, each dataset is treated as a set of multivariate time series, with the GRU model employed to learn temporal dependencies and forecast future values.

* Long Short-Term Memory (LSTM): Similar to GRU, the LSTM model is applied to each multivariate time series dataset to capture long-term dependencies, serving as another important deep learning baseline.

* Adaptive Graph Convolutional Recurrent Network (AGCRN) Bai et al. (2020): An advanced model that combines graph convolutional networks with recurrent neural networks, enabling the capture of complex spatiotemporal dependencies in graph-structured data, making it particularly effective for transport demand forecasting.

* Dynamic Spatial-Temporal Graph Convolutional Recurrent Network (DSTGCRN) Gong et al. (2024): The original model upon which our local model is based, combining graph convolutional and recurrent layers to model dynamic spatiotemporal data.

* LSTM-DSTGCRN: Our proposed model for local training enhances the DSTGCRN by replacing the GRU with LSTM networks. This modification improves the model's ability to capture long-term dependencies, making it better suited to the complex requirements in multimodal transport demand forecasting.
By comparing the performance of our model against these baselines, we can rigorously
evaluate its effectiveness in handling the complexities of transport demand forecasting
across diverse scenarios.

Secondly, we conduct a comparison of various FL approaches to evaluate their ef-
fectiveness in multimodal transport demand forecasting. The approaches compared
include:

* FedGRU Liu et al. (2020): A FL variant of the GRU model, where each client independently trains a GRU model on local data. The locally trained weights are then aggregated on the server using the FedAvg scheme, which helps to enhance overall model performance while maintaining data privacy across clients.

* FedLSTM Zeng et al. (2021): A federated adaptation of the LSTM network, designed to capture long-term dependencies in sequential data. Similar to FedGRU, the FedLSTM approach aggregates locally trained LSTM models at the server, allowing for improved forecasting performance without compromising the privacy of individual clients’ data.

* AGCRN + Attentive Li and Liu (2024): A variant of the AGCRN model (Bai et al., 2020) that incorporates the Attentive FL scheme proposed by Li and Liu (2024), where each client is weighted based on its similarity to others. This allows for a more tailored aggregation process, improving the model’s ability to generalize across different client datasets.

* LSTM-DSTGCRN + Attentive: The proposed LSTM-DSTGCRN model with the Attentive FL scheme proposed by Li and Liu (2024).

* LSTM-DSTGCRN + FedAvg: The proposed LSTM-DSTGCRN model with FedAvg scheme for all modules.

* LSTM-DSTGCRN + FedAvg with CSV: Our proposed FL scheme that integrates a CSV mechanism at the module level, ensuring that only the most beneficial updates are applied. This approach balances collaboration with individual client needs, enhancing the robustness and accuracy of the overall model.

Note that, the model DSTGCRN (Gong et al., 2024) can be viewed as a GRU-
DSTGCRN variant. While other recurrent architectures such as TCN could potentially
enhance model performance, we restrict our analysis to GRU and LSTM-based imple-
mentations to maintain experimental focus.

The overall comparison can be seen in Table 3. This table is read as follows: above
the middle line are the models that are trained locally by each client (using their data
only), while below are the FL approaches. The smallest MAE and RMSE values are
highlighted in bold. The lower the MAE and RMSE values, the better the model’s
performance.
<table><caption>Table 3: Performance comparison of local models on transport demand datasets</caption><thead><tr><th rowspan="2">Model</th><th colspan="2">NYC-Bike</th><th colspan="2">NYC-Taxi</th><th colspan="2">CHI-Taxi</th></tr><tr><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th></tr></thead><tbody><tr><td>GRU</td><td>2.1518</td><td>3.3612</td><td>11.7579</td><td>31.6111</td><td>2.6852</td><td>6.9351</td></tr><tr><td>LSTM</td><td>1.9727</td><td>3.2877</td><td>11.3981</td><td>30.5406</td><td>2.9644</td><td>7.0128</td></tr><tr><td>AGCRN Bai et al. (2020)</td><td>1.9793</td><td><b>2.9422</b></td><td>10.3327</td><td><b>24.1955</b></td><td>2.8162</td><td>6.8642</td></tr><tr><td>DSTGCRN Gong et al. (2024)</td><td>1.9593</td><td>3.0953</td><td>9.9527</td><td>26.4385</td><td>2.4335</td><td>6.6989</td></tr><tr><td>LSTM-DSTGCRN (ours)</td><td>1.8994</td><td>3.0450</td><td>9.8571</td><td>26.3968</td><td>2.6110</td><td>6.6846</td></tr><tr><td>FedGRU Liu et al. (2020)</td><td>2.4897</td><td>3.5930</td><td>11.0238</td><td>31.4011</td><td>2.7614</td><td><b>6.6305</b></td></tr><tr><td>FedLSTM Zeng et al. (2021)</td><td>2.2396</td><td>3.4365</td><td>11.5929</td><td>31.2145</td><td>2.9620</td><td>7.4549</td></tr><tr><td>AGCRN + Attentive Li and Liu (2024)</td><td>2.0143</td><td>3.1892</td><td>11.0276</td><td>27.3424</td><td>3.1452</td><td>8.2231</td></tr><tr><td>LSTM-DSTGCRN + Attentive</td><td>1.9323</td><td>3.2024</td><td>11.2389</td><td>26.1926</td><td>2.5551</td><td>6.8292</td></tr><tr><td>LSTM-DSTGCRN + Attentive + CSV</td><td><b>1.8667</b></td><td>3.4377</td><td>11.7614</td><td>28.3069</td><td><b>2.3127</b></td><td>8.2746</td></tr><tr><td>LSTM-DSTGCRN + FedAvg</td><td>1.9423</td><td>3.3253</td><td>10.3052</td><td>26.8824</td><td>3.3121</td><td>6.9915</td></tr><tr><td>LSTM-DSTGCRN + FedAvg with CSV</td><td>1.8677</td><td>3.1978</td><td><b>9.3249</b></td><td>26.1514</td><td>2.5453</td><td>7.2776</td></tr></tbody></table>

Considering the local models, i.e., above the middle line, the results indicate that our proposed LSTM-DSTGCRN performs competitively, often matching or slightly surpassing the baselines. On the NYC-Bike and NYC-Taxi datasets, LSTM-DSTGCRN achieves the best MAEs (1.8994 and 9.8571, respectively), whereas AGCRN has the lowest RMSE (2.9422 and 24.1955, respectively). This suggests that, in New York city, while the LSTM-DSTGCRN excels in capturing long-term dependencies, the AGCRN is more effective in reducing prediction variance. For the CHI-Taxi dataset, the DSTGCRN has the lowest MAE (2.4335), but the LSTM-DSTGCRN closely follows with an MAE of 2.6110 and the best RMSE (6.6846), demonstrating its robustness in reducing prediction variance. These results suggest that the LSTM-DSTGCRN provides a balanced approach to capturing both long-term temporal and spatial dependencies, showing modest improvements over the original DSTGCRN and other baselines across different datasets.

We observe that the MAE-RMSE divergence is pronounced for LSTM-DSTGCRN + Attentive (+CSV) but much less evident for LSTM-DSTGCRN + FedAvg (+CSV). This difference can be explained from the aggregation mechanism point of view. Attentive aggregation reweights each client's layer updates by how similar they are to other clients. Updates coming from clients that look more alike receive higher weights, while more distinctive clients are downweighted. Combined with CSV, which only accepts modules that improve validation loss, this drives the model toward the high-density, “typical” behavior shared by many clients, results in shrinking the MAE. Whereas, for rare, event-driven demand spikes where some clients' patterns genuinely diverge, the similarity weighting can dilute those locally critical signals. The result can be occasional larger residuals on tail cases, which shows up as a higher RMSE despite an improved MAE. By contrast, FedAvg averages client updates more uniformly and thus does not suppress atypical clients as strongly. When combined with CSV, it continues to reduce frequent errors while preserving more signal from rare regimes, which results in the MAE-RMSE
gap occurring less frequently (only on CHI-Taxi) compared to Attentive+CSV.

Figure 3 visualize the forecasts given by LSTM-DSTGCRN at some random nodes for each of the transport demand dataset.

<figure><img src="image_4.png" /><figcaption>Figure 3: Forecasts given by LSTM-DSTGCRN at some randomly chosen nodes of the transport demand datasets. The dashed lines present the predicted values, the solid lines present the true values.</figcaption></figure>

Considering the FL approaches, i.e., below the middle line, the results demonstrate that the proposed CSV mechanism, either with Attentive or FedAvg schemes, significantly improves the MAEs on all datasets. For example, on NYC-Bike and CHI-Taxi
datasets, the using of CSV mechanism helped the LSTM-DSTGCRN + Attentive and LSTM-DSTGCRN + FedAvg approaches to achieve better MAEs. These results highlight the effectiveness of the proposed CSV mechanism in enhancing the robustness and accuracy of the LSTM-DSTGCRN model.

Overall, on NYC-Bike, LSTM-DSTGCRN + Attentive + CSV gives the best MAE (1.8667), while LSTM-DSTGCRN + FedAvg + CSV follows closely with an MAE of 1.8677, both of them beat all of the local trained models, i.e., without FL. On NYC-Taxi, LSTM-DSTGCRN + FedAvg + CSV achieves the best MAE (9.3249) and RMSE (26.1514), outperforming all other FL approaches and local models. On CHI-Taxi, LSTM-DSTGCRN + FedAvg + CSV also achieves the best MAE (2.3127), and on CHI-Taxi, LSTM-DSTGCRN + Attentive + CSV achieves the best MAE (2.3127), outperforming all other FL approaches and local models. These results highlight the effectiveness of the FL combined with CSV mechanism. In other words, with FL, the clients can collaboratively enhance the model's performance, without compromising data privacy, while the usage of CSV mechanism ensures that only beneficial updates are integrated, thereby improving the overall model performance.

## 7.2. Insights from the training process on transport demand datasets

Figure 4 shows the training losses of the two approaches LSTM-DSTGCRN + FedAvg and LSTM-DSTGCRN + FedAvg + CSV. We can see that the direct integration of aggregated parameters without CSV results in greater fluctuations in training losses. In contrast, the CSV mechanism stabilizes the training process, leading to more consistent and lower losses. This suggests that the CSV mechanism effectively filters out noisy updates, ensuring that only beneficial information is integrated into the local models. This results in more stable and accurate predictions, as evidenced by the improved performance of the LSTM-DSTGCRN + FedAvg + CSV approach over LSTM-DSTGCRN + FedAvg.

<figure><img src="image_5.png" /><figcaption>Figure 4: Training losses of FL for LSTM-DSTGCRN with FedAvg and FedAvg+CSV.</figcaption></figure>

To give an insight into the updates of the modules during the FL process, we visualize the replacements map resulted by LSTM-DSTGCRN + FedAvg + CSV approach in Figure 5. We have trained the model for 50 FL rounds, and at each round, we record the module that was replaced by the aggregate one received from the server. The colored boxes indicate that at that FL round, the corresponding module(s) was/were replaced by the aggregate one(s) received from server. The results show that the LSTM module is updated more frequently than the other modules, and the NYC-Bike and NYC-Taxi
datasets have more frequent updates than the CHI-Taxi dataset. This suggests that these two clients are more active in the FL process, contributing more to the model's overall performance. Whereas, the CHI-Taxi dataset has fewer updates, indicating that the client's data may be less relevant (temporally and spatially) to the other clients' datasets.

<figure><img src="image_6.png" /><figcaption>Figure 5: Module replacements map resulted by LSTM-DSTGCRN + FedAvg with CSV approach. The colored boxes indicate that at that FL round, the corresponding module was replaced by the aggregate one received from server.</figcaption></figure>

Finally, to illustrate the complexity of the models and the communication overhead during the FL process, Table 4 reports the number of parameters and the payload size for each local model in our experiments. As shown, the graph-based models require significantly larger payloads compared to GRU and LSTM. However, the payload sizes remain relatively small, suggesting that communication overhead is unlikely to become a major bottleneck during the FL process.
<table><caption>Table 4: Parameter and payload size of the approaches.</caption><thead><tr><th>Model</th><th>Number of parameters</th><th>Payload size</th></tr></thead><tbody><tr><td>GRU</td><td>2753</td><td>14.81 KB</td></tr><tr><td>LSTM</td><td>3665</td><td>18.46 KB</td></tr><tr><td>AGCRN Bai et al. (2020)</td><td>119269</td><td>486.97 KB</td></tr><tr><td>DSTGCRN Gong et al. (2024)</td><td>121021</td><td>501.75 KB</td></tr><tr><td>LSTM-DSTGCRN (ours)</td><td>121933</td><td>505.39 KB</td></tr></tbody></table>

### 7.3. Ablation study of the LSTM-DSTGCRN model for transport demand datasets

To underscore the critical importance of each component within the LSTM-DSTGCRN model, we conduct an ablation study for the transport demand datasets. This study systematically examines the contribution of individual components–namely, the LSTM, Multiahead Attention (MA) mechanism, and AGCRN, by selectively removing or altering them and observing the impact on model performance. Through this approach, we aim to quantify the significance of each component in capturing the complex spatiotemporal dependencies inherent in multimodal transport demand forecasting. By isolating the effects of these components, we can better understand their roles and the synergies they create within the overall model architecture, thereby validating the enhancements introduced in our modified approach.

<table><caption>Table 5: Ablation study of LSTM-DSTGCRN model on transport demand datasets</caption><thead><tr><th rowspan="2">Model</th><th colspan="2">NYC-Bike</th><th colspan="2">NYC-Taxi</th><th colspan="2">CHI-Taxi</th></tr><tr><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th></tr></thead><tbody><tr><td>Without LSTM</td><td>1.9408</td><td>3.1432</td><td>10.1305</td><td><strong>26.1436</strong></td><td>3.3061</td><td>6.9760</td></tr><tr><td>Without MA</td><td>1.9143</td><td>3.1485</td><td>9.9951</td><td>27.0137</td><td>2.9370</td><td>6.8889</td></tr><tr><td>Without LSTM and MA</td><td>1.9661</td><td>3.1658</td><td>10.6862</td><td>26.7259</td><td>2.9259</td><td>6.9825</td></tr><tr><td>LSTM-DSTGCRN (our)</td><td><strong>1.8994</strong></td><td><strong>3.0450</strong></td><td><strong>9.8571</strong></td><td>26.3968</td><td><strong>2.6110</strong></td><td><strong>6.6846</strong></td></tr></tbody></table>

Table 5 presents the results of our ablation study on the three datasets. The metrics clearly demonstrate that each module within the LSTM-DSTGCRN model contributes significantly to its overall performance. The removal or alteration of any component, whether it be the LSTM, MA mechanism, leads to a noticeable decline in accuracy, as evidenced by increases in both MAE and RMSE. These findings underscore the critical role that each module plays in capturing the intricate spatiotemporal patterns and dependencies necessary for accurate transport demand forecasting.

### 7.4. Comparison of local models and FL approaches on OD matrix datasets

Table 6 provides a comparison of the performances of LSTM-DSTGCRN, GRU, and LSTM models with and without FL across two years (2021 and 2022) and two clients (Lyon PT and Orange Telecom) for OD matrix forecasting.
<table><caption>Table 6: Comparison of the local learning and federated learning across years and clients</caption><thead><tr><th rowspan="3">Model</th><th colspan="4">2021</th><th colspan="4">2022</th></tr><tr><th colspan="2">Lyon PT</th><th colspan="2">Orange Telecom</th><th colspan="2">Lyon PT</th><th colspan="2">Orange Telecom</th></tr><tr><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th><th>RMSE</th></tr></thead><tbody><tr><td>GRU (locally)</td><td>55.0299</td><td>134.6204</td><td>780.2223</td><td>1515.2890</td><td>47.5444</td><td>129.3204</td><td>927.7017</td><td>1645.8309</td></tr><tr><td>LSTM (locally)</td><td>89.1214</td><td>278.9800</td><td>788.6166</td><td>1487.3965</td><td>86.2957</td><td>284.2191</td><td>925.4053</td><td>1617.0138</td></tr><tr><td>LSTM-DSTGCRN (locally)</td><td><strong>42.3453</strong></td><td><strong>107.7701</strong></td><td>722.3093</td><td>1137.5153</td><td>46.7632</td><td>158.5128</td><td>607.1526</td><td>939.9001</td></tr><tr><td>FedGRU</td><td>96.8846</td><td>264.2408</td><td>773.3111</td><td>1525.6516</td><td>68.1231</td><td>160.2127</td><td>978.3316</td><td>1701.6402</td></tr><tr><td>FedLSTM</td><td>92.0171</td><td>330.3783</td><td>780.8315</td><td>1423.6266</td><td>93.6214</td><td>283.8421</td><td>1061.4070</td><td>1711.0444</td></tr><tr><td>LSTM-DSTGCRN + FedAvg</td><td>58.2769</td><td>127.7215</td><td><strong>693.0593</strong></td><td><strong>1099.7407</strong></td><td>44.0000</td><td>179.1663</td><td><strong>579.1404</strong></td><td><strong>833.5996</strong></td></tr><tr><td>LSTM-DSTGCRN + FedAvg + CSV</td><td>46.1419</td><td>123.1041</td><td>737.1721</td><td>1193.0021</td><td><strong>36.8111</strong></td><td><strong>89.4602</strong></td><td>636.3386</td><td>917.6329</td></tr></tbody></table>

The comparison demonstrates the effectiveness of the proposed FL framework in enhancing forecasting accuracy compared to local learning methods. Notably, the LSTM-DSTGCRN model consistently achieves superior performance across all metrics, outperforming the GRU and LSTM models in both local and federated settings. This highlights its ability to effectively capture the spatiotemporal dependencies inherent in the OD data. Among the FL approaches, the integration of the CSV mechanism improves the model's performance on Lyon PT's data, but not on Orange Telecom's data. We attribute this differential behavior to differences in data scale and industrial context. By construction, Orange's dataset is multimodal, encompassing not only public transport but also other transportation modes, and operates at a significantly higher scale than Lyon PT (as can be seen in Figure 8). This scale difference may amplify the performance variations between methods, making subtle improvements less apparent in absolute terms. However, the CSV mechanism still provides valuable benefits for the Orange dataset. As demonstrated in Figure 6 (and discussed again later), the FedAvg + CSV approach (red line) closely tracks the FedAvg baseline (blue line) while exhibiting considerably greater stability throughout training, highlighting the beneficial effect of CSV in terms of prediction reliability even when absolute performance gains are minimal.

The results in Table 6 emphasize again the advantages of FL in leveraging collaborative training while preserving data privacy, particularly in 2022, where it demonstrates improvements for both clients. These findings underscore the practicality of the proposed FL framework for OD matrices forecasting.

Figure 6 shows the validation losses of the three approaches: LSTM-DSTGCRN with local learning, LSTM-DSTGCRN + FedAvg, and LSTM-DSTGCRN + FedAvg + CSV. In particular, the LSTM-DSTGCRN with local learning (i.e., without federating) was trained with 300 epochs with early stopping technique (stop if the validation loss does not decrease for 10 consecutive epochs). The FL approaches were trained with 50 FL rounds and 6 local epochs per round. As we can see, for Lyon PT, learning with FedAvg + CSV results in comparable validation loss with local learning, even
better in terms of reliability. For Orange, the FL approaches significantly improve the validation loss compared with local learning. We can see that for both clients, the CSV mechanism improved the stability of the losses, because, as designed, it filters out suboptimal updates, leading to more consistent and reliable model performance.

<figure><img src="image_7.png" /><figcaption>Figure 6: Validation loss of three learning approaches of LSTM-DSTGCRN model for OD data 2022.</figcaption></figure>

Finally, for illustration, we show in Figure 7 and Figure 8 the replacement map and the predictions resulted by LSTM-DSTGCRN + FedAvg + CSV approach for the OD data 2022.

We can see that the LSTM module is updated more frequently than the other modules. This suggests that the clients learned from each other's temporal patterns, which are more relevant to the overall model's performance.

### 7.5. The impacts of number of epochs and FL rounds on OD matrix data

In this subsection, we revisit the 2022 OD datasets to investigate the training runtime and to analyze the impacts of the number of epochs and FL rounds on the performance of the LSTM-DSTGCRN model with the proposed CSV mechanism and FedAvg scheme.

Table 7 summarizes the average runtime for both local and federated approaches corresponding to the experiments reported in Table 6. For local models, the runtime is averaged per epoch, enabling direct comparison of computational cost across architectures. For federated training, the runtime is averaged per round, encompassing local client updates, client-server communication, model aggregation, and the CSV selection process when applicable. As expected, LSTM-DSTGCRN exhibits higher computational demands than the simpler GRU and LSTM baselines, requiring approximately 20 more time per epoch locally. This increase stems from the additional spatiotemporal graph convolution operations and attention mechanisms. The CSV mechanism introduces a modest overhead of approximately 5.5 seconds per round. This overhead reflects the additional computational cost of evaluating and selecting the validation-improving replacements of modules. Despite this increase, all runtimes remain within practical ranges, particularly considering the improved model stability and reliability that CSV provides.
<figure><img src="image_8.png" /><figcaption>Figure 7: Module replacements map resulted by LSTM-DSTGCRN + FedAvg with CSV approach for OD data 2022. The colored boxes indicate that at that FL round, the corresponding module was replaced by the aggregate one received from server.</figcaption></figure>

<table><caption>Table 7: Average runtime across models on Lyon PT 2022 OD data.</caption><thead><tr><th>Model</th><th>Average runtime</th></tr></thead><tbody><tr><td>GRU (locally)</td><td>0.232s/epoch</td></tr><tr><td>LSTM (locally)</td><td>0.341s/epoch</td></tr><tr><td>LSTM-DSTGCRN (locally)</td><td>7.142s/epoch</td></tr><tr><td>FedGRU</td><td>1.512s/round</td></tr><tr><td>FedLSTM</td><td>2.0233s/round</td></tr><tr><td>LSTM-DSTGCRN + FedAvg</td><td>44.351s/round</td></tr><tr><td>LSTM-DSTGCRN + FedAvg + CSV</td><td>49.876s/round</td></tr></tbody></table>

Figure 9 shows validation losses (in log scale) of 5 different learning approaches of LSTM-DSTGCRN: Local learning with 500 epochs, LSTM-DSTGCRN + FedAvg + CSV with four combinations of FL rounds and local epochs (100-5, 50-10, 10-50, 5-100). The results show that the learning process with 50 FL rounds and 10 local epochs per round (blue line) achieves the best performance, with the lowest and most stable validation loss. It is followed closely by the learning process with 100 FL rounds and
<figure><img src="image_9.png" /><figcaption>Figure 8: Forecasts given by LSTM-DSTGCRN + FedAvg with CSV at some random OD pairs. The dashed lines present the predicted values, the solid lines present the true values.</figcaption></figure>

5 local epochs per round (yellow line). These two approaches converge faster than the remaining three configurations. Particularly, the local learning with 500 epochs (black line) fails to provide stable convergence throughout the training process. This suggests that a balance between the number of FL rounds and local epochs is crucial for optimizing the model's performance. The learning process with fewer FL rounds tends to less effective. However, in general the FL processes give better performance than local learning, i.e., learning without collaboration.

### 7.6. Limitations and potential improvements

While our proposed framework shows improvements over existing methods, there are still some limitations and areas for future work:

* **Cost of CSV step:** Although the CSV mechanism improves model performance, it may introduce additional computational costs due to the validation process, especially for clients wish to validate at layer level or for deeper models. In these cases, the issue can be mitigated by ranking modules according to their gradient magnitudes (gradient-based importance) and validating only top-$k$ most important modules. Alternatively, an early stopping strategy can be applied, where the
<figure><img src="image_10.png" /><figcaption>Figure 9: Impact of number of FL rounds and local epochs on learning process of LSTM-DSTGCRN model for OD data 2022 (LL stands for locally learning).</figcaption></figure>

validation process is terminated once marginal improvements fall below a predefined threshold. In addition, validating only the top-k most influential modules can substantially reduce the computational cost of CSV, since the validation step scales linearly with the number of modules inspected; This strategy preserves the intended behavior of CSV, i.e., filtering out suboptimal updates, while keeping the per-round overhead modest, especially in deeper architectures or in settings with many clients.

* **Scalability:** Although the framework is designed to scale across multiple clients, similarly to the other FL framework, the communication overhead and computational complexity may increase with the number of clients. Future work could explore more efficient communication protocols and model compression techniques.

* **Data heterogeneity:** While the CSV mechanism addresses data heterogeneity to some extent, further improvements could be made by incorporating more sophisticated methods for handling diverse data distributions. The combinations of FedProx (Li et al., 2020), FedOpt (Reddi et al., 2021), or FedDyn (Acar et al., 2021) with CSV could be potential as these approaches are complementary, the former modify the update rule or adds regularization to stabilize training across non-IID clients, while the latter introduces an additional validation before accepting the aggregated parameter.

* **Security & privacy-preserving:** CSV also acts as a lightweight local filter that reduces the propagation of low-quality or potentially corrupted updates, but it is not a full adversarial defense. A thorough security treatment would require pairing CSV with robust aggregation/defense mechanisms or privacy tools (e.g., secure aggregation).

* **Extending to other domains:** The framework could be extended to other domains with similar spatiotemporal dynamics, such as energy consumption forecasting, environmental monitoring, or communication to validate its generalizability
and effectiveness. In energy consumption forecasting, we have graph structure
with consumption points as nodes and power transmission lines as edges. We have
also seasonal patterns and long-term dependencies as common as in transporta-
tion. However, for realistic applications in power grid management, incorporating
physical power flow constraints and grid capacity limitations becomes essential
to ensure feasibility of the predicted consumption patterns. For environmental
monitoring problems, such as air quality forecasting or water quality forecasting,
monitoring stations form nodes with atmospheric connections as edges. These
data exhibit also seasonal patterns, long-term dependencies and different regions
can mutually enhance their forecasting models through hidden pattern sharing via
FL. Finally, in communication domain, traffic flows in mobile networks represent
the movement of data packets between users and the network infrastructure that
could be modeled as a graph structure where cellular towers or base stations serve
as nodes and communication links or coverage overlaps form the edges.

In conclusion, the proposed FL framework with LSTM-DSTGCRN and CSV presents a significant advancement in spatiotemporal forecasting, with promising results across multimodal transport demand and OD matrix datasets.

8. Conclusion

In this paper, we proposed an advanced FL framework to address the challenges of spatiotemporal data forecasting in diverse applications, including multimodal transport demand and OD matrix forecasting. By leveraging the enhanced LSTM-DSTGCRN model, our approach effectively captures the intricate spatial and temporal dependencies inherent in spatiotemporal systems while preserving data privacy through FL.

The LSTM-DSTGCRN model, with its integration of LSTM network, demonstrates superior predictive capabilities. It excels at modeling long-term temporal patterns and dynamic spatial interactions, making it particularly well-suited for applications where data is distributed across multiple entities, such as urban transportation systems and other decentralized spatiotemporal domains. The model's ability to adapt to the dynamic and heterogeneous nature of such systems ensures robust and accurate forecasting.

Our proposed FL framework extends existing methodologies by introducing a novel CSV mechanism. This mechanism allows each client to validate the aggregated parameters received from the server before integrating them into their local models. Experimental results show that the CSV mechanism significantly improves model robustness and accuracy by mitigating the effects of suboptimal updates. For instance, the FL approach with CSV achieved faster convergence and more stable training losses compared to traditional FL methods, as evidenced by experiments on both transport demand and OD datasets.

In conclusion, the integration of the LSTM-DSTGCRN model within an FL framework with CSV represents a significant advancement in spatiotemporal data forecasting. This approach not only enhances model performance but also ensures data privacy and
effectively handles data heterogeneity. Future research could explore further optimiza-
tions and extensions of this framework, including its application to other domains with
similar spatiotemporal dynamics. These extensions would further validate the general-
izability and impact of the proposed framework.

Acknowledgements

This work was supported by the I-SITE FUTURE (reference ANR-16-IDEX-0003), a
program “Investissement d’Avenir” of France 2030, by the exploratory research facility
“EXPLO” of IRT SystemX, and by the ANR project MOBITIC (grant number ANR-
19-CE22-0010).

References

Acar, D.A.E., Zhao, Y., Navarro, R.M., Mattina, M., Whatmough, P.N., Saligrama, V., 2021. Federated learning based on dynamic regularization. URL: https://arxiv.org/abs/2111. 04263, arXiv:2111.04263.

Bai, L., Yao, L., Li, C., Wang, X., Wang, C., 2020. Adaptive graph convolutional recurrent
network for traffic forecasting, in: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., Lin,
H. (Eds.), Advances in Neural Information Processing Systems, Curran Associates, Inc.. pp.
17804-17815. URL: https://proceedings.neurips.cc/paper_files/paper/2020/file/
ce1aad92b939420fc17005e5461e6f48-Paper.pdf.

Casella, B., Esposito, R., Cavazzoni, C., Aldinucci, M., 2023. Benchmarking fedavg and fedcurv for image classification tasks. URL: https://arxiv.org/abs/2303.17942, arXiv:2303.17942.

Chen, F., Qi, Y., Wang, J., Chen, L., Zhang, Y., Shi, L., 2023. Temporal metrics based aggregated graph convolution network for traffic forecasting. Neurocomputing 556, 126662. URL: https://www.sciencedirect.com/science/article/pii/S0925231223007853, doi:https://doi.org/10.1016/j.neucom.2023.126662.

Chen, K., Chen, F., Lai, B., Jin, Z., Liu, Y., Li, K., Wei, L., Wang, P., Tang, Y., Huang, J., Hua, X.S., 2020. Dynamic spatio-temporal graph-based cnns for traffic flow prediction. IEEE Access 8, 185136-185145. doi:10.1109/ACCESS.2020.3027375.

Ge, L., Li, H., Liu, J., Zhou, A., 2019. Temporal graph convolutional networks for traffic speed prediction considering external factors, in: 2019 20th IEEE International Conference on Mobile Data Management (MDM), pp. 234-242. doi:10.1109/MDM.2019.00-52.

Gong, M., Zhang, Y., Li, J., Chen, L., 2024. Dynamic spatial-temporal model for carbon emission forecasting. Journal of Cleaner Production 463, 142581. URL: https://www.sciencedirect.com/science/article/pii/S0959652624020298, doi:https://doi.org/10.1016/j.jclepro.2024.142581.
Guo, K., Hu, Y., Qian, Z., Liu, H., Zhang, K., Sun, Y., Gao, J., Yin, B., 2021. Optimized graph convolution recurrent neural network for traffic prediction. IEEE Transactions on Intelligent Transportation Systems 22, 1138-1149. doi:10.1109/TITS.2019.2963722.

Guo, S., Lin, Y., Feng, N., Song, C., Wan, H., 2019. Attention based spatial-temporal graph convolutional networks for traffic flow forecasting. Proceedings of the AAAI Conference on Artificial Intelligence 33, 922-929. URL: https://ojs.aaai.org/index.php/AAAI/article/view/3881, doi:10.1609/aaai.v33i01.3301922.

Hu, J., Lin, X., Wang, C., 2022. Dstgn: Dynamic spatial-temporal graph convolutional network for traffic prediction. IEEE Sensors Journal 22, 13116-13124. doi:10.1109/JSEN.2022.3176016.

Hu, N., Zhang, D., Xie, K., Liang, W., Li, K.C., Zomaya, A.Y., 2024. Dynamic multi-scale spatial-temporal graph convolutional network for traffic flow prediction. Future Generation Computer Systems 158, 323-332. URL: https://www.sciencedirect.com/science/article/pii/S0167739X24001948, doi:https://doi.org/10.1016/j.future.2024.04.052.

Huang, R., Huang, C., Liu, Y., Dai, G., Kong, W., 2020. Lsgcn: Long short-term traffic prediction with graph convolutional networks, in: Bessiere, C. (Ed.), Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, International Joint Conferences on Artificial Intelligence Organization. pp. 2355-2361. URL: https://doi.org/10.24963/ijcai.2020/326, doi:10.24963/ijcai.2020/326. main track.

Kipf, T.N., Welling, M., 2017. Semi-supervised classification with graph convolutional networks, in: International Conference on Learning Representations. URL: https://openreview.net/forum?id=SJU4ayYgl.

Konecný, J., McMahan, H.B., Yu, F.X., Richtárik, P., Suresh, A.T., Bacon, D., 2016. Federated learning: Strategies for improving communication efficiency. ArXiv abs/1610.05492. URL: https://api.semanticscholar.org/CorpusID:14999259.

Li, C., Liu, W., 2024. Multimodal transport demand forecasting via federated learning. IEEE Transactions on Intelligent Transportation Systems 25, 4009-4020. doi:10.1109/TITS.2023.3325936. publisher Copyright: IEEE.

Li, Q., He, B., Song, D., 2021. Model-contrastive federated learning. URL: https://arxiv.org/abs/2103.16257, arXiv:2103.16257.

Li, T., Sahu, A.K., Zaheer, M., Sanjabi, M., Talwalkar, A., Smith, V., 2020. Federated optimization in heterogeneous networks. URL: https://arxiv.org/abs/1812.06127, arXiv:1812.06127.

Liu, Y., Yu, J.J.Q., Kang, J., Niyato, D., Zhang, S., 2020. Privacy-preserving traffic flow prediction: A federated learning approach. IEEE Internet of Things Journal 7, 7751-7763. doi:10.1109/JIOT.2020.2991401.
Lu, B., Gan, X., Jin, H., Fu, L., Zhang, H., 2020. Spatiotemporal adaptive gated graph convolution network for urban traffic flow forecasting, in: Proceedings of the 29th ACM International Conference on Information & Knowledge Management, Association for Computing Machinery, New York, NY, USA. p. 1025-1034. URL: https://doi.org/10.1145/3340531.3411894, doi:10.1145/3340531.3411894.

McMahan, H.B., Moore, E., Ramage, D., Hampson, S., y Arcas, B.A., 2016. Communication-efficient learning of deep networks from decentralized data, in: International Conference on Artificial Intelligence and Statistics. URL: https://api.semanticscholar.org/CorpusID:14955348.

Reddi, S., Charles, Z., Zaheer, M., Garrett, Z., Rush, K., Konečný, J., Kumar, S., McMahan, H.B., 2021. Adaptive federated optimization. URL: https://arxiv.org/abs/2003.00295, arXiv:2003.00295.

Sepasgozar, S.S., Pierre, S., 2022a. Fed-ntp: A federated learning algorithm for network traffic prediction in vanet. IEEE Access 10, 119607-119616. doi:10.1109/ACCESS.2022.3221970.

Sepasgozar, S.S., Pierre, S., 2022b. Network traffic prediction model considering road traffic parameters using artificial intelligence methods in vanet. IEEE Access 10, 8227-8242. doi:10.1109/ACCESS.2022.3144112.

Shi, Y., Zhang, L., Lu, S., Liu, Q., 2023. Short-term demand prediction of shared bikes based on lstm network. Electronics 12. URL: https://www.mdpi.com/2079-9292/12/6/1381, doi:10.3390/electronics12061381.

Shu, W., Cai, K., Xiong, N.N., 2022. A short-term traffic flow prediction model based on an improved gate recurrent unit neural network. IEEE Transactions on Intelligent Transportation Systems 23, 16654-16665. doi:10.1109/TITS.2021.3094659.

Song, C., Lin, Y., Guo, S., Wan, H., 2020. Spatial-temporal synchronous graph convolutional networks: A new framework for spatial-temporal network data forecasting, in: Proceedings of the AAAI Conference on Artificial Intelligence, pp. 914-921. doi:10.1609/aaai.v34i01.5438.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L.u., Polosukhin, I., 2017. Attention is all you need, in: Guyon, I., Luxburg, U.V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., Garnett, R. (Eds.), Advances in Neural Information Processing Systems, Curran Associates, Inc. URL: https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf.

Xia, Z., Zhang, Y., Yang, J., Xie, L., 2024. Dynamic spatial-temporal graph convolutional recurrent networks for traffic flow forecasting. Expert Systems with Applications 240, 122381. URL: https://www.sciencedirect.com/science/article/pii/S095741742302883X, doi:https://doi.org/10.1016/j.eswa.2023.122381.

Xu, J., Rahmatizadeh, R., Bölöni, L., Turgut, D., 2017. A sequence learning model with recurrent neural networks for taxi demand prediction, in: 2017 IEEE 42nd Conference on Local Computer Networks (LCN), pp. 261-268. doi:10.1109/LCN.2017.31.
Yu, B., Yin, H., Zhu, Z., 2017. Spatio-temporal graph convolutional neural network: A deep learning framework for traffic forecasting. CoRR abs/1709.04875. URL: http://arxiv.org/abs/1709.04875, arXiv:1709.04875.

Yuan, X., Chen, J., Yang, J., Zhang, N., Yang, T., Han, T., Taherkordi, A., 2023. Fedstn: Graph representation driven federated learning for edge computing enabled urban traffic flow prediction. IEEE Transactions on Intelligent Transportation Systems 24, 8738-8748. doi:10.1109/TITS.2022.3157056.

Yuan, X., Chen, J., Zhang, N., Zhu, C., Ye, Q., Shen, X.S., 2022. Fedtse: Low-cost federated learning for privacy-preserved traffic state estimation in iov, in: IEEE INFOCOM 2022 - IEEE Conference on Computer Communications Workshops (INFOCOM WKSHPS), pp. 1-6. doi:10.1109/INFOCOMWKSHPS54753.2022.9798018.

Zeng, T., Guo, J., Kim, K.J., Parsons, K., Orlik, P.V., Cairano, S.D., Saad, W., 2021. Multi-task federated learning for traffic prediction and its application to route planning. 2021 IEEE Intelligent Vehicles Symposium (IV), 451-457 URL: https://api.semanticscholar.org/CorpusID:235803365.

Zhang, S., Li, J., Shi, L., Ding, M., Nguyen, D.C., Tan, W., Weng, J., Han, Z., 2023. Federated learning in intelligent transportation systems: Recent applications and open problems. IEEE Transactions on Intelligent Transportation Systems 25, 3259-3285. URL: https://api.semanticscholar.org/CorpusID:262065551.

Zhang, S., Tong, H., Xu, J., Maciejewski, R., 2019. Graph convolutional networks: a comprehensive review. Computational Social Networks 6, 11. URL: https://doi.org/10.1186/s40649-019-0069-y, doi:10.1186/s40649-019-0069-y.

Zheng, C., Fan, X., Wang, C., Qi, J., 2019. Gman: A graph multi-attention network for traffic prediction. ArXiv abs/1911.08415. URL: https://api.semanticscholar.org/CorpusID:208158373.

Zuo, J., Zeitouni, K., Taher, Y., Garcia-Rodriguez, S., 2023. Graph convolutional networks for traffic forecasting with missing values. Data Mining and Knowledge Discovery 37, 913-947. URL: https://doi.org/10.1007/s10618-022-00903-7, doi:10.1007/s10618-022-00903-7.