Times2D Framework: FSDH Derivative Heatmaps
- Times2D Framework is a forecasting model that uses the FSDH module to extract first and second derivatives from multivariate time series and convert them into 2D heatmaps.
- FSDH computes normalized first and second derivatives to highlight sharp transitions and turning points, addressing nonstationary fluctuations.
- Integrated with a periodic decomposition block, FSDH enhances forecast accuracy by fusing edge-like features with global periodic patterns.
First and Second Derivative Heatmaps (FSDH) are a structured approach for extracting and representing sharp local transitions and turning points in multivariate time series data by leveraging pointwise discrete temporal derivatives. Developed as a core module within the Times2D forecasting framework, FSDH translates 1D sequential data into a 2D tensor format, enabling the use of 2D convolutional architectures for robust feature extraction. This representation addresses the limitations of strictly periodic or spectral decomposition by providing complementary edge-like and inflection-point information crucial for forecasting under nonstationary and highly fluctuating conditions (Nematirad et al., 31 Mar 2025).
1. Mathematical Construction
Given a batch tensor , where is the batch size, the length of the time series, and the feature dimension (channels), the FSDH module computes the following:
- First Derivative:
yielding .
- Second Derivative:
resulting in .
Normalization is performed along the time axis to ensure scale-robustness, either by absolute maximum scaling: or by z-score normalization:
2. Heatmap Tensorization and Convolutional Encoding
The normalized derivatives are stacked along a new "derivative" axis to form the 2D heatmap tensor: which results in .
This tensor serves as input to a shallow 2D convolutional network: where typical parameters are a kernel of size , stride 1, padding 1, 2–3 layers, with ReLU activation and BatchNorm after each convolution. The output is then aggregated (e.g., weighted sum or linear projection) and resized via a head module to for downstream forecasting.
3. Interpretative Role in Time Series Forecasting
The FSDH representation enables explicit modeling of sharp local dynamics:
- The first derivative highlights regions of acute increases or decreases in the series, corresponding to edges or sudden events.
- The second derivative identifies turning points and inflection regions, as sign changes in correlate with local maxima and minima.
Combined, these two maps encode local information about non-stationarity and irregular fluctuations. This is critical for reliably forecasting series with abrupt regime shifts, spikes, or drops, supplementing global periodic summaries.
4. Integration Within the Times2D Framework
The FSDH module is integrated into Times2D alongside the Periodic Decomposition Block (PDB). Both modules independently produce outputs:
- FSDH:
- PDB:
These are fused within the Aggregation Forecasting Block (AFB) via elementwise summation: Alternatively, learnable scalar gating factors may reweight the modules: This architecture supports modular, interpretable, and effective fusion of multiscale periodic structure and local temporal change information (Nematirad et al., 31 Mar 2025).
5. Implementation Details and Hyperparameterization
The FSDH configurations validated in experimental studies include:
| Parameter | Typical Value(s) | Notes |
|---|---|---|
| Input size () | 96 – 1440 | Series segment length |
| Convolutional Layers | 2 or 3 | ConvReLUBatchNorm, 3×3 kernels |
| Channels (per layer) | 32 → 64 → 32 | First layer: 2 input, last layer: output |
| Head | 1×1 conv or linear projection | For mapping |
| Loss | MSE or MAE on | Joint optimization across Times2D modules |
Both convolutional and head parameters, as well as any gating scalars, are trained end-to-end with the rest of the Times2D architecture.
6. Significance and Empirical Performance
FSDH provides a lightweight yet effective 2D "image" of time series derivatives, enabling convolutional architectures to efficiently extract edge-like (first derivative) and corner-like (second derivative) features. Empirical results within the Times2D model demonstrate that, when FSDH is fused with spectral features from the PDB, the combined representation achieves state-of-the-art results in both short-term and long-term multivariate time series forecasting across large-scale benchmarks. This suggests that explicitly capturing local nonstationary transitions, in addition to periodic structure, is crucial for high-fidelity predictive modeling in complex temporal domains (Nematirad et al., 31 Mar 2025).