accelerometer signal features and classification ... · the components used for feature extraction....

12
ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 1/12 Accelerometer Signal Features and Classification Algorithms for Positioning Applications Melania Susi, Daniele Borio, Gérard Lachapelle Position, Location And Navigation (PLAN) Group http://plan.geomatics.ucalgary.ca Department of Geomatics Engineering University of Calgary BIOGRAPHIES Melania Susi is an MSc student in the Department of Geomatics Engineering at the University of Calgary, Canada. She received her BE in Mathematical Engineering from Università Torvergata di Roma, Italy and MSc in Communication Engineering from Università di L’Aquila, Italy. She also served as system analyst at Thales Alenia Space Italia Spa Rome, where she was involved in Galileo related projects. Since January 2010, she has been a student in the PLAN Group of the Department of Geomatics Engineering at the University of Calgary, Canada. Daniele Borio received the M.S. degree in Communication Engineering from Politecnico di Torino, Italy, the M.S. degree in Electronics Engineering from ENSERG/INPG de Grenoble, France, in 2004, and the doctoral degree in electrical engineering from Politecnico di Torino in April 2008. From January 2008 to September 2010 he was a senior research associate in the PLAN group of the University of Calgary, Canada. Since October 2010 he is a post-doctoral fellow at the Joint Research Centre of the European Commission. His research interests include the fields of digital and wireless communications, location, and navigation. Professor Gérard Lachapelle holds a Canada Research Chair in Wireless Location in the Department of Geomatics Engineering where he has been a professor since 1988. He heads the PLAN Group and has been involved in a multitude of Global Navigation Satellite Systems (GNSS) R&D projects since 1980, ranging from RTK positioning to indoor location and GNSS signal processing enhancements. ABSTRACT The continuous development of Micro Electro- Mechanical Sensors (MEMSs) and their integration into cell-phones and other mobile devices is pushing the design of new algorithms capable of determining the user activity. Determining what the user is doing allows one to bound his displacement and provide information about his location. The design of such algorithms is a classification problem where the different classes are specified by the MEMS location and user activity. In this paper, MEMS accelerometer signals are analyzed in different domains and several features are selected for the design of classification algorithms. Frequency domain analysis is performed as a function of the user velocity and sensor location, showing the potential of the selected features even when the MEMS is not placed on the user foot. The selected features are finally integrated into three different classification algorithms whose characteristics are analyzed and compared under several operating conditions. 1 INTRODUCTION The continuous development of Micro Electro- Mechanical Systems (MEMS) and the progressive decrease of their size and cost are making them available in several electronic devices, such as cell-phones and other types of Personal Digital Assistants (PDAs). Most of the latest PDAs are now equipped with low-cost MEMS inertial units allowing several applications, including navigation-based services and heading determination. MEMS based navigation is however reliable only if continuous updates from a GPS unit are available. Without GPS update, the navigation solution provided by MEMS becomes quickly unreliable due to the different error sources affecting this type of sensors (Titterton & Weston 2004). For this reason, approaches different from the direct evaluation of the navigation solution based on MEMS sensors should be investigated. The measurements provided by MEMS can be used for determining the type of motion performed by the user (Chowdhary et al 2009) and for counting the number of steps (Skog et al 2010, Kwakkel 2008). In turn, this type of information can be used at least to provide bounds on the user position. Step counting techniques are very effective in determining the user total distance; however they require MEMS sensors to be placed on the user foot. This

Upload: others

Post on 10-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 1/12

Accelerometer Signal Features and Classification

Algorithms for Positioning Applications

Melania Susi, Daniele Borio, Gérard Lachapelle Position, Location And Navigation (PLAN) Group

http://plan.geomatics.ucalgary.ca Department of Geomatics Engineering

University of Calgary

BIOGRAPHIES

Melania Susi is an MSc student in the Department of Geomatics Engineering at the University of Calgary, Canada. She received her BE in Mathematical Engineering from Università Torvergata di Roma, Italy and MSc in Communication Engineering from Università di L’Aquila, Italy. She also served as system analyst at Thales Alenia Space Italia Spa Rome, where she was involved in Galileo related projects. Since January 2010, she has been a student in the PLAN Group of the Department of Geomatics Engineering at the University of Calgary, Canada. Daniele Borio received the M.S. degree in Communication Engineering from Politecnico di Torino, Italy, the M.S. degree in Electronics Engineering from ENSERG/INPG de Grenoble, France, in 2004, and the doctoral degree in electrical engineering from Politecnico di Torino in April 2008. From January 2008 to September 2010 he was a senior research associate in the PLAN group of the University of Calgary, Canada. Since October 2010 he is a post-doctoral fellow at the Joint Research Centre of the European Commission. His research interests include the fields of digital and wireless communications, location, and navigation. Professor Gérard Lachapelle holds a Canada Research Chair in Wireless Location in the Department of Geomatics Engineering where he has been a professor since 1988. He heads the PLAN Group and has been involved in a multitude of Global Navigation Satellite Systems (GNSS) R&D projects since 1980, ranging from RTK positioning to indoor location and GNSS signal processing enhancements.

ABSTRACT

The continuous development of Micro Electro-Mechanical Sensors (MEMSs) and their integration into cell-phones and other mobile devices is pushing the design of new algorithms capable of determining the user

activity. Determining what the user is doing allows one to bound his displacement and provide information about his location. The design of such algorithms is a classification problem where the different classes are specified by the MEMS location and user activity. In this paper, MEMS accelerometer signals are analyzed in different domains and several features are selected for the design of classification algorithms. Frequency domain analysis is performed as a function of the user velocity and sensor location, showing the potential of the selected features even when the MEMS is not placed on the user foot. The selected features are finally integrated into three different classification algorithms whose characteristics are analyzed and compared under several operating conditions.

1 INTRODUCTION

The continuous development of Micro Electro-Mechanical Systems (MEMS) and the progressive decrease of their size and cost are making them available in several electronic devices, such as cell-phones and other types of Personal Digital Assistants (PDAs). Most of the latest PDAs are now equipped with low-cost MEMS inertial units allowing several applications, including navigation-based services and heading determination. MEMS based navigation is however reliable only if continuous updates from a GPS unit are available. Without GPS update, the navigation solution provided by MEMS becomes quickly unreliable due to the different error sources affecting this type of sensors (Titterton & Weston 2004). For this reason, approaches different from the direct evaluation of the navigation solution based on MEMS sensors should be investigated. The measurements provided by MEMS can be used for determining the type of motion performed by the user (Chowdhary et al 2009) and for counting the number of steps (Skog et al 2010, Kwakkel 2008). In turn, this type of information can be used at least to provide bounds on the user position. Step counting techniques are very effective in determining the user total distance; however they require MEMS sensors to be placed on the user foot. This

Page 2: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 2/12

condition is unrealistic in the case of sensors integrated in a PDA. In this case, MEMS are more likely located in the user hand and pocket (Pei et al 2010). For this reason, it is worth investigating approaches different from step counting. In (Chowdhary et al 2009), an approach based on context detection has been proposed. Accelerometer signals are used to determine if the user is standing, walking or running. It is then suggested to use this contextual information to assist the user positioning. The analysis in (Chowdhary et al 2009) was however limited to the signal spectral characteristics. Linear Prediction Coding (LPC) was used to determine the spectral content of accelerometer signals and the LPC coefficients were used for context detection. LPC analysis is not able to fully characterize the properties of the accelerometer signals and other features are worth of investigation. Human activity recognition has been an active research field, most of all for clinical analysis (Nijsen et al 2010, Yin et al 2008). For example in (Bao & Intille 2004), up to five sensors placed in different body locations were used for recognizing the user activity. Although, this approach cannot be directly used for navigation purposes, the obtained results and the classification methodology should be considered for positioning applications. For these reasons, the main focus of this paper is to use classification techniques to recognize the user status and extract context information. The objective is to recognize motion modes such as standing, walking, running and climbing stairs when the accelerometer sensor is placed in the user hand or pocket.The first step of the analysis has been the identification of signal features suitable for univocally characterize a specific motion mode. The accelerometer signal has been thoroughly analyzed and its norm and individual components have been separately considered. The norm has been chosen since it provides information independent from the sensor orientation (Kwakkel 2008, Karantonis et al 2006). A traditional approach is the evaluation of the accelerometer signal energy over time that provides the intensity of the motion mode, allowing one to distinguish low and high-intensity activities (Karantonis et al 2006). The weakness of this approach is that different subjects can perform the same activity with very different energy values. In order to overcome this limit sub-band energy ratios have been considered. A sub-band energy estimator has been implemented and used to compute these features. These features have been selected according to the fact that faster motion modes make the signal energy migrates towards higher frequencies. It has been shown that the above features enable one to distinguish walking and running regardless the sensor position. Sub-band decomposition was considered by (Frank et al 2010), however, only the absolute value of the acceleration was used and no normalization among components was adopted.

Frequency analysis has also been performed and it has been shown that three dominant frequencies are present in the accelerometer signal. These frequencies increase as the user velocity increases. The three axial acceleration components have also been studied and the correlation among the signals is used to improve the context detection process. The selected features have been used for the design of three different classifiers: a Naive Bayesian classifier, a decision tree algorithm and a k-nearest-neighbour detector (Jain 2000). The three algorithms have been tested using several datasets and under different working conditions. Several subjects, both male and female, have been used for performing various experiments including standing, normal walking, running and climbing stairs. From the results, it emerges that the decision tree classifier is the most performing algorithm, in agreement with the results obtained in (Bao & Intille 2004). This algorithm is able to discriminate the different motion modes with a probability of correct detection greater than 90%. These results indicated the feasibility of using accelerometer signals for context detection even when the sensor is not placed on the foot. This information can then be used for positioning applications. In addition to this, further analysis has been carried out to better investigate the relationship between accelerometer features and user velocity. The initial findings described in the paper seem to indicate that velocity and accelerometer dominant frequency are strictly related and that this information can be used for effectively propagating the user position even when GPS is not available. The reminder of this paper is organized as follows. Section 2 briefly describes the accelerometer signals and the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented classifiers are detailed in Section 4. The experimental setup and performance analysis are provided in Section 5. Section 6 describes the preliminary results obtained analyzing the dominant frequencies as a function of the user velocity and suggests a possible way for predicting the user displacement. Some conclusions are finally drawn in Section 7.

2 THE ACCELEROMETER SIGNAL

A tri-axial accelerometer is a device able to provide the 3-dimensional (3D) acceleration of the user in a frame defined by the sensor orientation. More specifically, the following orthogonal components are provided:

[ ][ ] 0,1,2.[ ]

x

y

z

a na n na n

(1)

Page 3: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 3/12

where n is the time index and the three components are

sampled at the sampling frequency 1

ss

fT

. For the

experiments performed in this work crysta MEMS IMU, by Cloud Cap technology, were used and 100sf Hz. Since the most of the energy of the accelerations registered for human movements are below 15 Hz (Karantonis et al 2006, Mathie 2003), the components in (1) have been at first low-pass filtered using a 10th order Butterworth filter. The following notation is used to denote the filtered acceleration components: [ ], [ ], [ ]x y za n a n a n . (2) Accelerations (1) and (2) are defined in an arbitrary system of axes and two different approaches are usually adopted for their processing: projection of the measurements in a local frame

where the z-axis is parallel to the gravity vector and the other two axes are in the horizontal plane, parallel and orthogonal with respect to the direction of motion, respectively;

use of the signal norm (Kwakkel 2008). The first approach is usually adopted when the sensor is placed in a known position such as the trunk or foot (Karantonis et al 2006, Veltink et al 1996). In this case, the orientation of the sensor in the horizontal plane is approximately known and gravity is used to determine the tilt with respect to the vertical direction. The signal norm

2 2 2[ ] [ ] [ ][ ] x y za n a n as n n (3)

is usually preferred when the orientation of the sensor cannot be easily determined and it is adopted in the following. In (Pei et al 2010, Frank et al 2010) a hybrid approach is adopted where gravity is used to identify the vertical component of motion. The norm in the horizontal plane is then computed and used for motion recognition. When the sensor is placed on the foot and the user is performing a cyclic activity, such as walking and running, it is possible to distinguish several motion phases (Mathie 2003, Kwakkel 2008). This allows the adoption of different approaches for improving the accuracy of the user location, including the determination of the stance phase, i.e., when the foot is leaning on the ground, for zero velocity updates (ZUPT) (Kwakkel 2008, Skog et al 2010) and the estimation of the gait cycle that can be used along with a motion model for determining the user displacement. When the sensor is placed in the hand, these approaches are no longer valid. The motion of the hand can mask the accelerations due to the user displacements and other approaches should be used.

Figure 1 shows the norm of the accelerations measured by two sensors placed on the foot (upper part) and in the hand (lower part) of a user walking at normal speed. The two signals present clear periodicities reflecting the cyclic nature of the motion performed by the user. The different gait phases can be clearly determined from the signal provided by the sensor on the foot whereas these phases are not even defined in the case of the hand. The periodicity of the signal in the lower part of Figure 1 is due to the combined effect of the body motion and of the swing of the arm. These periodicities can be related to the gait cycle and motivate the use of frequency domain analysis of the accelerometer signal. It is noted that (3) is always positive and thus presents a non-zero mean. The presence of a non-zero DC component can hide important information and reduce the effectiveness of the frequency domain estimation techniques used in Section 3. Thus, the DC component is removed as follows:

1

00

1] [[ [ ]]L

lss n s nn l

L

(4)

where the second term is the signal mean computed using a moving average filter. L is the length of the moving average filter and is set equal to 128 corresponding to 1.28 s.

3 FEATURE SELECTION AND EXTRACTION

In order to perform the classification process, a set of features, meaningful attributes that characterize each motion mode in an unambiguous way, have to be extracted from the accelerometer data. In this work, the following motion states have been considered: 1. running

Figure 1: Norm of the acceleration measured by two

sensors placed on the foot (upper part) and in the

hand (lower part) of a user walking at normal speed.

Page 4: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 4/12

2. walking 3. climbing the stairs 4. going down the stairs 5. standing: the user is static. An ideal feature extraction process should be able to minimize the intra-set distance (distance among different features in the same class) and to maximize the inter-set distance (distance among different features in different classes) (Fukunaga 1990). In this way, the classifier is able to make a decision reducing the error probability due to a good inter-class separability. In order to recognize the five states mentioned above, the following features have been considered: 1. accelerometer signal energy 2. sub-band energy ratios 3. dominant frequencies 4. cross-correlations among the three components of the

accelerometer signal.

These features are computed by dividing the samples from the norm (4) or from the three components(2), in blocks of 128 samples. Each data block is then used for the evaluation of the features listed above. Since the accelerometer sampling frequency is equal to 100 Hz, the above number of samples corresponds to 1.28 s. Considering that the length of a step in walking mode is about 1 second, the chosen window is able to capture at

least a single user step. In the next sections the main properties of the named features, and how they vary as a function of the different motion modes is studied.

3.1 Frequency domain analysis

As illustrated in Section 2, the analysis in time domain of the accelerometer signal is not sufficient for motion mode detection when the sensor is not placed on the foot, and the step information cannot be derived. For this reason, it is worth to investigate alternative analysis domains, such as the frequency domain. Frequency domain analysis is able to capture the periodic nature of specific motion modes. In addition to this, since these peaks are centered on different frequency values for different activities, they can be used for classification purposes. In this work, the first three dominant frequencies, related to the main three temporal periodicities, are extracted. The non-stationary nature of the accelerometer signal has to be accounted for and a standard method used for the analysis of non-stationary signals, the Short Time Fourier Transform (STFT) (Cohen 1995), has been used. Despite the poor time-frequency localization properties of the STFT, this transform is attractive for its low computational requirement and for its non-parametric nature.

Figure 2: 1) Left side: dominant frequencies for the running (upper part) and walking mode (lower part). 2) Right

side: spectrogram for the running (upper part) and the walking mode (lower part)-MEMS sensor in the hand.

Page 5: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 5/12

The basic assumption of this technique is that any non-stationary signal can be regarded as stationary for short time duration. Then, the spectrogram is obtained as the square absolute value of the STFT. In Figure 2 (left side), the plots of the first three frequencies, obtained evaluating the first three maxima in the spectrogram, are shown as a function of time. Comparing the plots in Figure 2, it is possible to see how in the running mode (Figure 2, lower part) the frequency peaks appear at higher frequency values than in the walking mode (Figure 2, upper part). The reason is that, in the running mode, due to an increase in the user velocity, the steps have shorter durations. The relationship between dominant frequencies and user velocity is investigated in Section 6 and a model for the estimation of the user speed is suggested.

3.2 Energy based features

Motion mode recognition based on the total energy of the acceleration signal is a common approach found in the literature (Kwakkel 2008, Mathie 2003). In this work, the total energy is computed squaring the magnitude of the accelerometer data and integrating it according to the following expression:

20

1

1 L

totn

E s nL

(5)

where 0s n is the filtered norm of the accelerometer signal as defined in (4), and L is the length of the analysis window. This parameter is a direct measure of the intensity of a signal, able to clearly distinguish dynamic and static activities. On the other hand, the use of the total energy for the identification of different dynamic activities cannot be considered a robust approach. The weakness of this method is that this parameter is strongly dependent on the considered subject, since people can perform the same kind of activity with different energy levels. In addition to this, the value of the total energy can vary significantly for different sensor positions. For example, in general, a sensor placed in the hand experiences a higher energy than a sensor in the pocket even if the same motion mode is considered. To overcome the above limitations, an alternative approach has been proposed, based on the sub-band energy distribution. This approach is motivated by the consideration that faster motion modes are associated to higher energy frequency values. For this reason an energy estimator has been implemented, according to the scheme shown in Figure 3.

In this way, the energy in the following sub-bands is computed: 1. 0 - 2 Hz 2. 2 - 6 Hz 3. 6 - 10Hz 4. > 10Hz.

It has been observed that the running and the walking motion modes can be recognized with high accuracy by using the ratio between energies in the first and in the second sub-bands (0-2 Hz and 2-6 Hz), for all the considered sensor locations (e.g. foot, hand and pocket). In fact, as shown in Figure 4, in the running case the energy values in the sub-band between 2-6 Hz are significantly larger than the ones related to the first sub-band (0-2 Hz).

Figure 3: Sub-band energy estimator. A bank of filter

is used to extract the energy content in different sub-

bands.

Figure 4: Total energy and sub-band energies as a

function of time for the running and the walking

modes (accelerometer placed in the hand).

Page 6: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 6/12

3.3 Cross-correlation among components

Cross-correlation quantifies the similarity between signals. Motion modes that involve translation in one or more dimensions have been identified by computing, for each possible pair of accelerometer components the Pearson’s correlation (Good 2009), defined as:

1

2 2

1 1

[ ] [ ]L

nxy L L

n n

x n x y n yr

x n x y n y

(6)

where x[n] and y[n], for n in range (1, L), are the samples of the two selected accelerometer components and x and y are the sample means of the two components. When the

user is climbing/going down the stairs motion is performed in both the forward and vertical directions and the correlation values between accelerometer components are

bigger than in the walking case, as shown in Figure 5. Thus, the cross-correlation coefficients can be used to distinguish activities such as climbing/descending the stairs from other motion modes performed on a plane.

4 CLASSIFICATION ALGORITHMS

The goal of a classification system is to automatically assign a given input pattern to known classes of objects, according to specific decision rules (Jain 2000). The input pattern is defined by a set of features, represented by a vector 1 2, ,..., df f f f . In this paper, the features are represented by the quantities defined in Section 3. Then the classification process assigns each feature vector to one of the n possible classes 1 2, ,..., nc c c c , defined by the user motion modes. Classification algorithms can be divided in two main groups (Jain 2000): supervised and unsupervised classifiers. In supervised classification, a certain amount of data is labelled and used to train the classifier for assigning unlabelled data to one of the a priori known classes. In the

Figure 5: Cross-correlation over time between pair of accelerometer components for the stairs case (left side) and the

walking case (right side).

Page 7: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 7/12

unsupervised approach, the classes are defined only when the recognition process is completed (i.e. clustering classification). In this work, the supervised approach is used. Three different types of statistical classifiers have been designed and implemented: a Naive Bayesian classifier, a decision tree algorithm and a k-nearest-neighbour technique. The considered algorithms are briefly described in the following whereas additional details on these techniques can be found for example in (Jain 2000, Webb 2002).

4.1 Naïve Bayesian classifier

The Naive Bayesian classifier is a parametric technique based on the feature independence assumption, i.e., all the features used for the classification process are statistically independent (Jain 2000). Thus, the probability of observing a specific feature vector conditionally to its assignation to the j-th class is obtained multiplying the marginal conditional feature probabilities:

1 21

, ,..., | |d

d j i ji

P f f f c P f c

(7)

The algorithm chooses the class according to the maximum a posteriori (MAP) decision rule, i.e.

1 21

, ,..., arg maxj

d

d i j jc i

c f f f p f c p c

(8)

In this case the motion modes are assumed equally likely

and consequently the term jp c can be neglected. The

likelihood functions i jp f c are estimated by analyzing

the training data and using a Kernel Density Estimation (KDE) method with Gaussian kernel (Silverman 1996). In Figure 7, the sub-bands energy likelihood function is shown, for a data set including walking and running modes, when the sensor is in the hand.

The distribution can be approximated by a Gaussian mixture with modes related to the walking and running activities. A Gaussian distribution has been assumed for each motion mode and the mean and variance of each state has been obtained by fitting the mixture model with the empirical data. The cross-correlation features have been jointly considered as a multivariate Gaussian likelihood function. In this way, the correlation among these features has been considered, including the cross–correlation terms in the covariance matrix of the multivariate distribution function. Finally the feature joint conditional probability has been obtained by multiplying the single conditional distributions.

4.2 Decision tree classifier

The decision tree, a direct acyclic graph with the form of a tree, is a special type of non-parametric classifier (Webb 2002). The leaves of the tree represent all the possible classes that can be assigned to the input observations. Each internal node specifies a test related to one or more features. In this way, the full classification problem is divided in smaller, less complex classification tests. Then, for each input observation, it is possible to assign a specific class by traversing the decision tree from the root to the leaves.

In order to identify the various motion modes a decision tree, valid for different sensor locations (e.g. hand, pocket and foot), has been designed and implemented according to the scheme in Figure 6. The first feature evaluated, with the purpose to distinguish dynamic and static activities, is the total energy of the accelerometer signal. If the total energy is bigger than a fixed threshold the activity is considered dynamic otherwise is classified as static. The above threshold, equal to 0.6 m2/s4, has been empirically determined. In the case of dynamic activities four instances are possible: walking, running, climbing down the stairs and climbing up the stairs. In order to recognize different types of dynamic activities further testes, involving multiple features, are necessary. The energy ratio between first and second sub-bands enables one to

Figure 7: PDF of the sub-band energy ratio for the sensor

placed in the hand

Figure 6: Decision tree classifier for motion mode recognition

Page 8: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 8/12

distinguish running and going down the stairs from walking and going up the stairs. To reduce the ambiguity between walking and climbing up the stairs and running and climbing down the stairs the cross-correlation terms have been introduced. As explained in Section 3.3, usually this attribute assumes bigger values when the user is walking down/up the stairs, since in that case the motion involves more dimensions. However, when the sensor is in the hand, its orientation can rapidly vary and the correlation terms can be split along the three axis of the sensor reference system. Thus, other attributes are evaluated, such as the dominant frequencies and the total energy and used to make the decision more reliable.

4.3 K-nearest-neighbour classifier

The k-nearest-neighbour is a non-parametric classifier that, given an unlabeled feature vector, f , and a set of labelled feature vectors, finds the k nearest neighbours of the input vector and assigns to this vector the most frequent among the classes of his k neighbours (Jain 2000). The main advantage of the k-nearest-neighbour decision rule, similarly to the decision tree, is that it does not require the knowledge of the class conditional probability distributions. The performance of this classifier depends basically on the choice of the two following parameters: 1. k , that is the number of selected neighbours 2. the distance metric, that is used to find the k nearest

neighbours

In general big values of k are less sensitive to noise but can reduce the separability among decision regions, increasing the ambiguity of the decision. The determination of the best k value is usually performed by heuristic approaches (Jain 2000). In this research work k has been selected equal to one and a weighted Euclidean distance has been adopted.

5 EXPERIMENTAL RESULTS

In order to obtain a sufficient amount of data for the training and testing phases of the described classifiers, several data collections were performed by seven different subjects, two females and five males, of age ranged between 25 and 35. During each data collection the 3-axis accelerometers were placed in three different locations of the human body: on the foot, in the hand and in the pocket, as shown in Figure 8, and no indication were given about the orientation of the sensor. For the case of the sensor in the hand only the swinging mode has been analyzed. The accelerometers used for the measurements were connected via cables to a small laptop. The laptop and the battery used to power the accelerometers were placed in a backpack that could be easily transported during the tests. During the tests, the subjects were allowed to stop or change direction.

The five analyzed activities (walking, running, climbing down/up the stairs and static mode) were carried out in different natural scenarios, indoors and outdoors. In addition to this, treadmill tests were performed in order to be able to monitor the user velocity. The results of this experiment are provided in the following. The collected data have been divided in two different subsets: training and test data. The first type of data have been used for the algorithm training, as described in Section 4, whereas the second set of experiments was used for the evaluation of the algorithm performance. Since the main focus of this work was to perform motion mode recognition when the sensor is in the hand, the performance of the classifiers described in Section 2 is reported in Table 1 for this critical case. Specifically, the classifier accuracy, that is the number of correctly identified test samples normalized by the total number of test samples, is evaluated for each motion mode.

States (hand case)

Naïve Bayes Decision Tree

K nearest neighbour

Static/Standing 95% 99% 97% Walking 89% 96% 93% Running 93% 94% 91% Walking down the stairs

72% 92% 84%

Walking up the stairs

68% 82% 80%

Figure 8: Some location of the MEMS sensors during the data

collections: in the hand, on the foot and in the pocket

Table 1: Classifier accuracy (hand case)

Page 9: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 9/12

The decision tree shows the best performance and climbing up/down the stairs are the most difficult activities to recognize. These findings agree with results available in the literature (Yang 2009, Kwapisz et al. 2010). The ambiguity between descending the stairs and running and between climbing up the stairs and walking on a flat plane is due to the similar pattern of the sub-band energy ratio feature. However the total energy evaluation of the accelerometer signal allows the reduction of the uncertainty between walking down the stairs and running. More difficult is to reduce the ambiguity between climbing up the stairs and walking. In fact, in the slow walking case, the total energy is not sufficient for the identification process. In addition to this, the two modes are characterized by similar dominant frequencies. The case of the stairs is particularly critical when the sensor is in the hand. The reason is that, in the above situation, the change in the sensor orientation makes the cross-correlation terms unreliable for the classification process. However, in general, even for the stairs, the decision tree provides a good accuracy as shown in Figure 9.

The low performance of the Naïve Bayesian classifier can be attributed to the weak assumption of independent features that is clearly not valid for the considered case. Concerning the k-nearest-neighbour technique, the performance of this classifier is strictly related to the k parameter. Further analysis is requested to evaluate how the performance changes for different values of k.

6 DOMINANT FREQUENCIES AND VELOCITY

The encouraging performance, obtained using the identified features, motivates the development of a state machine able to determine the user activity and possibly predict his displacement. The design of such a structure is ongoing and only the working principle of the algorithm is provided. The complete implementation and analysis of the system is left for future work. Each state of the algorithm is defined by the sensor location and user activity. The transition between different states will be controlled by one of the developed classifiers. After identifying the motion states, the proposed structure will operate in two different modes: training and prediction. The distinction between the two modes is determined by the availability of GPS/GNSS velocity measurements that will be used for training purposes. A schematic view of the proposed structure is shown in Figure 10 where some of the states that will be included in the system are represented along with the two operating modes.

The use of velocity measurements from GPS/GNSS has been motivated by the studies conducted in this research work. More specifically, the dominant frequencies described in Section 3.1 have been analyzed as a function of the user velocity. It is noted that when the sensor is placed on the foot, the first dominant frequency corresponds to step rate, i.e., the number of steps performed by the user in a second. Thus, the user velocity can be expressed as 1 1·l fv s f (9) where 1ls f is the step length in units of metres. If the step length were independent from the step frequency, than a linear relationship between dominant frequencies and user velocity would be found. A linear model relating step length and step frequency was considered by (Shin et al

Figure 9: Total and sub-band energies (upper part)

and classification results of the decision tree classifier

for the stairs case (lower part). Sensor in the hand.

Figure 10: State machine integrating the developed

classifier and the availability of GNSS velocity

measurements for the training phase.

Page 10: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 10/12

2007). This model leads to a parabolic relationship between dominant frequencies and user velocity. This non-linear relationship can be intuitively explained by the fact that shorter or longer steps can be performed depending on the step frequency. A user, for example, can increase his speed (running) by making both longer steps and increasing his step frequency. This observation motivated the study of polynomial models relating the user velocity to the dominant frequencies of the accelerometer signal. Polynomial models have been selected for their simplicity and their potential capability of approximating a generic continuous function. The analysis has been extended to the three dominant frequencies and to different sensor locations. Although in the these cases, i.e. when the sensor is not placed on the foot and higher dominant frequencies are considered, it is not possible to provided a direct physical interpretation of the velocity/frequency relationship, the strong correlation between these quantities can be exploited for prediction purposes. The following general model has been considered:

0

Nn

l i n in

s f a f

(10)

where if is the i-th dominant frequency and 0nN

na

are

the polynomial coefficients to be determined empirically during the training phase, when both velocity measurements and accelerometer dominant frequencies are available. Eq. (10) implies the following frequency-velocity model

1

0

Nn

i n in

v f a f

. (11)

It is noted that in (11), the monomials in if are at least of order 1. This implies that 0 0v . (12) The above condition reflects the fact that when the user is not moving (zero velocity), almost no energy is present in the accelerometer signal and the dominant frequencies are equal to zero. In Figure 11, the time evolution of the dominant frequencies obtained during a pedestrian test are compared against the velocity recorded by a GPS receiver. The user was walking at different speeds and the notches that can be observed in Figure 11 occur in correspondence of inversion of motion. In this case, the sensor was placed on the foot. A clear correspondence between dominant frequencies and velocity can be observed. Around the middle of the experiment the user performed a short run: this is clearly reflected by the increased velocity and by the first dominant frequency. The change of status is less clear from the other two dominant frequencies.

The user velocity is plotted a function of the first dominant frequency in Figure 12 along with the interpolating polynomial model. In this case, a second order parabolic model has been selected. During the analysis, it has been found that the coefficient of the first term was close to zero and thus it has been omitted. Further analysis is ongoing to determine if model (11) needs to respect symmetry conditions of the type l i l iv f v f . (13) Although a good agreement between empirical results and model (11) is observed in Figure 12, further analysis is required for confirming the validity of the model.

Figure 11: Comparison between dominant frequencies

and user velocity for a pedestrian test. The notches

observed in the different curves indicate inversion of

motion. Sensor on the foot.

Figure 12: User speed as a function of the first

dominant frequency of the accelerometer signal.

Parabolic Interpolation. Sensor placed on the foot.

Page 11: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 11/12

The dominant frequencies observed when the sensor is placed in the hand are shown in Figure 13. In this case, the user was moving in a natural way and the swing of his arm was masking some of the frequency information clearly present in the foot case. This explains the presence of jumps and outliers in the dominant frequency time series. Despite the presence of outliers, the trend observed in the dominant frequencies is similar to the one found in the foot case and work is ongoing for the design of appropriate smoothing techniques enabling artefact removal.

7 CONCLUSION

In this paper, several features of the accelerometer signal have been investigated for the recognition of the user motion mode independently from the sensor location. Frequency domain analysis, sub-band energy distribution and correlation among acceleration components have been characterized under different operating conditions and used for the design of three different classifiers. Among the considered algorithms, the decision tree classifier showed the best performance and will be used as a starting point for the design of a state machine able not only to determine the user motion mode but possibly to estimate his velocity and displacement. REFERENCES

Bao, L. and S. S. Intille (2004) “Activity recognition from user-annotated acceleration data” in Proceeding of Second International Conference on Pervasive Computing (PERVASIVE), April, Vienna, Austria, pp. 1-17 Chowdhary, M., M. Sharma, A. Kumar, K. Paul, M. Jain, C. Agarwal, G. Narula (2009) “Context detection for improving positioning performance and enhancing user experience”, in Proceedings of the 22nd International Meeting of the Satellite Division of the Institute of Navigation, September, Savannah, GA, pp. 2072 - 2076

Cohen L. (1995), “Time-Frequency Analysis: Theory and Applications” Prentice-Hall, Inc., Upper Saddle River, NJ, USA Frank K., M. J. V. Nadales, P. Robertson, and M. Angermann (2010) “Reliable real-time recognition of motion related human activities using MEMS inertial sensors”, in Proc. of the 23rd International Technical Meeting of The Satellite Division of the Institute of Navigation, Portland, OR, September Fukunaga K. (1990) “Introduction to Statistical Pattern Recognition”, Academic Press, 2nd edition, October Good P. (2009) “Robustness of Pearson correlation”. Available on line at http://interstat.statjournals.net, May Jain K. (2000) “Statistical pattern recognition: Review” IEEE Transaction on pattern analysis and machine intelligence, Vol. 22, No. 1 Karantonis D. M., M. R. Narayanan, M. Mathie, N. H. Lovell and B. G. Celler (2006). “Implementation of a real-time human movement classifier using a triaxial accelerometer for ambulatory monitoring” IEEE Transactions on Information Technology in Biomedicine, Vol. 10, No. 1, January, pp. 156–167 Kwakkel S. P. (2008), “Human lower limb kinematics using GPS/INS”. MSc Thesis, Schulich School of Engineering, University of Calgary, Available at http://plan.geomatics.ucalgary.ca/papers/engo20279 _kwakkel%20msc%20thesis _dec08b.pdf, December Kwapisz J.R., G. M. Weiss, S.A. Moore (2010), “Activity recognition using cell phone accelerometers”, Sensor KDD’10,Washington, DC,USA July Mathie M. J. (2003), “Monitoring and Interpreting Human Movement Patterns Using a Triaxial Accelerometer”. Ph.D. thesis, University of New South Wales Nijsen T. M. E., R. M. Aarts, P. J. M. Cluitmans, and P. A. M. Griep (2010) “Time-frequency analysis of accelerometry data for detection of myoclonic seizures”, IEEE Transactions on Information Technology in Biomedicine, Vol. 14, No. 5, September, pp. 1197–1203 Pei L., R. Chen, J. Liu, W. Chen, H. Kuusniemi, T. Tenhunen, T. Kröger, Y. Chen, H. Leppäkoski and J. Takala (2010) “Motion recognition assisted indoor wireless navigation on a mobile phone”, in Proc. of the 23rd International Technical Meeting of The Satellite Division of the Institute of Navigation, Portland, OR, September, pp. 3366–3375 2010.

Figure 13: Comparison between dominant frequencies

and user velocity for a pedestrian test. The notches

observed in the different curves indicate inversion of

motion. Sensor in the hand.

Page 12: Accelerometer Signal Features and Classification ... · the components used for feature extraction. In Section 3, the selected features are briefly described whereas the implemented

ION ITM 2011, Session A1, San Diego, CA, 24-26 January 2011 12/12

Shin S. H., C. G. Park, J. W. Kim, H. S. Hong, J. M. Lee (2007), “ Adaptive step length estimation algorithm using low cost MEMS inertial sensors”, Sensors Applications Simposium, IEEE, San Diego, California, USA, 6-8 February Skog I., P. Händel, J.-O. Nilsson and J. Rantakokko (2010) “Zero-velocity detection - an algorithm evaluation”, IEEE Transactions on Biomedical Engineering, Vol. 57, No. 11, November, pp. 2657–2665 Titterton D. H. and J. L. Weston (2004), Strapdown Inertial Navigation Technology. The Institution of Electrical Engineers, Second Edition, 581 pages Veltink P. H., H. B. J. Bussmann, W. de Vries, W. L. J. Martens and R. C. Van Lummel (1996) “Detection of static and dynamic activities using uniaxial accelerometers”, IEEE Transactions on Rehabilitation Engineering, Vol. 4, No. 4, December, pp. 375–385 Webb A. (2002) “Statistical pattern recognition”, John Wiley & Sons, New York, USA Yang J. (2009) “Toward physical activity diary: motion recognition using acceleration with mobile phones”, IMCE’09, Beijing, China, 23 October Yin J., Q. Yang, and J. J. Pan (2010) “Sensor-based abnormal human-activity detection”, IEEE Transactions on Knowledge and Data Engineering, Vol. 20, No. 8, August, pp. 1082–1090