GithubHelp home page GithubHelp logo

neuroidss / har-cnn-keras Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shahnawax/har-cnn-keras

0.0 3.0 0.0 72.86 MB

Human Activity Recognition Using Convolutional Neural Network in Keras

Python 100.00%

har-cnn-keras's Introduction

Human Activity Recognition using CNN in Keras

This project is to create a small and simple Convolutional Neural Network for Human Activity Recognition using accelerometer sensor data for x, y and z axis.

Files

The repository contains

  • HAR.py, containing the Keras network implementation of the CNN for Human Activity Recognition,
  • actitracker_raw.txt, the dataset used for this experiment,
  • model.h5, a pretrained model on the training data,
  • evaluate_model.py, containing the evaluation script. This script evaluates the performance of the pretrained netowrk,
  • testData.npy, containing the testing data used for the evaluation of the model,
  • groundTruth.npy, containing the ground truth values for the testData outputs and
  • README.md. The classification accuracy of the network is approximately 92%.

Tools Required

Python 3.6 is used during development and following libraries are required to run the code provided in the notebook:

  • Keras 2.*
  • Numpy
  • Matplotlib
  • Pandas
  • sklearn

Dataset

We will use Actitracker data set released by Wireless Sensor Data Mining (WISDM) lab. The dataset we used for this project was released by Wireless Sensor Data Mining (WISDM) Lab and can be found on this [link]. The database has data for axis x,y and z for user to perform six different activities in controlled envoirnments. The activities include

  • Downstairs,
  • Jogging,
  • Sitting,
  • Standing,
  • Upstairs and
  • Walking.

The data is collected from 36 users using a smartphone in their pocket with the 20Hz sampling rate (20 samples per second). The dataset distribution with respect to activities (class labels) is shown in the figure below.

Evaluation

A network is created using the topology in HAR.py and trained on 80% of the data. To evaluate the performance of this network, we write a script "evaluate_model.py". This script uses the 20% of random samples in the dataset and tests the pretrained cnn model model.h5. This reports the percentage of the wrong predictions as error and creates a confusion matrix. The results shows that the network has an accuracy of 92.1 %. The confusion matrix is shown below

Related Problems

User identification from walking activity. Accelerometer dataset from 22 indivduals can be downloaded from the following [link]

har-cnn-keras's People

Contributors

shahnawax avatar

Watchers

James Cloos avatar  avatar  avatar

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.