HUMAN CONTEXT RECOGNITION WITH REDUCED FEATURE SPACE VECTORS FOR RESOURCE CONSTRAINT GADGETS

The aim of this paper is to determine the minimal features to train classification algorithms pertaining to context recognition using data collected from accelerometer sensor in smartphones. A detailed experimental evaluation of various time and frequency domain features on raw accelerometer sensor data collected from smartphones leads to the most influential minimal collection that aid in recognizing human context in resource constraint gadgets. To substantiate the study, four classifiers, namely, Logistic Regression, Support Vector Machine, Artificial Neural Network and Long Short Term Memory Recurrent Neural Networks are trained on six activities Sitting, Standing and lying (sedentary activities), Walking, Walking Upstairs and Walking Downstairs (dynamic activities). The raw accelerometer values from UCI public dataset and the data collected from Android application is used to build classification model. Classifier performance on both datasets showed 90% accuracy with four features taken over each axes of 3-axis accelerometer.


INTRODUCTION
User context recognition has become a major area of research over a decade. With the advent of smartphones with inertial sensors and the knowledge that these sensor data gives valid information towards developing ubiquitous applications in every domain of human life, has led to the widespread research in human context recognition. The research history has substantiated the role played by accelerometer sensors in smartphones to accurately determine human activities. The major challenge imposed by smartphones is the resource constraints while performing highly complex computations. This paper explores the most promising statistical features that could be extracted from raw accelerometer signal data collected from smartphones and determines the classification accuracy using machine learning classifiers Logistic Regression, Support Vector The classifiers are applied on raw accelerometer values available from the public dataset, Smartphone-Based Recognition of Human Activities and Postural Transitions Data Set [5], and data collected from Android application and has attained 90% accuracy. In addition to evaluating the classifiers using the minimum extracted time domain features, the impact on sample window size and the dominance of axis signal data on the selected activities are also determined.
Researchers have used up to 561 features [17] to perform activity recognition and postural transitions using Random Forest classifier. They also indicate that features created from accelerometer signals are more relevant for recognition than features created from gyroscope signals. Bao & Intille [3] used five biaxial accelerometers to collect data from 20 users and used decision tables, instance-based learning and Naïve Bayes classifiers to recognize twenty daily activities on a 512 sample 50% overlapped window. Features were extracted from both time and frequency domains.
The first work on activity recognition using accelerometer sensor in smartphone appeared in Kwapisz [13], where forty-three summary features were extracted from 200 samples collected from 10-second window. They used decision tree, logistic regression and neural networks for 229 HUMAN CONTEXT RECOGNITION WITH REDUCED FEATURE SPACE VECTORS detecting six activities. Anguita [1] used fixed-point arithmetic multiclass Support Vector Machine approach with 17 features estimated from a set of measures in time and frequency domain.
Harasimowic [7] emphasized that the size of the time window correspond to the time of a certain, basic movement within an activity with the highest results for SVM classifier on a window of seven to eight seconds.
Kose [12] performed online classification using clustered kNN method where the features computed were compared one by one with the values in the compact training sets created during the pre-processing step. Otebolaku [19] extracted 90 features from a combination of orientation, acceleration and rotation vector sensors. 30 separate features were extracted from each sensors on a window of length 64 with 50% overlapping samples to recognize seven activity contexts using 11 classifiers. Ignatov [9] proposed solution for user independent human activity recognition problem based on Convolutional Neural Networks using short recognition intervals. Yuan [25] integrated several Extreme Learning Machine (ELM) classifiers by averaging their output and thereby improving the accuracy of ELM classifier by 3.6%. Tang [4] extracted 24 features related to mean and standard deviation with kNN algorithm alone having an accuracy over 90%.
Siirtola [24] extracted 21 features form magnitude acceleration sequence to recognize five different activities. The QDA classifier helped to reduce the CPU usage and thus can be implemented in smartphones. Attal [2] and Kwon [14] discusses the requisite to consider various time domain and frequency domain features for context recognition.
Hong [10] .used two smartphones in either pant pockets along with several other wearable sensors and applied mean and standard deviation on channel that resulted in a 158 dimensional input space. 17 features were extracted by Nurhanim [18] whereas 18 identical features contributed to the research by [6] [16][20] [23]. Now researchers incorporate data streams from smart watches [15][21] [22] in addition to data from smartphones for better recognition of human context.
In this paper we have used four statistical features, namely, mean, standard deviation, skewness and kurtosis along the three axis of accelerometer and classification evaluated using four classifiers on two data sets. Section II describes context recognition methodology with data acquisition system, feature selection and context recognition. Section III explains our experiment and result analysis.

HUMAN CONTEXT RECOGNITION
Smartphones are equipped with dynamic accelerometer, an electromechanical device which can measure acceleration forces, on three-axis which determines very sensitive shifts in movement.
Data collected by accelerometer sensor include the acceleration along the x-axis (horizontal/ sideways movement), y-axis (upward/ downward movement) and z-axis (forward/ backward movement).

Data Acquisition System
An Android application implemented in the Galaxy Note3 SM-N9005 smartphone captures data from accelerometer sensor of smartphone placed in shirt pocket of candidate user and is transferred to the defined port in a push server, the node server. The speed/ interval in which the values, x-yz-coordinates, are captured by the phone can be controlled from application interface. The x-y-z acceleration values thus pushed from the phone is saved in MySQL database. The values can be captured in fast or normal speed mode, depending on the target requirement.
A graph is plotted for each of the x-y-z coordinate axis separately as well as in combination which represents the patterns formed by the axes values for different activities as shown in Fig. 1 (a), (b).
Data is collected from 25 users for walking, walking upstairs, walking downstairs, sitting, standing and laying.

Feature Selection
The raw data collected from accelerometer sensor is cleaned to minimize the effect of noise using a low pass filter [11]. Several block sizes ranging from 32 samples to 512 samples are applied to classifier and accuracy score is determined. It is concluded that a block size of 128 samples gives the best accuracy score.  Fig 1 (b) Web application that records the data stream received from the application via node server.
The following features [8] are computed for each axis.
The mean of the window is determined as (1) The standard deviation of the sliding window is determined as (2) The frequency skewness of the window is obtained as The frequency kurtosis of the sliding window is obtained as

Activity Classification
Our work is evaluated using major classifiers that exhibited good performance in previous works, A single layer LSTM recurrent neural network is also trained using the above extracted features with 64 neurons.
The classification accuracies concluded that the selected features are optimal to reasonably perform context recognition on raw data streams from accelerometer.
The performance of classifiers are evaluated using precision -recall metrics [2] given in (7) to (9).

EXPERIMENTS AND RESULTS
Data collected from the system are categorized into two -data collected from 70% of users formed the training set and data from 30% of users formed the test set. Six activities are chosen, namely,

Sitting, Standing and lying (sedentary activities), Walking, Walking Upstairs and Walking
Downstairs (dynamic activities). The classifiers are trained on annotated training set and evaluated using the test data.

Implementation
The accelerometer data is divided into blocks of size 128 which is determined by the accuracy of classifiers used and the influence of individual axis on activities.
Since we target the application in a resource constraint device, it is always recommended to minimize the computation and memory usage. Mean, Standard Deviation, Correlation, Percentile, Inter Quartile, Root Mean Square, Minimax, Entropy, Skewness and Kurtosis [24] features are extracted from both the data sets in a 50% overlapped window. Various combination of above mentioned features are applied on the blocks and experimental results shows that the classifiers give good accuracy scores with Mean, Standard Deviation, Skewness and Kurtosis. The remaining features contribute minimally to accuracy scores of classifiers.

Performance Evaluation
The

A. Classification results using public data set
The evaluation is performed on a public dataset, Smartphone-Based Recognition of Human   The train and validation curve of LSTM-RNN classifier, given in fig.2, show that the model has good learning ability.

CONCLUSION
The ubiquitous nature of smartphones has paved the way to numerous applications in various domains related to human positional and transitional data. This paper describes the implementation of context recognition using minimal features selected on four classifiers and compared the evaluation on a public dataset and data acquired using our application. The performance of classifiers with both data sets shows comparable results in less computation and complexity.
Misclassifications are maximum between ascending and descending stairs activities. LSTM-RNN deep learning method also proves that the features are optimal for a good learning model.
In the present work, the sensor test application performed data acquisition by carrying smartphone in shirt pocket. We plan as future work to acquire position independent data from accelerometer in smartphone and perform signal processing so that the context recognition task could be generalized independent of user and position, yet consuming minimum resources. A deep learning solution using Gated Recurrent Unit is also under consideration. It is noted that the range of variation of axis data values for each activity is sufficient to predict basic activities except a slight confusion between climbing upstairs and downstairs which could be alleviated by signal processing.

APPENDIX
The precision-recall curve showing the trade-off between precision and recall for different activities for the classifiers over various windows on UCIHAR and Sensor Fusion datasets are depicted in Fig 6 and confusion matrices are depicted in Fig.7.

CONFLICT OF INTERESTS
The author(s) declare that there is no conflict of interests.