Git Product home page Git Product logo

activitymonitor's Introduction

Activity Monitor

This repository hosts the source code for a simple proof-of-concept of a neural network running on an Arduino. The sketch can distinguish three different types of human activities: standing, walking, and hopping. Three LEDs serve as indicators for the respective activities. Three different features are extracted from a two second sliding window of the raw data coming from an accelerometer: maximum zero-crossing rate, cumulative absolute velocity of the acceleration vector sum, and the maximum acceleration vector sum. The features are fed into a 3-5-3 layer neural network to determine the activity.

The repository contains several sub-projects in different directories:

  • app: an Android application that is used to collect the acceleration data for training purposes. The main activity of this app also demonstrates the resulting neural network.
  • data: contains a total of 24 minutes of raw acceleration values at a sampling rate of 25 Hz that were recorded with the help of the Android app while performing the three activities. The data is stored in CSV files.
  • ann: contains the feature extraction algorithms and the resulting artificial neural network.
  • sgd: contains the implementation of a stochastic gradient descent learning algorithm. Running the command ./gradlew run will first determine the feature scaling, then create the training data that is stored in the file data/training-data.csv and finally perform the gradient descent to compute the weights and biases of the neural network. The resulting values are printed to the console and need to be manually pasted to the source code (ugly, I know).
  • arduino: contains an Arduino sketch that is basically a C++ version of the Java implementation of the neural network contained in directory ann. The sketch needs to be opened with the PlatformIO IDE (NOT the Arduino IDE).

The Arduino version of the Activity Monitor runs on a standard Arduino Uno. It makes use of the MPU6050 accelerometer and three colored LEDs for the various activities: red (standing), green (walking), and blue (hopping). The following image depicts the wiring:

Activity Monitor

License

This work is released under the Apache 2 License.

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.