Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Physics-Guided Adaptive Patch Routing for Temporal–Spectral Fusion in Wearable Human Activity Recognition

image This repository implements the methodology proposed in the paper "Physics-Guided Adaptive Patch Routing for Temporal–Spectral Fusion in Wearable Human Activity Recognition"

Paper Overview

Abstract: Wearable inertial sensor-based human activity recognition (HAR) must handle heterogeneous local motion regimes within a fixed analysis window, including steady, periodic, transitional, and locally corrupted segments. However, existing temporal–spectral HAR models commonly apply fixed or globally shared fusion at the window level, limiting their ability to adapt to patch-wise differences in motion structure. To address this limitation, we propose a physics-guided adaptive patch-routing dual-branch network. The model separately encodes temporal and spectral representations and uses a lightweight gate to adjust their contributions for each patch. Routing is guided by compact, physically interpretable descriptors of motion energy, jerk, spectral structure, and cross-signal coordination, while a physics-derived soft target stabilizes gate learning. The spectral branch further uses a learnable channel-wise projection of local Fourier magnitudes to capture task-relevant frequency patterns. Experiments on UCI-HAR, WISDM, PAMAP2, and UniMiB-SHAR show that the proposed method consistently achieves the highest Macro-F1 among the evaluated variants and outperforms uniform and sample-level fusion. Ablation results confirm the complementary roles of the two branches and the contributions of patch-level routing, rich motion descriptors, spectral projection, and routing supervision. Gate analyses further show non-trivial variation across patches and activity classes. Perturbation tests show that the proposed model maintains the highest absolute recognition performance among the evaluated fusion variants under the tested signal distortions, while Raspberry Pi 4 measurements demonstrate practical on-device feasibility. These results support physics-guided patch-wise routing as an effective and interpretable alternative to globally shared temporal–spectral fusion for wearable HAR.

Dataset

This repository does not include datasets. Please download them from the official sources below and configure the dataset path accordingly.

Requirements

torch==2.5.0
numpy
scikit-learn

To install all required packages:

pip install -r requirements.txt

All experiments were conducted in Google Colaboratory using Python 3.12.12 and PyTorch 2.5.0 with CUDA 12.6.

Codebase Overview

  • model.py: Implementation of the proposed PGPRDT (Physics-Guided Patch-Routing Dual Transformer) architecture. The implementation is based on PyTorch and includes the time-domain patch embedding, the frequency-domain branch with a learnable spectral filterbank, the two branch Transformer encoders, the patch-level physics gate for routing, and the classifier head.

Citing this Repository

If you use this code in your research, please cite:

@article{PGPRDT,
  title   = {Physics-Guided Adaptive Patch Routing for Temporal--Spectral Fusion in Wearable Human Activity Recognition},
  author  = {Jimin Kim and Myung-Kyu Yi},
  journal = {},
  volume  = {},
  number  = {},
  pages   = {},
  year    = {},
  publisher = {}
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or issues, please contact:

About

This repository implements the methodology proposed in the paper "Physics-Guided Adaptive Patch Routing for Temporal–Spectral Fusion in Wearable Human Activity Recognition"

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages