Gait Recognition Based on Tiny ML and IMU Sensors

Jiahang Zhang, Mingtong Chen, Zhengbao YangarXiv 2025 · DOI

TL;DR

This paper presents a low-power, real-time gait recognition system that runs entirely on a thumb-sized microcontroller. By combining Tiny Machine Learning (TinyML) with a 6-axis IMU sensor, the researchers achieved over 97% accuracy in classifying activities like walking and climbing stairs without ever needing to send data to the cloud.

What Problem Does This Paper Address?

Traditional gait recognition and activity monitoring often rely on cloud-based processing. While powerful, this approach has three major drawbacks: high power consumption (due to constant data transmission), significant latency, and privacy concerns regarding sensitive motion data.

For wearables like smartwatches or health monitors to be truly "set and forget," they need to perform inference locally on resource-constrained hardware. The challenge lies in compressing complex motion-sensing algorithms into the tiny memory and processing footprint of a microcontroller while maintaining high accuracy.

Methods

The researchers built a hardware-software pipeline designed for the "edge":

  • Hardware: They used the Seeed Studio XIAO-nRF52840 Sense, a compact development board featuring an ARM Cortex-M4 processor. This was paired with the LSM6DS3, a 6-axis Inertial Measurement Unit (IMU) that tracks both acceleration and angular velocity.
  • Software Pipeline: Using the Edge Impulse platform, the team developed a TinyML workflow.
  • Preprocessing: Raw sensor data was processed using a sliding window technique (2-second windows with an 80ms slide). To make the data digestible for a neural network, they performed spectral analysis, extracting features like Root Mean Square (RMS) for signal strength and Fast Fourier Transform (FFT) to capture frequency-domain characteristics.
  • The Model: A compact Deep Neural Network (DNN) was designed with an input layer of 39 neurons (representing the extracted features), two hidden layers (20 and 10 neurons respectively using ReLU activation), and a 4-neuron output layer for classification.

Datasets

The authors collected a custom dataset for this project:

  • Activities: Walking, Stationary, Going Upstairs, and Going Downstairs.
  • Volume: 40 sets of data, each 10 seconds long (400 seconds total).
  • Data Split: An 80/20 split was used, with 32 sets for training and 8 sets for testing.
  • Augmentation: Through the sliding window process, the original 10-second samples were broken down into 101 smaller, independent samples each, significantly increasing the effective size of the training set.

Key Insights and Ideas

  • Feature Engineering is King: Instead of feeding raw, noisy IMU data into a massive network, the authors used FFT and RMS. This "pre-digestion" allows a very small neural network (only 30 hidden neurons total) to perform sophisticated classification.
  • Frequency as a Fingerprint: The paper highlights that different activities have distinct "spectral signatures." For instance, the frequency characteristics of walking are noticeably different from being stationary, making FFT a highly effective tool for gait.
  • Anomaly Detection: Beyond simple classification, the system includes an anomaly score. This allows the device to recognize when a user is performing an "unknown" movement rather than forcing it into one of the four pre-defined categories, increasing the system's overall robustness.
  • On-Device Autonomy: By running the model locally on an ARM Cortex-M4, the system achieves near-zero latency (classification takes ~0ms after DSP) and can operate on battery or energy-harvesting power.

Key Results

The system demonstrated impressive performance for such a lightweight architecture:

  • Training Performance: Achieved 99.4% accuracy on the validation set during training.
  • Test Performance: Maintained a high 97.21% accuracy on the unseen test dataset.
  • Class Specifics: The "Stationary" category was perfect (100% accuracy). "Going Downstairs" was the most challenging category, occasionally being confused with walking or going upstairs, yet it still maintained a 93.2% accuracy rate.
  • Efficiency: Real-time inference results showed the model was highly confident, often giving the correct activity a probability score of >0.99.

Limitations and Future Work

While the results are promising, the authors acknowledge several areas for growth:

  • Dataset Diversity: The current model was trained on a relatively small dataset (400 seconds). Future work involves expanding the range of motion patterns and including more diverse subjects.
  • Environmental Complexity: The model needs further testing and optimization to handle "complex environments" where gait might be less predictable.
  • Self-Sufficiency: A primary goal for future iterations is the integration of an energy-harvesting module, aiming for a system that is fully self-powered and requires no battery replacements or charging.

Summary updated

BibTeX
@misc{zhang2025gait,
  author = {Jiahang Zhang and Mingtong Chen and Zhengbao Yang},
  title = {{Gait Recognition Based on Tiny ML and IMU Sensors}},
  year = {2025},
  eprint = {2507.18627},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.18627},
  howpublished = {arXiv},
}
Figure