14
Multimed Tools Appl (2016) 75:7257–7270 DOI 10.1007/s11042-015-2643-0 Human activity recognition using quasiperiodic time series collected from a single tri-axial accelerometer Andrey D. Ignatov 1 · Vadim V. Strijov 1 Received: 16 September 2014 / Revised: 9 March 2015 / Accepted: 20 April 2015 Published online: 17 May 2015 © Springer Science+Business Media New York 2015 Abstract The current generation of portable mobile devices incorporates various types of sensors that open up new areas for the analysis of human behavior. In this paper, we propose a method for human physical activity recognition using time series, collected from a single tri-axial accelerometer of a smartphone. Primarily, the method solves a problem of online time series segmentation, assuming that each meaningful segment corresponds to one funda- mental period of motion. To extract the fundamental period we construct the phase trajectory matrix, applying the technique of principal component analysis. The obtained segments refer to various types of human physical activity. To recognize these activities we use the k-nearest neighbor algorithm and neural network as an alternative. We verify the accuracy of the proposed algorithms by testing them on the WISDM dataset of labeled accelerometer time series from thirteen users. The results show that our method achieves high precision, ensuring nearly 96 % recognition accuracy when using the bunch of segmentation and k-nearest neighbor algorithms. Keywords Machine learning · k-nearest neighbor method · Neural network · Segmentation · Physical activity recognition · Singular value decomposition Andrey D. Ignatov [email protected] Vadim V. Strijov [email protected] 1 Moscow Institute of Physics and Technology, Inststitutskii per. 9, 141700, Dolgoprudny, Moscow Region, Russia

Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270DOI 10.1007/s11042-015-2643-0

Human activity recognition using quasiperiodic timeseries collected from a single tri-axial accelerometer

Andrey D. Ignatov1 ·Vadim V. Strijov1

Received: 16 September 2014 / Revised: 9 March 2015 / Accepted: 20 April 2015Published online: 17 May 2015© Springer Science+Business Media New York 2015

Abstract The current generation of portable mobile devices incorporates various types ofsensors that open up new areas for the analysis of human behavior. In this paper, we proposea method for human physical activity recognition using time series, collected from a singletri-axial accelerometer of a smartphone. Primarily, the method solves a problem of onlinetime series segmentation, assuming that each meaningful segment corresponds to one funda-mental period of motion. To extract the fundamental period we construct the phase trajectorymatrix, applying the technique of principal component analysis. The obtained segmentsrefer to various types of human physical activity. To recognize these activities we use thek-nearest neighbor algorithm and neural network as an alternative. We verify the accuracyof the proposed algorithms by testing them on the WISDM dataset of labeled accelerometertime series from thirteen users. The results show that our method achieves high precision,ensuring nearly 96 % recognition accuracy when using the bunch of segmentation andk-nearest neighbor algorithms.

Keywords Machine learning · k-nearest neighbor method · Neural network ·Segmentation · Physical activity recognition · Singular value decomposition

� Andrey D. [email protected]

Vadim V. [email protected]

1 Moscow Institute of Physics and Technology,Inststitutskii per. 9, 141700, Dolgoprudny, Moscow Region, Russia

Page 2: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7258 Multimed Tools Appl (2016) 75:7257–7270

1 Introduction

The current generation of portable mobile devices, such as cellular phones or music players,is becoming increasingly complex. Most of these devices incorporate various types of sen-sors, including accelerometers, light sensors, cameras, microphones and GPS sensors, thatcan be applied for analysis of everyday human behavior. One its important part is humanphysical activity, that reflects various aspects of health and thus is exceedingly attractivefor many applications in the field of healthcare monitoring. In this paper, our purpose is toperform human physical activity recognition using data, collected from the built-in tri-axialaccelerometer of a mobile phone. This data represents quasiperiodic time series correspond-ing to one of performed activities: walking, jogging, stair climbing, sitting or standing. Foreach time series we have to detect the correspondent activity type. Related problems of timeseries classification arise in human activity recognition on the silhouette [8], face recogni-tion [35], gestures recognition [39], activity intensity level recognition [26] and detection ofactivity periods [28].

In the research of human activity recognition we generally face two related challenges.The first challenge is an online segmentation of time series into meaningful segments. Thebasic approach for this problem is to split each time series into equal segments [11, 15,20]. However, in activity recognition the quality of segmentation directly influences therecognition results, and this elemental solution is actually not enough for accurate activityestimation. Thus, there should be used more sophisticated methods, based on deep analysisof the time series’ structure. One natural way is to search for fundamental period of motionin these series and to consider it as a basis of partition. To extract this period we propose atechnique, based on principal component analysis [19].

The second challenge is to construct an efficient classification method, that assign eachobtained segment to one of the pre-determined classes. There exists a variety of differentapproaches, such as neural network [23, 25], logistic regression [15, 17, 18], SVM [6, 30],decision trees [23, 38], fuzzy algorithms [7] and differen heuristic algorithms [24, 28] basedon spectrum analysis.

The main contributions of this paper are twofold. First, we propose an online seg-mentation algorithm for quasiperiodic time series, that is based on the extraction of thefundamental period. To detect this period we apply the technique of principal componentanalysis. Second, we propose the classification algorithm, based on the k-nearest neigh-bor method, which makes it possible real-time activity recognition on the smartphones. Wealso consider neural network as an alternative solution and compare the results, obtained bythese two algorithms.

The paper is arranged as follows. Section 2 introduces some related work on humanactivity recognition and time series segmentation. Section 3 introduces an overview of thewhole process of human activity recognition. Section 4 presents the detailed description ofthe algorithms of online time series segmentation, noise reduction and time series classifi-cation. Section 5 describes the experiments and provides the classification results, Section 6summarizes our conclusions.

2 Related work

The task of human activity recognition using accelerometer has been well addressed inliterature. However, the problem of time series segmentation in context of this task was not

Page 3: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7259

covered adequately in earlier papers. Primarily, this problem was considered as independentand was solved without verifying its results in real applications. Another lack of proposedsolutions in terms of activity recognition consists in leaving out of account some particularaspects of the data, such as quasiperiodicity and homogeneity.

The solutions for the segmentation problem can be divided into two groups. First groupis based on dynamic programming [4, 16]. While these algorithms show reasonable seg-mentation accuracy, they are not fast enough and thus are insufficient for processing of longseries. The second group represents various greedy algorithms [13, 16]. These algorithmsuse the specific physical properties of the measured signal and in particular cases providesolutions that are very close to the optimal ones. For instance, methods designed for walk-ing steps detection usually use peaks in acceleration that are associated with a heel strikeor other phase of walking gate [5, 33, 37]. These algorithms are derived from the thresh-old methods, in which the step is count every time when the signal exceeds a predefined oradaptive threshold. Among other conventional segmentation techniques are sliding window-based algorithms [14] and algorithms, based on the signal transformation into a frequencydomain [3, 27]. All these algorithms rely on the specific form of the signal, and while weconsider a number of different activities their applicability is limited in this case. In thispaper we propose a more general approach for quasiperiodic time series segmentation. Tosolve the problem, we use a technique based on the analysis of the phase trajectory matrix.The method we propose is also applicable for partitioning into periods any periodical orquasiperiodical time series.

Time series classification, the second step in the human activity recognition process, hasa variety of possible approaches. The commonly encountered solutions for this problemare based on the SVM [6, 30, 34], neural networks [12, 23, 25] and decision trees [2, 23,29], while relatively little research effort has been given to the k-nearest neighbor method,particularly because the problem of segmenting and aligning the data in this case becomesespecially important [21].

Among relevant research are [1, 29] that describe the use of k-nearest neighbor methodto recognize human daily activities. The authors propose it as an alternative solution forthe classification problem, and study [1] show promising results for this method. However,these papers, like many other earliest works, are focused on the use of multiple accelerom-eters. Thus, works [1, 2, 9, 23, 29, 32] deal with activity recognition using data fromfive accelerometers. Though proposed systems are capable of identifying a wide range ofactivities, they are not practical while demanding the user wear a variety of sensors.

During the last several years there was a widespread of smartphones and other commer-cial mobile devices. They perfectly suit for the activity recognition process, while have avariety of sensors, enough processing power and do not require any additional equipmentfor data collection and recognition. For this reason we have chosen an open WISDM Acti-tracker Dataset [36] for training and performance evaluation of our algorithm. This datasetcontains accelerometer data from Android cell phones. Data was collected from thirteen dif-ferent users as they performed activities such as walking, jogging, stair climbing, sitting andstanding, and consists of over a million time series points measured by an accelerometer.

Another advantage of this dataset is that it was already used in several research works [11,15, 20]. In work [15] authors divided the source data into 10-second segments and gen-erated totally 43 features out of six basic ones for each segment. For classification of theobtained feature vectors three techniques were used: decision trees (J48), logistic regres-sion and multilayer neural network. In [11] authors also used 10-second segments, butthere were developed additional features using PCA analysis and fast-Fourier transform. For

Page 4: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7260 Multimed Tools Appl (2016) 75:7257–7270

activity recognition was used SVM classifier. The detailed classification results obtained inworks [11, 15] are presented in the Table 1.

In the works above basic segmentation technique was used and classification was per-formed using the extracted features. In this paper, we propose an advanced method foronline time series segmentation, based on the analysis of the phase trajectory matrix. Weverify its results in this classification problem, and use the k-nearest neighbor method toclassify the obtained raw segments.

3 Problem statement

Before developing the algorithmic approach, we introduce in this section some usefulnotations and provide additional information about the architecture of the proposed model.

In order to collect data for the considered supervise learning problem one has to carry asmartphone while performing a specific set of activities. Let S = {xt }Mt=1, xt ∈ R

3 be thetime series, obtained from the accelerometer of the phone. These data represent measure-ments of acceleration in three directions, and for each element xt , t ∈ {1, 2, . . . , M} theregiven type of physical activity yt ∈ Y . Define a segmentation of time series S as a sequence{Si}ni=1 of n segments such that S1S2 . . . Sn = S and each Si is non-empty.

The procedure of the human activity recognition consists of the three following steps:

1) segmentation of the initial time series S,2) removal noise from each obtained segment Si ,3) implementation of the k-nearest neighbor algorithm fknn to the treated

segments {Si}ni=1.

The scheme of the whole process is presented in Fig. 1.To evaluate the overall performance of the proposed model we use the error function G,

which is ratio between the number of incorrect estimations and the total number of obser-vations. Denote fknn be our classification algorithm. Then, the accuracy of classificationis:

G(X,Y, fknn) = 1

N

N∑i=1

[yi �= fknn (Xi)], (1)

Table 1 Accuracy of activity recognition for methods proposed in [11, 15]

Activity type, Y J48 Logistic regression Multilayer perceptron SVM

Size of the dataset 4539 4539 4539 unknown

Testing technique 10-fold CV 10-fold CV 10-fold CV 50 % for train, 50 %

for test

Jogging 96.5 98.0 98.3 95.7

Walking 89.9 93.6 91.7 92.7

Upstairs 59.3 27.5 61.5 79.5

Downstairs 55.5 12.3 44.3 79.8

Sitting 95.7 92.2 95.0 87.1

Standing 93.3 87.0 91.9 93.2

Overall 85.1 78.1 91.7 92.2

Page 5: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7261

Fig. 1 Architecture of the proposed approach

where X = {Xi}Ni=1 is the set of test samples, Y = {yi}Ni=1 is the set of answers, thatcorresponds to X. Here, the following notation for the indicator function is used:

[y �= y′] ={1, if y �= y′,0, if y = y′.

LetW be the set of parameters for the considered model. Thus, we treat the classificationproblem as the error function minimization problem:

α = arg minw∈W G(X,Y, fknn). (2)

4 Algorithms

The human activity recognition procedure consists of two steps. The first step is data pro-cessing, that involves time series segmentation and noise reduction. The second step isclassification of obtained segments. In this section, we provide algorithms for both of thesesteps, taking into account the specifics of the considered data.

4.1 Segmentation of the quasiperiodic time series

Hence, we propose an algorithm for time series segmentation under the assumption of theirquasiperiodicity. This assumption is based on the nature of human motion, which consistsin the repetition of movement phases. For instance, during the cycle of normal human gait,each lower limb goes through a stance phase and a swing phase and then returns to thestance phase [22, 31]. When human is inactive (e.g. standing or lying), this repetition isconnected with respiration phases. Though the sequence of time series points measured byan accelerometer may change in each cycle, the characteristic form of the signal stays thesame, which leads to the quasiperiodicity of time series. Based on the described physicalproperty of human motions, we can define the fundamental period as a segment of timeseries, measured during one cycle of motion. From mathematical point of view quasiperi-odicity of time series is equivalent to the fact that these series can be presented with highaccuracy as a superposition of harmonic components with different periods. Then the har-monic with the longest period and this period are the fundamental ones. It should be notedthat in the case of strict periodicity the fundamental period coincides the real period and thedescribed method is also applicable.

Page 6: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7262 Multimed Tools Appl (2016) 75:7257–7270

Consider the one-dimensional time series S = {xt }Mt=1, and let S′ = {xt }p+mt=p be its

section, p + 2m ≤ M . Our purpose is to extract the fundamental period from this section,assuming that its length m is much grater than the length of the period. First, we constructthe Hankel matrix A, that is a square matrix with constant skew-diagonals, which first lineis S′:

A =

⎛⎜⎜⎜⎝

xp xp+1 xp+2 · · · xp+m

xp+1 xp+2 xp+3 · · · xp+m+1...

......

. . ....

xp+m xp+m+1 xp+m+2 · · · xp+2m−1

⎞⎟⎟⎟⎠ .

Then we apply the singular value decomposition to the Hankel matrix: A = U�Vᵀ,where � is a diagonal matrix, U and V are orthogonal matrixes. Let {λi}Ni=1 be the diagonalelements of matrix �, and let vᵀk be the k-th row of matrix Vᵀ. Consider m principalcomponents yk = Avk that account for 95 % of the variance.

The obtained components {yk}mk=1 are mapped into the m-dimensional phase space Φm,that consists of all possible values of these components. Thereby we get the phase trajectoryY , every point of which is of the form Y(t) = (y1, y2, . . . , ym)(t). To extract segmentswe should split this trajectory by the hyperplane Y1 = Y2 = . . . = Ym. Assume that thehyperplane cuts the line section which connects the points Y(t) and Y(t +1). Then the timeseries S′ should be split between xp+t and xp+t+1. This performs the segmentation

{S′

i

}n

i=1of S′. Figure 2 shows an example of segmentation results.

The obtained segments have different lengths. Since the basic classification algorithms,including k-nearest neighbor method, cannot be applied directly to this segments, theyshould be primarily reduced to an equal length. Assume that the segments should be rescaledto the predefined size L. For this reason, each segment S′

i is approximated by the polylineS′

i of length li = |S′i |, so that the k-th vertex of this polyline is the k-th term of the time

series S′i . Then we construct the time series Xi of length L, defined as:

Xi(j) = S′i

(j × li

L

),

that corresponds to the time series S′i .

Fig. 2 Segmentation results. Red points mark the limits of segments

Page 7: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7263

4.2 Noise reduction

We assume that the time series S contains normally distributed Gaussian noise with param-eterN

(0, σ 2

). It introduces an additional error in the time series classification process, and

in order to improve the classification accuracy we apply noise reduction. To remove noisewe apply an algorithm, based on the singular value decomposition technique.

Here we use the notation introduced in the paragraph above. Let S′ be the section of thetime series S, and let A be the Hankel matrix corresponding to this section. Consider thesingular value decomposition of matrixA. To reduce the noise level we computem principalcomponents yk = Avk that account for 95 % of the variance. Then we construct matrix Y,where k-th row is the k-th principal component yk . Define series S′, which i-th element isa skew-diagonal sum of matrix Y. The obtained series S′ has less noise variance σ ′2 < σ 2

than the source series S′.

4.3 K-nearest neighbor method

To solve the time series classification problem in this paper we use the k-nearest neighbormethod. The brief description of the method is provided below. Let X = {Xi}Ni=1 be thelearning sample and let Y = {yi}Ni=1 be the set of answers, that corresponds to X. Supposewe need to classify the object X′ /∈ X. First, we arrange objects from the learning sample Xin the distance ascending order to X′:

ρ(X′, Xi1

) ≤ ρ(X′, Xi2

) ≤ · · · ≤ ρ(X′, Xik

). (3)

Here, Xin is the n-th nearest neighbor for X′ and ρ is the standard Minkowsky metric.Denote by yin the class of the n-th neighbor. Then the class y′ of X′ is defined as:

y′ = argmaxy∈Y

k∑n=1

[yin = y

]w(n,Xin), (4)

where w is a weight function, that evaluates the significance of n-th neighbor for the clas-sification of object X′. In this paper we consider four different weight functions, presentedin the Table 2.

5 Experiments and evaluation

To evaluate the performance of the proposed model and compare it with existing alternativeswe carried out a set of experiments, described in this section. Experiments were performedon the WISDM dataset [36] that represents time series from the accelerometer of a cellphone. These data were collected from 13 different people while they were performing a

Table 2 Weight functions wFunction Value

w1(n,Xin ) 1

w2(n,Xin ) 1 − nk+1

w3(n,Xin )1

ρ(X′,Xin )

w4(n,Xin )1

ρ(X′,Xin )2

Page 8: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7264 Multimed Tools Appl (2016) 75:7257–7270

specific set of six activities: walking, jogging, ascending stairs, descending stairs, sittingand standing.

To analyze the segmentation accuracy we performed two sets of experiments. In the firstset we used three conventional segmentation techniques: temporally-fixed segmentation,sliding window [14], and threshold-based algorithm [5, 10]. The second set was conductedusing the proposed segmentation algorithm based on the fundamental period extraction. Inboth experiments we used k-nearest neighbor method to classify the obtained segments.

The classification technique plays the crucial role in the activity recognition problem. Tocompare the results obtained by the proposed model, we determined parameters and appliedto the same dataset a classification method based on the neural network.

The classification accuracy for all methods was verified using 10-fold cross validation,the experiments we conducted on the set of 5600 samples.

5.1 Conventional segmentation techniques

To compare the proposed segmentation algorithm with alternatives, we applied three differ-ent online segmentation techniques to the same dataset. The first one is an elemental solutionthat splits the time series into segments of equal predefined length N . The second techniqueis based on the sliding window algorithm [14]. In this algorithm, a segment is grown untilit exceeds a predefined error bound and then the process is repeated with the first data pointnot included in the newly obtained segment. Also, we considered a threshold-based algo-rithm [5, 10], in which a new segment is created every time the signal exceeds preliminaryspecified threshold. The value of the threshold, the length of segments N , the error boundand other parameters of these algorithms were determined in the computational experiment.

The obtained segments were classified using the k-nearest neighbor method. We con-sidered different types of the weight function w (Table 2), and the number of neighbors k.Table 3 resumes the classification results obtained using the determined optimal parameters.

5.2 Segmentation based on the fundamental period extraction

In this section we describe experiment that was conducted to determine parameters and toestimate accuracy of the segmentation algorithm, proposed in this paper.

Considered algorithm had two parameters. First we had to select the threshold M , thatcuts off segments of length less then M . The second parameter was length L, to whichall the remained segments must be rescaled. In this experiment both M and L were over

Table 3 Classification results for the conventional segmentation techniques

Activity type, Y Size of the test sample Temporally-fixed Threshold-based Sliding window

Jogging 1600 90.6 91.3 94.3

Walking 1600 98.8 96.5 97.2

Upstairs 800 91.3 89.4 92.4

Downstairs 800 90.0 86.5 91.6

Sitting 400 100 87.5 100

Standing 400 100 75.2 97.5

Overall 5600 94.29 90.41 95.11

Processing time, s – 3.1 3.9 161.7

Page 9: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7265

1520

2530

3540

4550

20

30

40

50

0.7

0.75

0.8

0.85

0.9

0.95

1

Fig. 3 Dependence between the ratio of correct answers and parameters M , L

the range 14 to 50 with a two-step and the segmentation algorithm was implemented forall possible combinations of these parameters. Obtained segments were classified using thek-nearest neighbor algorithm with the linear weight function w2 and the value of k = 1.Figure 3 shows the classification results of the experiment.

The figure illustrates that the best classification results correspond to the values M thatare between 20 and 25. There is also a slight increase of classification accuracy for coinci-dent values of parameters M and L. Using parameters M = 22, N = 22 we obtained finalclassification results, presented in the Table 4. In comparison to the temporally-fixed seg-mentation algorithm, the overall accuracy was improved by more than 2 % to 96.61 %.In terms of individual class accuracy, the results for descending stairs remained the same,while the accuracy of recognition jogging and ascending stairs outperforms the previousresults by almost 5 %. Comparing with the sliding window algorithm, the overall accuracywas also improved by 1.5 % while the processing time was about 4 times smaller.

Table 4 Classification results for algorithm, based on the fundamental periods extraction

Activity type, Y Size of the test sample Correct answers, %

Jogging 1600 96.9

Walking 1600 99.4

Upstairs 800 95.0

Downstairs 800 90.0

Sitting 400 100

Standing 400 97.5

Overall 5600 96.61

Processing time, s – 32.3

Page 10: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7266 Multimed Tools Appl (2016) 75:7257–7270

Table 5 Classification results for the neural network

Activity type, Y Size of the test sample Correct answers, %

Jogging 1600 96.3

Walking 1600 100

Upstairs 800 68.8

Downstairs 800 85.0

Sitting 400 100

Standing 400 100

Overall 5600 92.32

5.3 Neural network-based approach

This paragraph is devoted to the approach based on the neural network. Here we considertwo-layer perceptron with sigmoidal activation function, trained with the backpropagationmethod.

Our first experiments showed that the performance of this method on the set of raw seg-ments is rather low. Thus, we extracted a feature vector for each segment and used it in thefurther classification process. We calculated 15 features for each 3-dimensional segment, 5for each direction: the mean value, the mean absolute value, the difference between maxi-mum and minimum value, the total value of absolute differences and the mean value of thecontained fundamental period.

The main parameter of the neural network was the number of neurons H in the hiddenunit. To estimate optimal value of this parameter we implemented neural network for H

over the range 8 to 32 and computed the classification accuracy and the root-mean-squareerror. The best results were for value of H near 24, and Table 5 presents classificationresults for this parameter. The overall number of correct answers was 517 or 92.32 %.For four common activities, jogging, walking, sitting and standing, we archived perfectaccuracy, while the most complicated task for the classifier was to distinguish ascendingand descending stairs.

5.4 Processing time

In this section we estimate the velocity of the described KNN-based method and compareit with the velocity of the methods previously proposed in papers [11, 15]. There was noinformation about the processing time in these papers, so we implemented the algorithmsexactly as they were described there to test them under the same conditions. As in originalworks, we used algorithms from the WEKA machine learning library for the classificationof the segments. All methods were launched on the same ten datasets of different lengthsranging between 1400 and 14000 on an Intel Core-i3 330M 2 CPU 2.13 GHz machine. Theprocessing time for each method is presented on the Fig. 4. The slowest methods are basedon logistic regression and neural network [15], they require far more processing time thanthe rest ones. Much faster are methods based on SVM [11] and J48 decision tree [15], theyshow similar velocity. The shortest time is achieved by the KNN-based method. ThoughKNN is not generally a fast algorithm, in this case due to the small length of segments (22points) this method shows the best performance.

Page 11: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7267

Fig. 4 Dependence between the length of the dataset and the processing time for five activity recognitionmethods

6 Conclusion and future work

In this paper, we proposed a method for human activity recognition using time series, col-lected from an accelerometer of a cell phone. We introduced an algorithm for online timeseries segmentation and proposed the k-nearest neighbor method for the classification ofobtained segments. The accuracy of activity recognition was verified in three computationalexperiments on the WISDM dataset. The experiment, in which we used a combination offeature extraction and neural network has shown almost the same overall accuracy as amultilayer perceptron in the work [15]. The method, based on the basic time series segmen-tation and the k-nearest neighbor algorithm has improved the results by about 2 %. The bestresults, over 96 % of correct answers, was shown by a combination of the advanced seg-mentation and the k-nearest neighbor algorithms. This method has outperformed the rest interms of overall and individual accuracy, especially in the distinguishing between ascend-ing and descending stairs. More important is that it requires the segments to be of the length20-30 or 1.0-1.5 seconds, that is about 7 times shorter than in works [11, 15]. This reducescomputational costs and together with a low classification time of each segment (much lessthan a second) makes it possible real-time activity recognition.

We plan to improve our activity recognition system in several ways. First, we intendto teach our system to recognize additional activities, such as driving, jumping and ridingthe bicycle. For this purpose we need to extend the existing dataset by adding new train-ing samples. Second, we plan to reduce the size of the training set by removing similartime series. This will lower the computational load and the memory occupied by the pro-gram. Finally, we hope to develop an application for mobile devices that performs real-timeactivity recognition and distribute the code as an open library for Java applications.

Acknowledgments This work is supported by the Russian Foundation for Basic Research (RFBR) undergrant number 14-07-31326 and by the Ministry of Education and Science of the Russian Federation,RFMEFI60414X0041.

Page 12: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7268 Multimed Tools Appl (2016) 75:7257–7270

References

1. Altun K, Barshan B (2010) Human activity recognition using inertial/magnetic sensor units. In: Salah A,Gevers T, Sebe N, Vinciarelli A (eds) Human behavior understanding, volume 6219 of lecture notes incomputer science. Springer, Berlin Heidelberg, pp 38–51

2. Bao L, Intille SS (2004) Activity recognition from user-annotated acceleration data. In: Ferscha A,Mattern F (eds) Pervasive computing, volume 3001 of lecture notes in computer science. Springer, BerlinHeidelberg, pp 1–17

3. Barralon P, Vuillerme N, Noury N (2006)Walk detection with a kinematic sensor: frequency and waveletcomparison. Proceedings of the 28th IEEE EMBS annual international conference 1:1711–1714

4. Bellman R (1961) On the approximation of curves by line segments using dynamic programming.Commun ACM 4(6):284

5. Brajdic A, Harle R (2013) Walk detection and step counting on unconstrained smartphones. UbiComp2013 1:225–234

6. Burges CJC (1998) A tutorial on support vector machines for pattern recognition. Data Min Knowl Disc2(2):121–167

7. Chiang S-Y, Kan Y-C, Tu Y-C, Lin H-C (2012) Activity recognition by fuzzy logic system in wire-less sensor network for physical therapy. In: Watada J, Watanabe T, Phillips-Wren G, Howlett RJ, JainLC (eds) Intelligent Decision Technologies, volume 16 of Smart Innovation, Systems and Technologies.Springer, Berlin Heidelberg, pp 191–200

8. Chin T-J, Wang L, Schindler K, Suter D (2007) Extrapolating learned manifolds for human activityrecognition. 2007 IEEE International Conference on Image Processing 1:383–384

9. Foerster F, Fahrenberg J (2000) Motion pattern and posture: Correctly assessed by calibrated accelerom-eters. Behav Res Methods Instrum Comput 32(3):450–457

10. Goyal P, Ribeiro VJ, Saran H, Kumar A (2011) Strap-down pedestrian dead-reckoning system. In: 2011International conference on indoor positioning and indoor navigation (IPIN), pp 1–7

11. Kai K, Tony P (2013) Classification of mobile device accelerometer data for uniqueactivity identificationunique activity identification. http://cs229.stanford.edu/proj2013/PratkanisKuspa-ClassificationOfMobileDeviceAccelerometerDataforUniqueActivityIdentification.pdf

12. Khan AM, Lee YK, Kim TS (2008) Accelerometer signal-based human activity recognition using aug-mented autoregressive model coefficients and artificial neural nets. In: Engineering in medicine andbiology society, 2008, EMBS 2008, 30th annual international conference of the IEEE, pp 5172–5175

13. Keogh E, Chu S, Hart D, Pazzani M (2001) An online algorithm for segmenting time series. In: DataMining, 2001 Proceedings IEEE International Conference on ICDM 2001, pp 289–296

14. Keogh E, Chu S, Hart D, Pazzani M (1993) Segmenting time series: A survey and novel approach. In:In an edited volume, data mining in time series databases, published by world scientific. PublishingCompany, pp 1–22

15. Kwapisz JR, Weiss GM, Moore SA (2011) Activity recognition using cell phone accelerometers.SIGKDD Explor Newsl 12(2):74–82

16. lai Chung F, Tak chung F, Ng V, Luk RWP (2004) An evolutionary approach to pattern-based time seriessegmentation. IEEE Trans Evol Comput 8(5):471–489

17. Liu W, Li Y, Lin X, Tao D, Wang Y (2014) Hessian-regularized co-training for social activityrecognition. PLoS ONE 9:e108474

18. Liu W, Liu H, Tao D, Wang Y, Ke L (2014) Multiview hessian regularized logistic regression for actionrecognition. In: Signal Processing

19. Liu W, Zhang H, Tao D, Wang Y, Lu K (2014) Large-scale paralleled sparse principal componentanalysis

20. Lockhart J (2011) Mobile sensor data mining. Fordham Undergraduate Research Journal 1:67–6821. Lockhart JW, Weiss GM (2014) Limitations with activity recognition methodology & #38; data sets. In:

Proceedings of the 2014 ACM international joint conference on pervasive and ubiquitous computing:Adjunct Publication, UbiComp ’14 adjunct. ACM, New York, pp 747–756

22. Loudon J (2008) The clinical orthopedic assessment guide. Human Kinetics 2:395–40823. Mannini A, Sabatini AM (2010) Machine learning methods for classifying human physical activity from

on-body accelerometers. Sensors 10(2):1154–117524. Mi Z, Sawchuk AA (2013) Human daily activity recognition with sparse representation using wearable

sensors. IEEE Journal of Biomedical and Health Informatics 17(3):553–56025. Mi Z, Alexander AS (2011) Manifold learning and recognition of human activity using body-area

sensors. 10th International Conference 2:7–13

Page 13: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

Multimed Tools Appl (2016) 75:7257–7270 7269

26. Mo L, Liu S, Gao RX, John D, Staudenmayer JW, Freedson PS (2012) Wireless design of a multisensorsystem for physical activity monitoring. IEEE Trans Biomed Eng 59(11):3230–3237

27. Nyan M, Tay F, Seah K, Sitoh Y (2006) Classification of gait patterns in the time-frequency domain. JBiomech 39:2647–2656

28. Olivares A, Ramirez J, Gorriz JM, Olivares G, Damas M (2012) Detection of (in)activityperiods in human body motion using inertial sensors: A comparative study. Sensors 12(5):5791–5814

29. Ravi N, Dandekar N, Mysore P, Littman ML (2005) Activity recognition from accelerometer data.In: Proceedings of the 17th conference on innovative applications of artificial intelligence - Volume 3,IAAI’05. AAAI Press, pp 1541–1546

30. Schuldt C, Laptev I, Caputo B (2004) Recognizing human actions: A local svm approach. In: Proceed-ings of the pattern recognition, 17th international conference on (ICPR’04) Volume 3 - Volume 03, ICPR’04. IEEE Computer Society, Washington, pp 32–36

31. Shultz SJ, Houglum PA, Perrin DH (2005) Examination of muskoskeletal injuries. Human Kinetics 2:55–60

32. Tapia EM, Intille SS, Haskell W, Larson K, Wright J, King A, Friedman R (2007) Real-time recognitionof physical activities and their intensities using wireless accelerometers and a heart rate monitor. In:2007 11th IEEE international symposium on wearable computers, pp 37–40

33. Thuer G, Verwimp T (2008) Step detection algorithms for accelerometers. Master’s thesis, Paper of theE-LAB Master Thesis. http://nitarc.be/map/paper/AMBIT ThuerVerwimp.pdf

34. Wang S, Yang J, Chen N, Chen X, Zhang Q (2005) Human activity recognition with user-free accelerom-eters in the sensor networks. In: Neural networks and brain, 2005, international conference on ICNN B’05, vol 2, pp 1212–1217

35. Wen-Ming C, Li N (2010) Face recognition based on manifold learning and renyi entropy. Nat Sci 2:49–53

36. Wisdm’s activity prediction dataset (2012). http://www.cis.fordham.edu/wisdm/dataset.php37. Ying H, Silex C, Schnitzer A, Leonhardt S, Schiek M (2007) Automatic step detection in the accelerom-

eter signal. In: Leonhardt S, Falck T, Mahonen P (eds) 4th International workshop on wearable andimplantable body sensor networks (BSN 2007), volume 13 of IFMBE proceedings. Springer, BerlinHeidelberg, pp 80–85

38. Yurur O, Liu C-H, Moreno W (2013) Unsupervised posture detection by smartphone accelerometer.Electron Lett 49(8):562–564

39. Zhou Y, Cheng Z, Jing L (2014) Threshold selection and adjustment for online segmentation ofone-stroke finger gestures using single tri-axial accelerometer. Multimedia Tools and Applications70:1–20

Andrey D. Ignatov is a student of the Moscow Institute of Physics and Technology (MIPT). Currently, he isa member of the ECG Informational Processing Research group, an assistant in the Laboratory of the Exper-imental Economics in the MIPT University and the author and co-author of several research publications inthe field of machine learning applications for medical purposes. His current interests include computationalintelligence, data analysis, bio-signal analysis and intelligent healthcare systems.

Page 14: Human activity recognition using quasiperiodic time series ......perform human physical activity recognition using data, collected from the built-in tri-axial accelerometerofamobilephone.Thisdatarepresentsquasiperiodictimeseriescorrespond-

7270 Multimed Tools Appl (2016) 75:7257–7270

Vadim V. Strijov obtained Ph.D. in Physics and Mathematics from the Computing Centre of the RussianAcademy of Sciences in 2002 with a thesis on Mathematical Modelling and Data Analysis and M.S. inSystem Analysis and Computer-Aided Design from Ufa Aircraft Institute in 1992. He is the author of theExpert estimation concordance theory. Field of research: Machine Learning, Data Analysis, Model Selection,Structure Learning, Preference Learning. Current duties: Principal Investigator at the Computing Center ofthe Russian Academy of Sciences, Associate Professor at the Moscow Institute of Physics and Technology,Editor in chief of the Journal of Machine Learning and Data Analysis.