Introduction
The proliferation of edge devices, such as smart routers, smartphones, and industrial controllers, has led to an explosion of high-frequency time series data. Traditionally, this data is offloaded to the cloud for analysis, raising significant privacy concerns and consuming substantial bandwidth. However, performing real-time classification directly on these resource-constrained devices is challenging. Standard deep learning architectures like Long Short-Term Memory (LSTM) networks or Transformers are often too memory-intensive and power-hungry for tiny processors.
Furthermore, Recurrent Neural Networks (RNNs) frequently suffer from "catastrophic forgetting," where information from the beginning of a long sequence is lost as new data arrives. Most models also require the entire sequence to be available before a reliable prediction can be made. To address these limitations, we propose strAPI (streaming Attentive Power Iteration), a framework designed for efficient, real-time decision-making on the edge.
Methodology: The strAPI Framework
The core innovation of strAPI is the replacement of traditional recurrence with a matrix sketching technique. Instead of maintaining a complex hidden state, the model creates a compact, updatable summary of the data stream that retains its essential characteristics.
Architecture Components
- Temporal Convolutional Network (TCN): This serves as the initial feature extractor, capturing local nonlinear patterns within the raw signal.
- Continuous Augmented Positional Embeddings (CAPE): These embeddings inject necessary temporal order information into the data stream.
- Attentive Power Iteration (API): This is the central mechanism of the model. API functions as an incremental version of Principal Component Analysis (PCA). Unlike standard unsupervised PCA, API incorporates an attention mechanism to weight incoming data batches. This allows the model to dynamically prioritize the most informative parts of the time series for inclusion in the "sketch" (the latent representation $U$).
As shown in the figure above, the API mechanism (b) focuses on "signature" components of the signal compared to standard PCA (a). The incremental nature of the process (c) ensures that the internal sketch is updated as each new data point arrives, requiring only a single pass over the data and minimal storage.
Experimental Evaluation
The strAPI model was evaluated against five diverse public benchmarks to test its robustness across different signal types:
- Google-13: Audio keyword spotting.
- DSA-19: Daily and sports activity sensor data.
- HAR-6: Smartphone-based human activity recognition.
- Handwriting: Smartwatch motion data during alphabet writing.
- Epilepsy: Bio-medical brain disorder recognition.
Key Results and Insights
The experimental results demonstrate that strAPI significantly outperforms traditional benchmarks in both efficiency and accuracy.
Energy and Computational Efficiency
strAPI achieved a 70% reduction in energy consumption compared to LSTMs and was 30–48% more efficient than Shallow RNNs (SRNNs). Computationally, it required only about 20% of the Multiply-Accumulate operations (MACs) of an LSTM, making it highly suitable for low-power hardware. Task completion was also found to be three times faster than LSTM-based approaches.
Accuracy and Early Classification
On long-sequence datasets like Handwriting, strAPI improved accuracy by 45% over baselines. This is attributed to its ability to maintain a weighted summary of the entire stream, effectively solving the catastrophic forgetting problem. Notably, strAPI enables early classification; on the Epilepsy dataset, it reached over 87% accuracy by the second batch of data, well before the full sequence was processed.
Conclusion
By shifting from recurrence to attentive matrix sketching, strAPI provides a scalable solution for real-time time series classification on edge devices. It offers a superior balance of accuracy, speed, and energy efficiency. Future work will focus on addressing "concept drift," where data patterns change over time, and adapting the model for dynamic pattern recognition where class labels might shift mid-stream.
Summary updated