Abstract
Temporal Domain Generalization (TDG) aims at learning models under temporally evolving data distributions and achieving generalization to unseen future data distributions following the evolving trend. Existing advanced TDG methods learn the evolving patterns through the collective behaviors observed at the population-level of instances, such as time-varying statistics and parameters, tending to overlook the impact of individual-level instance evolving processes on the decision boundary. However, a major obstacle is that datasets at different timestamps may comprise unrelated instances and there is no inherent existence of the instance-level evolving trajectories, which hinders us from learning how the decision boundary changes. To address the above challenges, we propose a Continuous-Time modelling Optimal Transport trajectories (CTOT) framework. Specifically, we utilize optimal transport to align the data distributions between each pair of adjacent source domains to construct instance evolving trajectories. Subsequently, they are modelled by a continuous-time model and extrapolated to generate future virtual instances, which help the model to adapt its decision boundary to the future domain. Extensive experiments on multiple classification and regression benchmarks demonstrate the effectiveness of the proposed CTOT framework.
Introduction
In many real-world applications, such as epidemiology or financial forecasting, data distributions are not static but evolve continuously over time. This phenomenon necessitates Temporal Domain Generalization (TDG), where models must generalize to future, unseen distributions by capturing the underlying temporal trend.
Traditional TDG approaches typically focus on population-level shifts, tracking changes in global statistics (e.g., mean, variance) or model parameter drift. However, these methods often fail to capture fine-grained information necessary for precise decision boundary adjustment, especially in complex, non-Gaussian data. A significant challenge in instance-level modeling is the lack of explicit trajectories; datasets at different timestamps often contain entirely different individuals. Without a "ground truth" path for specific instances, learning the "physics" of the distribution shift becomes difficult.
Methodology: The CTOT Framework
To overcome the absence of instance-level trajectories, we propose the Continuous-Time modelling Optimal Transport trajectories (CTOT) framework. CTOT operates in two primary phases:
1. Instance Evolving Trajectory Mining
Since instances at time $t$ and $t+1$ are typically unrelated, CTOT employs Optimal Transport (OT) to establish a correspondence. By calculating the most efficient transformation between distributions at adjacent timestamps, the model pairs instances across time. This process effectively "mines" synthetic trajectories, representing how data points move through the representation space.
2. Continuous-time Modelling and Extrapolation
Once trajectories are established, they are modeled using Neural Differential Equations (NDEs), such as Neural ODEs or SDEs. Unlike discrete recurrent models, NDEs are well-suited for irregular time intervals and provide smooth extrapolation into the future. To ensure the learned dynamics remain realistic, we introduce an interpolation loss ($L_{itp}$), which acts as a regularization term to maintain consistency between known timestamps.
Finally, the model extrapolates these trajectories to a future timestamp ($T+1$), generating "virtual instances" that allow the model to adapt its decision boundary before encountering real test data.
Experiments and Results
The CTOT framework was evaluated across seven benchmarks, including synthetic datasets (2-Moons, Rot-MNIST) and real-world tasks (Online News Popularity, Electricity demand, House prices, and Appliance energy prediction).
Performance Summary
CTOT consistently outperformed state-of-the-art TDG baselines (e.g., DRAIN, EvoS) in both classification and regression tasks:
- Classification: On the 2-Moons dataset, CTOT achieved a misclassification error of 1.5%, significantly lower than the 3.0% achieved by EvoS.
- Regression: In the Appliance energy prediction task, the SDE variant of CTOT reached a Mean Absolute Error (MAE) of 5.1, compared to 6.1 for the previous best method, DDA.
Sensitivity Analysis
We conducted sensitivity analyses on key hyperparameters, including the KL-divergence weight ($\lambda_{kl}$), the interpolation loss weight ($\lambda_{itp}$), and the interpolation interval ($\epsilon$).
The results indicate that the interpolation loss is vital for preventing erratic dynamics, while the stochasticity in the SDE version often aids generalization by accounting for inherent randomness in future shifts.
Conclusion
The CTOT framework shifts the focus of TDG from population-level statistics to individual instance-level evolution. By leveraging Optimal Transport to synthesize trajectories and NDEs for continuous-time modeling, CTOT provides a robust mechanism for adapting to evolving data distributions. Future work will explore more complex stochastic processes and address the computational scalability of the Optimal Transport step for large-scale datasets.
Code available at: https://github.com/JinYujie99/CTOT
Summary updated