EMBEDLIX RESEARCH · MACHINE LEARNING LABORATORY SERIES
Human Activity Recognition Using Machine Learning
From smartphone sensor rows to recurrent movement sequences: controlled performance and the limits of generalization
Abstract
Smartphone motion sensing provides a practical setting for studying how machine learning moves from raw measurements to activity decisions. This laboratory series compares K-nearest neighbours, Decision Trees, a feedforward neural network and a compact gated recurrent unit (GRU) network using six acceleration and gyroscope channels from 48 recordings and 95,837 aligned rows. Recording identities are retained during splitting, and scaling is fitted to training data only. [1–5]
The selected KNN achieved 91.12% same-person test accuracy; the feedforward network achieved 90.09%. A one-layer, 32-unit GRU processing 100-sample windows achieved 99.19% on the controlled test. However, 99% window overlap creates correlated observations. Continuous recording agreement was approximately 63.62%, while another-person evaluation fell to 37.94% for KNN and approximately 25.78% for GRU under different external protocols. The latter also used approximate labels and a mismatched fourth activity.
The findings support temporal modelling under the controlled collection conditions, but do not establish person-independent reliability. Improved participant diversity, consistent phone setup, exact activity annotations and a stronger final evaluation protocol are more important next steps than simply increasing model complexity.
Keywords: human activity recognition; inertial sensing; smartphone; grouped validation; KNN; neural networks; GRU; distribution shift.
48
Separate recordings
6
Sensor channels
4
Activity classes
Controlled test accuracy · 0–100%
The central finding
99.19% controlled accuracy is not a real-world reliability claim. A new participant and natural continuous movement exposed substantial failure, including confident incorrect predictions. Both the achievement and its limits are part of the research result.
Study contributions
- 01A transparent progression from timestamp-aligned smartphone signals to classical, feedforward and recurrent classifiers.
- 02Recording-aware evaluation and training-only scaling, with repeated-test-access and overlap limitations explicitly acknowledged.
- 03Class-level and external-condition analysis rather than a headline accuracy alone.
- 04Original code and figures accompanied by implementation explanations, source references and an actionable follow-up protocol.
The research chapters
Data acquisition and experimental methodology
From smartphone sensor recordings to a recording-aware, training-only preprocessing protocol.
Classical learning: KNN and Decision Trees
Recording-aware cross-validation, feature scaling, search settings and the selected classical baseline.
Feedforward neural networks: implementation and learning
A six-input, two-hidden-layer classifier, capacity/scaling experiments and honest final-test interpretation.
GRU sequence modelling: from windows to predictions
Boundary-safe time windows, recurrent architecture, validation searches and controlled-test results.
Results, generalization and critical discussion
Controlled performance alongside continuous-recording failures, external-person shift and research limitations.
Reproducibility, source materials and research record
Downloadable evidence, notebook execution order, software records and transparent authorship.
Primary research materials
Original logbook and seminar, plus notebook copies with personal workstation paths redacted. Raw CSVs and fitted models were not supplied; saved outputs are not an independent replication.