Adaptive TinyML with Shift-Aware Routing for Human Activity Recognition Under Distribution Shifts
Hilal Akarkamçı, Mahmut KılıçaslanHuman activity recognition (HAR) on wearable and mobile devices requires models that can operate with limited computational resources while remaining reliable under changing real-world sensing conditions. However, most TinyML-based HAR systems follow the same computational path for every input, regardless of whether an activity pattern is familiar or affected by changes in the user, sensor placement, or sensing configuration. This study presents a shift-aware adaptive TinyML framework that adjusts the inference effort according to the prediction confidence and feature-space distribution shift. A lightweight multi-exit architecture allows confident samples to be classified at early stages, while uncertain or shifted samples are routed to deeper exits. A source-derived feature-space shift score complements confidence-based routing by identifying distribution changes that may not be reflected by predictive uncertainty alone. Persistent severe shifts are additionally considered through a guarded label-free test-time adaptation mechanism that does not require new activity annotations or full model retraining. The framework was evaluated on three publicly available HAR benchmark datasets, REALDISP, WISDM, and PAMAP2, covering complementary sensor-displacement, sensing-domain, unseen-user, and body-location shifts. Across the three benchmarks, explicit shift-aware routing produced a stronger adaptive computational response to changing sensing conditions than confidence-only routing. In REALDISP, the computational cost remained nearly unchanged from IDEAL to SELF conditions with confidence-only routing, whereas shift-aware routing increased the normalized computation by 0.0187 (p = 0.0253). In WISDM and PAMAP2, the increase in computation under the distribution shift was approximately 2.88 and 2.85 times greater with shift-aware routing than with confidence-only routing, respectively. The effect on recognition performance, however, depended on the shift scenario. Shift-aware routing significantly improved the target-domain Macro-F1 in the WISDM WATCH-to-PHONE scenario (ΔMacro-F1 = +0.0096, p = 0.0023), whereas no significant differences were observed for REALDISP SELF or PAMAP2 ANKLE. These findings demonstrate that explicit distribution-shift information can help resource-constrained HAR models allocate additional computation when sensing conditions change, while also showing that deeper inference alone may not overcome severe domain mismatch. The proposed framework provides a practical basis for adaptive inference in TinyML-based wearable and edge sensing systems operating under variable real-world conditions.