Abstract
Sensor-based human activity recognition (HAR) requires predicting the action of a person based on sensor-generated time series data. HAR has attracted major interest in the past few years, thanks to the large number of applications enabled by modern ubiquitous computing devices. While several techniques based on hand-crafted feature engineering have been proposed, the current state-of-the-art is represented by deep learning architectures that automatically obtain high-level representations and use recurrent neural networks (RNNs) to extract temporal dependencies in the input. RNNs have several limitations, in particular in dealing with long-term dependencies. We propose a novel deep learning framework, TrASenD, based on a purely attention-based mechanism, that overcomes the limitations of the state-of-the-art. We show that our proposed attention-based architecture is considerably more powerful than previous approaches, with an average increment of more than 7% on the F1 score over the previous best-performing model. Furthermore, we consider the problem of personalizing HAR deep learning models, which is of great importance in several applications. We propose a simple and effective transfer-learning-based strategy to adapt a model to a specific user, providing an average increment of 6% on the F1 score on the predictions for that user. Our extensive experimental evaluation proves the significantly superior capabilities of our proposed framework over the current state-of-the-art and the effectiveness of our user adaptation technique.
Introduction
Human Activity Recognition (HAR) leverages data from wearable sensors, such as accelerometers and gyroscopes found in smartphones, to identify physical activities like walking, running, or climbing stairs. Despite its potential in healthcare and fitness tracking, HAR faces two significant challenges. First, the "Temporal Bottleneck": traditional state-of-the-art models rely on Recurrent Neural Networks (RNNs) like LSTMs or GRUs. These process data sequentially, making them computationally inefficient and prone to losing information over long time sequences. Second, the "Personal Problem": movement patterns are highly individual. A generalized model often fails to account for unique gaits or physical nuances, and existing personalization methods are typically too complex for on-device deployment.
The TRASEND Framework
To address these issues, we introduce TRASEND (Attention-Based Deep Learning Framework for Human Activity Recognition). The framework transitions from sequential processing to a parallelized, attention-based approach.
Pure Attention Mechanism
The core innovation of TRASEND is the replacement of recurrent layers with an 8-headed self-attention mechanism, inspired by the Transformer architecture. Unlike RNNs, this mechanism allows the model to observe the entire time sequence simultaneously, "attending" to the most critical moments for a specific activity. This bypasses the sequential limitations of RNNs and captures long-term temporal relationships more effectively.
User Adaptation and Personalization
To handle individual variability, TRASEND employs a lightweight transfer-learning strategy. Rather than retraining the entire complex model, we freeze the feature-extraction layers (CNNs) and only retrain the final output layer using a small amount of user-specific feedback. This approach captures an individual's unique movement "style" without requiring massive datasets or high computational power.
Experimental Evaluation
We evaluated TRASEND on three diverse, multi-modal HAR datasets: HHAR (Heterogeneity Activity Recognition), PAMAP2 (Physical Activity Monitoring), and USC-HAD (University of Southern California Human Activity Dataset). These datasets cover a wide range of subjects, devices, and activities.
Key Results
- Performance Gains: TRASEND consistently outperformed the previous state-of-the-art, DeepSense. On the HHAR dataset, TRASEND achieved an F1 score of 0.848, a 7% improvement over DeepSense's 0.720.
- Personalization Efficacy: The user adaptation module provided a consistent boost, increasing F1 scores by an average of 6% across users.
- Robustness: Through data augmentation (adding artificial noise), the model demonstrated significant resilience to the "messy" nature of real-world sensor data.
Conclusion
TRASEND demonstrates that "pure" attention models are superior to RNNs for multimodal sensor data in HAR. By focusing on the "last mile" of classification for personalization, we provide a path toward highly accurate, individualized activity recognition. Future work will focus on minimizing the user feedback burden through techniques like curriculum learning and further optimizing the architecture for real-time execution on low-power wearable hardware.
Summary updated