ActiFormer: Sign-Aware Linear Attention for Sensor-Based Human Activity Recognition
- 17 November 2025
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Internet of Things Journal
- Vol. 13 (2) , 3482-3499
Abstract
Human Activity Recognition (HAR) plays a pivotal role in ubiquitous computing. However, it remains constrained by the challenge of balancing fine-grained temporal modeling with real-time efficiency on resource-limited devices. While Transformer-based models excel at capturing long-range dependencies, they suffer from high computational costs, limiting their applicability on resource-constrained devices. Linear attention mechanisms improve efficiency but often discard negative signals and produce overly smooth, high-entropy attention distributions, impairing the extraction of fine-grained patterns and degrading classification accuracy in complex scenarios. In this work, we present ActiFormer, a novel sign-aware linear attention framework tailored for sensor-based HAR to overcome these limitations. To preserve bidirectional signal dynamics, we introduce Sign-Aware Attention, which explicitly models both same-sign and cross-sign interactions between queries and keys, effectively retaining negative signals crucial for accurate recognition. Furthermore, we propose a learnable entropy-scaling function that compensates for the exponential scaling effect lost in linear attention, originally provided by softmax, solving the high-entropy attention weight issue by amplifying the importance of critical temporal points. Extensive experiments on four benchmark HAR datasets demonstrate that ActiFormer consistently outperforms CNNs, standard Transformers, and state-of-the-art linear attention models, both in accuracy and efficiency. Its lightweight design supports real-time inference on edge devices such as the Raspberry Pi 5, highlighting its practical deployability in real-world applications.Keywords
Funding Information
- National Natural Science Foundation of China (62373194)
- Cultivating Plan Program for the Leader in Science and Technology of Yunnan Province, China, (202005AC160005)
- Ten Thousand Talent Plans for Young of Yunnan Province, China (YNWR-QNBJ-2019-188)
This publication has 51 references indexed in Scilit:
- Lightweight transformer-driven multi-scale trapezoidal attention network for saliency detectionEngineering Applications of Artificial Intelligence, 2025
- Attention enhanced machine instinctive vision with human-inspired saliency detectionImage and Vision Computing, 2024
- Transition-aware human activity recognition using an ensemble deep learning frameworkComputers in Human Behavior, 2024
- Visionary vigilance: Optimized YOLOV8 for fallen person detection with large-scale benchmark datasetImage and Vision Computing, 2024
- ATFA: Adversarial Time–Frequency Attention network for sensor-based multimodal human activity recognitionExpert Systems with Applications, 2023
- Transformer-based deep reverse attention network for multi-sensory human activity recognitionEngineering Applications of Artificial Intelligence, 2023
- GRU-INC: An inception-attention based approach using GRU for human activity recognitionExpert Systems with Applications, 2022
- Toward human activity recognition: a surveyNeural Computing and Applications, 2022
- A multibranch CNN-BiLSTM model for human activity recognition using wearable sensor dataThe Visual Computer, 2021
- CNN-SVM Learning Approach Based Human Activity Recognition2020