scieee AI-readable full text Open interactive document viewer

Using conventional cell phones to recognize basic physical movements

Tormashova, Oxana

Abstract

[ANGLÈS] Human activity recognition system via wearable sensors can provide valuable information about person's life-style and can help to monitor human activities in order to improve person's interaction with environment. In current work we research possible approaches to development of an accelerometer sensor based system for human activity recognition. The movements are described with accelerometer data, gathered by means of sensor embedded in mobile phone. For each type of movements a feature vector is created and is further processed by a classification system to generate a classification rule. The result rule is used to recognize a particular human activity. The purpose is to develop a program that implements a human activity classification system for a mobile phone with sufficient accuracy.

Full text

Abstract--Human activity recognition system via wearable sensors can provide valuable information about person's lifestyle and can help to monitor human activities in order to improve person's interaction with environment. In current work we research possible approaches to development of an accelerometer sensor based system for human activity recognition. The movements are described with accelerometer data, gathered by means of sensor embedded in mobile phone. For each type of movements a feature vector is created and is further processed by a classification system to generate a classification rule. The result rule is used to recognize a particular human activity. The purpose is to develop a program that implements a human activity classification system for a mobile phone with sufficient accuracy. Index Terms--Accelerometer, Human activity recognition, Adaboost, Gaussian Models, KNN, KMeans. I. INTRODUCTION N modern time of widely spread mobile devices people do NOT imagine their life without mobile devices, such as PDAs, mobile phones, and other portable personal electronic devices. These devices are equipped with different types of sensors as a standard component of the control. The information from these sensor can be used in systems that are capable of automatic recognition and classifying specific physical activities of human beings. The aim of activity recognition system is to recognize the activity of its user based on previously monitored and analyzed data about behavior of the person, and take necessary actions in response. It may help improving the performance of healthcare monitoring devices or promoting the development of advanced human-machine interfaces. I The acceleration sensor, i.e. accelerometer, in particular, now among the standard features in most mobile phones and entertainment devices, can be used as a source of information about its owner’s activity and motion. An accelerometer measures proper acceleration of a device and returns a realtime measurement of acceleration along the x-, yor z-axis to be used as a human motion detector. Analysis of acceleration signals enables recognition of different type of human motion activities such as walking, running, standing up, etc, which is a rich source of context information for a mobile application. Accelerometers have been widely accepted due to their compact size, their low-power requirement, low cost, nonintrusiveness and capacity to provide data directly related to the motion of people. Most of the systems proposed in the literature utilize data from an accelerometer in combination with data from other sensing devices like gyroscopes or EMG sensors in order to enhance the system’s performance. It increases the number of required sensors for the classification system. The additional limitation is the number, location and nature of sensors that people will tolerate. That's why development of a single sensor system for human activities recognition is a challenging but promising research area. Activity recognition requires a technique that can achieve required level of reliability of recognition while being used under the conditions of daily living. The aim of the current work is to research a possibility of building a recognition system based solely on data from a single 3-axis accelerometer and to develop a software that implements the algorithm of movement recognition on a mobile phone. For a general analysis the signal processing flow is shown in a following figure: Fig. 1. Signal process flow for accelerometer data. II. APPROACHES TO HUMAN ACTIVITY RECOGNITION There is a bulk of human motion analysis literature. Many techniques have already been proposed for activity recognition in specific environment (e.g. laboratory) using the cooperation of several sensors. Three mainly utilized approaches for activity recognition are: video based, environmental sensor based and wearable sensor based. A. Video based systems This type of system use video cameras to obtain information about human activities. These systems works good enough in the specific environment, but have a significant drop of accuracy in real home settings [1]. Changes of the scene, variable light, increasing number of people in the scene etc, provides a significant challenges while processing of the information. The other limitation of such systems is that they are tied to a specific location and can't be used for monitoring activities of a person outside of 1 Using conventional cell phones to recognize basic physical movements Oxana Tormashova, ETSETB UPC this location. In addition, the cost of utilized sensor such as microphones and camera are high enough. B. Environmental sensor based systems The aim of these system is to monitor the interaction between users and their home environment [1, 2]. They use a set of ambient sensors distributed through the person's living environment. The system monitor the occupants of the home all day. The data gathered by these sensors can be used in order to intelligently adapt the environment to persons needs. Like the video based systems environmental systems depend on location and can't monitor outside of the living environment. They also are infrastructure dependent. C. Wearable sensor based systems Such systems utilize wearable during normal daily activity sensors. They continuously monitor bio-mechanical and physiological data of the person independent of his location. This type of sensors can be attached to a person by means of clothes, jewelry or worn as independent wearable devices. They can measure physical parameters that can not be measured by other types of sensor systems and thus are well suited for collecting data of human activities in order to classifier and recognize activity patterns. In addition this type of sensors are low-priced and do not invade as actively peoples privacy as video sensors for example. There are different types of body-attaches sensors, such as electromechanical switches, goniometers, accelerometers, gyroscopes, pedometers, and actometers, that can be used to monitor human movements in free-living environment. Of all these accelerometers were considered to be a useful tool for collecting physical information about human movements. By means of accelerometers it's possible to gather information about both frequency and intensity of movement. Some type of accelerometers can in addition measure body tilt. Accelerometers are miniature and low cost and is useful for development of small lightweight, portable systems that can be worn by person during day without too much inconvenience for the person. In this work we try to develop and implement in programming code a movement recognition system based on a single tri-axial accelerometer sensor embedded in a mobile phone. III. RELATED WORK IN ACTIVITY RECOGNITION USING ACCELEROMETER Most studies on the use of wearable devices in monitoring have used multiple sensors, typically accelerometers fixed to specific places on the body, usually a subset of the thighs, wrists, arms, sternum, waist and lower legs[3, 4, 5]. The limitation of such approach is number and location of these devices. A smaller number of studies have investigated the use of a single accelerometry device attached at the waist, sternum or back[6, 7]. A single sensor can be integrated into a mobile device, such as cell phones or wristwatches, and is more comfortable for the person in daily use. In order to compensate for one sensor it can be located in different places on the person. Although the use of a larger number of sensors is likely to provide a higher accuracy of movement classification, such a system may be uncomfortable and inconvenient during longtime monitoring of daily activities. In [13] was shown that placing accelerometer at only two locations (either the hip and wrist or thigh and wrist) did not affect activity recognition scores significantly (less than 5%) when compared to a system with five sensors. The researches on movement classification from accelerometer data implemented wide variation of classification algorithm. In order to implement classification algorithm the software has to learn to recognize and associate activity patterns. This is called machine learning. There are two approaches to such techniques[15]: supervised or unsupervised. In case of supervised technique there is a set of activity data previously labeled and used to “train” classification algorithm. Once the training phase is complete, the classifier is able to assign an activity label to an unknown example of sensor data. With unsupervised approaches all the sensor data are passed to the algorithm which automatically identifies a number of states or data clusters, each of which may correspond to a particular activity. The range of classification methodologies can be divide into the following types[15]: A. Threshold-based classification The idea of the threshold-based classification is to compare obtained feature value with the specified threshold in order to decide whether a particular activity is being performed. Due to its implementation this approach is useful for discrimination between static postures and transitions between them using angles derived from accelerometers placed on different parts of body. Some of the researches have also applied threshold-based classification to the problem of differentiation between static postures and dynamic activity. In addition threshold-based classification has been successfully applied to the detection of falls. A range of features can be used in order to detect fall accident. The most common characteristic used to identify the presence of a fall is the rapid deceleration which occurs as the faller contacts the ground. The value of the threshold depends on location of the sensor. It is also possible to combine different thresholds in order to achieve better accuracy during classification[16, 17]. B. Hierarchical methods A hierarchical classification scheme construct a binary decision structure which is consists of of a number of consecutive nodes. At each node a decision rule is applied to input features. The result is either a final classification or a 2 transition value for feather classification process. The disadvantage of this approach is that the decision rules have to be determined before the testing based of manual inspection and analysis of the training data. Fig. 2. Example of the hierarchical classification scheme. Many researches utilized hierarchical in combination with other classification schemes [7 , 19]. C. Decision trees The decision tree approach is similar to hierarchical scheme. The difference is that decision trees use strict algorithms in order to define a set of rule for classification and thus automate the process. These algorithms examine features one at a time to determine the most suitable ones for discrimination of the activities and develop a set of rules that will be later used in a classification system. Decision trees has been applied to solve a wide range of classification problems[21, 22, 23, 46]. One of the most thorough studies was carried out in [20]. The authors combined time and frequency features and used five sensors to recognize 20 activities with an accuracy of 86%. D. K-nearest neighbor K-nearest neighbor algorithm (k-NN) is a method for classifying objects by constructing multidimensional feature space, in which each dimension corresponds to a different feature. First training data is placed in a feature space based on closure metric. Fig. 3. Example of the KNN classification. Then a new data is classified by defining the majority of the k-nearest neighbors which correspond to a given activity. The k value is varied from 1 to a small percentage of training data and is usually selected empirically. E. Artificial neural networks Artificial neural network (ANN) is a mathematical model or computational model that represents complex relationships between its inputs (independent variables) and outputs (dependent variables). ANN is an adaptive system that characterized by some form of optimization process that permits to obtain the output values for given set of inputs. First ANN is run over the training set, after that it can then be used to obtain the outputs for any set of inputs. Fig. 4. An artificial neural network is an interconnected group of nodes, akin to the vast network of neurons in the human brain. In case of activity classification ANN inputs usually are the sensor data and outputs - different classes of activities. ANNs have been widely used within the field of human movement research. One of the most common ANNs is referred to as a multilayer feed-forward neural network or Multi-Layered Perceptron (MLP) described in [30, 31]. In it input and outputs are interconnected through hidden layers, the flow of information through the network is controlled by the weighting of the links between the nodes and the transfer function within each node. This type of network is trained by iteratively optimizing the weights in order to accurately produce the desired training outputs from the corresponding inputs. MLP was used in many researches, such as [32, 33, 34] . An alternative to the feedforward ANN is the probabilistic neural network[35]. This type of network assume to have a example patterns for classification stored in memory and thus reduce time of training. Spiking or pulsed neural networks (PNN) [36, 37] work with much larger number of binary input that normal ANN and behave relatively well with accelerometer-base data[38]. F. Support vector machines Support vector machines (SVMs) [24] establish a popular machine learning method which is based on finding optimal separating decision hyperplanes between classes with the maximum margin between patterns of each class. In short it constructs for given example a classification between two classes, making it a non-probabilistic binary linear classifier. For a set of training data this algorithm is implemented on each of the examples marking it as belonging to one of two categories. The result model is used for assigning test data to a specific category. 3 Fig. 5. A two-dimensional example of SVM. The SVM analysis attempts to find a best 1-dimensional hyperplane (i.e. a line) that separates the cases based on their target categories. The vectors (points) that constrain the width of the margin are the support vectors. SVMs have only been applied in a small number of activity classification studies[6, 25, 26]. Three studies have used SVM techniques to differentiate between simulated falls and other activities. In [27] data from accelerometer were combine with data from microphone in order to differentiate between falls, walking and running. In [28, 29] data from from a tri-axial accelerometer embedded in a mobile phone were used for a fall recognition. G. Naive Bayes and Gaussian mixture models The Bayesian classifier is based on the estimated conditional probabilities or likelihoods of the signal patterns available from each activity class. The probability of unknown example being generated by a specific activity is estimated by means of likelihood function. With a naive Bayes classifier, the input features are assumed to be independent of each other. Under this assumption it is possible to present likelihood function for each class as a mixture of n simple probability density functions, where n is the number of features. In reality the assumption of independence between features is often violated but this approaches is popular due to its simplicity and ease of implementation[43, 44, 45]. The approach was studied in many researches but sometimes produce unstable results. In [3] authors suggested that the reason for this poor performance may have been the violation of assumptions that acceleration features can be considered conditionally independent and modeled by a normal distribution. Fig. 6. Example of Bayesian classifier. The likelihood is measured by drawing a circle around X(white circle) which encompasses a number (to be chosen a priori) of points irrespective of their class labels. Then a new object (white circle) is classified as a RED one, based on maximum likelihood value. A Gaussian mixture model (GMM) [10, 31, 9] is very similar to Bayes classifier. However, the likelihood function is to be of unknown shape and functional form and thus approximated by a weighted mixture of Gaussian functions. Fig. 7. Two-component Gaussian mixture model: data points, and equiprobability surfaces of the model. To improve the quality of GMM it is usual to fit these models many times with different parameters and choose the best result, as measured by the likelihood or some other external criterion. One of the most popular approximate inference algorithms that is used to calculated parameters and mixing coefficient of Gaussian components is the expectation-maximization algorithm (EM). Expectation-maximization is a wellfundamented statistical algorithm to get around this problem by an iterative process and it's the fastest algorithm for learning mixture models. But there are also other approaches. For example in [39] time-domain features were used to construct separated GMMs for a number of movements. For training instead of EM they employed a statistical estimate proposed in the field speech recognition. Classification of test data was achieved by selecting the GMM (activity) with the highest probability of having produced that particular set of features. H. Fuzzy logic Fuzzy logic is derived from fuzzy set theory and allows mapping from set of inputs to one or more outputs utilizing a set of if–then statements called rules. Fuzzy logic allows input data to have a partial membership in multiple sets. During the training process a training data first is assigned to fuzzy sets. Then the rules is applied to produce a corresponding output. In case of activity classification the example with the maximum membership is selected. Fig. 8. Example of fuzzy logic membership functions Although fuzzy logic should be more suitable for dealing with real-world problems than normally used hierarchical or decision tree classification schemes it's been applied to a limited number of activity classification problems f.e. to identify different static postures or to differentiate between 4 different movements [40, 49], to identify sit-to-stand and stand-to-sit transitions [41], to identify falls [42]. I. Markov chains and hidden Markov models For specific movements, some transitions between activities are more likely to occur than others. For such problem can be used hidden Markov models (HMM), that represents Markov chains with unknown (or hidden) state of the model at any given time. The states can only be determined from observable parameters which depend on the state. For classification purpose the features obtained from sensor data are defined as observable parameters and different activities correspond to the state of the model. States in a HMM can correspond to more than one activity. As previously describe techniques HMM is firstly trained with example data. Then it can then be used to determine witch sequence of state transitions is the most likely could have resulted from an observed sequence of features. HMMs are trained by determining state transitions along with the probabilities that each possible set of observations (features) will be observed for a given state. HMMs is one of the most popular approaches in literature[47, 48, 50]. It can be used as a single classifier just like a part of a two-stage classification scheme (e.g in combination with boosting algorithm[47]). J. Combining different classifiers Recently meta-stage schemes for classification analysis has gained popularity. They improve performance of single classifiers by combining their output using different techniques. These include majority voting (where the class with the majority of votes is accepted), stacked generalization (which trains the base classifiers and then uses their predictions as data to a new learning stage) or boosting (which assigns weights to the training patterns to combine the performance of weak classifiers). In [23] five base-level classifiers in a boosted scheme for eight common activities were studied. In general, when an inter-subject design was used, the boosted SVM was shown to outperform other metalevel classification schemes. AdaBoost is a type of adaptive boosting that adapt multiple weak classifiers to create a single more reliable one. Fig. 9. Example of AdaBoost with two weak hypothesis. It combines two learners, h1 and h2, in order to obtain a “good” learner. Neither h1 nor h2 is a perfect learner. Initially AdaBoost chooses the one that classifies more data correctly. Then the data is re-weighted to reduce the impact of the misclassified data[51]. This process continues and at each step the weight of each week learner among other learners is determined. The obtained at the end of iterations combination of “weak” learners will be a “good” learner, that classifies the given data more accurately that each learner separately. IV. CLASSIFICATION PROCEDURE Classification process consists of training phase and test phase. The training phase includes processing the labeled set of movement data and generating a classification rule for each movement as the result. The training were carried out using whole learning data, generating classification rule for each type of movement. Test phase were conducted in two steps: for the set of data that were previously included for generating classification rule in training phase; and for independent set of movement data, that were not used for generation of the classification rules. Accuracy was calculated as follows: Test data is automatically labeled in order to evaluate the recognition accuracy of the test phase. V. ACCELERATION DATA For the current work was used a smart-phone with Android OS and a a built-in tri-axial accelerometer. The accelerometer records linear acceleration information along x, y, z axis that is applied to a device itself. Fig. 10. The coordinate-system of the Android-based mobile phone. It is defined relative to the screen of the phone in its default orientation. The axes are not swapped when the device's screen orientation changes. When the mobile phone is placed in the upright position the y-axis acceleration direction reflects the up and down body movement, forward movement was along the z-axis and side movement was assigned to the x-axis. In the experiment performed in this research, the movement data collection the phone were held in the hand while moving. During collection the change of acceleration was measured while the subject was repeating postures such as standing, sitting, walking, falling, going upstairs and downstairs. The acceleration data was collected during a short directed routine performed by a person and was recorded by a mobile phone 5 application in a text file with corresponding title in a following format: time-stamp, x acceleration, y acceleration, z acceleration. The set of instructions for data collection can be summarized as following: 1. Select movement type. 2. Press the button to start the testing. 3. Wait a few seconds before the recoding starts. 4. Make the motion. 5. Press stop to end recording. Different physical activities results in different patterns in data provided by acceleration sensors, and thus can be classified accordingly. The example of gathered data captured by acceleration sensors over time (samples) can be seen on the following figures: Fig. 11. The acceleration values for x, y, z direction for each observed movement. Different activities has been placed on the figures. As can be seen, there is a significant difference in pattern of acceleration for different activities. For the purpose of and in order to remove to remove the dependence on phone screen angle gathered data was preprocessed by calculating in addition the angle of inclination with respect to the horizontal plane for gathered data. Data processing of training data was performed offline, after a recording had been completed. The result of this was the classification of training data that can be used later in mobile application in order to classify the new movement in real-time. VI. WINDOWING TECHNIQUES Most classification methods before processing sensor data divide the sensor signal into smaller time segments by means of different windowing techniques. Then classification algorithm is applied for each window data separately. The information then combined in order to generate an activity profile for the whole signal. In activity monitoring three windowing techniques are used: sliding windows, event-defined windows and activitydefined windows. In case of sliding widow the signal is divided into small windows of fixed length without gaps between them. As a variation of sliding window exist overlapping sliding widow approach. Fig. 12. Example of sliding widow technique: simple sliding window and overlapping sliding window. This approach doesn't require preprocessing of the sensor signal and is very simple in implementation, thus can be used in real-time applications. Due to simplicity of this approach it's used by the most of movement recognition systems. In this work exactly this approach was used. In event-defined approach the signal is preprocessed in order to locate specific events as points for and defined successive windows. As events may not be uniformly spaced in time, the window size is not fixed. Fig. 13. Example of event-defined widow technique In case of activity-defined windows the times when activities changes is determined. These points define the definition of sensor data into windows, each of of which correspond to a different activity. Fig. 14. Example of activity-defined widow technique VII. FEATURE SELECTION AND EXTRACTION For the purpose of automatic classification of acceleration data it should be preprocessed into a subset of feature variables with high information content. 6 Standing up mov2.sta 3v*480c x y z 1 21 41 61 81 101 121 141 161 181 201 221 241 261 281 301 321 341 361 381 401 421 441 461 481 -2 0 2 4 6 8 10 12 14 16 Sitting down mov3.sta 3v*480c x y z 1 21 41 61 81 101 121 141 161 181 201 221 241 261 281 301 321 341 361 381 401 421 441 461 481 -4 -2 0 2 4 6 8 10 12 14 Going upstairs mov4 3v*480c x y z 1 21 41 61 81 101 121 141 161 181 201 221 241 261 281 301 321 341 361 381 401 421 441 461 481 -4 -2 0 2 4 6 8 10 12 14 16 Going downstairs mov5.sta 3v*480c x y z 1 21 41 61 81 101 121 141 161 181 201 221 241 261 281 301 321 341 361 381 401 421 441 461 481 -4 -2 0 2 4 6 8 10 12 14 16 18 Walking mov0.sta 3v*480c x y z 1 21 41 61 81 101 121 141 161 181 201 221 241 261 281 301 321 341 361 381 401 421 441 461 481 -4 -2 0 2 4 6 8 10 12 14 Fall mov1 3v*96c x y z 1 5 9 13 17 21 25 29 33 37 41 45 4 9 53 57 61 65 69 73 77 81 85 8 9 93 97 -20 -15 -10 -5 0 5 10 15 20 In order to moderate rapid and dramatic change in gathered accelerometer values a simple Kalman filter was implemented. The data was processed through filter before extraction of the features. The parameters of the filter are the following: observation H = 1, state transition F = 1, noise covariances Q = 5 and R = 5 , the control-input model B = 0 and initial covariance = 0.1 Fig. 15. Original x-acceleration and filtered signal. The chosen parameters for Kalman fiter: H=1, F=1, R=5, Q=5, initial covariance = 0.1. In addition to x, y and z accelerometer signals were calculated a magnitude signal as follows: Time domain features are obtained directly from accelerometer signals and usually represent statistical values. In time domain for each acceleration and magnitude signals were calculated: minimum and maximum values, mean values, standard deviation, correlation between axis, root mean squared acceleration, interquartile range and zero crossings (number of sign changes in the segment). For frequency domain features obtained from accelerometer data transformed into the frequency domain using a fast Fourier transform (FFT). The aggregated FFT signals and energy were calculated in order to characterize the spectral distribution. In the dataset, the acceleration data stream from one movement was divided using a sliding window approach into overlapping rectangular windows 2.5 seconds each. Over each window a vector of the previously described features was calculated. The segmentation is done for all three acceleration signals x, y, z. Fig. 16. Types of features used in current study. The segments at this stage are still represented as time series. Then for each segment one feature vector is created that consists of all previously described features. VIII. METHODS USED IN STUDY In this work were used three methods of classification in order to specify the most suitable one for movement recognition. A. K-Means Clustering Algorithm K-means is a very simple and fast algorithm for clustering data. It computes the geometric center of samples belonging to the same category in training set. The test sample is classified by finding the nearest center. It requires very little resources for training phase and thus is a possible candidate for a classification algorithm that can be used in a real-time movement recognition system. In movement recognition systems with wearable sensors Kmeans algorithm mostly used for filtering or combining data before processing it through main classifier. In [53] K-means algorithm was used to recognize touch gesture types in unsupervised analysis. The other study [54] used k-means to construct a compressed dataset for the SVM classifier in order to reduce redundant information in the original data set. B. k-Nearest Neighbors Classification The second algorithm that were implemented in current study is k-Nearest Neighbors classification. It is one of the most well-known and widely used nonparametric pattern classification methods. There are two basic problems that are yet to be resolved by the research community and can be viewed as serious disadvantages. The first issue is the selection of the best number of neighbors to consider. The second issue is the computational and the storage issue. The traditional KNN algorithm requires the storage of the whole training set which may be an excessive amount of storage for large data sets and leads to a large computation time in the classification stage. Despite its shortcomings k-Nearest Neighbors is one of the most popular classification algorithms as it's simple in implementation, effective and fast. C. AdaBoost Classifier The general idea of boosting algorithm is to try to build a “good” learning algorithm based on a group of ”weak” classifiers. The one of the most popular machine learning algorithms AdaBoost was proposed by Freund and Schapire in 1995 [11]. As AdaBoost is an algorithm that works under supervising, a training set of data has to be label previously. This labeled data set should contain both correct samples labeled as “+1” and incorrect samples labeled as “ − 1.” One of the main ideas of the algorithm is to maintain a distribution or set of weights over the training set. For each 7 Simple Kalman filter original signal filtered signal (R 5, Q 5) 1 7 13 19 25 31 37 43 49 55 61 67 73 79 85 91 97 103 109 115 121 127 133 -1,0 -0,8 -0,6 -0,4 -0,2 0,0 0,2 0,4 0,6 0,8 1,0 example xi the weight of this distribution is defined. Initially, all weights are set equally, but on each round, the weight of incorrectly classified examples increases and thus decrease its impact on the result strong classifier. An individual weak classifier is simple and easy to implement. Its classification accuracy is relatively low. To improve accuracy a strong classifier is obtained as a combination of weak classifiers. The strong classifier will have a higher classification accuracy than each weak classifier. The implementation of AdaBoost is simple and depends on choice of “weak” classifier. As a weak classifier in this work we use a simple threshold-based classification. The algorithm of it is the following: Given: Input sequence of N feature vectors x(x1..xN), where each x∈Rd , number C of clusters to partition the data set and maximum number of iterations T. 1. Fixed one of the features. Select and order values for a chosen feature in training dataset. 2. Set threshold. 3. Make hypothesis of the correct location of the feature regarding selected threshold. 4. Find the threshold that produce minimum error for the current feature under that assumption. 5. Make inverse hypothesis. 6. Select the threshold with minimum error for the current feature. 7. Repeat. The general algorithm of AdaBoost is the following [12]: After obtaining the weak hypothesis ht AdaBoost chooses the parameter αt. This parameter measures the importance of hypothesis. This value is larger the smaller is error for the hypothesis. The final hypothesis H is a weighted majority vote of the T weak hypotheses where at is the weight assigned to ht. The result of running AdaBoost over training data is a set of threshold for specific features for each movement. To classify test data, for each example each hypothesis is verified and the one with the minimum error is selected. D. Gaussian Mixture Models Gaussian Mixture Models (GMMs) are parametric representation of probability density functions, based on a weighted sum of multivariate Gaussian distribution. The Gaussian classifier produces a mixture of class-conditional probability density p(x|λi) for each class λi under assumption that it has a a Gaussian distribution. Each cluster for training data is interpreted as a hyperplane in a high dimensional space and is modeled as a GMM with specific parameters. The aim of clustering is to obtain parameters of the cluster hyperplanes that maximize a likelihood function of data memberships. GMM parameters are estimated from training data using the iterative Expectation-Maximization (EM) algorithm. A Gaussian mixture model is a weighted sum of M component Gaussian densities as given by the equation, where x is a D-dimensional continuous-valued data vector (i.e. features), wi, i = 1 … M, are the mixture weights (mixing coefficients), and g(x|µi, Σi), i = 1 … M, are the component Gaussian densities. Each component density is a D-variate Gaussian function of the form, with mean vector µi and covariance matrix Σi. The mixture weights satisfy the constraint that The complete Gaussian mixture model is parametrized by the mean vectors, covariance matrices and mixture weights from all component densities. These parameters are collectively represented by the notation, The example of the GMM is shown on the following figure. Fig. 17. Types of Gaussian Mixture Models. 8 The covariance matrices, Σi, can be full rank or constrained to be diagonal. The choice of model configuration (number of components, full or diagonal covariance matrices, and parameter tying) is often determined by the amount of data available for estimating the GMM parameters and how the GMM is used in a particular biometric application. According to [10] because the component Gaussian are acting together to model the overall feature density, full covariance matrices are not necessary even if the features are not statistically independent. The linear combination of diagonal covariance basis Gaussians is capable of modeling the correlations between feature vector elements. The effect of using a set of M full covariance matrix Gaussians can be equally obtained by using a larger set of diagonal covariance Gaussians. The algorithm implemented in current work are the following: Given: Input sequence of N feature vectors x(x1..xN), where each x∈Rd , number C of clusters to partition the data set, number K of Gaussians for each cluster and the maximum number of iterations T. 1. C = 0; 2. Initialize iteration t = 0: Initialize Gaussian parameters: means µi (obtained from data by running K-means over it), covariances Σi and wi =1/N for i =1...N. One for each Gaussian k. 3. E step. For each point xi determine its assignment score to each Gaussian k: γ(znk) is called a “responsibility”: how much is this Gaussian k responsible for this point xi 4. M step. Given scores, adjust µi , wi, Σi for each Gaussian k. Mean of Gaussian k: Covariance matrix of Gaussian k: Mixing Coefficient (weights) for Gaussian k: 5. Evaluate log likelihood. If likelihood or parameters converge, stop. Else go to Step 3 (E step). 6. Next cluster C. The idea is to run a back-end EM-Gaussian classifier over data for each specified movement. The initial parameter for each GMM was obtained from K-means algorithm. The result of the classification is a set of GMMs that describe each class. Then this set of GMMs is used for recognition of movements. For each example in given test data a likelihood function for each type of movement is calculated and the class that provide a maximum likelihood is selected. IX. TEST RESULTS In current study each of the selected classification algorithms was developed and tested in the NetBeans IDE 7.1.2 environment, Java 1.6 platform and Windows 7 operating system. Tests were made for the teaching and the recognition phase separately. On mobile platforms Android 4.1 the software was developed in order to gather data for observed movements and test the results. There were observed six types of basic movements, such as: walking, falling, standing up, sitting down, going upstairs and going downstairs. Training data consisted of files with stored accelerometer information for each observed movement. Test data consisted of two sets: data that were included in training set and data that wasn't used during training phase respectively. The tests were conducted for features obtained from original data and from filtered data. As filter was used simple Kalman filter described previously in VII part. The result aggregated accuracy for each classification algorithm is presented in the Tables I, II, III. Here K-means algorithm was tested in two modes: for each tested sample separately and for all tested samples taken together. KNN algorithm was tested for different parameter of neighbors taken into account. And GMM algorithm was tested with seven initial number of Gaussians in the model. TABLE I ACCURACY OF CLASSIFICATION ALGORITHMS FOR ALL FEATURES 9 Algorithm All features Without Kalman filter With Kalman filter K-Means 0,37 0,53 0,29 0,48 K-Means All 0,38 0,54 0,3 0,49 KNN5 0,66 0,86 0,66 0,8 KNN9 0,68 0,73 0,64 0,77 KNN11 0,74 0,75 0,66 0,77 AdaBoost 0,72 0,9 0,83 0,88 GMM5 0,2 0,44 0,38 0,51 GMM9 0,44 0,64 0,42 0,6 GMM11 0,46 0,66 0,42 0,64 GMM13 0,35 0,44 0,55 0,62 GMM17 0,5 0,53 0,09 0,1 GMM19 0,18 0,06 0,4 0,4 GMM23 0,44 0,48 0,25 0,28 Accuracy for test files excluded from training Accuracy for test files included in training Accuracy for test files excluded from training Accuracy for test files included in training