EdgeHAR: An Edge-Native Compact Sensor Foundation Model for Human Activity Recognition
Authors: He Zhang, Siyu Yuan, Siyu Liu, Sizhen Bian, Bin Guo
Organizations: Northwestern Polytechnical University Xi’an, Shaanxi, China · RPTU University Kaiserslautern-Landau Kaiserslautern, Rheinland Pfalz, Germany · Xi’an University of Technology Xi’an, Shaanxi, China
Sensor-based human activity recognition (HAR) is fundamental to ubiquitous and wearable computing, yet existing foundation models are largely designed for cloud-scale deployment and struggle with real-world sensing shifts, including unseen users, devices, sampling rates, and sensor placements. We present EdgeHAR, an edge-native compact sensor foundation model designed for wearable intelligence. Unlike conventional models that entangle activity knowledge with acquisition variations, EdgeHAR learns transferable representations by factorizing sensor signals into three latent codes: an (i)Activity-Semantic Code capturing reusable activity knowledge, a (ii)Motion-Dynamics Code modeling temporal patterns, and an (iii)Acquisition-Context Code representing sensor-specific variations. This disentangled design enables efficient adaptation to new users, devices, placements, and activity classes with limited target-domain data. By incorporating lightweight adaptation modules, EdgeHAR achieves foundation-model-level transferability while satisfying edge constraints in computation, memory, latency, and privacy. Experiments across heterogeneous HAR datasets demonstrate that EdgeHAR maintains competitive recognition performance under distribution shifts with substantially reduced deployment cost. EdgeHAR establishes a practical paradigm for compact, edge-first foundation models for ubiquitous sensing systems.
Figures & tables
Figure 1. Overview of EdgeHAR
Dataset
Subjects
Sensors
Position
Rate
Classes
HHAR ( Stisen et al., 2015 )
9
acc+gyro
Multiple
50 HZ
6
MotionSense ( Malekzadeh et al., 2019 )
24
acc+gyro
Pocket
50 HZ
6
UCI-HAR ( Reyes-Ortiz et al., 2016 )
30
acc+gyro
Waist
50 HZ
6
Shoaib ( Shoaib et al., 2014 )
10
acc+gyro+mag
Multiple
50 HZ
7
PAMAP2 ( Reiss and Stricker, 2012 )
9
acc+gyro+mag
Multiple
100 HZ
18
Table 1. Statistics of wearable sensing datasets used for EdgeHAR pretraining and evaluation.
Source
Target
SDMix
Contrast -Sense
CrossHAR
OUR-ZS
OUR-FS
S+M+H
UCI
75.38
79.43
88.71
62.85
92.15
U+S+H
Motion
64.16
53.20
76.12
54.23
88.68
H+U+M
Shoaib
70.11
63.83
73.52
58.62
86.28
S+U+M
HHAR
71.10
71.75
74.36
47.12
92.45
Table 2. Multi-source cross-dataset transfer performance (ACC%). ZS is zero-short and FS is few-short.
Source
Target
Transformer
UniHAR
LLM4HAR
OUR-ZS
OUR-FS
UCI
Shoaib
25.99
69.90
74.98
63.32
90.70
Motion
35.64
76.08
87.09
62.45
88.23
HHAR
44.52
75.43
85.75
61.08
96.08
Motion
UCI
39.36
69.05
89.44
67.96
93.09
Shoaib
44.26
78.71
73.70
77.64
93.01
HHAR
42.97
58.33
75.21
79.68
97.53
Table 3. Single-source cross-dataset transfer performance (ACC%). ZS is zero-short and FS is few-short.
Method
UCI
Motion
HHAR
Avg.
SDMix
90.33
75.48
77.44
81.08
ContrastSense
93.33
83.13
87.66
88.04
DI2SDiff
87.68
88.43
89.19
88.43
OUR-ZS
86.19
85.42
88.97
86.86
OUR-FS
91.88
93.17
94.89
93.31
Table 4. Cross-person transfer performance (ACC%) on unseen users.
Source
Target
Mixup
ContrastSense
DI2SDiff
OUR-ZS
OUR-FS
B+P+W
Arm
40.17
70.81
74.14
6.00
95.71
A+P+W
Belt
39.87
68.06
68.71
19.90
88.29
A+B+W
Pocket
47.01
71.48
72.36
69.25
90.19
A+B+P
Wrist
41.12
75.54
77.11
42.09
91.59
Table 5. Cross-position transfer performance (ACC%) on shoaib dataset. ZS is zero-short and FS is few-short.
Model
Params(M)
Size(MB)
CPU(ms)
Memory(MB)
GPT-2 Small
160.0
400.0
1028.0
–
LLMHAR
8.0
46
104.5
–
CNN
6.45
25.805
2.14
51.05
DeepConvLSTM
0.46
1.85
40.90
10.16
HART
1.45
5.91
5.38
12.74
MobileHART
2.54
10.35
13.49
20.77
Table 6. Efficiency comparison under edge deployment.
Emerging Activity
K=20
K=50
K=100
Lying back
0.0022
0.6674
0.8611
Walking parking lot
0.3260
0.8871
0.9899
Cycling bike horizontal
0.0596
0.3849
0.9413
Playing basketball
0.2471
0.6147
0.8786
Macro-F1
0.1627
0.7487
0.9186
Overall Accuracy
0.2382
0.7574
0.9190
Table 7. Few-shot adaptation to emerging activities on PAMAP2. K denotes the number of target samples per activity.
Figure 2. Effect of target-domain fine-tuning data ratio on adaptation performance. EdgeHAR is evaluated under different amounts of target data across heterogeneous datasets.
Human Activity Recognition (HAR) from wearable sensors supports applications in healthcare, rehabilitation, fitness tracking, and smart environments. Yet, existing deep learning approaches require dataset-specific training, large labeled corpora, and repeated adaptation to new sensor settings or activity taxonomies. Retrieval-Augmented Generation for Human Activity Recognition (RAG-HAR) addresses this by framing HAR as a training-free, retrieval-augmented task, in which statistical descriptions of sensor windows are used to retrieve similar labeled examples that guide LLM-based classification. We introduce RAG-HAR+, a retrieval-first and cost-optimized extension that strengthens retrieval while reducing dependence on LLM-based inference. RAG-HAR+ uses an offline Retrieval Designer Agent to design dataset-specific feature groups from a diverse pool of motion descriptors, enabling sensor windows to be compared using features better aligned with dataset-specific activity patterns. During inference, RAG-HAR+ uses majority voting over retrieved neighbors for samples with strong retrieval evidence and defers only uncertain cases to an LLM-based Ambiguity Resolver Agent. Across six HAR benchmarks, RAG-HAR+ maintains competitive or improved performance while reducing LLM usage, token consumption, and inference time. We further extend the RAG-HAR mobile prototype to demonstrate the practical feasibility of retrieval-first, LLM-assisted HAR in mobile sensing scenarios.
HAR is increasingly expected to run continuously on edge devices, yet recent LLM-based methods remain hard to deploy: raw sensor prompts are long, cloud inference adds latency and privacy risk, and fine-tuned LLM pipelines turn general-purpose models into task-specific classifiers. We present STELLA, an efficient sensor-to-LLM translation framework for on-device HAR that shifts the burden from LLM adaptation to sensor tokenization. A lightweight hierarchical tokenizer compresses an entire multi-channel inertial window into a fixed set of compact latent sensor tokens, which are projected into the embedding space of a frozen pretrained LLM and combined with a natural-language prompt for label scoring. This preserves activity-relevant temporal and cross-channel structure while keeping LLM-side computation predictable across sensor configurations. STELLA also supports on-device personalization, adapting only the lightweight tokenizer on small amounts of user-specific labelled data and augmenting inference with a local retrieval context, keeping the LLM, user data, and retrieval on device. Across seven public HAR datasets and eight benchmark settings, STELLA achieves new state-of-the-art performance, improving over prior methods by up to 11.83% F1; on-device personalization yields up to a further 21.91% F1 as user data accumulates after deployment. STELLA also outperforms representative time-series tokenizers under the same LLM pipeline and achieves real-time inference under practical mobile and edge budgets, showing that efficient sensor tokenization is a practical path toward accurate, private, and personalized LLM-based HAR on edge devices.
Nirhoshan Sivaroopan, Albert Zomaya, Kanchana Thilakarathna
Human Activity Recognition (HAR) has shown remarkable effectiveness in various applications, such as smart healthcare and intelligent manufacturing. However, a major challenge faced by HAR is the distribution shift across different sensor data domains, which often leads to decreased performance when deployed for real-world applications. To address this issue, this paper introduces GenHAR, a novel framework designed to mitigate the domain gap by learning domain-invariant sensor representations. GenHAR aims to enhance the generalization capabilities of HAR on target domains purely with data from the source domain. The key novelty of GenHAR lies in two aspects. Firstly, GenHAR tokenizes sensor data and learns correlations among frequency sensor channel dimensions to improve the robustness of HAR models. Secondly, GenHAR improves the efficiency via selective masking and an efficient attention mechanism. We conduct a systematic analysis of GenHAR by comparing it with state-of-the-art HAR methods on real-world human activity datasets. Results show that GenHAR outperforms state-of-the-art methods by 9.97% in accuracy, and reduces Floating Point Operations by 6.4 times. Moreover, we deploy GenHAR at a leading logistics company in 4 cities, and have detected 2.15 billion real-time activities. We release our code at: https://github.com/Sensor-FoundationModel/GenHAR.
Zhiqing Hong, Zelong Li, Xiubin Fan +5
HKUST (GZ) Guangzhou, China · JD Logistics Beijing, China · Beijing Normal–Hong Kong Baptist University Zhuhai, China +2