Gramian Angular Summation Field
- GASF is a nonlinear transformation that encodes time series data into dense, image-like matrices using angular embedding and pairwise cosine summation.
- It enables the application of deep learning models like CNNs and Vision Transformers on transformed time series for biomedical, financial, and autonomous system analyses.
- Its bijective property allows exact recovery of the original normalized series from the matrix diagonal, ensuring robust and lossless encoding of temporal dynamics.
The Gramian Angular Summation Field (GASF) is a nonlinear transformation that encodes univariate or vector time series into two-dimensional, spatially structured matrices, primarily to facilitate feature extraction by deep learning architectures adapted from computer vision. By leveraging angular embedding and pairwise trigonometric interactions, GASF preserves both fine-scale and long-range temporal dependencies in a dense image-like form. This bijective mapping enables lossless or near-lossless encoding of time-series dynamics, supports direct application of 2D convolutions or Vision Transformer modules, and underpins high-performing pipelines for diverse temporal domains including biomedical signals, sensor analytics, autonomous systems, finance, energy, and more.
1. Mathematical Formulation and Derivation
The core GASF transformation operates in three sequential steps:
- Normalization: The input time series is linearly scaled to a compact interval (most commonly or ). For scaling:
or, for scaling:
- Polar Encoding: Each normalized point is mapped to an angle via:
Optionally, a radius is associated, but is not necessary for GASF computation.
- Gramian Matrix Construction: The GASF matrix is constructed as:
Using trigonometric identities:
Diagonal elements encode self-correlation, , enabling (for normalization) exact inversion of the original series from the diagonal (Wang et al., 2015). GASF is symmetric, .
Extensions exist for multivariate settings, such as the GASF image of a vector-valued snapshot in power system operation (Qu et al., 2024), where normalization is performed componentwise, and the -dimensional state vector yields an Gramian.
2. Algorithmic Pipeline and Implementation Aspects
Typical GASF pipelines combine the mathematical construction above with the following steps:
- Rescaling windowed sequences: Sliding or blocking to produce fixed-length segments, possibly with overlap for event-rich classes (Garibo-i-Orts et al., 2023, Soumma et al., 2024).
- Efficient computation: The outer sum enables vectorized calculation of ; complexity is but feasible for moderate via GPU acceleration.
- Image resizing and stacking: Raw GASF is resized (e.g., 32×32, 64×64, 128×128, 224×224) to match 2D-CNN or ViT input, with channel replication for compatibility with standard vision backbones (e.g., ResNet, VGG), or multi-axis stacking for triaxial sensors (Soumma et al., 2024).
- Preprocessing and postprocessing: Optionally, smoothing (e.g., Gaussian blur) combats high-frequency noise, and image intensity is linearly remapped to appropriate input domains (e.g., [0,1] or [0,255]) (Elmir et al., 2023).
GASF construction is robust to local noise, preserves the temporal order, and facilitates recovery of the normalized series values from the main diagonal.
3. Structural Properties and Theoretical Guarantees
Key mathematical and interpretive properties:
- Bijectivity and Invertibility: On -rescaled data, the main diagonal of the GASF allows exact reconstruction of the original normalized series, as (Wang et al., 2015, You et al., 2023).
- Symmetry and Temporal Encoding: GASF images are symmetric and encode temporal correlations of all orders; off-diagonal patterns capture interactions at all lags.
- Noise and Robustness: Elementwise cosine mapping spreads local perturbations, conferring robustness against high-frequency measurement artifacts (Garibo-i-Orts et al., 2023).
- Rotation and Ordering: Time reversal yields a 180-degree rotation of the GASF image (Garibo-i-Orts et al., 2023), preserving the correct correspondence between sequence orientation and spatial pattern.
- Vector and Matrix Notation:
The GASF transformation is theoretically lossless for normalized inputs and largely preserves temporal dynamics relevant for ML tasks.
4. Comparison with Related Time Series Imaging Methods
GASF is one among several time-series-to-image methods, with distinct features and use cases:
| Encoding | Matrix Formula | Encodes | Symmetry |
|---|---|---|---|
| GASF | Sum-phase (global correlation) | Symmetric | |
| Gramian Angular Difference Field (GADF) | Phase difference (local transition) | Skew-symmetric | |
| Markov Transition Field (MTF) | Transitions between quantized values | State co-occurrence | Typically asymmetric |
| Recurrence Plot (RP) | Recurrence of similar states | Binary, symmetric |
GASF distinguishes itself by encoding magnitude co-movement and temporal structure in a strictly symmetric, continuous-valued image. It is distributively robust and compatible with pre-trained 2D-CNNs and ViTs (Wang et al., 2015, You et al., 2023). GADF, its closest sibling, emphasizes local oscillatory or phase-shifted dynamics (Yousuf et al., 2023, Qin et al., 2024); the choice between GASF and GADF is guided by application-specific discriminative needs.
5. Application Domains and Empirical Performance
GASF has been successfully deployed across domains:
- Cardiac and Biomedical Signal Analysis: ECG arrhythmia classification (Elmir et al., 2023), myocardial infarction detection (Yousuf et al., 2023), fNIRS cognitive state discrimination (Wickramaratne et al., 2021), and freezing-of-gait detection in Parkinson’s via wearable sensors (Soumma et al., 2024). GASF-based 2D-CNNs and fusion architectures consistently outperform 1D-CNNs on raw signals, achieving state-of-the-art accuracy (e.g., 99.6% on MIT-BIH, 98.65% on PTB, 99.68-99.82% on MI detection).
- Autonomous Systems and Behavior Analytics: Driving behavior characterization with GAF-ViT, leveraging GASF images of speed, acceleration, and jerk for transformer-based classification (You et al., 2023).
- Financial Forecasting and Transfer Learning: Use of GASF as a pre-processing step for source domain selection, improving time series similarity estimation and reducing forecasting errors (Long et al., 1 Apr 2025).
- Anomalous Diffusion and Single-Particle Tracking: Regression and classification of diffusion regimes and exponents using GASF-encoded trajectory images consumed by ResNet/MobileNet, with improvements over ConvLSTM baselines, especially for short, noisy trajectories (Garibo-i-Orts et al., 2023).
- Power Systems and Operational Scenario Mining: Encoding power system states as GASF images enables deep time series aggregation and unsupervised clustering of grid operational snapshots, using VGG-derived encoders and deep GMM, and yielding superior clustering metrics (Qu et al., 2024).
- Traffic Data Imputation: Generative adversarial networks (TSDIGAN) with GASF input achieve lower MAE and RMSE in high-missingness regimes compared to previous approaches (Huang et al., 2020).
Empirically, GASF enables direct leveraging of powerful vision models (ResNet, VGG, EfficientNet, MobileNet, Vision Transformer) for temporal data, accelerating convergence and supporting sophisticated fusion (e.g., cross-attention, dual streams) (Qin et al., 2024, You et al., 2023).
6. Limitations, Computational Considerations, and Parameter Choices
Critical technical considerations include:
- Quadratic scaling: For a sequence of length , GASF images require storage and computation, making direct use on very long sequences impractical (Wang et al., 2015, Huang et al., 2020). Downsampling, tiling, or sliding windows are used for tractability.
- Normalization sensitivity: The angular embedding is highly sensitive to the quality of normalization; extreme outliers or improper scaling can compress variance into a narrow angular range, reducing discriminative power (Wang et al., 2015, You et al., 2023).
- Temporal resolution and resizing: Resizing to standard model input (e.g., 32×32, 64×64, 224×224) may introduce interpolation artifacts, particularly if the original is far from the target resolution (Qu et al., 2024).
- Single vs. multi-channel construction: For multivariate signals, GASF matrices are computed per channel and stacked as images, or a single GASF is formed by treating the vector snapshot as a “series” over variables (Soumma et al., 2024, Qu et al., 2024).
- Lack of explicit higher-order encoding: GASF emphasizes second-order (pairwise) angular relations; dependencies beyond pairwise are not directly captured, although deep network feature extractors may absorb such patterns (Qu et al., 2024).
- Comparison with hand-crafted features: GASF eliminates the need for manual feature engineering, but tuning of preprocessing and normalization remains nontrivial.
7. Impact, Extensions, and Future Research Directions
GASF has catalyzed a new paradigm in time-series analysis by bridging one-dimensional sequence data and advanced computer vision models. Its bijective, dense, and information-rich encoding has enabled the transfer of deep convolutional and transformer architectures with minimal adaptation, resulting in state-of-the-art results across multiple applications (Wang et al., 2015, Qin et al., 2024, Garibo-i-Orts et al., 2023, Soumma et al., 2024).
Research continues on:
- Hybrid and Multimodal Fusion: Integration with temporal models (1D CNNs, BiLSTM), cross-modal and split-attention mechanisms (as in GAF-FusionNet), and stacked GASF/GADF/MTF channels (Qin et al., 2024, Wang et al., 2015).
- Clustering and Unsupervised Learning: Using GASF images as feature maps for unsupervised embedding and clustering pipelines, such as those based on VGG and GMM for complex operational scenario mining (Qu et al., 2024).
- Interpretability: Visualizing texture patterns and off-diagonal motifs in GASF images to reveal latent temporal structures and anomalies, particularly in biomedical and physiological contexts (Elmir et al., 2023).
- Efficient Scaling: Algorithmic innovations for memory- and computation-efficient GASF computation, including patching, aggregation, or low-rank approximation are active areas of technical development.
- New Domains: Ongoing work is expanding the adoption of GASF encodings to physiological monitoring, industrial systems, and interdisciplinary data fusion settings where robust temporal pattern extraction is crucial.
The GASF framework demonstrates that temporal relational encoding, when combined with deep learning vision architectures, offers a powerful methodology for signal classification, regression, clustering, imputation, and anomaly detection across a broad range of scientific and engineering problems.