/Human-Activity-Recognition-Keras-Android

Sensor-based human activity recognition from smartphone data in Keras with on-device inference

Primary LanguageJava

Overview

This is the source code for a sensor-based human activity recognition android app. The model has been built with Keras deep learning library. The classifier has been trained and validated on "Sensors Activity Dataset" by Shoaib et al. which is available for download from here. The dataset contains data for seven activities of daily living including biking, downstairs, jogging, sitting, standing, upstairs, and walking. An LSTM learner has been employed for classification task which achieved an accuracy of 98% on valdiation data. Finally the model has been exported in protobuf format to be used in android app for on-device inference. You can check out the jupyter notebook that goes along to follow all the steps which have been taken to build and export the model.

Screenshots

Dependencies

  • Python 3.6
  • Tensorflow 1.13.1
  • Keras

Instructions

Download Android Studio and then import the android app. The trained model has been inculded in the assets folder of the android app. Since I've placed the dependencies in the build.gradle file, they should be automatically downloaded.