Git Product home page Git Product logo

har's Introduction

Real-time human activity recognition from accelerometer data using Convolutional Neural Networks


1. Overview

This code implements a Convolutional Neural Network-based approach for real-time human activity recognition.

The proposed architecture combines a shallow CNN for unsupervised local feature extraction together with statistical features that encode global characteristics of the time series. Among its main benefits are short recognition intervals of size up to 1 second, almost no manual feature engineering or data preprocessing, and a domain-independent architecture that with a minimal amount of modifications can be applied to different types of datasets.


2. Dependencies

Data segmentation:
  • matlab or octave
Activity classification
  • python 2.7+
  • scikit-learn
  • numpy
  • tesnorflow

3. Experiments

The system was evaluated on two commonly used WISDM and UCI datasets that contain labeled accelerometer data from 36 and 30 users respectively and can be freely downloaded from the corresponding websites.

Data Segmentation

To perform a segmentation of the initial time series and generate datasets for testing the model, unzip file
"data_processing/datasets.zip" and run matlab scripts "run_WISDM.m" or "run_UCI.m" for WISDM and UCI datasets respectively. The parameters of segmentation are specified in the header of these scripts.

Baseline HAR techniques
  • To test an approach based on Random Forest + hand-crafted features run "wisdm_random_forest.py".
  • To test an approach based on Random Forest + PCA features set parameter 'use_pca_features' to true in "run_WISDM.m" and after the data is generated run "wisdm_random_forest.py".
  • To test an approach based on the classification of raw accelerometer time series using K-nearest neighbor algorithm, run "wisdm_knn.py".
CNN Model

The proposed CNN-based model is implemented using tensorflow machine learning library.

To apply CNN to WISDM dataset, generate traing data and run "cnn_wisdm.py". For UCI dataset run "cnn_uci.py". The parameters of the CNN are specified in the header of these scripts.


4. System performance

When using UCI dataset and segments (recognition intervals) of size 128, CNN should achieve the accuracy score of about 97%. For segments of size 50 this value should be about 94%.

When using WISDM dataset and segments (recognition intervals) of size 200, CNN should achieve the accuracy score of about 93%. For segments of size 50 this value should be about 90%.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.