Key features of project:
Back end:
Python flask frame is used to build server connecting front-end (Android APP) and back-end by http request
Python flask frame is used to build server connecting front-end (Android APP) and back-end by http request
- http://<IP>:5000/trigger route posts information as json data(awake time range) from user, triggers the Kinect sensor to capture user's pictures every 30 seconds, and uses the previously-machine-learned LASSO coefficients & threshold to predict his/her sleeping depth constantly at the same time.
- http://<IP>:5000/wakeornot route gets the json format data containing the user's wake up information to the Android front_end. The alarm will be triggered once the user is in light sleeping mode during time range he/she sets up.
Front end:
WakeMeUp is used as the front-end of the system.
WakeMeUp is used as the front-end of the system.
- Android application allows users to pick either the regular alarm mode or the WakeMeUp alarm mode.
- Under regular alarm mode, the application performs just like all other alarm applications in the smart phone.
- Under WakeMeUp alarm mode, the alarm periodically queries the server for current sleeping status. When the setting approaches, the alarm will choose the time when the user is under light sleep and wake the user up.
Hardware:
- Kinect: Captures the user's sleeping image.
- Jawbone: Used as the the true reference sleep depth value.
Machine Learning Data:
- 10 days of Kinect-captured sleeping images as the machine learning training X attributes, with an even time interval of 30 seconds.
- 10 days of Jawbone data of sleep cycle timeline as the training Y feature.
- [X1, X2, X3, X4, X5] are 5 consecutive pixel-wise sleeping image differences.
- [Y] is the prediction of the sleep depth of the following 30 seconds.
Sleep Image Example:
<Will be published soon>
<Will be published soon>
Algorithms:
- Kinect data cleaning method: By calculating Mean square error (MSE) between adjacent images, differences between images are thus evaluated.
- Lasso regression models: Give a set of input measurements x1, x2 ...xp and an outcome measurement y, the lasso fits a linear model y=b0 + b1*x1+ b2*x2 + ... b5*x5. The result y is to predict the next 30 second's body changing data(kinect’s data) by the use of previous 150 seconds' difference between each two graphs consecutively, and deep/light modes during each time period. 1 represent light mode, and 0 represents deep mode. If the predict result is larger than the threshold, we treats it as a light sleeping mode, else deep sleeping mode.