Generative modeling for time series has long been a tale of two cities. On one side, models excel at short, high-dimensional sequences but stumble over long-range dependencies. On the other, specialized architectures for long-range data lack the expressiveness to handle shorter, more complex patterns. In a new paper titled "Utilizing Image Transforms and Diffusion Models for Generative Modeling of Short and Long Time Series," researchers propose an elegant solution: stop treating time series like sequences and start treating them like images.
Overview
The authors introduce ImagenTime, a unified framework that transforms time series data into images using invertible transforms (like the Short-Time Fourier Transform or Delay Embeddings). It then applies state-of-the-art vision diffusion models to generate new "data-images," which are subsequently converted back into time series. This approach achieves state-of-the-art results across short, long, and "ultra-long" sequences (up to 17,500 steps), significantly outperforming existing recurrent and transformer-based models.
The Challenge of Time Series Generation
The field of time series generation is currently fragmented due to the inherent trade-offs of different architectures:
- Recurrent Neural Networks (RNNs) are effective for short sequences but suffer from vanishing gradients, making them "forgetful" over long distances.
- Transformers capture long-range dependencies, but their computational cost grows quadratically with sequence length ($O(L^2)$), making them prohibitively expensive for very long data.
- State Space Models (SSMs) are efficient for long sequences but often lack the expressiveness needed for short-term, non-stationary data.
The authors identify a dichotomy where researchers must choose a completely different neural architecture depending on the length of their data. They ask: Can we develop a single, unified framework that handles both high-dimensional short sequences and low-dimensional ultra-long time series?
Methodology: Transform, Diffuse, Invert
The core idea is a three-step pipeline: Transform $\rightarrow$ Diffuse $\rightarrow$ Invert.
- Image Transforms: Instead of feeding raw sequences into a model, the framework uses invertible mathematical transforms to "fold" the data into 2D images.
- Delay Embeddings: This involves arranging the series into columns with a specific "skip" value. It is particularly effective for capturing the underlying dynamics of shorter sequences.
- Short-Time Fourier Transform (STFT): This maps the signal into the frequency domain over time. It acts as a powerhouse for long and ultra-long sequences by compressing massive amounts of temporal information into a compact spatial representation.
- Diffusion Backbone: Once the data is represented as an image, the authors leverage a high-performance vision diffusion model (EDM). This model learns to "denoise" a random field of pixels into a coherent image. By using a vision-based backbone, the framework inherits years of optimization and architectural progress from the computer vision community.
- Inversion: Because the initial transforms are invertible, the generated image can be mathematically mapped back into a standard time series with negligible loss.
Experimental Setup
The authors tested their framework on an exhaustive list of benchmarks spanning various sequence lengths:
- Short-Term: Stocks (Google stock data), Energy (appliance use), MuJoCo (physics simulations), and Sine waves.
- Long-Term: FRED-MD (macroeconomic data), NN5 Daily (cash withdrawals), and Temp Rain (weather).
- Ultra-Long: They introduced a challenging benchmark using San Francisco Traffic (17,544 steps) and KDD-Cup 2018 air quality data (10,920 steps).
- Conditional Tasks: ETT (electricity load), Physionet (ICU health records), and USHCN (climate records) were used for interpolation and extrapolation tests.
Why This Approach Works
- The "Resolution" Advantage: A moderately sized $256 \times 256$ image can represent a time series of up to 65,000 steps. This bypasses the sequential processing bottleneck entirely; the diffusion model sees the "whole picture" at once.
- Architecture Agnosticism: By converting data to a standard image format, the specific nature of the time series becomes secondary to the spatial patterns in the image. This allows a single model architecture to work across vastly different domains.
- Borrowing Maturity: The key insight is realizing that vision models are currently much more mature than time series generative models. Mapping the problem into the vision domain allows researchers to leverage the heavy lifting already done in computer vision.
Performance and Results
The results demonstrate dominance across almost every metric evaluated:
- Unconditional Generation: In short-term tasks, ImagenTime improved the discriminative score (a measure of how realistic the data is) by 58.17% over previous diffusion models.
- Long-Range Superiority: In ultra-long tasks, it showed a 132.61% improvement in classification scores compared to state-of-the-art baselines like LS4.
- Conditional Tasks: For missing data imputation (interpolation), the model was roughly 4 times more accurate than previous best-in-class methods like CRU or ODE-RNN.
- Qualitative Success: As shown above, t-SNE visualizations confirm that the generated data distributions almost perfectly overlap with real-world data, whereas previous state-of-the-art models often exhibited significant "mode collapse" or distribution shifts.
Limitations and Future Directions
While powerful, the approach has a few hurdles:
- Computational Overhead: While inference is efficient, training high-quality diffusion models generally requires more compute than training simple RNNs.
- Hyperparameter Sensitivity: The authors noted that the diffusion backbone can "collapse" if the learning rate is set too high (above $10^{-3}$).
- Future Directions: The authors suggest this "time-series-as-image" foundation could be extended to other tasks like anomaly detection, few-shot learning, and classification, potentially serving as a true foundation model for time series.
Paper Citation: Naiman, I., Berman, N., et al. (2024). Utilizing Image Transforms and Diffusion Models for Generative Modeling of Short and Long Time Series. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).
Summary updated