Coder Social home page Coder Social logo

xfactor_2_pickup's Introduction

App Name: Pickup

Pickup

What does it do:

Once the app is opened, it will go to the background immediately, so there is no UI for this app. However it will work in the background as a service, monitoring the user's gesture to decide whether the phone is opened by the owner or not.

How to kill it:

Since this app has no UI, and only works as a background service, it can only be killed manually in the settings of the system.

Pickup Kill

How it works

When the screen is turned off, all sensor data will be collected by this service automatically, and these data will be written into a local csv file in external folder like this: /storage/emulated/legacy/Android/data/edu.cmu.ebiz.pickup/files/

Once the screen is turned on, it will read these data from local files, and abstract features from them, and decide whether it is the owner that picked up this phone.

Machine learning algorithm

Decison is made basing on a random forest model which was trained before, this model file is located in assets folder. And we are using Random Forest algorithm prived by Weka, to use Weka in this app, a weka.jar is imported, and this line needs to be added to dependencies in build.gradle

compile files('libs/weka.jar')

Data format and related features

Only accelerometer and magnetic sensor data will be used, so there will be two files in this folder: 2015_08_21_23_47_55_acc.csv and 2015_08_21_23_47_55_magetic.csv ([Why don't use other sensor data?] (https://www.dropbox.com/s/bnvwc62nh7kt24q/Pickup.pptx?dl=0) [Page 2])

104 featureswill be abstracted [{Accelerometer, Magnetic} * {X,Y,Z,Magnitude} * {Mean, Std, Min, Max, Percentile25,50,75, FTT[0,1,2]}]

Related Classes

All data related classes will be placed in pattern package

What's the result?

Once the result is decided from this Random Forest model, it will be stored in isOwner as a boolean variable, and this result will be [sent out as a broadcast to "org.twinone.locker.pickup.result" Action] (https://github.com/miworking/XFactor_PickupRecognition/blob/master/app/src/main/java/edu/cmu/ebiz/pickup/AEScreenOnOffService.java#L271-L286)

and the XFactor app will register a receiver for this broadcast, and calculate a pickup_score basing on this result.

Collect data

This app can also be used to collect data for later modeling. The only difference is to comment the following line so that data will not be cleared everyone when use turns off the screen. Once data is collected, you can use TrainModel to preprocess them and generate features in a arff file, so as to be used in Weka.

After you have collected enough data, you'd better copy this folder to your desktop and rename it so that it wont be erased in the future. /storage/emulated/legacy/Android/data/edu.cmu.ebiz.pickup/files/

Here we collected data from 6 people, and put them like this

you can refer to the README of TrainModel to go further on how to use these data to traing a model

xfactor_2_pickup's People

Contributors

miworking3 avatar mizhoucmu avatar

Watchers

 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.