Built to order

Human Activity Recognition using Smartphone Sensors

A system that figures out what a person is doing — walking, sitting, standing, climbing stairs — from their phone's accelerometer and gyroscope alone. A two-layer LSTM reads 2.56-second windows of 50 Hz sensor signals and classifies them into six activities. It is trained on the UCI HAR dataset: 30 volunteers wearing a Samsung Galaxy S II on the waist, 10,299 labeled windows, with a subject-disjoint train/test split so the model is tested on people it never saw. The demo console shows live sensor streams, the characteristic waveform of each activity, and per-class evaluation. Suitable for

AI & Machine Learning NumPyPython 3.10windowing)signal preprocessing)TensorFlow · KerasSoftware
Human Activity Recognition using Smartphone Sensors — project thumbnail preview
More project photos (3)

The problem

Every smartphone carries an inertial measurement unit — a tri-axial accelerometer and gyroscope sampling motion dozens of times per second. That stream is rich enough to tell walking from sitting, stairs from flat ground, without any camera or GPS: the signature of each activity lives in the rhythm and amplitude of the signal. Turning raw sensor traces into activity labels is the human activity recognition (HAR) problem, and it matters wherever a camera is impractical or intrusive — fall detection for the elderly, step counting that does not drain GPS, context-aware phones that silence themselves in meetings. The standard teaching benchmark is the UCI HAR dataset (Anguita et al., ESANN 2013): 30 volunteers aged 19–48 wore a Galaxy S II on their waist while walking, climbing stairs, sitting, standing and lying down, producing 10,299 labeled 2.56-second windows at 50 Hz. This project trains a two-layer LSTM directly on those windows, evaluates it on nine held-out subjects the model never trained on, and ships a sensor console demo with live animated streams, per-activity waveform patterns, and a per-class evaluation view. The report is upfront about the classic confusion pair — sitting versus standing — and about the fixed waist placement the dataset assumes.

SYSTEM FLOW

5 components 7 connections

Live flow
Drag to explore
100%
storageUCI HAR windows

10,299 windows of 50 Hz accelerometer and gyroscope data from 30 subjects, labeled with 6 activities. Split by subject: 21 train, 9 test.

Follow the working sequence

How it works

  1. Raw 50 Hz accelerometer and gyroscope signals are noise-filtered; gravity is separated from body acceleration with a 0.3 Hz Butterworth low-pass filter.
  2. Signals are segmented into 2.56-second windows (128 readings) with 50% overlap, each window labeled with one of six activities.
  3. Windows are split by subject — 21 subjects for training, 9 for testing — so evaluation measures generalization to new people.
  4. The LSTM reads each 128-step window (6 channels: 3 accel + 3 gyro axes) and the final hidden state feeds a 6-way softmax.
  5. Categorical cross-entropy is minimized with Adam; validation F1 on held-out subjects drives early stopping.
  6. The console demo streams simulated sensor data through the same windowing and displays the predicted activity with confidence.

Tech stack:

  • Python 3.10, TensorFlow/Keras (two-layer LSTM, training loop)
  • NumPy, pandas (signal loading, windowing, 561-feature handling)
  • SciPy (Butterworth filtering, following the dataset's preprocessing)
  • scikit-learn (SVM baseline, metrics, confusion matrix)
  • Matplotlib, Seaborn (waveform plots, training curves, confusion heatmap)
  • Jupyter notebook (buyer-run training and evaluation)
  • Flask demo app with the animated sensor console
  • UCI HAR dataset (Anguita et al., ESANN 2013 — 30 subjects, 6 activities, 10,299 windows)
Parameter Value
Model 2-layer LSTM (128 units) on 128-sample windows; dense softmax, 6 classes
Dataset UCI HAR (UCI ML Repository, dataset 240): 30 volunteers, Samsung Galaxy S II on waist, 6 activities, 50 Hz, 10,299 windows, 561-feature vectors
Split Subject-disjoint: 21 subjects train / 9 subjects test (the official protocol)
Preprocessing Noise filters, 0.3 Hz Butterworth gravity separation, 2.56 s windows with 50% overlap
Training Categorical cross-entropy, Adam; design target ≈ 92–95% accuracy on held-out subjects (dataset paper's SVM baseline ≈ 96%)
Evaluation Per-class precision/recall/F1, confusion matrix — computed by the notebook on your build
Input Tri-axial accelerometer + gyroscope streams (or the dataset's window files)
Output Activity label (walking, upstairs, downstairs, sitting, standing, laying) with confidence

Project features

  • [Two-layer LSTM classifier] 128-unit LSTM layers over 128-sample windows of accelerometer and gyroscope signals; dense softmax over the six activities.
  • [UCI HAR data pipeline] Loader for the 10,299-window dataset with the official subject-disjoint split: 21 subjects train, 9 subjects test.
  • [Live sensor console] Animated tri-axial accelerometer and gyroscope streams with activity simulation (walk, stairs, sit, stand, lie) and a live prediction card.
  • [Signal pattern gallery] Characteristic waveform of each of the six activities with plain-language notes on what distinguishes them.
  • [Per-class evaluation view] Precision, recall and F1 per activity plus a confusion-matrix heatmap; numbers are design targets, computed for real by the notebook.
  • [Windowing visualizer] Shows the 2.56-second sliding window with 50% overlap over the raw 50 Hz signal, the exact preprocessing the dataset uses.
  • [Classical baseline comparison] An SVM on the 561 engineered features (the dataset paper's own baseline) alongside the LSTM, for the report's comparison section.
  • [Error analysis section] Documents the sitting-vs-standing confusion and the effect of phone placement, straight from the held-out evaluation.

What is included

  • Complete source code (signal pipeline, LSTM model, SVM baseline, windowing, demo console)
  • Jupyter training and evaluation notebook (buyer-run procedure: load UCI HAR, train LSTM, evaluate on held-out subjects, compare with SVM)
  • Project report PDF (background, signal preprocessing, architecture, evaluation, error analysis)
  • PPT presentation for final review
  • Viva Q&A preparation document (why subject-disjoint splits, LSTM vs engineered features, sitting-vs-standing confusion, placement sensitivity)
  • Setup guide (environment, dataset download, training your own model, running the console)

Advantages

  • Classifies six everyday activities — walking, sitting, standing, climbing stairs and more — from a phone's accelerometer and gyroscope alone.
  • Uses a two-layer LSTM over 2.56-second windows of 50 Hz sensor signals, with 128-unit layers over 128-sample windows.
  • Trained on the UCI HAR dataset: 30 volunteers, 10,299 labeled windows, with a subject-disjoint split of 21 subjects for training and 9 for testing, so it is tested on people it never saw.
  • Includes a live sensor console with animated tri-axial streams and a signal-pattern gallery showing the characteristic waveform of each activity.
  • Compares against a classical SVM baseline on the 561 engineered features, with per-class precision, recall and F1 plus a confusion-matrix heatmap.

Disadvantages

  • The dataset fixes the phone at the waist: a phone in a pocket, hand or bag produces different signals the model is not trained for.
  • Sitting vs standing is the classic confusion pair — both are near-flat signals differing only in gravity orientation.
  • Only six scripted activities are covered; running, cycling and household activities are outside the dataset and the model.
  • The demo console's live stream is simulated; real phone-sensor capture is a documented extension, not part of the base build.
  • Reported accuracy is a design target for the build — the notebook computes the build's real numbers on the nine held-out subjects.

Limitations & prerequisites

  • The dataset fixes the phone at the waist: a phone in a pocket, hand, or bag produces different signals and the model is not trained for that.
  • Sitting vs standing is the classic confusion pair — both are near-flat signals differing only in gravity orientation; the report documents this openly.
  • Only six scripted activities are covered; running, cycling, and household activities are outside the dataset and the model.
  • The demo console's live stream is simulated; real phone-sensor capture is documented as an extension, not part of the base build.
  • Reported accuracy is a design target for your build — the notebook computes your build's real numbers on the nine held-out subjects.

Frequently Asked Questions

Which dataset is used?

The UCI Human Activity Recognition Using Smartphones dataset (Anguita et al., ESANN 2013; UCI ML Repository dataset 240): 30 volunteers, a Galaxy S II on the waist, six activities, 10,299 labeled windows at 50 Hz.

Which model is used?

A two-layer LSTM (128 units) that reads 128-sample windows of accelerometer + gyroscope data directly; the notebook also trains the dataset paper's SVM-on-561-features baseline for comparison.

Is the accuracy guaranteed?

No. ≈ 92–95% on held-out subjects is the design target (the paper's SVM baseline reports ~96%); your build's actual metrics come from the notebook's evaluation on the nine test subjects.

Can it work with my phone's sensors?

The model expects waist-mounted, 50 Hz signals like the dataset's. Phone-in-pocket or wrist data would need retraining on newly collected data — documented as an extension.

Why split by subject instead of randomly?

A random split lets the model memorize a person's gait and inflates accuracy. Subject-disjoint splits test what matters: recognizing activities of people the model never saw.

Is this project suitable for a final-year project?

Yes — it covers sensor signal processing, sequence modeling, and honest evaluation methodology, and suits Computer Science, AI/ML, Data Science and Electronics students. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML, Data Science and Electronics.

Components & software requirements
  • Python 3.10, TensorFlow/Keras (two-layer LSTM, training loop)
  • NumPy, pandas (signal loading, windowing, 561-feature handling)
  • SciPy (Butterworth filtering, following the dataset's preprocessing)
  • scikit-learn (SVM baseline, metrics, confusion matrix)
  • Matplotlib, Seaborn (waveform plots, training curves, confusion heatmap)
  • Jupyter notebook (buyer-run training and evaluation)
  • Flask demo app with the animated sensor console
  • UCI HAR dataset (Anguita et al., ESANN 2013 — 30 subjects, 6 activities, 10,299 windows)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download free synopsis (PDF)

Enter your name and WhatsApp number — the synopsis PDF downloads immediately. We may send occasional project updates on WhatsApp; no spam.

Anguita et al. (2013), A Public Domain Dataset for Human Activity Recognition Using Smartphones, ESANN

Get a quotation