Mobile Device Monitoring
To detect the driver’s phone movement, especially raising it from hip to ear, we developed a native Android application to record changes in the device’s x, y, and z axis through the accelerometer.
Simply setting a threshold to the three values will be enough to detect significant movement of the phone. However, the acceleration changes during driving is rather complex, and it is equally distracting to receive extraneous warnings during that can be attributed to normal driving behavior. A sudden brake or vibrations caused by driving on a rough road should not be enough to flood the driver with notifications. Therefore, a machine learning model is introduced to allow for more consistent reporting. The input is a vector of 15 elements, since the accelerator can get up to 5 (x, y, z) data points in a single second and the primary action we’re monitoring for can be completed in less than 1 second. Approximately 500 records of regular movement and approximately 200 records of phone raising (including both right and left side) were gathered as the training data and used to train a Xgboost model in the AWS Sagemaker. After we have the model, we make the Android application stream the 5 (x, y, z) acceleration tuples through Kinesis, since it is power consuming to run a machine learning model on a smart phone. A python script running on EC2 will get the data from AWS Kinesis, analysis the data and send warnings if needed. |