| Literature DB >> 31991636 |
Sijie Zhuo1, Lucas Sherlock1, Gillian Dobbie2, Yun Sing Koh2, Giovanni Russello2, Danielle Lottridge2.
Abstract
By developing awareness of smartphone activities that the user is performing on their smartphone, such as scrolling feeds, typing and watching videos, we can develop application features that are beneficial to the users, such as personalization. It is currently not possible to access real-time smartphone activities directly, due to standard smartphone privileges and if internal movement sensors can detect them, there may be implications for access policies. Our research seeks to understand whether the sensor data from existing smartphone inertial measurement unit (IMU) sensors (triaxial accelerometers, gyroscopes and magnetometers) can be used to classify typical human smartphone activities. We designed and conducted a study with human participants which uses an Android app to collect motion data during scrolling, typing and watching videos, while walking or seated and the baseline of smartphone non-use, while sitting and walking. We then trained a machine learning (ML) model to perform real-time activity recognition of those eight states. We investigated various algorithms and parameters for the best accuracy. Our optimal solution achieved an accuracy of 78.6% with the Extremely Randomized Trees algorithm, data sampled at 50 Hz and 5-s windows. We conclude by discussing the viability of using IMU sensors to recognize common smartphone activities.Entities:
Keywords: machine learning; real-time classification; smartphone IMU sensors; smartphone activity recognition
Year: 2020 PMID: 31991636 PMCID: PMC7038357 DOI: 10.3390/s20030655
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1Ten seconds of acceleration data for a. typing (left) and b. watching (right), both while seated. The acceleration data for typing shows greater variation while the data for watching is smoother.
Sensors and features used in prior research on human activity recognition with smartphones.
| Sensors | Features | Reference |
|---|---|---|
| Accelerometer, Gyroscope | Mean, Standard Deviation, Mean Absolute Deviation, Window Maximum Value, Window Minimum Value, Frequency Skewness, Maximum Frequency, Average Energy, Signal Magnitude Area, Entropy, Window Interquartile Range, Pearson Correlation Coefficients, Frequency Signal Weighted Average, Spectral Energy and Angle between a Central Vector and Mean of Three Consecutive Windows | [ |
| Accelerometer, Gyroscope | [ | |
| Accelerometer, Gyroscope, Magnetometer | Mean, Average Absolute Difference, Standard Deviation, Average Resultant Acceleration and Histogram | [ |
| Accelerometer | Mean, Elapse Time between Consecutive Local Peaks, Average of Peak Frequency (APF), Variance of APF, Root Mean Square, Standerd Deviation, Minmax Value and Correlation | [ |
| Accelerometer, Gyroscope, Magnetometer | Mean, Variance, Standard Deviation, FFT Coefficient, Zero Crossing Rate, Maximum Correlation Value and Index of Max Correlation | [ |
| Accelerometer | Mean, Standard Deviation, Average Absolute Difference, Average Resultant Acceleration, Time between Peaks and Binned Distribution | [ |
| Accelerometer, Gyroscope | Mean, Standard Deviation, Median Absolute Value, Window Maximum Value, Window Minimum Value, Signal Magnitude Area, Energy, Interquartile Range, Entropy, Autoregression Coefficient, Correlation, Maximum Frequency Index, Mean Frequency, Skewness, Kurtosis, Energy Band, and the Angle between Two Vectors | [ |
| Accelerometer | Autoregressive Coefficients and Signal Magnitude Area | [ |
| Accelerometer, Gyroscope, Magnetometer | Mean, Standard Deviation, Magnitude, Window Maximum Value, Window Minimum Value, Semi-quartile, Median and Sum of the First Ten FFT Coefficient | [ |
| Accelerometer | Mean, Standard Deviation, Variance, Skewness, Kurtosis, Correlation and Signal Magnitude Area | [ |
Figure 2Study data collection and processing workflow: a user uses the smartphone for specified time periods and specified activities, while sensor data is recorded. In real time, data is transmitted and classified.
Figure 3Foyer of the building used for the walking condition, selected to simulate the real walking conditions that smartphone users might experience in daily life.
Figure 4Screenshots of the four tasks which participants completed as part of the study, while software collects the IMU sensor data. Each of the four tasks is completed while sitting and while walking.
List of features and description for the investigation of recognition of smartphone activities with inertial measurement unit (IMU) sensors.
| Features | Number of Parameters | Description |
|---|---|---|
| Mean | 9 | The average value of the data for each axis in the window |
| Standard Deviation | 9 | Standard deviation of each axis in the window |
| Variance | 9 | The square of the standard deviation of each axis in the window |
| Mean Absolute Deviation | 9 | The average difference between the mean and each of the values for each axis in the window |
| Window Minimum Value | 9 | The minimum value of the data for each axis in the window |
| Window Maximum Value | 9 | The maximum value of the data for each axis in the window |
| Inter-quartile Range | 9 | The range of the middle 50% of the values for each axis in the data |
| Average Resultant Acceleration | 3 | The average of the square roots of the sum of the squared value of 3 axis for each type of sensor in the data |
| Skewness | 9 | The degree of distortion of each axis from the symmetrical bell curve in the window |
| Kurtosis | 9 | The weight of the distribution tails for each axis in the window |
| Signal Magnitude Area | 3 | The normalized integral of 3-axis for each type of sensor in the window |
| Energy | 9 | The area under the squared magnitude of each axis in the window |
| Zero Crossing Rate | 9 | The number of times the data crossed the 0 value for each axis in the window |
| Number of Peaks | 9 | The number of peaks for each axis in the window |
Figure 5Correlation table before and after feature extraction.
Figure 6Autocorrelation for the final selected features.
Cross-validation accuracy and standard deviation for the classification algorithms trained for different window sizes.
| Algorithms | 50 Hz with 2.56 s Window Size | 50 Hz with 5 s Window Size | 50 Hz with 8 s Window Size | 5 Hz with 2.56 s Window Size | 5 Hz with 5 s Window Size | 5 Hz with 8 s Window Size |
|---|---|---|---|---|---|---|
| MLP |
|
|
|
|
|
|
| SVM |
|
|
|
|
|
|
| KNN |
|
|
|
|
|
|
| Bagging |
|
|
|
|
|
|
| AdaBoosting |
|
|
|
|
|
|
| RF |
|
|
|
|
|
|
| ET |
|
|
|
|
|
|
Cross-validation accuracy and standard deviation for the classification algorithms trained for longer window sizes.
| Algorithms | 50 Hz with 10 s Window Size | 50 Hz with 15 s Window size | 50 Hz with 20 s Window Size | 5 Hz with 10 s Window Size | 5 Hz with 15 s Window Size | 5 Hz with 20 s Window Size |
|---|---|---|---|---|---|---|
| MLP |
|
|
|
|
|
|
| SVM |
|
|
|
|
|
|
| KNN |
|
|
|
|
|
|
| Bagging |
|
|
|
|
|
|
| AdaBoosting |
|
|
|
|
|
|
| RF |
|
|
|
|
|
|
| ET |
|
|
|
|
|
|
Figure 7Confusion matrix for the three models (Multi-Layer Perceptron (MLP), Random Forest (RF) and Extremely Randomized Trees (ET)) with different frequencies.
Cross-validation score for the three models (MLP, RF and ET) with different frequencies.
| Algorithms | All Labels | Combined Reading and Scrolling |
|---|---|---|
| MLP with 50 Hz data |
|
|
| RF with 50 Hz data |
|
|
| ET with 50 Hz data |
|
|
| MLP with 5 Hz data |
|
|
| RF with 5 Hz data |
|
|
| ET with 5 Hz data |
|
|
Figure 8Confusion matrix for the three models (MLP, RF and ET) with different frequencies, after combining labels.
Precision, recall and F1-score for MLP, RF and ET.
| Algorithms | Precision | Recall | F1-score |
|---|---|---|---|
| MLP with 50 Hz data | 0.961 | 0.959 | 0.960 |
| RF with 50 Hz data | 0.963 | 0.952 | 0.957 |
| ET with 50 Hz data | 0.978 | 0.971 | 0.974 |
| MLP with 5 Hz data | 0.922 | 0.915 | 0.918 |
| RF with 5 Hz data | 0.931 | 0.908 | 0.915 |
| ET with 5 Hz data | 0.940 | 0.913 | 0.921 |
Results of the questions after reading task as an approximation of reading quality.
| Article 1 | Article 2 | Article 3 | Correctness | |
|---|---|---|---|---|
| Sitting Condition | Correct: 5, Incorrect: 4 | Correct: 2, Incorrect: 1 | Correct: 4, Incorrect: 2 | 61.1% |
| Walking Condition | Correct: 1, Incorrect: 3 | Correct: 2, Incorrect: 6 | Correct: 2, Incorrect: 4 | 27.8% |
| Correctness | 40.3% | 50% | 50% | 44.5% |
Frequencies of participants’ smartphone activities.
| Activities | Constantly throughout the Day | A Few Times a Day | Daily | A Few Times per Week | Once a Week or Less |
|---|---|---|---|---|---|
| Typing | 38.1% | 42.9% | 14.3% | 4.8% | 0% |
| Reading | 42.9% | 38.1% | 14.3% | 4.8% | 0% |
| Watching video | 4.8% | 33.3% | 14.3% | 28.6% | 19.0% |
| Scrolling news feeds | 33.3% | 33.3% | 23.8% | 4.8% | 4.8% |
| Typing while walking | 4.8% | 38.1% | 19.0% | 23.8% | 14.3% |
| Reading while walking | 14.3% | 14.3% | 23.8% | 28.6% | 19.0% |
| Watching video while walking | 0% | 4.8% | 0% | 28.6% | 66.7% |
| Scrolling news feeds while walking | 9.5% | 4.8% | 28.6% | 28.6% | 28.6% |
Figure 9Accuracy vs sample size plot for the three models (MLP, RF and ET).