Full text
UNIVERSIDAD DE SEVILLA DEPARTAMENTO DE LENGUAJES Y SISTEMAS INFORMÁTICOS Desarrollo y Versatilidad del Algortimo de Discretización Ameva (Development and Versatility of the Discretization Algorithm Ameva) International Doctoral Dissertation presented by D. Miguel Ángel Álvarez de la Concepción advised by Dr. Juan Antonio Álvarez García and Dr. Luis Miguel Soria Morillo. April 2018.
To my wife and children. I would never have become who I am without you all.
Acknowledgments I would like to thank to my thesis directors, Dr. Juan Antonio Álvarez García and Dr. Luis Miguel Soria Morillo, all the effort, support and time dedicated to the elaboration of this work and to many others that we have shared in the past. They have encouraged me to conclude what I saw so distant and actually was so close. Also, I would like to thank to Dr. Juan Antonio Ortega Ramírez, Dr. Luis González Abril and Dr. Francisco Velasco Morente for the good advises, both professional and personal, that they have given me and for believing in me since the beginning of my stage as researcher. I will be eternally grateful. To my parents, Rafael and María de los Ángeles, for having instilled in me the values of hard work and sacrifice, which have allowed me to achieve great goals in my life, and my sister, Sara Inmaculada, for her unconditional love. To all my colleagues in the Computer Languages and Systems department, of the research group and especially of the Scientific Computer Center of Andalusia where I have spent most of the time. We have worked and enjoyed some free time together, we have laughed, we have cried and those moments are what have made us great and unforgettable friends. In particular I want to thank to José Ignacio Sánchez Venzalá and Antonio Manuel Bellido Moreno for their friendship reflected in the good times we have spent inside and outside the workplace. I will never forget you. Finally, and in a more special and unique way, thanks to my wife Cristina and my children Adriana and Hugo. You are special and I tell you every day. You are the engine of my life and there is not even once time I have made a hard decision without thinking of you all before. Thanks for the love that you give me, especially in the most difficult moments where your devotion and blind trust is evident. From now on we will have all the time in the world to play with dolls. To all, many thanks from heart.
CONTENTS I Preface 1 Introduction 19 1.1 Research motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 1.2 Research methodology . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.3 Researchquestion............................. 24 1.4 Successcriteria .............................. 24 1.5 Properties analyzed and discussed . . . . . . . . . . . . . . . . . . . . 25 1.6 Thesisoutline............................... 25 2 Ameva 29 2.1 Introduction................................ 29 2.2 The Ameva discretization algorithm . . . . . . . . . . . . . . . . . . . 30 2.3 Optimizations of the algorithm . . . . . . . . . . . . . . . . . . . . . 33 2.3.1 First optimization . . . . . . . . . . . . . . . . . . . . . . . . . 35 2.3.2 Second optimization . . . . . . . . . . . . . . . . . . . . . . . 36 Page vii
CONTENTS 2.4 Featurereduction............................. 36 3 Activity Recognition and Fall Detection 41 3.1 Introduction................................ 41 3.2 Embedded sensors and activities . . . . . . . . . . . . . . . . . . . . . 43 3.3 Datacollection .............................. 44 3.4 Methodology ............................... 46 II Selected research works 4 Discrete techniques applied to low-energy mobile human activity recognition. A new approach 53 5 Low energy physical activity recognition system on smartphones 65 6 Mobile activity recognition and fall detection system for elderly people using Ameva algorithm 103 III Other relevant research works 7 A qualitative methodology to reduce features in classification problems 119 8 The CICA GRID - A cloud computing infrastructure on demand with open source technologies 127 9 Activity recognition system using AMEVA method 135 10 An adaptive methodology to discretize and select features 149 Page viii
CONTENTS 11 Activity recognition system using non-intrusive devices through a complementary technique based on discrete methods 163 12 Evaluating wearable activity recognition and fall detection systems179 IV Final remarks 13 Conclusions and future work 189 13.1Conclusions ................................189 13.2Futurework................................190 A Curriculum 193 A.1 Publishedpapers .............................193 A.1.1 JCR Indexed Journals . . . . . . . . . . . . . . . . . . . . . . 194 A.1.2 OtherJournals ..........................195 A.1.3 International Conferences . . . . . . . . . . . . . . . . . . . . 196 A.1.4 National Conferences . . . . . . . . . . . . . . . . . . . . . . . 198 A.2 Patents ..................................200 A.3 Awards...................................201 A.4 R&Dprojects...............................201 A.5 Scientific Outreach Events . . . . . . . . . . . . . . . . . . . . . . . . 202 A.6 Supervision of Degree Projects . . . . . . . . . . . . . . . . . . . . . . 203 Bibliography 205 Page ix
PART I Preface Page 17
CHAPTER 1 INTRODUCTION It is strange that only extraordinary men make the discoveries, which later appear so easy and simple - Georg Christoph Lichtenberg 1.1 Research motivation This doctoral thesis will present the work of the doctorate in discretization and classification systems based on discrete techniques and its application in the area of activity recognition. The energy saving and the low computational complexity, as well as the increasing of the performance, are the main objectives that have been defined to optimize the execution of algorithms in mobile devices with the lower possible impact. As part of the research team, we decided to continue with one of the main topics Page 19
Chapter 1: Introduction that my research group did. It is the Ameva discretization algorithm and there were some open discussions around the possibilities that it had, starting with the relation between discretization and classification. The problem of classification is one of the main issues in data analysis and pattern recognition that requires the construction of a classifier, that is, a function that assigns a class label to instances described by a set of features. The induction of classifiers from data sets of classified instances is a central problem in machine learning. For that purpose, a large number of methodologies based on SVM [46], Naive Bayesian [116], C5.0 [49], etc. have been developed. One of the most important preprocess in classification is the discretization. This process establishes a relationship between continuous variables and their discrete transformation through functions. Therefore, it is possible to model qualitatively a series of continuous values if a label is assigned to them. Some studies [34] have shown that execute a prior process to discretize continuous features is more efficient than work directly with the continuous values. This process reduces the computation time and memory usage in classification algorithms and it is used to manage the set of values of a feature more effectively. One of the contributions in this vein of the present doctoral thesis is a discretization method based on the Ameva discretization algorithm. Ameva algorithm reduces execution time and the number of intervals as it was demonstrated in [47]. This behavior is outstanding when the data set has a large number of classes, although, under certain circumstances, it has a slight reduction in the capacity of identification. The Ameva discretization algorithm performs this process effectively and quickly, so the set of values of a feature is greatly reduced, but do not reduce the number of features. Because Ameva uses the statistic χ2to determine the relationship between features and classes, it is possible to use this algorithm to determine the relationship between features. In fact, this is one of the open questions derived from this research. In the other hand, activity recognition and fall detection are two areas of great Page 20
1.1 Research motivation interest as can be seen in Figure 1.1 and detailed in Table 1.1, where the result of some Web of Science reports have been exported. The number of research papers in these areas has been grown in the last decades due to the facilities offered by the technologies companies with new and really good devices. They do not only allow to get relevant information from their embedded sensors, but share the information across health entities or other users in general-purpose applications. Figure 1.1: Growth in activity recognition and fall detection research papers since 2010. In terms of activity recognition, the appearance of affordable gyroscopes and accelerometers allowed researches to use them in their investigations. From 2000 to now, wearable sensors and smartphone devices increased the number of possibilities of getting information and data in some ways. This means that the generation of products and services around the world is also more efficient. In the other hand, the number of research papers in fall detection is lower because it didn’t have an own well defined area (the majority of researchers included it in activity recognition), but the increasing of the published papers in the last years is Page 21
Chapter 1: Introduction proportionally bigger. Since 2010, fall detection has gained importance for elderly people, for this reason, medical companies are investing several resources. # research papers Year Activity recognition Fall detection 2010 930 267 2011 1373 390 2012 1848 726 2013 3062 1147 2014 4329 1620 2015 6697 2167 2016 8402 2931 2017 9862 3699 Table 1.1: Detail of number of research papers reported by Web of Science since 2010. Within this context, this thesis proposal continues the thesis of one of the advisors, Luis Miguel Soria Morillo [86], where one of the topics was mobile physical activity recognition systems. He ended up that one of the needs was the decreasing of the computational time and therefore of battery draining and, here, it is where a new algorithm based on the Ameva discretization algorithm was developed as part of this thesis. All this research was done as part of two research projects: HERMES (Healthy and Efficient Routes in Massive Open-Data Based Smart Cities-Citizen) and Simon (Saving Energy by Intelligent Monitoring)(1) where the objectives were to achieve energy efficiency in the day-to-day life of citizens and monitoring the citizens of a smart city. (1)This research is partially supported by the projects of the Spanish Ministry of Economy and Competitiveness HERMES (TIN2013-46801-C4-1-r) and Simon (P11-TIC-8052) of the Andalusian Regional Ministry of Economy, Innovation and Science. Page 22
1.2 Research methodology 1.2 Research methodology This research follows the standard scientific research technique [66] which includes the following phases: 1. Define research problem. Most of the activity recognition systems applied to mobile devices have a high computational cost and in this dissertation, a new one is designed that has a trade-off between battery draining and performance. 2. Review the literature. During the period of this doctoral thesis, a deep searching and reading of the research based on activity recognition systems has been done and the references of each paper show it. 3. Formulate hypotheses. As part of the previous works made in our research group, we discussed how to apply discretization techniques in order to reduce the computational cost in the analysis of the data acquired by the mobile devices without decreasing the performance. 4. Design research. The whole system was analyzed in order to find the key points that are susceptible to changes and we found some of them where the discretization algorithm could be applied. The main ones were the pre-process and the post-process steps. 5. Collect data. Hundreds of megabytes of real data were collected using some devices carried out by dozens of people of diverse age. Also, a few well-known databases from other researchers were used as well. 6. Execution of the project. The designed algorithm was executed using the previous data as training data and after that, it was executed in real environments. 7. Analyze data. The information obtained by the system was analyzed using standard metrics and was compared with previous results. Page 23
Chapter 1: Introduction 8. Interpret and report. Once the information was analyzed and interpreted, some papers were published as a result of our hypothesis. 1.3 Research question The research question that leads this thesis dissertation is: are we able to reduce the computational cost in the activity recognition and fall detection system developed by us without decreasing the performance and therefore increasing the battery life using Ameva? Within the context of activity recognition, we focused on obtaining and discretizing data, generating some statistics and clustering them in activities using Ameva. To this end, activity recognition systems from the literature and new proposals were tested and compared. Also, a software was specially developed for this purpose and tested in real scenarios. Within the context of specific activities, we focused on rating as the maximum priority the detection of fall detection. The question became how to adapt the system in order to isolate the recognition of that activity in the set of activities configured in the system using the Ameva discretization algorithm. As part of the system, the same software developed in the previous case was used. 1.4 Success criteria The success will be achieved if the research question is resolved. This means that we have to check that both the model and the supporting algorithms actually recognize and identify the activities and demonstrate their validity through real scenarios. The developed software demonstrates that the output matches the prediction that was formulated in the hypothesis. Using the sensors in the mobile devices, hundreds of Megabytes of data were Page 24
1.5 Properties analyzed and discussed collected and computed from a set of 10 users. The learning process of each activity recognized by the system consisted of its performance for a time of 6 minutes and, for the recognition process, users were followed over a period of 72 hours. Later, new experiments were carried out on real scenarios by a set of a wide age people [27]. Apart of that, other well-know databases [101, 131, 70, 106] were used as well. 1.5 Properties analyzed and discussed Activity recognition and fall detection is approached from two sides: •Performance. In relation to the number of activities recognized by the system, we improved it developing a new methodology using the Ameva algorithm as an extension of the Luis Miguel Soria Morillo’s thesis. •Battery draining. In relation to the computational cost, the methodology uses the Ameva algorithm as well. It allowed to reduce the amount of data that has to be analyzed. The work presented in this document provides a solution for the improvement of activity recognition in order to satisfy user preferences, by and minimizing energy consumption with high performance, using the Ameva algorithm. 1.6 Thesis outline The document is structured as follows: In Part. I, the current introduction is presented in Chapter 1. Chapter 2 describes the Ameva discretization algorithm based on the χ2statistic and Chapter 3 introduces the problem of recognizing the actions of one or more subjects and presents the difficulty of identifying a specific activity among others, where is a major health risk that diminishes the quality of life for elderly people. In Part. II, three selected journal papers are provided. These Page 25
Chapter 2: Ameva Lj, for i= 1,2, . . . , ` and j= 1,2, . . . , k. So that: ni·= k X j=1 nij, n·j= ` X i=1 nij, N = ` X i=1 k X j=1 nij Given discrete attributes Cand L(k), these are statistically independents if for all Ci∈ C and Lj∈ L(k), then nij =ni·n·j N for i= 1,2, . . . , ` and j= 1,2, . . . , k. In other case, a dependence between these attributes exists. Therefore, a way to measure the dependence between Cand L(k)is the study of value ` X i=1 k X j=1 nij −ni·n·j N2 Considering a relative measure, χ2(k)def =χ2(L(k),C|X)is defined by χ2(k) = ` X i=1 k X j=1 nij −ni·n·j N2 ni·n·j N =N −1 + ` X i=1 k X j=1 n2 ij ni·n·j!(2.1) It is straightforward to prove that max X,L(k),Cχ2(k) = N(min{`, k} − 1) (2.2) Hence, the Ameva coefficient, Ameva(k)def =Ameva(L(k),C|X), is defined as follows: Ameva(k) = χ2(k) k(`−1) for k, ` ≥2. The Ameva criterion has the following properties: •The minimum value of Ameva(k)is 0and when this value is achieved then both discrete attributes Cand L(k)are statistically independent and viceversa. •The maximum value of Ameva(k)indicates the best correlation between class labels and discrete intervals. If k≥`then, for all x∈Cia unique j0exists such that x∈Lj0(remaining intervals (k−`) have no elements); and if k < ` Page 32
2.3 Optimizations of the algorithm then, for all x∈Lj, a unique i0exists such that x∈Ci0(remaining classes have no elements) i.e. the highest value of the Ameva coefficient is achieved when all values within a particular interval belong to the same associated class for each interval. •The aggregated value is divided by the number of intervals k, hence the criterion favors discretization schemes with the lowest number of intervals. •From Equation 2.2, it is followed that Amevamax(k)def = maxX,L(k),CAmeva(k) = N(k−1) k(`−1) if k < ` and N kotherwise. Hence, Amevamax(k)is an increasing function of kif k≤`, and a decreasing function of kif k > `. Therefore, maxk≥2Amevamax(k) = Amevamax(`)i.e. the maximum value of the Ameva coefficient is achieved in the optimal situation, it is to say, when all values of Ciare in a unique interval Ljand viceversa. Therefore, the aim of the Ameva method is to maximize the dependence relationship between the class labels Cand the continuous-values attribute L(k), and at the same time to minimize the number of discrete intervals k. 2.3 Optimizations of the algorithm A deep study was done in order to understanding its strengths and weaknesses and there are two main characteristics based on the Ameva coefficient that should be presented. •The problem of finding a discretization scheme L(k)with a global optimal value of Ameva criterion is highly combinatorial. The first approach reduces the task of discretization to a reasonable computational cost, so it can be applied to continuous attributes with a large number of different values and computes a local maximum value of the coefficient Ameva. The algorithm works with a top-down scheme by starting as a single interval and dividing it into two new intervals using as criterion the results obtained in the search Page 33
Chapter 2: Ameva for the optimal value of Ameva(k)after the division. The algorithm has two parts and is detailed in the Algorithm 1. This algorithm finds the best and smallest number of intervals based on the value of the coefficient Ameva. •The number of class labels is small and, as the Ameva criterion provides a reduced number of intervals, it is possible to define a genetic algorithm that finds the maximum overall value of the Ameva coefficient with a not excessive computational cost. Algorithm 1: The Ameva algorithm Data: X={x1, x2, . . . , xN}, xi< xi+1 and C={C1, C2, . . . , C`}, ` ≥2 Result: D: discretization scheme D={[x0, xN]}; A={x0, xN}; global = 0; while true do for j←1to N−1, xj@Ado B=sort(A∪xj); localj=Ameva(L(B),C|X); end if max(local1, local2, . . . , localN−1)> global then A=sort(A∪xj); D={[x0, x1],[x1, x2],...,[x|A|−1, x|A|]}; global =local; else break; end end Based on the previous findings, two optimization of Ameva discretization algorithm that provides improvements in two ways were performed: Page 34
2.3 Optimizations of the algorithm •In the first optimization, the accuracy was increased and the computational cost was decreased over other discretization algorithms. •In the second optimization, the accuracy was increased over its original version and the computational cost was reduced compared to other discretization algorithms. 2.3.1 First optimization In this optimization, the algorithm stops when the number of intervals is equal to the number of existing classes in the class variable. As a result, the accuracy is reduced and the computational time is increased, but in comparison with other discretization algorithms, both are better. The algorithm is detailed in the Algorithm 2. Algorithm 2: The first optimization of the Ameva discretization algorithm Data: X={x1, x2, . . . , xN}, xi< xi+1 and C={C1, C2, . . . , C`}, ` ≥2 Result: D: discretization scheme D={[x0, xN]}; A={x0, xN}; while |D|< ` do for j←1to N−1, xj@Ado B=sort(A∪xj); localj=Ameva(L(B),C|X); end A=sort(A∪xj/max(local1, local2, . . . , localN−1) = localj); D={[x0, x1],[x1, x2],...,[x|A|−1, x|A|]}; end Page 35
Chapter 2: Ameva 2.3.2 Second optimization After studying the Ameva discretization algorithm and checking the partial results at each step of the value of the Ameva coefficient, it was discovered that there are more than one max point. Thus, the implemented function got in some cases more than one local maximum. The original Ameva discretization algorithm ends when the next value of the Ameva coefficient is less than the previous one as can be seen in the Algorithm 1, so if there is another local maximum value of the Ameva coefficient, then it will not be considered. Because it has to be considered, in this optimization, the algorithm stops also when the number of intervals is the number of classes, but it gets the best discretization scheme. The algorithm is detailed in the Algorithm 3. 2.4 Feature reduction If `= 1 or k= 1 then it is not possible to use the Ameva discretization algorithm(1). Let us see the two cases in Table 2.2 and Table 2.3. Equation 2.1 can not be calculated using Table 2.2 because it is not possible to divide by 0. Nevertheless, all the instances belong to the same class, therefore can be concluded that the dependence is maximum. In this case, let us indicate that A∗(1) = 1. Regarding to Table 2.3, the Ameva discretization algorithm can not be used because X2(k)=0and the Ameva coefficient does not give any information about the dependence. However, the dependence is not minimum and a new coefficient is (1)Let us indicate these pathological cases do not happen in a standard discretization, but it will be necessary taking into account in the presented methodology in the current section Page 36
2.4 Feature reduction Algorithm 3: The second optimization of the Ameva discretization algorithm Data: X={x1, x2, . . . , xN}, xi< xi+1 and C={C1, C2, . . . , C`}, ` ≥2 Result: D: discretization scheme D={[x0, xN]}; A={x0, xN}; A0={x0, xN}; global = 0; while |D|< ` do for j←1to N−1, xj@A0do B=sort(A0∪xj); localj=Ameva(L(B),C|X); end A0=sort(A0∪xj/max(local1, local2, . . . , localN−1) = localj); if max(local1, local2, . . . , localN−1)> global then A=A0; D={[x0, x1],[x1, x2],...,[x|A|−1, x|A|]}; global =local; end end necessary. By taking into account that if all instances are distributed equally in all classes, the dependence is minimum, and if exists isuch that ni1=N, the dependence is maximum. Hence the following coefficient, called Entropy, is considered: A(1) = 1 + 1 Nln ` ` X i=1 ni1ln(ni1 N) It holds that 0≤A(1) ≤1and the next: •If A(1) = 0, then ni1=N `(minimum dependency). •If A(1) = 1, then a unique ni1exists that ni1=N(maximum dependency). Page 37
Chapter 2: Ameva Ci|LjL1· · · Lj· · · Lkni· C1n11 · · · n1j· · · n1kN n·jn11 · · · n1j· · · n1kN Table 2.2: Contingency table at first case (`= 1) Ci|LjL1ni· C1n11 n11 . . .. . .. . . Cini1ni1 . . .. . .. . . C`n`1n`1 n·jN N Table 2.3: Contingency table at second case (k= 1) This new coefficient allows to establish a new methodology to reduce features using the Ameva discretization algorithm. Given an attribute Xiwhere i= 1,2, . . . , s, the Ameva discretization algorithm is applied to this attribute so obtained intervals are considered as a new set of classes. This set of classes is denotes as follows: Ci={Ci 1, Ci 2, . . . , Ci `}(2.3) Let us consider Xp⊂Xas the data subset that belongs to the class Cp∈ Ciwhere p= 1,2, . . . , `. From Equation 2.3, for each attribute Xjwith j= 1,2, . . . , s, a gijp value is obtained from Cias follows: •If the Xpdata subset all belong to the same class Cithen gijp =A∗(1) = 1. •If the subset of data belongs to different classes, then: –If values of the attribute Xjare always in the same interval, then gijp = A(1). Page 38
2.4 Feature reduction –If values of the attribute Xjare not always in the same interval, then gijp =AmevaN(`i), where AmevaN(`i)is defined as follows(2): AmevaN(`i) = `0 i Np Ameva(`i) provided that Npis the number of instances of the class Xpand l0 iis the number of intervals of the attribute Xifor which there is at least one value in the data subset. Given i, j = 1,2, . . . , s, a gijp value can be obtained applying this methodology for all class Cp∈ C for p= 1,2, . . . , `, and by considering different statistics as follows: gmin ij = min pgijp ggeo ij =` v u u t ` Y p=1 gijp gari ij =1 ` ` X p=1 gijp gmax ij = max pgijp Also, it is well-known that gmin ij ≤ggeo ij ≤gari ij ≤gmax ij is holded. The main properties of the matrix G= (gij), that is, G= 1g12 · · · g1s g21 1· · · g2s . . .. . ..... . . gs1gs2· · · 1 are the following: i) it is squared but non symmetric matrix; ii) the values of the main diagonal are 1; iii) 0≤gij, gji ≤1. (2)This new Ameva coefficient is chosen in order to obtain a normalized value 0≤AmevaN(`i)≤1 as same as A(1). Furthermore, it is straightforward to prove that if i=jfor i= 1,2, . . . , s, then gijp = 1, for all p= 1,2, . . . , `. Page 39
Chapter 2: Ameva From the Gmatrix, a method of generating rules of dependence between attributes can be defined. For example, a possible rule is the next: given a threshold value, θ, if max(gij, gji)> θ and i < j where i, j = 1,2, . . . , s and i6=j, then the Xjattribute is eliminated. A first approach has been published in [6] and [26] as part of the future work and a new way to use the Ameva discretization algorithm. Page 40
CHAPTER 3 ACTIVITY RECOGNITION AND FALL DETECTION The good thing about science is that it is true whether or not you believe in it - Neil deGrasse Tyson 3.1 Introduction Activity recognition is an important area of research and applications and its goal is an automated analysis (or interpretation) of ongoing events and their context from data. Its applications include surveillance systems, patient monitoring systems and a variety of systems that involve interactions between persons and electronic devices. Most of these applications require recognition of high-level activities, often composed of multiple simple (or atomic) actions of persons. In this context, one of the main Page 41
Chapter 3: Activity Recognition and Fall Detection Based on previously generated intervals, the algorithm has to provide a probability associated with the elements of the training set x∈ X . For that purpose, a Class Matrix, V, is defined as a three-dimensional matrix that contains the number of items from the training set associated with an interval Lpin a activity Cifor each statistic Spof the system. This matrix is defined as follows: V= (vpij) where vpij = #{x∈X|inf(Lp i)< x ≤sup(Lp i)},p= 1,2, . . . , m,i= 1,2, . . . , kp and j= 1,2, . . . , `. Hence, each position in the Class Matrix is uniquely associated with a position in the Discretization Matrix, which is determined by its range. Figure 3.2 shows the contents of the Class Matrix obtained during a learning process for only 3 out of 8 activities recognized by the system. Within these activities, five intervals determined by the Ameva discretization algorithm can be observed in the Class Matrix for the mean statistic. Figure 3.2: Example of Class Matrix. The next step is to specify the likelihood that a given value xassociated to a statistic Spcorresponds to an activity Ciin an interval Lp. This is done by the Page 48
3.4 Methodology Activity-Interval Matrix denoted by Uand defined as follows: U= (upij) where each value is defined as upij =vpij vp·jP` q=1,q6=j1−vpiq vp·q `−1 and vp·jis the total number of time windows of the training process labelled with the activity Cjfor the statistic Sp, and p= 1,2, . . . , m,i= 1,2, . . . , kp, and j= 1,2, . . . , `. Also, each value upij can be seen as a degree of belonging for a given x, identified with a activity Ci, to be included in the interval Lpof the statistic Sp. Similarly, they hold the following properties: •upij = 0 ⇐⇒ vpij = 0 ∨vpiq =vp·q, q 6=j •upij = 1 ⇐⇒ vpij =vp·j=vpi· Figure 3.3 shows a set of values for each of the positions of the Activity-Interval Matrix. These results have been obtained from the training set of the Class Matrix described above in Figure 3.2. Once the discretization intervals and the probabilities of belonging have been obtained, the process of classification is described. It is divided into two main parts: the way to perform the recognition of physical activity and the task of determining the frequency of a particular activity is presented. The most likely activity is decided by a majority voting system starting from the Activity-Interval Matrix, U, and a set of data x∈ X for the statistics S. It consists of finding an activity Ci∈ C that maximizes this likelihood and it is defined in the following expression denoted by mpa (most probable activity): mpa(x) = Ck Page 49
Chapter 3: Activity Recognition and Fall Detection Figure 3.3: Example of Activity-Interval Matrix. where k= maxjPm p=1 upij |x∈(inf(Lp i), sup(Lp i)]). This expression assumes that all statistics provide the same information to the system and there is no correlation between them. A detailed analysis and results have been published in [25], [88] and [28] as part of the main topic of this doctoral thesis. Page 50
PART II Selected research works Page 51
CHAPTER 4 DISCRETE TECHNIQUES APPLIED TO LOW-ENERGY MOBILE HUMAN ACTIVITY RECOGNITION. A NEW APPROACH Overview This paper addresses a low-energy solution for human activity recognition systems using discrete techniques based on the Ameva algorithm. It is used both in the pre-process step where the continuous values are transformed to discrete values and the classification step where the decision is taken based on a set of intervals that determine the activity where the value belongs to. Unlike other systems currently in use, this proposal enables recognition of high granularity activities by using accelerometer sensors and remains free of dependence on the features of any recognition activity dataset. Thanks to this discretization process, the classification cost is much lower than it would be with continuous variables and gets the life of the battery to be longer, so the accuracy of activity recognition systems can be increased without sacrificing efficiency. Furthermore, the data is Page 53
Chapter 4: Discrete techniques applied to low-energy mobile human activity recognition. A new approach processed in the mobile itself, obtaining the results in real time, and therefore the efficiency is better than if data were sent to a server. The strengths of the system are both the high success rate and the reduced computational cost associated with the processing of data during the recognition process. Context This research was initiated as a part of one of the possible uses of the Ameva algorithm that this PhD candidate carried out with activity recognition systems. The idea of reducing the computational cost in mobile devices using discrete variables was the main goal of the paper. Also, it was the first attempt to use Ameva as a classification algorithm due to its high computational performance. This paper is the result of over 1 year’s work in this area. Journal information Figure 4.1: Expert Systems with Applications cover. The Journal Expert Systems with Applications was selected for the submission of this paper that is indexed in JCR with an Impact Factor of 2.240 and a 5-Year I.F. 2.571. Also, it stands in ranking Q1 in three categories: Operations Research & Management Science (12/81); Engineering, Electrical & Electronic (48/249); Computer Science, Artificial Intelligence (29/123). Page 54
Discrete techniques applied to low-energy mobile human activity recognition. A new approach Álvarez de la Concepción M.A. a , Soria Morillo L.M. a, ⇑ , Gonzalez-Abril L. b , Ortega Ramírez J.A. a a Computer Languages and Systems Dept., University of Seville, 41012 Seville, Spain b Applied Economics I Dept., University of Seville, 41018 Seville, Spain article info Keywords: Pattern recognition Discretization method Qualitative systems Smart-energy computing Energy saving abstract Human activity recognition systems are currently implemented by hundreds of applications and, in recent years, several technology manufacturers have introduced new wearable devices for this purpose. Battery consumption constitutes a critical point in these systems since most are provided with a rechargeable battery. In this paper, by using discrete techniques based on the Ameva algorithm, an innovative approach for human activity recognition systems on mobile devices is presented. Furthermore, unlike other systems in current use, this proposal enables recognition of high granularity activities by using accelerometer sensors. Hence, the accuracy of activity recognition systems can be increased without sacrificing efficiency. A comparative is carried out between the proposed approach and an approach based on the well-known neural networks. Ó2014 Elsevier Ltd. All rights reserved. 1. Introduction In recent years, thanks largely to the growing interest in monitoring certain sectors of the population, such as elderly people with dementia and people in rehabilitation, activity recognition systems have experienced an increase in both number and quality of results. However, most of these results incur high computational costs, and hence cannot be applied on a general-purpose mobile device due to their excessive energy consumption. Although, the calculation of the physical activity of a user, based on data obtained from an accelerometer, remains a current research topic, numerous limitations have been identified that make these systems uncomfortable for users in general. The first difference observed between the many systems developed is the type of sensor used. There are systems using specific hardware (Ravi, Dandekar, Mysore, & Littman, 2005), while others use general-purpose hardware (Hong, Kim, Ahn, & Kim, 2008). Obviously, the use of generic hardware constitutes a benefit for users, since their availability, low cost, and versatility are points greatly in their favour; not to mention the reduction in the risk of loss, since these devices have already been integrated into everyday objects, such as users’ smartphones. However, general purpose devices are used for other purposes, such as making phone calls, surfing the Internet, and listening to music. For this reason, the physical activity recognition system must be executed in background mode and cause the least impact on the system as possible, in terms of complexity and energy consumption. Another difference found between the proposals surveyed is the number and position of the sensors. In Brezmes, Gorricho, and Cotrina (2009), it can be observed that the accelerometer sensor is placedinagloveandamultitudeofactivitiesarerecognizeddepending on the movement of the hand. In contrast, other studies use either various sensors placed on many parts of the body (Bicocchi, Mamei, & Zambonelli, 2010; Lepri, Mana, Cappelletti, Pianesi, & Zancanaro, 2010) or a wearable wireless sensor node with a static wireless non-intrusive sensory infrastructure (Paoli, Fernández- Luque, & Zapata, 2011) to recognize these activities. According to certain comparative studies and previous research based on multiplesensors, these last two typesofsensors provide greater accuracy. However, in studies, such as Hong et al. (2008), a sensor is kept in a user’s pocket or worn on the hip, which is more wearable on the monitored person, and requires much lower infrastructure. Once the most comfortable alternative for users is determined, some device sensors could be chosen to perform the activity monitoring. Some research uses data not only from accelerometers and a gyroscope (Dernbach, Das, Krishnan, Thomas, & Cook, 2012), but also from other sources, such as microphones, light sensors and voice recognition to determine the context of the user (Kwapisz, Weiss, & Moore, 2011) and ECG sensors (Li et al., 2010; Pawar, Chaudhuri, & Duttagupta, 2007; Ward, Lukowicz, Troster, & Starner, 2006) for this purpose. http://dx.doi.org/10.1016/j.eswa.2014.04.018 0957-4174/Ó2014 Elsevier Ltd. All rights reserved. ⇑ Corresponding author. E-mail addresses: [email protected] (M.A. Álvarez de la Concepción), [email protected] (L.M. Soria Morillo), [email protected] (L. Gonzalez-Abril), [email protected] (J.A. Ortega Ramírez). Expert Systems with Applications 41 (2014) 6138–6146 Contents lists available at ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa
The first example, which incorporates microphone and bluetooth devices, helps to obtain contextual information about the user environments and would be appropriate to perform a more in-depth analysis of the activity, for instance, whether the user is walking in a disco or at home, or whether s/he is alone or with someone. However, high-level activity recognition (walking, playing, running or standing up) is carried out using other sensors. On the other hand, ECG can help determine high-level activities by means of heart-rate processing. In this sense, certain activities (walking or running) could be discerned based on the effort exerted. However, the problem here is that ECG sensors are both expensive and uncomfortable for the user. Thus, the present work is focused on the recognition of physical activities carried out by users by means of their mobile devices, and hence special attention must be paid to energy consumption and the computational cost of the methods used. There are related studies where data for activity recognition is obtained through mobile devices where this data is sent to a server to process the information (Altun, Barshan, & Tunçel, 2010). In these cases, computational cost is no limitation and hence methods of a more complex nature can be used. In contrast, efficiency is a crucial issue when processing is carried out within the mobile device itself (Fuentes, Gonzalez-Abril, Angulo, & Ortega, 2012; Reddy et al., 2010). Taking previous works into account, physical activity monitoring through smartphones presents the following challenges: To decrease, as far as possible, the risk of forgetting the processing device so that continuous monitoring can be performed anywhere and any time. To reduce the drain of energy on the smartphone, by developing an accurate and efficient system. To integrate learning and monitoring on the device itself, in realtime and without sharing server information. In order to reduce the cost associated to accelerometer and gyroscope signal analysis, this paper opts for an innovative approach based on a discretization method that uses only accelerometer sensors since with these good results can be achieved and a lot energy can be saved (the more sensors used, the greater the consumption). Furthermore, the data is processed in the mobile itself, and therefore the efficiency is better than if data were sent to a server, and the result is obtained in real time. Thanks to this discretization process, the classification cost is much lower than it would be with continuous variables, and therefore the life of the battery is longer. It is therefore possible not only to eliminate the correlation between variables during the recognition process, but also to minimize the energy consumption of the process. The remainder of the paper is organized as follows: Section 2 describes the method of data capture through the mobile device using an accelerometer sensor, and outlines all the physical activities that can be recognized by the system described. In Section 3, a new process, that discretizes continuous variables andprovidesclassification, is presented. Section 4shows a comparison between the new method and other methods used previously in the literature. Finally, in Section 5, a discussion is given on the various advantages of the proposed algorithm as well as on certain challenges and tasks that are currently being developed for the described recognition system. 2. Activity recognition 2.1. Embedded sensors and battery impact Throughout this work, a KR3DM triaxial accelerometer integrated into a Google Nexus S is used. This sensor has a range of sampling frequencies between 25 Hz and 1500 Hz. Specific frequency is defined by each piece of software by using Android primitives. At these sampling rates, the device used for the testing process is configured to operate at 50 Hz in order to prevent excessive use of data and to reduce the computational cost. Therefore, based on the Nyquist–Shannon theorem, it can be ensured that signals with significant energy components below 25 Hz are liaison free. Depending on where the user takes the device, vibrations and any other kind of noise could be present with frequency components over 25 Hz, but these are of no interest in this work. However, the human-activity frequency range is much lower than the sampling band chosen. By using accelerometers taped to the body while running, Bhattacharya, McCutcheon, Shvartz, and Greenleaf (1980) found the main frequency components between 1–18 Hz at the ankle. As will be seen later, our work proposes placing the device at the hip, where acceleration forces are lower than at the ankle, and hence frequencies at this position are also lower. On the other hand, a lower frequency allows the computation cost to be reduced thanks to the fact that each feature is obtained from accelerometry data. Furthermore, by reducing this processing time, the system becomes faster, more efficient and consumes less energy. Indeed, for contextual systems, with their intensive use of sensors, the high-energy consumption required must be taken into account not only in obtaining the data but also in its processing. A typical smartphone from the latest generation has a multitude of sensors that are commonly used, such as GPS (Morillo, Ramirez, Garcia, & Gonzalez-Abril, 2012), NFC, and a microphone. This means that, as result of high energy consumption, the useful time between device charges remains very low. By applying Moore’s law, it can be observed that manufacturers increase their processing power at least twice each year, in contrast to battery development, which has failed to double over the last five years. Battery life is not a secondary consideration, since, according to a survey performed by North American Technologies (Forrester, 2011), it stands as the second most important purchase decision factor for buyers of smartphones. Users acceptance, in the context of aware applications in general and of activity recognition systems in particular, is therefore critical. For this reason, in this work, not only has an accurate and fast system been developed, but a low energy consumption model is also presented from the viewpoint of discrete techniques. There are various solutions using specific hardware (Choudhury et al., 2008) that have a high degree of autonomy. However, the problems faced by these elements are, as outlined earlier, the risk of losing and/or forgetting the device and the discomfort for users. Furthermore, these solutions are usually very expensive. In recent years, a large number of personal devices able to monitor the activity level have been developed by large companies, such as Adidas (Fig. 1), and Nike (Fig. 2). However, the aims of this work, even though related, are quite different. Both of these commercial devices allow the physical activity level to the detected. This is interesting from the point of view of calories burned. The limit imposed on the number of activities constitutes the main disadvantage of these systems, since they can only detect certain parameters, such as the number of sprints or total distance covered. Although these features are significant, for many users the number of these activities may be insufficient, for example, for users involved in a physical rehabilitation process which must be monitored by doctors. In these cases, activity recognition should have greater granularity to detect activities. The activities our system is able to discern will be discussed in the following section. In short, although our proposal has been tested with smartphone embedded sensors, no limitation whatsoever is envisaged. In this paper, a new independent-sensor technique for activity recognition is presented, which uses and continues the work in Soria Morillo, Ortega Ramirez, and Gonzalez-Abril (2012). Thus, this M.A. Álvarez de la Concepción et al. /Expert Systems with Applications 41 (2014) 6138–6146 6139
technique can be developed on a smartphone, a commercial wristband or any other appliance which contains an accelerometer and processing unit. In contrast to other proposals, our work is focused on battery consumption, which becomes even more critical on external devices where drains on the battery must be reduced to provide greater usage time. There are several related studies which centre on the accuracy power trade off, for example in the proposals by Zappi et al. (2008) and Wang et al. (2009). Not only do these proposals operate with smartphones, but also with distributed body sensors, where it is possible to determine which sensors are the most important, and which can be disconnected in order to minimize energy cost. 2.2. Set of activities In this work, far from being a static system, the number and type of activities recognized depends on the user; users can carry out hot-training on the system, which may involve adding new activities, and hence other activities can be detected. This is crucial for the accomplishment of a highly customizable environment where the users themselves can determine which activities are important and which remain irrelevant. For a large numbers of users, it could prove more practical to recognize only a few activities, such as walking, sitting, and falling. For other users, however, activities, such as driving and cycling could be more relevant. In a rehabilitation process, by setting out an exercise programme, doctors and relatives could ascertain whether the user is carrying out the prescribed physical exercise correctly. During the system testing and by performing comparative analysis with other platforms, 8 activities have been taken into account. These activities include standing, walking, running, jumping, cycling, driving, climbing stairs, and descending stairs. Moreover, thanks to this proposal, activities that have not been previously learned by the system can be determined while users carry them out. This learning process is achieved based on the analysis of the probability associated to each pattern while the user is performing each activity. In this sense, the system alerts the user when a non-trained activity is detected and therefore, the opportunity to carry out in-depth training for this activity is presented. Obviously, the number of activities to be detected has an impact on the accuracy of the system, especially if acceleration patterns between activities are very similar. This aspect will be discussed later. 2.3. Data collection Several related studies attain results of activity recognition offline. First, an appropriate set of acceleration readings must be obtained from sensors. Once this set is completed, it must be sent to the server and the readings are then classified into any of the recognized activities. In Duong, Bui, Phung, and Venkatesh (2005) and other model-driven studies into activity recognition, learning is conducted off-line. This means that the user must be connected to the training server so that the model, from which the recognition process can be carried out, can be obtained. However, training and recognition sets are obtained using time windows of fixed duration. Each time window is composed of a set of accelerometer readings from which it is possible to calculate a variety of features. After having conducted a performance and system accuracy analysis, it has been determined that the optimum length for these windows is 5 s. This time has been chosen due to the importance of ensuring that, in each time window, there is at least one activity cycle. An activity cycle is defined as an complete execution of an activity pattern. For example, two steps are an activity cycle for walking and one pedal stroke is the activity cycle for cycling. If a complete activity cycle is not presented in each time window, then, based on acceleration patterns, it will not be possible to determine the activity performed. The segmentation process and activity cycle are shown in Fig. 3. Based on these time windows, which contain data for each accelerometer axis and reduce the computational cost of the new solution, a signal module has been chosen. This eliminates the problem caused by the device rotation (He & Jin, 2009). Furthermore, it increases user comfort by removing the restriction of maintaining the same orientation during the learning and recognition process. For each data in a time window size N;a i ¼ða x i ;a y i ;a z i Þ; i¼1;2;...;Nwhere x;yand zrepresent the three accelerometer axes, the accelerometer module is defined as follows: ja i j¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi a x i 2 þa y i 2 þa z i 2 q Hence, the following statistics are obtained for each time window. Mean: a¼ 1 N P N i¼1 ja i j. Minimum: a min ¼minfja 1 j;ja 2 j;...;ja N jg. Fig. 1. Adidas MyCoach: intalled into Adidas shoes. Fig. 2. Nike FuelBand: wristband with accelerometer sensor for activity level. 6140 M.A. Álvarez de la Concepción et al. / Expert Systems with Applications 41 (2014) 6138–6146
CHAPTER 5 LOW ENERGY PHYSICAL ACTIVITY RECOGNITION SYSTEM ON SMARTPHONES Overview This paper addresses a low-energy solution for human activity recognition systems using a dynamic sampling rate method for energy reduction based on Ameva as a classification system. In this context, the broadened problem of activity recognition systems based on IMU sensors is the high power consumption caused by keeping the smartphone awake in order to perform all tasks needed, so getting a way to reduce the energy consumption and the processing cost of the system is the focus of this work. The literature has explored three ways of solving this drawback: selecting the system features depending on the computational cost for their calculation, reducing the sampling rate below the threshold of 50 Hz and implementing a dynamic sampling rate method in the proposed solutions that is based on the demonstration that different activities exhibit differing levels of classification accuracy, depending on the on-body placement of the accelerometers. Through this comparison, the Dynamic Page 65
Chapter 5: Low energy physical activity recognition system on smartphones Ameva Classification System has been applied, implementing a dynamic sampling rate method for energy reduction applying a duty cycle optimization. The accuracy of the system does not vary depending on the user who performs the test and this method has a very slight impact on system accuracy because its auto-reconfiguration makes it possible to increase the sample rate if necessary. As conclusion this strategy brings considerable benefit in terms of the energy savings achieved. Context This research topic was based on previous works of human activity recognition systems as a continuation in the same area of knowledge. In this case, the energy reduction was the main goal and the use of a dynamic sampling rate allowed achieve it. This paper is the result of over one year of work in this area and applies usage information (and data from other sources) from real experimentation performed for a previous paper titled Discrete techniques applied to low-energy mobile human activity recognition. A new approach. Journal information Figure 5.1: Sensors cover. The Journal Sensors was selected for the submission of this paper that is indexed in JCR with an Impact Factor of 2.033 and a 5-Year I.F. 2.437. Also, it stands in different rankings in three categories: Instruments & Instrumentation (12/56, Q1); Chemistry, Analytical (36/75, Q2); Electrochemistry (16/27, Q3). Page 66
Sensors 2015,15, 5163-5196; doi:10.3390/s150305163 OPEN ACCESS sensors ISSN 1424-8220 www.mdpi.com/journal/sensors Article Low Energy Physical Activity Recognition System on Smartphones Luis Miguel Soria Morillo 1,*, Luis Gonzalez-Abril 2, Juan Antonio Ortega Ramirez 1 and Miguel Angel Alvarez de la Concepcion 1 1Computer Languages and Systems Department, University of Seville, 41012 Seville, Spain; E-Mails: jorte[email protected] (J.A.O.R.); maalv[email protected] (M.A.A.C.) 2Applied Economics I Department, University of Seville, 41018 Seville, Spain; E-Mail: [email protected] *Author to whom correspondence should be addressed; E-Mail: [email protected]; Tel.: +34-954-556-881. Academic Editor: Leonhard M. Reindl Received: 17 December 2014 / Accepted: 13 February 2015 / Published: 3 March 2015 Abstract: An innovative approach to physical activity recognition based on the use of discrete variables obtained from accelerometer sensors is presented. The system first performs a discretization process for each variable, which allows efficient recognition of activities performed by users using as little energy as possible. To this end, an innovative discretization and classification technique is presented based on the χ2distribution. Furthermore, the entire recognition process is executed on the smartphone, which determines not only the activity performed, but also the frequency at which it is carried out. These techniques and the new classification system presented reduce energy consumption caused by the activity monitoring system. The energy saved increases smartphone usage time to more than 27 h without recharging while maintaining accuracy. Keywords: contextual information; mobile environment; discretization method; qualitative systems; smart-energy computing
Sensors 2015,15 5164 1. Introduction Just 30 min of moderate activity five days a week can improve your health, according to the Centers for Disease Control and Prevention. By enabling activity monitoring on an individual scale over an extended period of time in a ubiquitous way, physical and psychological health and fitness can be improved. Studies performed by certain health institutes [1–4] have shown significant associations between physical activity and reduced risk of incident coronary heart disease and coronary events. Their results can be seen in Figure 1, where the inverse correlation between the risk of cardiovascular incidents and physical activity level is shown through a comparison of four separate studies. 2 The first difference observed between the systems developed so far is the type of sensors used. There are systems that use specific hardware (Nishkam Ravi, Nikhil D, Preetham Mysore, 2005) [10] [11], while others use general purpose hardware [12] [13] [6]. Obviously, generic hardware use is a benefit for users, since the cost of such devices and versatility are assets in their favour and the risk of loss and of leaving the hardware behind is decreased since objects, like users’ smartphones, have already been integrated into the users’ daily life. However, general purpose devices are used for other purposes, such as making phone calls, surfing the Internet, and listening to music. For this reason, the physical activity recognition system must be executed in background mode and cause the least possible impact on the system, in terms of complexity and energy consumption. Another difference found between related studies is the number and position of the sensors. In [14], it can be seen that the accelerometer sensor is placed in a glove, which user must wear, and it can recognize a multitude of activities depending on the movement of the hand. In contrast, certain studies use various sensors all over the body to recognize these activities [15] [16]. In recent years, as a result of technological progress, it has been possible to build sensors of such a diminutive size that they can be installed into users’ clothes [17] or attached to the user’s body [18] [19]. According to certain comparative studies and research based on multiple sensors, this type of sensor produces results of higher accuracy, although, in work such as that by [12], it is shown that it is more comfortable for the user when the sensor placed in the user's pocket. This is because installing them in the under monitoring persons’ body is easier, not to mention that infrastructure is much lower. Once the most comfortable alternative for users is determined, then the various sensors can be analyzed in terms of the way basis data is obtained to perform the activity recognition. As noted above, certain related work has made use of sensors such as GPS, accelerometers and microphones, and the most efficient sensor with which to obtain the highest accuracy must be selected. In order to determine the method which provokes the least drain of energy, a comparison between the energy consumption of the most frequently used sensors in the literature is made. This is critical in choosing the best sensor method since, together with performance, these constitute the two main issues upon which the final decision is based. To this end, an application is developed which measuresthe battery energy consumed by each sensor. To prevent problems arising from the use of certain devices, the application was installed on 60 users’ smartphones with different features. The 8 most used sensors (microphone, GPS, Wi-Fi, accelerometer, NFC, Bluetooth, electrocardiograph connected by Bluetooth and gyroscope) from the literature in the field of activities recognition were analyzed. The result of this comparison is shown in Figure 2, where the time is represented on the horizontal axis, and on the vertical axis the battery level at a specific instant of time appears.It can be seen in the figure, that the lowest power consumption is given by the microphone, followed by that of the accelerometer sensor. Therefore, from these results it can be deducted that the use of GPS or Bluetooth does not constitute a good choice for the development of an energy-efficient physical-activity recognition system. 0.4 0.5 0.6 0.7 0.8 0.9 1 1 (low) 2345 (high) Relative risk of cardiovascular incidents Physical activity level Ellekjaer et al. 2000 Lee et al., 2001 Manson et al., 2002 Hu et al., 2000 Figure 1: Associations between physical activity and reduced risk of incident coronary heart disease and coronary events Figure 1. Associations between the risk of cardiovascular incidents and physical activity level. In recent years, thanks largely to increased interest in monitoring certain sectors of the population, such as elderly people with dementia and people in rehabilitation, activity recognition systems have increased in both number and quality. Furthermore, communication between relatives, friends and professionals can be improved by means of graphs of weekly activity (highly relevant for sportsmen and relatives of elderly people), whereby the doctor can be automatically alerted if any strange activity is detected. In fact, automatic recognition of human activity represents one of the most important research areas in ubiquitous computing [5,6]. For this reason, it is extremely important to ensure that the intrusion level caused by the system is the lowest possible. Some recent works, such as [7–9], attempt to solve this problem by using a variety of sensors, such as accelerometers, gyroscopes, GPS and even radio-frequency identification and near-field communication (NFC) sensors. As will be seen below, however, the use of these sensors causes a major drain on the energy of autonomous devices running on batteries, such as smartphones. On the other hand, by using data acquired from these sensors and applying certain classification methods, it is possible to perform pervasive physical activity monitoring. Some of these algorithms, such as Bayesian decision (BDM), decision tree algorithms (RBA), least-squares methods (LSM), support vector machines (SVM), K-nearest neighborhood (KNN) and artificial neural networks (ANN), will be analyzed and compared in this work. The results show the main differences between different studies, and certain drawbacks will be determined. These drawbacks, commonly related to energy consumption and computational cost, do not make possible their implementation on real users’ smartphones. The first difference observed between the systems developed so far is the type of sensor used.
Sensors 2015,15 5165 There are systems that use specific hardware [10–12], whereas others use general purpose hardware [7,13,14]. Obviously, the use of generic hardware, as smartphones, is a benefit to users, because the cost of such devices and their versatility are assets in their favor. The risk of loss, forgetting and disuse is decreased because users’ smartphones have already been integrated into the users’ daily life. However, general purpose devices are used for other purposes, such as making phone calls, surfing the Internet and listening to music. For this reason, the physical activity recognition system must be executed in background mode and should cause the least impact as possible on the system in terms of complexity and energy consumption. Another difference found among related studies is the number and position of sensors used. In [15], the accelerometer sensor is placed in a glove, which the user must wear. This sensor can recognize a multitude of activities, depending on the movement of the hand. In contrast, some studies use diverse sensors all over the body to recognize these activities [16–18]. In recent years, as a result of technological progress, it has been possible to build sensors of reduced size that can be installed into the user’s clothes [19] or attached to the user’s body [20,21]. According to some comparative studies and research based on multiple sensors, this type of sensor gives higher accuracy, although [13] shows that it is more comfortable for the user when the sensor is placed into the user’s pocket or at the hip. This increased user acceptance for devices attached at the hip or in the pocket is because the installation on a monitored person’s body is easier, not to mention that the infrastructure is much more simple and inexpensive. Once the most comfortable alternative for users is determined, some device sensors can be chosen to perform the activity monitoring. Some works, close to social computing, make use of microphones [22–26] and electrocardiogram (ECG) sensors [27–29] for this purpose. The former type, which consists of microphone and Bluetooth devices, helps to obtain contextual information about the user’s environments and would be appropriate to perform a deeper analysis of the activity, for instance if the user is walking in a disco or at home, if the user is alone or with someone. However, high-level activity recognition (walking, playing, running or standing up) is done using other sensors. ECG can help in determining high-level activities by means of heart rate processing. In this sense, some activities (walking or running) could be discerned based on the effort needed to perform them. The problem here is that ECG sensors are expensive and uncomfortable for the user. In other works [21], data for activity recognition are obtained through any kind of mobile device (not only mobile phones), although these data are sent to a server, where the information is subsequently processed. Thus, the computational cost is not a handicap, as learning and/or recognition are performed in the server and a more complex processing can be applied. In contrast, when processing is carried out in the mobile device itself [30], efficiency becomes a crucial issue. In this vein, in order to apply a solution based on distributed computing, the device must always be connected to a data network. This does not currently represent a major drawback, since most devices have this kind of connectivity, although there are still users (mostly elderly) whose devices have not been associated with a continuous data connection outside the range of WiFi networks. Finally, decrease the energy cost conflicts with the need to send the data collected in a continuous way between device and server. This means that current strategies of sensor batching (as will be seen hereafter) cannot be applied, and devices must be continually waking up from sleep mode. Furthermore, the intensive use of the data network has a deep impact on the energy use.
Sensors 2015,15 5166 The work in [31] shows the increase in energy consumption when 3G and WiFi are used, and in [32], it can also be observed that approximately 44% of battery usage in smartphones occurs by the use of GSM (3G or 2G). Taking into account previous works, physical activity monitoring through smartphones presents the following challenges: •To decrease as far as possible the risk of forgetting the processing device, so as to carry out continuous monitoring of users, everywhere and anytime; •To reduce the energy impact on the smartphone, developing an accurate and efficient system; •To integrate learning and monitoring on the device itself, in real time and without server information sharing. Along this work, all of these challenges are addressed, and certain solutions are offered to achieve the proposed objective: to build a complete, accurate and low energy consumption system for pervasive physical activity monitoring using sensors embedded on smartphones. The remainder of this paper is organized as follows. Section 2 presents the need to reduce the energy consumed by physical activity monitoring systems when they are executed in a smartphone. Section 3 presents the feature extraction model, the dataset obtained from sensors and all physical activities that can be recognized by the described system. In Section 4, discretizing continuous variables and a classification process are presented. Section 5 compares the presented method and other methods used previously in the literature. Finally, Section 6 discusses the advantages of the proposed algorithm, as well as some challenges and future works about the recognition system described. 2. Justification for the Reduction of Energy Consumption Applying Moore’s law, manufacturers increase processing power at least twice each year, in contrast with battery development, which did not even double over the last five years. This is not secondary at all. From a survey performed by North American Technologies [33], battery life is the second most important purchase decision factor for smartphones. Users’ acceptance of context-aware applications in general and of activity monitoring systems in particular is critical. For this reason, not only has an accurate and fast system been developed, but a low energy consumption model from the viewpoint of discrete techniques is also presented throughout this work. To determine the building blocks that promote the least drain of energy, a comparison between the energy consumption of the most frequently-used smartphone sensors in the literature is made. This is critical for choosing the most efficient sensors to be used in the monitoring application. Although some of these sensors cannot be used separately to determine the physical activity performed, some of them could work together. An application has been developed to measure the battery energy consumed by each sensor in a real environment. For this purpose, Samsung Galaxy S2, Nexus One, Samsung Galaxy S3, Nexus 5 and HTC Tatoo were used. The application was run for four weeks, with battery consumption calculated based on the activated sensors. To prevent problems arising from the use of concrete devices, the application was installed on 20 users’ smartphones with different features. The eight most-used sensors (microphone, GPS, WiFi, accelerometer, NFC, Bluetooth, ECG connected by Bluetooth and gyroscope) from the
Sensors 2015,15 5167 literature in the field of activity recognition were analyzed. It must be taken into account that battery consumption for the microphone depends not only on the microphone sensor itself, but also on the sample rate and the buffer. The last one is useful to keep the audio codec, memory controller and DMA engines awake for the shortest possible time. To avoid battery capacity and the energy expenditure of the smartphone without performing any action and with no user interaction, a useless energy cost trend line is generated. This line (generated in the absence of normal user usage) is useful as the baseline, regardless of the time and the power consumption of sensors over several kinds of smartphones with different features. Figure 2shows the result of this comparison (The values are displayed in hours regarding a generic device. However, during the evaluation process, the lifetime deviation compared to the values of useless energy cost has been studied on different devices), with the time represented on the horizontal axis and the battery level at a specific instant of time appearing on the vertical axis. The procedure to represent the results was as follows. The useless energy cost is measured for all devices on which the study was conducted. Once this value is measured (associated with 100% of the battery lifetime), the rest of the battery time runs using different sensors (GPS energy cost, accelerometer energy cost, and so on) was obtained. By a simple ratio, the percentage of reduction in the lifetime of the battery relative to the baseline (useless energy cost) is calculated. Thus, an approximate percentage of the impact that sensors have on the battery lifetime was obtained. Finally, to illustrate the results, these percentages are reflected on a generic device where the unused battery time is about 56 h. It can be seen in the figure that the lowest power consumption is given by the microphone, followed by the accelerometer sensor. Therefore, from these results, it can be deduced that the use of GPS or Bluetooth does not constitute a good choice to develop an energy-efficient physical activity monitoring system, despite their having higher accuracy. In the case of Bluetooth, advances in this sensors have reduced the energy consumption, but this technology still suffers from serious problems when being used in the field of activities recognition. On the one hand, the infrastructure must be installed in each location where it will be used. Currently, there are just a few public Bluetooth access points. Furthermore, dynamic activities, such as walking, running or cycling, can hardly be recognized by Bluetooth, unless additional devices associated with these activities are installed on the objects (bike, skateboard, and so on). It must be noted that nowadays, the smartphone is the only device (together with certain wearables, such as smart-watches) carried continuously for most users. Therefore, the use of Bluetooth devices for activity recognition systems must force the use of these devices, which would not be suitable for user acceptance of AR (Activity Recognition) systems. Finally, the cost of infrastructure is also a determining factor. Bluetooth access point networks are more expensive than embedding all of the necessary technology in the smartphone itself. Other research is based on the use of microphone and voice recognition to determine the context of the user [34], and it could be thought that the result is more energy efficient. However, voice recognition presents problems when the environment is noisy or the user is alone, so sometimes, it is not possible to obtain results from the audio signal classifier. Thus, in the cited work, this process was complemented with other methods based on inertial measurement units (IMUs). It must be noted that an IMU is a device that measures velocity, orientation and gravitational forces, using a combination of accelerometers, gyroscopes and magnetometers.
Sensors 2015,15 5168 To reduce the cost related to process accelerometer signals, this paper opts for an innovative technique, through which, the work is performed in the field of discrete variables. Thanks to a discretization process, the classification cost is much lower than that obtained when working with continuous variables. Any dependence between variables during the recognition process is therefore eliminated, and energy consumption from the process itself is reduced. 10 20 30 40 50 60 70 80 90 100 0 3 5 8 1013151820232528303335384043454850535558 Battery level (%) Time (hours) GPSenergycost GSMenergycost Accelerometerenergycost Wifienergycost Uselessenergycost NFCenergycost Bluetoothenergycost Microphoneprocessing Figure 2. Energy cost comparison between sensors embedded in smartphones. 3. Building the Dataset 3.1. Embedded Sensor Limitations Throughout this work, a triaxial accelerometer, BMA150 Bosh, integrated into a Google Nexus S, and other similar accelerometers integrated into a Samsung Galaxy S3 and a Nexus 5 were used. These sensors have a range of sampling frequencies between 25 Hz and 1500 Hz; however, human activities have a relatively low frequency, so it is not necessary to fully exploit the capabilities of the sensor. Activities, such as walking, running and jumping, can be determined with small blocks of data. This choice is also supported by other related works using similar devices [35]. However, when working with these elements, not only the high energy consumption required by the data collection, but also the processing of such data must be taken into account. Mobile devices currently feature a multitude of sensors that are used routinely. This means that, as a result of high energy consumption, the useful time between device recharges is very low. Thus, usage is conditioned by dependence on the electric grid to recharge the mobile device. On the other hand, there are various solutions using specific hardware [36] that have a high degree of autonomy. The problems faced by these elements, however, include the aforementioned risk of loss and the risk of leaving the hardware behind, together with the discomfort for users. Furthermore, these solutions tend to be very expensive and are not oriented towards a wide range of applications. 3.2. Feature Extraction Certain related studies attain results on activity recognition off-line. A comprehensive training set from the inertial sensor output is first needed before data can be classified into any of the recognized
Sensors 2015,15 5169 activities. For this purpose, both training and recognition sets are obtained using overlapped time windows of fixed duration. Following the conducting of a performance and system accuracy analysis, it is determined that the optimum length for these windows is 4 s with 1 s overlapping [37,38]. The recognition delay is determined by the following relation: delay =size(v)·0.75 + k·f(size(v)) (1) where size(v)is the length of the time window, kis a computational constant that depends on the specific device and the ffunction represents the discretization and classification complexity, which depends on the length of the time window. The length of each time window has been chosen, because it is very important to ensure that each time window contains at least one activity cycle. Figure 3shows the segmentation process and activity cycle. 4 6 8 10 12 14 16 012345678910 ACCELERATION VALUE TIME (SECONDS) TIME WINDOW SIZE ACTIVITY LIFECYCLE Figure 3. Relation between windows length and activity cycle. As a premise for the use of time windows as a data collection method, it is assumed that the physical activities recognized by the system must have a duration greater than or equal to the size of this time window. Therefore, certain activities, such as a fall, may not be recognized by the system due to their exceptionality. Once data have been obtained, it is necessary to perform a filtering process before making the classification in order to remove all signal noise. In most cases, the noise of IMUs is negligible, although one kind of noise that can seriously affect the activity classification exists. This noise is produced by vibrations that take place on the device when it is carried by the user. A Butterworth low pass filter is applied to reduce the noise generated. Finally, following this strategy, a total of 561 temporal and frequential variables were derived from the inertial sensors on the devices. 3.3. Set of Activities To improve and establish a comparative baseline for classification algorithms, which is easy and publicly replicable, it was decided to use two public datasets and one built for this study. The first dataset under study, named the Human Activity Recognition Using Smartphones Data Set, presented in UCI [39], is composed of 10,299 instances of time windows sampled in fixed-width sliding windows of 2.56 s and 50% overlap (128 readings/window) at a constant rate of 50 Hz, 561 variables and six activities labeled, carried out with a group of 30 volunteers with an age bracket of 19–48 years. The second public dataset, named the PAMAP2 Physical Activity Monitoring Data Set and published in UCI,
Sensors 2015,15 5176 4.3. Classification Process This section presents the process of classification from the data of the time windows analysis. This process is divided into two main parts. First, the way to perform the recognition of physical activity is described. Later, the task to determine the frequency of a particular activity is exposed. 4.3.1. Classifying Data For the classification process, the more likely activity is decided by a majority voting system from the activity-interval matrix and a set of data x∈Xfor the Sset. Therefore, it consists of finding an activity Ci∈ C that maximizes the likelihood. The above criterion is collected in the following expression, denoted by mpa,mpa(x) = Ck, where, k= arg max j m X p=1 upij;inf(Lp,i)< x ≤Lp,i!. The expression shows that the weight contributed by each statistic to the likely calculation function is the same. This can be done under the assumption that all statistics provide the same information to the system, and there is no correlation between them. Thus, the most likely activity represents the activity whose data, obtained through the processing time window, are more suited to the value set from the activity-interval matrix. In this way, the proposed algorithm not only determines the mpa, but its associated probability. Figure 5shows the total interval probability based on a training set and 100 features (Downstairs and upstairs activities make reference to the dynamic activities of ascending and descending stairs). The peaks presented in this chart correspond to the features giving more information to the system. From this likelihood, certain activities that do not adapt well to sets of generic classification can be identified. It is an indication that the user is carrying out new activities for which the system has not been trained previously. -30 20 70 120 170 220 270 320 1 6 11 16 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96 Association level Feature Walking Upstairs Downstairs Sitting Standing Laying Figure 5. Association level of each activity for the 100 first features. Figure 6shows the process flow described in this section for process recognition from the activity-interval matrix calculated in the previous section.
Sensors 2015,15 5177 Recoverydatafrom accelerometer sensor Endoftemporal window? No Buildtemporal windowdataset Yes Gettime‐domain measures ApplyFastFourier Transform processing Getfrequencydomainmeasures Removenoise applyingfilters ExecuteAmeva algorithmovereach variable Getintervalsfor eachmeasureand associatedactivity (Discretization‐ Matrix) numberofdata fromthetraining setincludedon eachinterval(Class‐ Matrix) Obtainrelative probabilitiesofeach activityofbelongto eachintervalof Class‐Matrix (Activity‐Interval Matrix) Recoverydatafrom accelerometer sensor Endoftemporal window? Buildtemporal windowdataset Yes Gettime‐domain measures ApplyFastFourier Transform processing Getfrequencydomainmeasures Findanactivitysuch thatthesumof eachinterval associated probabilities(in Activity‐Interval Matriz)is maximized Savemost‐likely activityintouser activitylog SaveActivity‐ IntervalMatrixinto userprofile No ¿isidleactivity detected? Yes Increasesleeptime fornextdata No ¿isdifferentfromlast activityrecognized? Yes Update accelerometer samplerate Figure 6. Flow diagram for the recognition process. 4.3.2. Activity Cycle Cadence Approach The cadence at which any activity is performed is really important in order to get the calories burned and the intensity of the recognized activity. For this reason, although this factor does not make contributions to the field of activity recognition systems, it is crucial to get a system with added value applicable in a real life context. To determine the frequency for each activity cycle, the maximum module of the time window frequencies must first be calculated. Subsequently, the frequency associated with the maximum module (τ) represents the number of cycles per second for the activity related to the time window processed. From this and by using a simple expression, from the frequency value associated with the activity recognized in the current time window, the frequency of the activities per minute (z(X)) can be obtained as follows: z(X) =τ·60 sec 4.4. Dynamic Sample Rate and Duty Cycle It is crucial to consider energy consumption and the processing cost of the system when it is working on a mobile device. The broadened problem of activity recognition systems based on IMU sensors is the high power consumption caused by keeping the smartphone awake in order to perform all tasks needed, such as sensor sampling and activity classification. The literature has explored three ways of solving this drawback: selecting the system features depending on the computational cost for their calculation [47,48], reducing the sampling rate below the threshold of 50 Hz [49] and implementing a dynamic sampling rate method in the proposed solutions [35,50]. Dynamic sampling rate approaches, the most extensive over the last few years, is based on the demonstration that different activities exhibit differing levels of classification accuracy, depending on the on-body placement of the accelerometers [51]. Through this comparison, the Dynamic Ameva Classification System has been applied, implementing a dynamic sampling rate method for energy reduction. The frequency varies from 32 Hz for sitting, standing and lying to 50 Hz for walking, upstairs and downstairs. It must be taken into account that these frequencies were obtained experimentally
Sensors 2015,15 5178 by studying the pattern of the different activities from the point of view of the accelerometery. This study was conducted covering over 600,000 different time windows of activities obtained from 10 different users. To respect the heterogeneity of the target users of the proposed recognition system, users with different profiles were selected, from those 21 years of age with an athletic profile, to seniors 82 years of age with a sedentary profile. Thanks to this information, it is possible to determine a suitable accelerometer frequency spectrum according to each activity. It should be noted that this frequency will have not only a power impact due to the decrease of data obtained from the accelerometer, but will also cause a reduction of the execution time of the algorithm, due to the smaller size of the time windows. Algorithm 1calculates the sampling rate corresponding to a recognized activity at a given time. For the calculation, the current recognized activity and previous detected activity are taken into account. If the recognition process enters into a stable phase, i.e., there is continuity in the last set of recognized activities, the algorithm proceeds to update the sample rate. This update is calculated from the sampling rate associated with the activity detected, which is obtained from the map SampleRateList. As mentioned before, the specific values for the list SampleRateList are calculated experimentally for each of the activities recognized. Later, if stabilization occurs for a prolonged period, our proposal proceeds to the regular updating of the sample rate based on the base log2of the number of memories used. Algorithm 1 Dynamic sampling rate algorithm. SampleRateList ←InitSampleRate(Frequencies) MaxMemoryList ←InitMemoryList(Memories) AmevaIsRunning ←true Count ←0 WinSize ←5 WinSamples ←50 * WinSize; Aprevious ←GetAmevaActivity(Statistics) while AmevaIsRunning do Alast ←GetAmevaActivity(Statistics) if Alast == Aprevious then Count ←ActivityMemory + 1 else Count ←0 end if if IsCriticalActivity(Alast)and Count > GetMaxMemory(Alast)then NewFrequency ←SampleRateList(Alast) WinSamples ←NewFrequency ∗WinSize end if if Count%30 == MaxMemoryList(Alast)then WinSize ←WinSize +log2(Count%30) WinSamples ←NewFrequency ∗WinSize end if Aprevious ←Alast end while
Sensors 2015,15 5179 The maximum memory limit is defined as the specific period for which an activity is considered stable. This maximum memory is fixed experimentally and depends on the specific activity. In [52] can be seen a related work, in which the sample rate is calculated from the estimated power required for each sample rate. The main problem of this work is that it does not take into account the specific activity to update the sample rate. Thus, errors may occur due to the low sample rate reached in the case of activity stabilization for a long period. Such excessively low sampling frequencies cause a decrease in the accuracy of the system, as can be seen in [52]. In [53], another system of dynamic frequency is proposed. In this case, the sample rate is only addressed from the activity being performed. This means that at the same time that an activity is recognized, the algorithm immediately proceeds to update the sample rate. This causes two problems. On the one hand, it could be a case of sporadic activities (e.g., a fall) directly affecting the frequency of sampling and having a negative impact on the next set of activities recognized. On the other hand, by failing to update the sample rate periodically, the ability to minimize power consumption when a long-term stabilization occurs (e.g., when the user goes to sleep) is reduced. In the proposed algorithm, the size of the time windows is increased, thus decreasing the number of times for carrying out the classification process and, therefore, the consumption caused by the main CPU to perform this action. It should be noted that increasing the size of the temporal window has a direct impact on power consumption, especially in those devices having a coprocessor for context purposes [54]. This CPU, separate from the main CPU, allows autonomous acquisition of contextual data, usually from the accelerometer or gyroscope, without activating the main processor. This produces a decrease in power consumption while these data are collected in the form of an asynchronous batch operation. Thus, by increasing the size of the time window, maximizing the use of the contextual coprocessor and delaying the use of the main CPU for the implementation of the classification algorithm, an increase in the lifetime of the battery is achieved while the recognition system is being used. Keep in mind that this improvement in the use of the coprocessor has not been applied in the comparison with other methods, because it is understood that it may be applied to other comparable jobs with no impact on accuracy. However, it has been key for the lifetime data in the comparison shown in Figure 7, where the three versions of the proposed activity recognition system have been subjected to a cross-comparison. 0 20 40 60 80 100 120 0 200 400 600 800 1000 1200 1400 1600 %BATTERYREMAINING TIME(MINUTES) AmevaAR Amevaw/DynamicSample Amevaw/DynamicSampleandDuty Cycle Figure 7. Comparison between simple Ameva method, Ameva with dynamic sample optimization and Ameva with the dynamic sample and duty cycle. Furthermore, a second step towards energy savings is introduced by applying idle activity detection. It is well known that for some time, users do not wear their smartphones, so activity recognition is not
Sensors 2015,15 5180 available. However, during this time, the system is running and, thus, consuming power. Thanks to the idle activity recognition, the system can detect this situation and, consequently, reduce the windows processed per unit time. This decision saves energy and reduces the system overload. For this purpose, when no acceleration is detected on the smartphone, idle mode is enabled. Algorithm 2presents this process. Algorithm 2 Duty cycle algorithm. DutyCyclePeriods ←3,600,000, 1,800,000, 600,000, 300,000, 60,000, 10,000, 3000 AccDataCollection ← ∅ Threshold ←0.3 Alast ←∅ AmevaIsRunning ←true WindowsSleep ←0 MinWindowsSleep ←5 DutyIndex ←0 WinSamples ←WindowLength(WindowSize); while AmevaIsRunning do while size(AccDataCollection)< WinSamples do AccDataCollection ←GetLastAccData() end while WindowV ar ←V ar(AccDataCollection) if WindowV ar < Threshold then Alast ←NoDevice WindowsSleep ←WindowsSleep + 1 if WindowsSleep == MinWindowsSleep then if DutyIndex < size(DutyCyclePeriods)then DutyIndex ←DutyIndex + 1 end ifSleep(DutyCyclePeriods[DutyIndex]) end if else DutyIndex ←0 end if end while First, a number of periods are defined in milliseconds, which will be the values that lead to sleep mode for the activity recognition system. Once the time window is obtained and the variance over this window is calculated, it is determined whether the variance is less than Threshold. This Threshold was set to 0.3 during the experiments carried out. If the variance exceeds this threshold, this indicates that there has been no significant movement on the device. If so, the W indowsSleep varis increased, responsible for counting the number of windows without activity. If WindowsSleep is equal to the number of windows needed to decide that the device is in a period of inactivity, given by MinWindowsSleep, the algorithm proceeds to the activation or update of the duty cycle. This update consists of a gradual increase, depending on the values of DutyCyclePeriods, of the idle time, while it is determined that there is no movement in the successive time windows. The impact of such optimization in the battery lifetime can be seen in Figure 7. By using the simple Ameva detection, the battery life time reaches 14 h. This is because the system is always on and the
Sensors 2015,15 5181 accelerometers are working at 50 Hz. Applying the first optimization criteria, the dynamic sampling rate, a battery life of 18 h is obtained, 3 more than previously, because some activities reduce the sampling rate and, therefore, the battery consumption. The last optimization applied to Ameva classification is the idle activity detection. Because most users expend much time at home or working with the device on the table, idle activity detection tunes up the system, avoiding unnecessary energy drain, and the battery lifetime is up to 26 h. 5. Results and Discussion Once the basis of the activity recognition algorithm has been laid out, an analysis of the new proposal can be performed. To this end, the new development is compared with widely-used recognition systems based on neural network, decision tree, SVM and the naive Bayes classifier. These systems have been trained using MATLAB R2014b and implemented on the devices through the Android Studio and SDK tools provided by Google. In order to obtain energy consumption results, as will be explained further below, the monitoring software, Trepn, has been used. Trepn Profiler is an on-target power and performance profiling application for mobile devices distributed by Qualcomm for monitoring snapdragon processors. This diagnostic tool allows profiling of the performance and power consumption of Android applications running under this family of processors. Figure 8shows a screenshot of this tool. As can be observed in the upper side, battery power is being monitored. Figure 8. Trepn profiling tool screenshot.
Sensors 2015,15 5182 In this case, both learning and recognition are performed by continuous methods. The test process is conducted on Google Nexus S, Samsung Galaxy S3, LG Nexus 5 and Google Nexus One devices for a group of 10 users. Notably, the activity habits of these users are quite different, as two of them are under 25 years old, five users are between 25 and 40 years old and three are over 40. To determine the energy impact of the developed system over the used smartphones, each user was monitored for 15 days. The application ran continuously in the users’ smartphones during these 15 days. A total of 3640 h were monitored for all users through the Android application developed. Furthermore, to perform the accuracy evaluation, each user introduced into the same application the activity that was carried out. In this case, getting users to record their daily activity at all times was very complicated, and hence, a total of 1215 h of registered activities was obtained. From these, a study on the precision was completed. More specifically, the evaluation dataset for each activity is composed as follows: no device (332 h), standing (87 h), walking (198 h), lying (371 h), sitting (215 h), upstairs (5 h) and downstairs (7 h). 5.1. Performance Analysis In this section, the results of the performance analysis comparison between the method presented in this paper and different related works are presented. These methods are Ameva, ANN, binary tree, Bayesian, KNN, SVM, Mahalanobis distance and discriminant analysis. This test is conducted on eight different activities to unify the results for all users. Based on data from the UCI HAR, UCI PAMAP2 and the dataset built in this paper, a more in-depth comparison is performed. To this end, various measures for the evaluation of the performance of the information retrieval system are used. All measures used below assume a ground truth (gold standard value) contained in the labeled datasets. This comparison was performed from the implementation of the algorithms referenced previously. In Table 7, the differences between the compared methods can be observed (These results have been obtained using the UCI HAR dataset, the PAMAP2 dataset and a custom dataset built in this work). Most values presented for each measure show that the Ameva method gives better classification than the other algorithms, especially regarding precision. That is, the number of false positives in the Ameva method is lower than in the others methods. Furthermore, the training process for Ameva was faster than the others, except for binary tree, where the time was very similar. Appendix B shows more in-depth performance measures obtained by applying different algorithms compared in the table above. These values have been separated according to the specific activity. Thus, the accuracy variation can be observed more in detail between the different methods depending on the activity undertaken. However, as can be seen in these tables, there is no great difference between the values obtained in terms of activity. Therefore, it can be concluded that the compared learning methods are robust to the activities under monitoring. Based on the results for error and classification analysis above, it can be determined that the Ameva method for activity recognition presents better results than the other methods, which are widely used throughout the literature, especially SVM and Bayesian. Furthermore, not only is the execution time of the Ameva algorithm faster than that given by the others, the risk of overloading the system under the Ameva method is also lower. This is because a majority vote brings a dynamism that makes certain statistical values not critical when performing the classification, as for example with classification trees.
Sensors 2015,15 5183 Table 7. Performance comparison in % by using measures of evaluation. Method Accuracy Recall Specificity Precision F1-Measure Ameva 99.23 96.93 99.56 96.94 96.93 ANN 98.36 93.50 99.07 93.47 93.48 C4.5 97.51 90.08 98.58 90.04 90.03 Bayesian 92.56 70.96 95.75 70.22 70.41 KNN 97.66 90.74 98.66 90.66 90.69 SVM 90.56 63.09 94.61 62.22 62.41 Mahalanobis distance 93.48 87.41 93.87 91.74 91.67 Discriminant analysis 99.15 96.14 97.75 96.37 96.28 5.2. Energy Consumption Results A comparison with other works in the field of energy consumption is not easy at all. The main problems are the heterogeneity of smartphones on the market with different batteries, consumption, screens and processors and the use of the smartphone for other tasks, such as calling, reading emails or using WhatsApp. A real analysis without any restriction to the users was carried out. Users utilize theirs smartphones normally. Hence, battery consumption depends on this use. Tests were executed on LG Nexus 5, Samsung Galaxy S3 and Samsung Galaxy S4 devices. The devices were restored to their original configuration after each test to avoid interference from external application consumption. Figure 9shows the battery lifetime for 10 users by applying the Ameva method with the optimizations described above. As can be seen, battery life depends largely on the users’ habits. Whereas, for User 3, the usage time is up to 23 h, for User 4, it is close to 18 h. It must be noted that all users are related to computer science environments, and the use of their devices is quite high. The current work is now compared with KNN, binary decision tree (C4.5), SVM, neural networks and the naive Bayes classifier. In all cases, the process for obtaining the needed data and calculating the features is the same. This allows comparison of just the computational cost of the classification algorithms. 0 10 20 30 40 50 60 70 80 90 100 0 200 400 600 800 1000 1200 1400 %BATTERYREMAINING TIME(MINUTES) User1User2User3 User4User5User6 User7User8User9 User10 Figure 9. Analysis of battery lifetime through different user habits. Table 8shows the battery lifetime (in minutes) for each classifier, with four tests conducted for each one. As can be observed, the Ameva classifier extends the battery time by three hours compared with the next most efficient method, the binary decision tree (C4.5). In this section, learning times are not taken into account; only the recognition process was evaluated.
Sensors 2015,15 5184 Table 8. Battery lifetime in minutes for the execution with different classifiers. Algorithm Test Mean 1 2 3 4 Ameva 1130 1150 1070 1205 1138 KNN 750 730 760 700 731 Binary decision tree (C4.5) 915 925 898 907 905 SVM 820 870 780 830 822 Neural Networks 515 597 578 510 548 Naive Bayes 780 750 820 870 814 Finally, this work is compared with other AR systems from the literature [30,50,55,56] implemented and run on the same user’s smartphone. Figure 10 shows the results. Figure 10. Battery lifetime analysis over other methods. It can be observed in Figure 10 that the Ameva system increases the battery lifetime by up to 4.5 h. As mentioned before, all methods were executed in the same smartphone used by the same user, each for five days. Later, other works will be compared in terms of accuracy, but for now, we can see that the proposed system significantly reduces the energy consumed. Figure 11 shows a power consumption comparison based on W/h (The watt-hour (W/h) is a unit of energy equivalent to one watt of power expended for one hour) for each compared method. To reduce deviations from the power consumption given by Trepn software, the device was previously calibrated using a spectrum analyzer, which measured the real consumption. Thereby, the correctness of the Trepn Qualcomm software readings was checked. Moreover, because of the impact that CPU consumption obviously has on processing cost, it was decided to keep a wake lock on the device. This ensured that the processor would not enter into a low-power mode during the performance comparison. Thus, the baseline for comparison is one in which the device is not used, but the processors remain awake. It should be noted that this wake lock was deactivated for the battery life tests, in order to perform testing of each algorithm behavior in a real application scenario. As can be seen in Figure 11, the energy consumption of the Ameva algorithm is significantly less than the other alternatives. Specifically, it can be seen that the consumption is about 50% that of the most efficient alternative among those compared. This is mainly due to two reasons: first, the possibility of carrying out a selection of variables at run time, depending
Sensors 2015,15 5185 on the coefficient Ameva for each statistic; and second, the reduced computational cost of the proposed classification method. ‐ 0.50 1.00 1.50 2.00 2.50 0 21 41 62 82 103 123 144 164 185 205 226 246 267 287 308 328 349 369 390 410 431 451 472 492 513 533 PowerConsumptionWh Timestamp(sec) Reddy,2010 Srinivasan,2012 Zinnen,2009 Ameva Figure 11. Power consumption analysis. To clarify the differences in the power consumption characteristics of different classifiers, these are compared with the proposed algorithm. The C4.5 algorithm will specifically be discussed, which was a priori more efficient from the point of view of complexity and which has been used by many studies in the literature. Regarding accuracy, there is no big difference between Ameva and the algorithm based on C4.5, as was shown previously. However, there is a difference from the point of view of energy consumption. Specifically, Ameva is about 50% below the average consumption of the algorithm C4.5. This is mainly due to the capability of automatic selection that is made based on the characteristics of the Ameva coefficient. Those intervals generated by Ameva whose coefficient is less than the threshold (at this moment, the threshold is defined in a static way) are removed, and the associated statistics are not taken into account when computing the result. This makes the used statistic, on average, 40% of the pre-established attributes of each temporal window. This process, applied to the UCI HAR dataset [39], makes the total statistics considered go from 561 to 63, while C4.5 should consider 117 attributes for classification. The tree generated by the C4.5 algorithm can be seen in Figure 12. Consequently, this decrease in the processed attributes makes it unnecessary to process the data on the time window in order to get them and, as a result, reduces the complexity of the process of collecting statistics regarding the C4.5 algorithm. In conclusion, the power consumption aim of this work has been accomplished. It is noted in [57] that users recharge their smartphones once a day, mostly happening at 8 pm, when users are at home. Because our system allows the user to maintain the device battery for more than 18 hours in all cases, they can retain their recharging habits.
Sensors 2015,15 5192 Conflicts of Interest The authors declare no conflicts of interest. References 1. Manson, J.E.; Greenland, P.; LaCroix, A.Z.; Stefanick, M.L.; Mouton, C.P.; Oberman, A.; Perri, M.G.; Sheps, D.S.; Pettinger, M.B.; Siscovick, D.S. Walking compared with vigorous exercise for the prevention of cardiovascular events in women. N. Engl. J. Med. 2002,347, 716–725. 2. Ellekjaer, H.; Holmen, J.; Vatten, L. Physical activity and stroke mortality in women. Stroke 2000, 31, 14–18. 3. Sattelmair, J.R.; Kurth, T.; Buring, J.E.; Lee, I.M. Physical Activity and Risk of Stroke in Women. Stroke 2010,41, 1243–1250. 4. Lee, I.M.; Rexrode, K.M.; Cook, N.R.; Manson, J.E.; Buring, J.E. Physical activity and coronary heart disease in women. JAMA 2001,285, 1447–1454. 5. Weiser, M. The computer for the 21st century. In Human-Computer Interaction; Morgan Kaufmann Publishers Inc.: San Francisco, CA, USA, 1995; pp. 933–940. 6. Ordoñez, F.J.; de Toledo, P.; Sanchis, A. Activity Recognition Using Hybrid Generative/Discriminative Models on Home Environments Using Binary Sensors. Sensors 2013, 13, 5460–5477. 7. Hong, Y.J.; Kim, I.J.; Ahn, S.C.; Kim, H.G. Mobile health monitoring system based on activity recognition using accelerometer. Simul. Model. Pract. Theory 2010,18, 446–455. 8. Khan, A.M.; Lee, Y.K.; Lee, S.; Kim, T.S. Accelerometer’s position independent physical activity recognition system for long-term activity monitoring in the elderly. Med. Biol. Eng. Comput. 2010,48, 1271–1279. 9. Preece, S.J.; Goulermas, J.Y.; Kenney, L.P.J.; Howard, D.; Meijer, K.; Crompton, R. Activity identification using body-mounted sensors—A review of classification techniques. Physiol. Measur. 2009,30, R1–R33. 10. Ravi, N.; Nikhil, D.; Mysore, P.; Littman, M.L. Activity recognition from accelerometer data. In Proceedings of the Seventeenth Conference on Innovative Applications of Artificial Intelligence (IAAI), Pittsburgh, PA, USA, 9–13 July 2005; pp. 1541–1546. 11. Han, C.W.; Kang, S.J.; Kim, N.S. Implementation of HMM-Based Human Activity Recognition Using Single Triaxial Accelerometer. IEICE Trans. 2010,93-A, 1379–1383. 12. Paiyarom, S.; Tungamchit, P.; Keinprasit, R.; Kayasith, P. Activity monitoring system using Dynamic Time Warping for the elderly and disabled people. In Proceedings of the 2nd International Conference on Computer, Control and Communication, Karachi, Pakistan, 17–18 February 2009; pp. 1–4. 13. Hong, Y.J.; Kim, I.J.; Ahn, S.C.; Kim, H.G. Activity Recognition Using Wearable Sensors for Elder Care. Future Gener. Commun. Netw. 2008,2, 302–305.
Sensors 2015,15 5193 14. Musolesi, M.; Piraccini, M.; Fodor, K.; Corradi, A.; Campbell, A.T. Supporting Energy-Efficient Uploading Strategies for Continuous Sensing Applications on Mobile Phones Pervasive Computing. In Proceedings of the 8th International Conference on Pervasive Computing, Helsinki, Finland, 17–20 May 2010; Floréen, P., Krüger, A., Spasojevic, M., Eds.; Springer: Berlin/Heidelberg, Germany; pp. 355–372. 15. Brezmes, T.; Gorricho, J.-L.; Cotrina, J. Activity Recognition from Accelerometer Data on a Mobile Phone. Test 2009,5518, 796–799. 16. Lepri, B.; Mana, N.; Cappelletti, A.; Pianesi, F.; Zancanaro, M. What is happening now? Detection of activities of daily living from simple visual features. Pers. Ubiquitous Comput. 2010, 14, 749–766. 17. Bicocchi, N.; Mamei, M.; Zambonelli, F. Detecting activities from body-worn accelerometers via instance-based algorithms. Pervasive Mob. Comput. 2010,6, 482–495. 18. Intille, S.S.; Bao, L. Physical Activity Recognition from Acceleration Data under SemiNaturalistic Conditions. Technical Report; Massachusetts Institute of Technology: Cambridge, MA, USA, 2003. 19. Laerhoven, K.V. ISWC 2010: The Latest in Wearable Computing Research. IEEE Pervasive Comput. 2011,10, 8–10. 20. Khan, A.M.; Lee, Y.K.; Lee, S.Y.; Kim, T.S. A triaxial accelerometer-based physical-activity recognition via augmented-signal features and a hierarchical recognizer. Trans. Inf. Tech. Biomed. 2010,14, 1166–1172. 21. Altun, K.; Barshan, B.; Tunçel, O. Comparative study on classifying human activities with miniature inertial and magnetic sensors. Pattern Recogn. 2010,43, 3605–3620. 22. Choudhury, T.; LaMarca, A.; LeGrand, L.; Rahimi, A.; Rea, A.; Borriello, G.; Hemingway, B.; Koscher, K.; Landay, J.A.; Lester, J.; et al. The mobile sensing platform: An embedded activity recognition system. IEEE Pervasive Comput. 2008,7, 32–41. 23. Liang, G.; Cao, J.; Zhu, W. CircleSense: A Pervasive Computing System for Recognizing Social Activities. In Proceedings of the 2013 IEEE International Conference on Pervasive Computing and Communication, San Diego, CA, USA, 18–22 March 2013. 24. Fogarty, J.; Au, C.; Hudson, S.E. Sensing from the basement: A feasibility study of unobtrusive and low-cost home activity recognition. In Proceedings of the 19th Annual ACM Symposium on User Interface Software and Technology, Montreux, Switzerland, 15–18 October 2006; ACM: New York, NY, USA; pp. 91–100. 25. Stager, M.; Lukowicz, P.; Troster, G. Implementation and evaluation of a low-power sound-based user activity recognition system. In Proceedings of the Eighth International Symposium on Wearable Computers, Arlington, VA, USA, 31 October–3 November 2004; pp. 138–141. 26. Wojek, C.; Nickel, K.; Stiefelhagen, R. Activity Recognition and Room-Level Tracking in an Office Environment. In Proceedings of the 2006 IEEE International Conference on Multisensor Fusion and Integration for Intelligent Systems, Heidelberg, Germany, 3–6 September 2006; pp. 25–30. 27. Li, M.; Rozgic, V.; Thatte, G.; Lee, S.; Emken, B.; Annavaram, M.; Mitra, U.; Spruijt-Metz, D.; Narayanan, S. Multimodal Physical Activity Recognition by Fusing Temporal and Cepstral Information. IEEE Trans. Neural Syst. Rehabil. Eng. 2010,18, 369–380.
Sensors 2015,15 5194 28. Pawar, T.; Chaudhuri, S.; Duttagupta, S.P. Body Movement Activity Recognition for Ambulatory Cardiac Monitoring. IEEE Trans. Biomed. Eng. 2007,54, 874–882. 29. Ward, J.; Lukowicz, P.; Troster, G.; Starner, T. Activity Recognition of Assembly Tasks Using Body-Worn Microphones and Accelerometers. IEEE Trans. Pattern Anal. Machine Intell. 2006, 28, 1553–1567. 30. Reddy, S.; Mun, M.; Burke, J.; Estrin, D.; Hansen, M.; Srivastava, M. Using mobile phones to determine transportation modes. ACM Trans. Sen. Netw. 2010,6, 1–27. 31. Sharkey, J. Coding for life—Battery life, that is. In Proceedings of the Google IO Developer Conference, San Francisco, CA, USA, 27–28 May 2009. 32. Maloney, S.; Boci, I. Survey: Techniques for Efficient energy consumption in Mobile Architectures. Power (mW) 2012,16, 7–35. 33. Forrester. North American Technographics Consumer Technology Online Survey, Q1 2011 (US); Technical Report; Forrester: Cambridge, MA, USA, 2011. 34. Miluzzo, E.; Lane, N.D.; Fodor, K.; Peterson, R.; Lu, H.; Musolesi, M.; Eisenman, S.B.; Zheng, X.; Campbell, A.T. Sensing meets mobile social networks: The design, implementation and evaluation of the CenceMe application. In Proceedings of the 6th ACM Conference on Embedded Network Sensor Systems, New York, NY, USA, 5–7 November 2008; ACM: New York, NY, USA; pp. 337–350. 35. Yan, Z.; Subbaraju, V.; Chakraborty, D.; Misra, A.; Aberer, K. Energy-Efficient Continuous Activity Recognition on Mobile Phones: An Activity-Adaptive Approach. In Proceedings of the 2012 16th International Symposium on Wearable Computers (ISWC), Newcastle, CA, USA, 18–22 June 2012; pp. 17–24. 36. Choudhury, T.; Borriello, G.; Consolvo, S.; Haehnel, D.; Harrison, B.; Hemingway, B.; Hightower, J.; Klasnja, P.; Koscher, K.; LaMarca, A.; et al. The mobile sensing platform: An embedded activity recognition system. IEEE Pervasive Comput. 2008,7, 32–41. 37. Ravi, N.; Dandekar, N.; Mysore, P.; Littman, M.L. Activity recognition from accelerometer data. AAAI 2005,5, 1541–1546. 38. Tapia, E.M.; Intille, S.S.; Haskell, W.; Larson, K.; Wright, J.; King, A.; Friedman, R. Real-time recognition of physical activities and their intensities using wireless accelerometers and a heart rate monitor. In Proceedings of the 2007 11th IEEE International Symposium on Wearable Computers, Boston, MA, USA, 11–13 October 2007; pp. 37–40. 39. Anguita, D.; Ghio, A.; Oneto, L.; Parra, X.; Reyes-Ortiz, J.L. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. In Proceedings of the International Workshop of Ambient Assited Living (IWAAL 2012), Vitoria-Gasteiz, Spain, 3–5 December 2012. 40. Reiscs, A.; Stricker, D. Introducing a New Benchmarked Dataset for Activity Monitoring. In Proceedings of the 2012 16th International Symposium on Wearable Computers (ISWC), Newcastle, CA, USA, 18–22 June 2012; pp. 108–109. 41. Gonzalez-Abril, L.; Cuberos, F.J.; Velasco, F.; Ortega, J.A. Ameva: An autonomous discretization algorithm. Expert Syst. Appl. 2009,36, 5327–5332.
Sensors 2015,15 5195 42. Falomir Llansola, Z.; Museros Cabedo, L.; González Abril, L.; Escrig Monferrer, M.T.; Ortega, J.A. A model for the qualitative description of images based on visual and spatial features. Comput. Vis. Image Underst. 2012,116, 698–714. 43. Gonzalez-Abril, L.; Velasco, F.; Ortega, J.; Cuberos, F. A new approach to qualitative learning in time series. Expert Syst. Appl. 2009,36, 9924–9927. 44. Falomir, Z.; Gonzalez-Abril, L.; Museros, L.; Ortega, J.A. Measures of Similarity Between Objects Based on Qualitative Shape Descriptions. Spat. Cogn. Comput. 2013,13, 181–218. 45. Kwapisz, J.R.; Weiss, G.M.; Moore, S.A. Activity recognition using cell phone accelerometers. SIGKDD Explor. Newsl. 2011,12, 74–82. 46. Ward, J.A.; Lukowicz, P.; Troster, G.; Starner, T.E. Activity recognition of assembly tasks using body-worn microphones and accelerometers. IEEE Trans. Pattern Anal. Mach. Intell. 2006,28, 1553–1567. 47. Chu, D.; Lane, N.D.; Lai, T.T.T.; Pang, C.; Meng, X.; Guo, Q.; Li, F.; Zhao, F. Balancing energy, latency and accuracy for mobile sensor data classification. In Proceedings of the 9th ACM Conference on Embedded Networked Sensor Systems, Seattle, WA, USA, 1–4 November 2011; ACM: New York, NY, USA; pp. 54–67. 48. Wang, Y.; Krishnamachari, B.; Zhao, Q.; Annavaram, M. The tradeoff between energy efficiency and user state estimation accuracy in mobile sensing. In Proceedings of MobiCase, San Diego, CA, USA, 26–29 October 2009. 49. Lu, H.; Yang, J.; Liu, Z.; Lane, N.D.; Choudhury, T.; Campbell, A.T. The Jigsaw continuous sensing engine for mobile phone applications. In Proceedings of the 8th ACM Conference on Embedded Networked Sensor Systems, Zurich, Switzerland, 3–5 November 2010; ACM: New York, NY, USA, pp. 71–84. 50. Srinivasan, V.; Phan, T. An accurate two-tier classifier for efficient duty-cycling of smartphone activity recognition systems. In Proceedings of the Third International Workshop on Sensing Applications on Mobile Phones, Toronto, ON, Canada, 6 November 2012; ACM: New York, NY, USA; pp. 11:1–11:5. 51. Krause, A.; Ihmig, M.; Rankin, E.; Leong, D.; Gupta, S.; Siewiorek, D.; Smailagic, A.; Deisher, M.; Sengupta, U. Trading off prediction accuracy and power consumption for context-aware wearable computing. In Proceedings of the Ninth IEEE International Symposium on Wearable Computers, Osaka, Japan, 18–21 October 2005; pp. 20–26. 52. Yurur, O.; Liu, C.H.; Liu, X.; Moreno, W. Adaptive Sampling and Duty Cycling for Smartphone Accelerometer. In Proceedings of the 2013 IEEE 10th International Conference on Mobile Ad-Hoc and Sensor Systems (MASS), Hangzhou, China, 14–16 October 2013; pp. 511–518. 53. Yan, Z.; Subbaraju, V.; Chakraborty, D.; Misra, A.; Aberer, K. Energy-efficient continuous activity recognition on mobile phones: An activity-adaptive approach. In Proceedings of the 2012 16th International Symposium on Wearable Computers (ISWC), Newcastle, CA, USA, 18–22 June 2012; pp. 17–24. 54. Shen, C.; Chakraborty, S.; Raghavan, K.R.; Choi, H.; Srivastava, M.B. Exploiting processor heterogeneity for energy efficient context inference on mobile phones. In Proceedings of the Workshop on Power-Aware Computing and Systems, Farmington, PA, USA, 3–6 November 2013.
Sensors 2015,15 5196 55. Khan, A.; Lee, Y.K.; Lee, S.; Kim, T.S. A Triaxial Accelerometer-Based Physical-Activity Recognition via Augmented-Signal Features and a Hierarchical Recognizer. IEEE Trans. Inf. Technol. Biomed. 2010,14, 1166–1172. 56. Zinnen, A.; Blanke, U.; Schiele, B. An Analysis of Sensor-Oriented vs. Model-Based Activity Recognition. In Proceedings of the International Symposium on Wearable Computers, Linz, Austria, 4–7 September 2009; pp. 93–100. 57. Ferreira, D.; Dey, A.K.; Kostakos, V. Understanding human-smartphone concerns: A study of battery life. In Proceedings of the 9th International Conference on Pervasive Computing, San Francisco, CA, USA, 12–15 June 2011; Springer-Verlag: Berlin, Heidelberg, Germany; pp. 19–33. 58. Wang, Y.; Krishnamachari, B.; Annavaram, M. Semi-Markov state estimation and policy optimization for energy efficient mobile sensing. In Proceedings of the 2012 9th Annual IEEE Communications Society Conference on Sensor, Mesh and Ad Hoc Communications and Networks (SECON), Seoul , Korea, 18–21 June 2012; pp. 533–541. 59. Jia, R.; Liu, B. Human daily activity recognition by fusing accelerometer and multi-lead ECG data. In Proceedings of the 2013 IEEE International Conference on Signal Processing, Communication and Computing (ICSPCC), Kunming, China, 5–8 August 2013; pp. 1–4. c 2015 by the authors; licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution license (http://creativecommons.org/licenses/by/4.0/).
CHAPTER 6 MOBILE ACTIVITY RECOGNITION AND FALL DETECTION SYSTEM FOR ELDERLY PEOPLE USING AMEVA ALGORITHM Overview This paper addresses the human activities recognition problem for elderly people where the most important problem with classification models is that a good training process is needed to get the best results. Therefore, it is important to detect correctly the lifestyle of elderly people, but the difficulty is that they will waste their time training a device. This aspect makes the aged population a singular group for activity recognition systems. All common learning processes have a test phase that normally is carried out in a laboratory setting and, in activity recognition, this stage is performed in a controlled environment, throughout public generated datasets and also by the developed team of the system itself. The presented approach differs from the traditional system because it has been proved effective also in a non-controlled environment. Page 103
Chapter 6: Mobile activity recognition and fall detection system for elderly people using Ameva algorithm The developed system was accurate, comfortable and efficient and monitors the physical activity carried out by the user using the core of the Ameva algorithm. Moreover, with the purpose of reducing the cost and increasing user acceptance and usability, the entire system uses only a smartphone to recover all the information required. Context This research topic was initiated as an extension to an awarded activity recognition system that participated in the EvAAL 2012 and EvAAL 2013 competitions where the fall detection was the main goal. This paper is the result of several years of acquiring a wide range of knowledge in these fields. Journal information Figure 6.1: Pervasive and Mobile Computing cover. The Journal Pervasive and Mobile Computing was selected for the submission of this paper that is indexed in JCR with an Impact Factor of 2.079 in 2014 and 1.719 in 2015; and a 5-Year I.F. 2.366. Also, it stands in ranking Q2 in two categories in 2016: Telecommunications (34/89); Computer Science, Information Systems (53/146). Page 104
Pervasive and Mobile Computing 34 (2017) 3–13 Contents lists available at ScienceDirect Pervasive and Mobile Computing journal homepage: www.elsevier.com/locate/pmc Mobile activity recognition and fall detection system for elderly people using Ameva algorithm Miguel Ángel Álvarez de la Concepcióna,∗, Luis Miguel Soria Morilloa, Juan Antonio Álvarez Garcíaa, Luis González-Abrilb aComputer Languages and Systems Department, University of Seville, 41012 Seville, Spain bApplied Economics I Department, University of Seville, 41012 Seville, Spain article info Article history: Available online 21 May 2016 Keywords: Activity recognition Artificial intelligent Cognitive computing Contextual information Mobile environment Smart-energy computing abstract Currently, the lifestyle of elderly people is regularly monitored in order to establish guidelines for rehabilitation processes or ensure the welfare of this segment of the population. In this sense, activity recognition is essential to detect an objective set of behaviors throughout the day. This paper describes an accurate, comfortable and efficient system, which monitors the physical activity carried out by the user. An extension to an awarded activity recognition system that participated in the EvAAL 2012 and EvAAL 2013 competitions is presented. This approach uses data retrieved from accelerometer sensors to generate discrete variables and it is tested in a non-controlled environment. In order to achieve the goal, the core of the algorithm Ameva is used to develop an innovative selection, discretization and classification technique for activity recognition. Moreover, with the purpose of reducing the cost and increasing user acceptance and usability, the entire system uses only a smartphone to recover all the information required. ©2016 Elsevier B.V. All rights reserved. 1. Introduction According to Taipale [1], in 2014, there were more than 800 million people 60 years of age and over and the global number is increasing. The United Nations [2] indicated that 64 countries are expected to have an elderly population of more than 30% by 2050. Also, the Global Age Watch Index [3] shows that the number of people living alone is increasing and older people emerge as a growing market for consumption. One of the aims of gerontechnology [4] is to extend the time during which elderly people can live independently in their preferred environment with the support of information and communication technologies [5], thus maximizing their vital and productive years and reducing the cost of care in later life. To achieve this goal, activity recognition is one of the main facilities of gerontechnology: real-time monitoring of human activities represents a useful tool for many purposes and applications such as daily activities assistance, health, and activity monitoring or safety and security enhancement [6]. Although activities of daily living (ADL) are useful to analyze user behavior, falls are the most important events that need to be detected. According to the World Health Organization [7], more than 28% of people aged 65 and over fall each year, increasing to more than 32% for those over 70 years. If preventive measures are not taken in the near future, the number of injuries caused by falls is projected to double by 2030. In this environment, assistive devices that contribute to reduce the ∗Corresponding author. E-mail addresses: [email protected] (M. Álvarez de la Concepción), [email protected] (L.M. Soria Morillo), [email protected] (J.A. Álvarez García), [email protected] (L. González-Abril). http://dx.doi.org/10.1016/j.pmcj.2016.05.002 1574-1192/©2016 Elsevier B.V. All rights reserved.
10 M. Álvarez de la Concepción et al. / Pervasive and Mobile Computing 34 (2017) 3–13 Table 4 AIm matrix for standard deviation with six discretization intervals and six activities. Interval Activity Walking Upstairs Downstairs Sitting Standing Lying Lp,10.00 0.00 0.00 0.42 0.48 0.10 Lp,20.00 0.00 0.00 0.35 0.31 0.34 Lp,30.00 0.00 0.00 0.25 0.24 0.51 Lp,40.61 0.36 0.02 0.00 0.00 0.01 Lp,50.30 0.49 0.21 0.00 0.00 0.00 Lp,60.02 0.07 0.92 0.00 0.00 0.00 Table 5 Confusion matrix of the complete set of activities (percentage). Predicted class Walk Fall Stop Run Up Down Cycle Drive Walk 93.50 0.54 0.54 0.54 0.72 0.36 0.72 3.07 Fall 0.20 98.00 0.00 0.40 0.20 0.80 0.20 0.20 Stop 0.00 0.00 96.60 0.00 0.00 0.54 0.72 2.15 Actual Run 0.43 1.28 0.00 96.36 0.86 0.21 0.43 0.43 class Up 0.21 0.21 1.05 0.21 96.00 1.47 0.63 0.21 Down 0.98 0.73 1.22 0.73 2.20 91.95 0.24 1.95 Cycle 0.23 0.23 0.00 0.23 0.46 0.23 97.91 0.70 Drive 0.47 0.24 4.25 0.24 0.47 0.24 0.47 93.63 usually performed on a synthetic dataset, due to the great handicap of generating data of real falls. Therefore, in this paper the problem of falling is addressed in parallel, defining an accelerometric profile criteria and a period of no accelerations. By this method, the system detects a fall when the accelerometry profile shows acceleration peaks followed by a long period of inactivity. During the execution, this period was set to five seconds. Table 4 shows a set of different values obtained for each of the positions of the AIm matrix. In order to show the quality of the system with the considered set of activities, a confusion matrix with the complete set of activities is presented in Table 5. These data have been collected from a test case where a 31 year old researcher simulated the movements and two falls (forward and backward) of an elderly person during 15 min. These scores were obtained during the training phase from the datasets described above and mean that the likelihood for a given value xassociated to an Sstatistic corresponds to the right activity Ci; i.e. this indicator reflects the probability that a given configuration of the input parameters belongs to the activity Cibased on the intervals Ligenerated from the AIm matrix for all variables obtained in the dataset using the maximum likelihood method. 5. Comparison with other systems As mentioned in Section 1, the number of research studies and applications of the activity recognition has increased in several contexts in recent years. The insightful practical implications include elderly care, quality of self-care estimation and monitoring daily live activities among others. Lara [8] studied a deep evaluation of some existing activity recognition systems taking into account the type of sensors and the measured attributes, the integration device, the level of obtrusiveness, the type of data collection protocol, the level of energy consumption, the classifier flexibility level, the feature extraction method(s), the learning algorithm(s) and the overall accuracy for all activities. Also, they were divided into online and supervised offline systems. Shoaib[46]usedfivepositionsusingafourmotionsensors smartphone collecting data in some statistics in order to detect sevenphysical activitiesthrough atimewindow approach.The studyconsistsinwhichare thebestplacesforthe smartphone using a combination of them and analyzing the accuracy obtained by the most widely used classification algorithms. Based on their evaluations, they show that both the accelerometer and the gyroscope are capable of taking the lead roles in the activity recognition process, depending on the type of activity being recognized, the body position, the classification method and the feature set being used. However, the authors do not offer a new approach, but a general analysis. Plasqui’s main goal [47] was to review all recent validation studies of accelerometers against doubly labeled water in order to guide researchers in their selection of an appropriate accelerometer for a specified research goal. They concluded that the best-wearing position for an accelerometer to assess daily life physical activity is as close as possible to the center of mass, hence the lower back or hip. Only the differentiation between standing and sitting could not be achieved with a single accelerometer at this position. Finally,Ellis [48] used twoaccelerometers(right hip and non-dominantwrist)and a GPSinorder to monitor fouractivities of 40 overweight and obese breast cancer survivors. They use a two-step process to determine the activity. The first step is performed by a low-level classifier using a random forest classifier over the combination of GPS and accelerometer features. The output of each decision tree in the forest is combined using majority voting to obtain a prediction. The second
M. Álvarez de la Concepción et al. / Pervasive and Mobile Computing 34 (2017) 3–13 11 Table 6 Comparison with other activity recognition systems. ND (not determined). (*) This value of battery life has been obtained directly from the author’s paper assertions. Method Number of Average # of Execution Battery activities accuracy (%) sensors environment life (h) (*) Our proposal (2015) 9 (extensible) 95 1 general Smartphone 18.0 (measured) Antos et al. [10] (2014) 5 88 1 general Smartphone ND Liang et al. [11] (2014) 11 85 1 general Smartphone 3.2 (measured) Weng et al. [12] (2014) 4 98 1 general Smartphone ND Kozina et al. [14] (2013) 7 ND 2 general Smartphone ND Shoaib et al. [46] (2014) 7 ND 5 general Smartphone ND Ellis et al. [48] (2014) 4 85 2 general ND ND Sasank Reddy [52] (2010) 5 93 8 general Phone 8.2 (measured) Hong Lu [15] (2010) 5 94 1 general Smartphone 14.0 (experimental) Vijay Srinivasan [53] (2012) 6 91 1 general Smartphone 12.5 (measured) Yi Wang [54] (2012) 2 90 1 general Phone 150.0 (experimental) Jia [55] (2013) 7 98 2 specific Smartphone 7.0 (measured) level classifier is a Hidden Markov model. Each hidden state belongs to one of the activities. The results of their activity classification system used leave-one-subject-out cross validation and the overall accuracy was 85.6%. Although the accuracy is very close to the approach presented here, it uses two devices and only detects four activities. For the online systems (which are the focus of our approach), three of them get a high accuracy (over 94%) but have some disadvantages. Ermes [49] only applied a subject-dependent evaluation. Besides, their data were collected from only three subjects, which inhibits flexibility to support new users. eWatch [50], which embeds four sensors and a microcontroller within a device that can be worn as a watch for sport uses, is very energy efficient. The execution time for the feature extraction and the classification stage is lower than 0.3 ms. However, data was collected under controlled conditions, i.e., a lead experimenter supervised and gave specific guidelines to the subjects on how to perform the activities. Kao [51] presented a triaxial accelerometer placed on the user’s dominant wrist, sampling at 100 Hz. The system reports an average response time of less than 10 ms. However, given the nature of the recognized activities, the excess of granularity causes confusion, among others, between swinging, knocking and running. Table 6 shows different related works in the field of activity recognition. In this comparison, five features were evaluated. Number of activities shows the total amount of physical activities recognized by the system. The average accuracy indicates the performance of recognition in terms of activities properly classified compared with total instances. The number of devices (smartphones, sensors, motes, etc.) used during the recognition and training process is collected in # of sensors. Hardware configuration where the system is executed is presented under the execution environments feature. Finally, battery life shows the total time during which the execution environment is working until it runs out of battery. It should be noted that the studies analyzed are minimal when compared to the amount of research found on activity recognition. This is because we only want to take into account studies that have been tested or have the computational requirements to be tested in mobile devices. 6. Conclusions and future work Efficiency and accuracy are two elements that must be taken into account when any AR system is implemented on a mobile device and, more importantly, when this mobile device is a smartphone. In this work, a recognition system based on discrete variables is presented whereby the discretization algorithm Ameva and a new classification system are used. It has a low complexity and both the runtime and energy consumption have been reduced in comparison to other related works. The system has been validated in an international competition (1st and 3rd positions). Although the accuracy was not very good in the 2012 and the 2013 EvAAL competitions, the system is very usable and easy to introduce in lifestyle of elderly people. Several improvements have been carried out and described in this paper. The classification algorithm has been developed for multi-class datasets and it obtains a good accuracy when there is approximately the same number of examples for each class in the training phase. It is also fast because it is based on the discretization algorithm Ameva and a majority voting system which both have a very low processing time. This makes it possible to embed the system into tiny pervasive hardware such as smartwatches or specific devices attached to the user’s clothing or body. Furthermore, although it will be tested with other datasets, the core of this algorithm remains free of dependence on the features of any recognition activity dataset and is, therefore, applicable to any dataset that contains activities with different behavior patterns (for example, walk and stand). The advantages of the system are the high accuracy rate and the reduced computational cost as has been demonstrated in the experimental results. Regarding the success rate, it has been possible to achieve an average accuracy of 95% in the recognition of eight different types of activities with a group of 30 volunteers. On the other hand, the complexity associated with the data processing during the recognition process has been optimized due to the inclusion of discrete variables and 24 h of continuous monitoring have been reached without recharging the device. Based on the results obtained during the process of experimentation, the most likely system confusions occur when the acceleration associated with the activity is high. In the case of falls, it could give false positives if the device is thrown on a
12 M. Álvarez de la Concepción et al. / Pervasive and Mobile Computing 34 (2017) 3–13 surface or when the user performs actions involving high accelerations followed by an inactivity period (let yourself fall on a chair or a sofa). This approach is not really bad because it reduces the number of the false negatives especially when the most critical activity is the falling [56,57]. Finally, the case of picking something up or similar activities, would not be a problem for the system. These activities could lead to a high acceleration during its performance (not as great as those generated during a fall, although similar), but there is no inactivity period after its execution. As for interference caused by the frequency of carrying out the activities, their consequences are mild. In the case of walking at a high enough rate, the system could interpret the user is running. Or if you jump fast enough and with a not too high altitude, you might consider running is the most likely activity. However, even looking directly at the user, these activities can lead to confusion because of their similarity. This system is currently focused on ADL activities and fall detection of elderly people. Due to that, the application developed to execute this AR system can transmit an alarm signal to the relatives and/or medical center. Besides this, relatives and medical staff can examine the activities performed by the elderly under their monitoring along the day in a website, improving the system functionality beyond an alarm system. It complements existing telecare services, such as those as offered by the Andalusian Regional Ministry of Equality, Health and Social Policy among others. Finally,in order toimprovethe accuracy andtotrack rehabilitation processbymeans of a fine-grainedAR system, the Myo device2that is a gesture control armband will be included in the solution. It detects the hand and wrist motions throughout high sensitivity electromyogram sensors, and it could help caregivers to obtain more information about the lifestyle of their patients. For instance, it could be possible to retrieve information about the use of the walking stick in daily life or during rehabilitation process. This hardware will also allow the detection of important aspects such as dyskinesia (for Parkinson’s patients), fatigue or other muscular pathologies. Acknowledgments This research is partially supported by the projects of the Spanish Ministry of Economy and Competitiveness HERMES (TIN2013-46801-C4-1-r), Simon (P11-TIC-8052) and M-Learning (P11-TIC-7124) of the Andalusian Regional Ministry of Economy, Innovation and Science. References [1] V. Taipale, Global trends, policies and gerontechnology, Gerontechnology 12 (4) (2014) 187–193. [2] Fund UNP, International HA, Ageing in the twenty-first century: a celebration and a challenge. United Nations Population FundHelp Age New York, London, 2012. [3] Index GA, Insight Report, London, UK: HelpAge International. Retrieved from http://www.helpage.org, 2014. [4] J.E. van Bronswijk, H. Bouma, J.L. Fozard, W.D. Kearns, G.C. Davison, P.C. Tuan, Defining gerontechnology for R&D purposes, Gerontechnology 8 (1) (2009) 3–10. [5] N. Agarwal, M. Sebastian, Wireless infrastructure setup strategies for healthcare, in: Proceedings of the 7th International Conference on Pervasive Technologies Related to Assistive Environments, ACM, 2014, p. 66. [6] O. Yurur, C. Liu, W. Moreno, A survey of context-aware middleware designs for human activity recognition, IEEE Commun. Mag. 52 (6) (2014) 24–31. [7] Ageing WHO, Unit LC, WHO Global Report on Falls Prevention in Older Age, World Health Organization, 2008. [8] O.D. Lara, M.A. Labrador, A survey on human activity recognition using wearable sensors, IEEE Commun. Surv. Tutor. 15 (3) (2013) 1192–1209. [9] H. Gjoreski, Context-based reasoning in ambient intelligence (Ph.D. thesis), IPS Jožef Stefan, Ljubljana, Slovenia, 2015. [10] S.A. Antos, M.V. Albert, K.P. Kording, Hand, belt, pocket or bag: Practical activity tracking with mobile phones, J. Neurosci. Methods 231 (2014) 22–30. [11] Y. Liang, X. Zhou, Z. Yu, B. Guo, Energy-efficient motion related activity recognition on mobile devices for pervasive healthcare, Mob. Netw. Appl. 19 (3) (2014) 303–317. [12] S. Weng, L. Xiang, W. Tang, H. Yang, L. Zheng, H. Lu, et al., A low power and high accuracy MEMS sensor based activity recognition algorithm, in: Bioinformatics and Biomedicine, BIBM, 2014 IEEE International Conference on, IEEE, 2014, pp. 33–38. [13] T. Rault, A. Bouabdallah, Y. Challal, F. Marin, Context-aware energy-efficient wireless sensor architecture for body activity recognition, in: Pervasive Computing and Communications Workshops, PERCOM Workshops, 2014 IEEE International Conference on, IEEE, 2014, pp. 203–206. [14] S. Kozina, H. Gjoreski, M. Gams, M. Luštrek, Efficient activity recognition and fall detection using accelerometers, in: Evaluating AAL Systems Through Competitive Benchmarking, Springer, 2013, pp. 13–23. [15] H. Lu, J. Yang, Z. Liu, N.D. Lane, T. Choudhury, A.T. Campbell, The Jigsaw continuous sensing engine for mobile phone applications, in: Proceedings of the 8th ACM Conference on Embedded Networked Sensor Systems, ACM, 2010, pp. 71–84. [16] L. Gonzalez-Abril, F.J. Cuberos, F. Velasco, J.A. Ortega, Ameva: An autonomous discretization algorithm, Expert Syst. Appl. 36 (3) (2009) 5327–5332. [17] N. Costa, P. Domingues, F. Fdez-Riverola, A. Pereira, A mobile virtual butler to bridge the gap between users and ambient assisted living: a smart home case study, Sensors 14 (8) (2014) 14302–14329. [18] S. Azzi, C. Dallaire, A. Bouzouane, B. Bouchard, S. Giroux, Human activity recognition in big data smart home context, in: Big Data (Big Data), 2014 IEEE International Conference on, IEEE, 2014, pp. 1–8. [19] Q. Zhang, Y. Su, P. Yu, Assisting an elderly with early dementia using wireless sensors data in smarter safer home, in: Service Science and Knowledge Innovation, Springer, 2014, pp. 398–404. [20] J.M. Chaquet, E.J. Carmona, A. Fernández-Caballero, A survey of video datasets for human action and activity recognition, Comput. Vis. Image Underst. 117 (6) (2013) 633–659. [21] C. Rougier, J. Meunier, A. St-Arnaud, J. Rousseau, 3D head tracking for fall detection using a single calibrated camera, Image Vis. Comput. 31 (3) (2013) 246–254. [22] G. Srivastava, J. Park, A.C. Kak, B. Tamersoy, J. Aggarwal, Multi-camera human action recognition, in: Computer Vision, Springer, 2014, pp. 501–511. 2Available from https://www.thalmic.com/en/myo/.
M. Álvarez de la Concepción et al. / Pervasive and Mobile Computing 34 (2017) 3–13 13 [23] M. Kanis, S. Robben, J. Hagen, A. Bimmerman, N. Wagelaar, B. Krose, Sensor monitoring in the home: giving voice to elderly people, in: Pervasive Computing Technologies for Healthcare, PervasiveHealth, 2013 7th International Conference on, IEEE, 2013, pp. 97–100. [24] Yh Wu, J. Wrobel, M. Cornuet, H. Kerhervé, S. Damnée, A.S. Rigaud, Acceptance of an assistive robot in older adults: a mixed-method study of human–robot interaction over a 1-month period in the living lab setting, Clin. Intervent. Aging (2014) 9. [25] Y.H. Wu, J. Wrobel, V. Cristancho-Lacroix, L. Kamali, M. Chetouani, D. Duhaut, et al., Designing an assistive robot for older adults: The ROBADOM project, IRBM 34 (2) (2013) 119–123. [26] P. Dell’Acqua, L.V. Klompstra, T. Jaarsma, A. Samini, An assistive tool for monitoring physical activities in older adults, in: Serious Games and Applications for Health, SeGAH, 2013 IEEE 2nd International Conference on, IEEE, 2013, pp. 1–6. [27] L. Hu, Y. Chen, S. Wang, Z. Chen, b-COELM: A fast, lightweight and accurate activity recognition model for mini-wearable devices, Pervasive Mob. Comput. 15 (2014) 200–214. [28] R. Rana, M. Hume, J. Reilly, R. Jurdak, J. Soar, Transforming knowledge capture in healthcare: Opportunistic and Context-aware affect Sensing on Smartphones. arXiv preprint arXiv:150202796, 2015. [29] M.A. Habib, M.S. Mohktar, S.B. Kamaruzzaman, K.S. Lim, T.M. Pin, F. Ibrahim, Smartphone-based solutions for fall detection and prevention: challenges and open issues, Sensors 14 (4) (2014) 7181–7208. [30] P.S. Jeong, YH. Cho, Fall detection system using smartphone for mobile healthcare, J. Korea Soc. IT Serv. 12 (4) (2013) 435–447. [31] J.A. Álvarez-García, L.M.S. Morillo, M.Á.Á. de La Concepción, A. Fernández-Montes, J.A.O. Ramírez, Evaluating wearable activity recognition and fall detection systems, in: 6th European Conference of the International Federation for Medical and Biological Engineering, Springer, 2015, pp. 653–656. [32] Z.S. Abdallah, M.M. Gaber, B. Srinivasan, S. Krishnaswamy, Adaptive mobile activity recognition system with evolving data streams, Neurocomputing 150 (2015) 304–317. [33] Z.Zhao, Z. Chen,Y. Chen, S. Wang, H.Wang, A classincremental extreme learning machine foractivity recognition, Cogn.Comput. 6 (3) (2014) 423–431. [34] M.Á.Á. de la Concepción, L.S. Morillo, L. Gonzalez-Abril, J.O. Ramírez, Discrete techniques applied to low-energy mobile human activity recognition. A new approach, Expert. Syst. Appl. 41 (14) (2014) 6138–6146. [35] A. Martínez, M. Llorente, J.P. Lázaro, Ciami living lab: an economically sustainable technological tool for open innovation, I ENoLL Living Lab Summer School, 2010. [36] J.A. Álvarez-García, P. Barsocchi, S. Chessa, D. Salvi, Evaluation of localization and activity recognition systems for ambient assisted living: The experience of the 2012 EvAAL competition, J. Ambient Intelli. Smart Environ. 5 (1) (2013) 119–132. [37] M.Á.Á. de la Concepción, L.M.S. Morillo, L.G. Abril, J.A.O. Ramírez, Activity recognition system using non-intrusive devices through a complementary technique based on discrete methods, in: Evaluating AAL Systems Through Competitive Benchmarking, Springer, 2013, pp. 36–47. [38] H. Gjoreski, S. Kozina, M. Gams, M. Lustrek, J.A. Álvarez-García, J.H. Hong, et al., Competitive live evaluations of activity-recognition systems, IEEE Pervasive Comput. 14 (1) (2015) 70–77. [39] D. Anguita, A. Ghio, L. Oneto, X. Parra, J.L. Reyes-Ortiz, A Public Domain Dataset for Human Activity Recognition using Smartphones, in: ESANN, 2013. [40] M. Zhang, A.A. Sawchuk, USC-HAD: A daily activity dataset for ubiquitous activity recognition using wearable sensors, in: ACM International Conference on Ubiquitous Computing, Ubicomp, Workshop on Situation, Activity and Goal Awareness (SAGAware), Pittsburgh, Pennsylvania, USA, 2012. [41] G.M. Weiss, J.W. Lockhart, The impact of personalization on smartphone-based activity recognition, in: AAAI Workshop on Activity Context Representation: Techniques and Languages, 2012. [42] M. Shoaib, H. Scholten, P.J. Havinga, Towards physical activity recognition using smartphone sensors, in: Ubiquitous Intelligence and Computing, 2013 IEEE 10th International Conference on and 10th International Conference on Autonomic and Trusted Computing, UIC/ATC, IEEE, 2013, pp. 80–87. [43] F. Guo, Y. Li, M.S. Kankanhalli, M.S. Brown, An evaluation of wearable activity monitoring devices, in: Proceedings of the 1st ACM International Workshop on Personal Data Meets Distributed Multimedia, ACM, 2013, pp. 31–34. [44] M. Carman, N. Tam, M. Woodward, Why Fitbit has succeeded when other pedometers have failed, 2013. [45] F. Bagalà, C. Becker, A. Cappello, L. Chiari, K. Aminian, J.M. Hausdorff, et al., Evaluation of accelerometer-based fall detection algorithms on real-world falls, PLoS One 7 (5) (2012) e37062. [46] M. Shoaib, S. Bosch, O.D. Incel, H. Scholten, PJ. Havinga, Fusion of smartphone motion sensors for physical activity recognition, Sensors 14 (6) (2014) 10146–10176. [47] G. Plasqui, A. Bonomi, K. Westerterp, Daily physical activity assessment with accelerometers: new insights and validation studies, Obes. Rev. 14 (6) (2013) 451–462. [48] K. Ellis, J. Kerr, S. Godbole, G. Lanckriet, Multi-sensor physical activity recognition in free-living, in: Proceedings of the 2014 ACM International Joint Conference on Pervasive and Ubiquitous Computing: Adjunct Publication, ACM, 2014, pp. 431–440. [49] M. Ermes, J. PÄrkkÄ, J. MÄntyjÄrvi, I. Korhonen, Detection of daily activities and sports with wearable sensors in controlled and uncontrolled conditions, IEEE Trans. Inf. Technol. Biomed. 12 (1) (2008) 20–26. [50] U. Maurer, A. Rowe, A. Smailagic, D. Siewiorek, Location and activity recognition using eWatch: A wearable sensor platform, in: Ambient Intelligence in Everyday Life: Foreword by Emile Aarts, Springer, Berlin, Heidelberg, 2006, pp. 86–102. [51] T.P. Kao, C.W. Lin, J.S. Wang, Development of a portable activity detector for daily activity recognition, in: 2009 IEEE International Symposium on Industrial Electronics, 2009, pp. 115–120. [52] B. Longstaff, S. Reddy, D. Estrin, Improving activity classification for health applications on mobile devices using active and semi-supervised learning, in: Pervasive Computing Technologies for Healthcare, PervasiveHealth, 2010 4th International Conference on-NO PERMISSIONS, IEEE, 2010, pp. 1–7. [53] V. Srinivasan, T. Phan, An accurate two-tier classifier for efficient duty-cycling of smartphone activity recognition systems, in: Proceedings of the Third International Workshop on Sensing Applications on Mobile Phones, ACM, 2012, p. 11. [54] Y. Wang, B. Krishnamachari, M. Annavaram, Semi-Markov state estimation and policy optimization for energy efficient mobile sensing, in: Sensor, Mesh and Ad Hoc Communications and Networks, SECON, 2012 9th Annual IEEE Communications Society Conference on, IEEE, 2012, pp. 533–541. [55] R. Jia, B. Liu, Human daily activity recognition by fusing accelerometer and multi-lead ECG data, in: Signal Processing, Communication and Computing, ICSPCC, 2013 IEEE International Conference on, IEEE, 2013, pp. 1–4. [56] Q. Li, J.A. Stankovic, M.A. Hanson, A.T. Barth, J. Lach, G. Zhou, Accurate, fast fall detection using gyroscopes and accelerometer-derived posture information, in: Wearable and Implantable Body Sensor Networks, 2009. BSN 2009, Sixth International Workshop on, IEEE, 2009, pp. 138–143. [57] A. Sixsmith, N. Johnson, A smart sensor to detect the falls of the elderly, IEEE Pervasive Comput. 3 (2) (2004) 42–47.
PART III Other relevant research works Page 117
CHAPTER 7 A QUALITATIVE METHODOLOGY TO REDUCE FEATURES IN CLASSIFICATION PROBLEMS Overview This paper develops a preliminary feature reduction technique using the Ameva algorithm that has been confirmed as one of the most promising algorithms due to its reduced execution time and the smaller number of intervals provided. When data is obtained experimentally, is not considered what features are relevant for the studied system and the application of several techniques that determines which are relevant for the system is a common step. The methodology presented in this paper uses the Ameva algorithm because it is based on the statistic χ2that determines the relationship between features and classes. For this reason, it is possible to use this algorithm to determine the relationship between features. The core of the algorithm is a new coefficient called entropy that has been developed to determine the dependence between features. This approach can be satis- Page 119
Chapter 7: A qualitative methodology to reduce features in classification problems factorily apply in the feature reduction area when the data set has a lot of instances and features, and one of these features determines the class which each instance belongs. Context This research was originally started in the feature reduction area as a new possible use of the Ameva algorithm. The idea took as a principle the advantages of the χ2statistic that determines the correlation between two features and proposes the ones with the highest Ameva coefficient value as the features that could be removed. This paper is the result of over 8 months’ work and currently is one of the areas under investigation. Research work information Figure 7.1: Qualitative Reasoning cover. The International Workshop on Qualitative Reasoning is focus on Qualitative Reasoning that is a research area at the interface of Artificial Intelligence, Cognitive Science and Engineering Sciences. This workshop is always co-located with the International Joint Conference on Artificial Intelligence (IJCAI). Link: http://www.qrg.northwestern.edu /papers/Files/qr-workshops/QR2011/2011 _Proceedings/qr11_paper1.pdf Page 120
A qualitative methodology to reduce features in classification problems Alvarez, M.A.a; Gonzalez-Abril, L.b; Ortega, J.A.a; Soria, L.M.a aDepartment of Computer Science, University of Seville bDepartment of Applied Economics I, University of Seville Seville, Spain {maalvarez, luisgon, jortega, lsoria}@us.es Abstract In this paper, a preliminary methodology which quantifies the dependence between features in a data set by using the Ameva discretization algorithm and the advantages of a qualitative model is developed. Thus, different matrices of interdependence are built providing a grade of dependence between two features. This methodology is applied to a well-known data set, obtaining promising results for the carried out system. 1 Introduction The problem of classification is one of the main problems in data analysis and pattern recognition that requires the construction of a classifier, that is, a function that assigns a class label to instances described by a set of features. The induction of classifiers from data sets of classified instances is a central problem in machine learning. For that purpose, a large number of methodologies based on SVM [1], Naive Bayesian [2], C5.0 [3], etc. have been developed. Additionally, qualitative modeling and reasoning is a very interesting area for applying and experimenting with machine learning techniques. Qualitative reasoning has special interest to systems where machine learning can be applied as modeling, diagnosis, control, discovery, design, and knowledge compilation. One of the most important preprocess in classification is the discretization. This process establishes a relationship between continuous variables and their discrete transformation through functions. Therefore, it is possible to model qualitatively a series of continuous values if a label is assigned to them. Some studies [4]have shown that execute a prior process to discretize continuous features is more efficient than work directly with the continuous values. This process reduces the computation time and memory usage in the application of classification algorithms and it is used to manage the set of values of a feature more effectively. Some relevant discretization methods are Ameva [5], Khiops [6], CAIM [7]and others [8; 9]. The Ameva discretization method has been confirmed as one of the most promising algorithms due to its reduced execution time and the smaller number of intervals provided. This behavior is outstanding when the data set has a large number of classes, although it has a slight reduction in the capacity of identification [5; 10]. Another problem in the classification process is the existence of irrelevant features [11]. When data is obtained experimentally, is not considered what features are relevant for the studied system. Several techniques [12; 13; 14]have been developed to reduce the number of features and to determine which are relevant for the system. Some of these techniques are based on principals components analysis [15]or factorial analysis [16]. The Ameva discretization algorithm [10]performs the discretization process effectively and quickly, so the set of values of a feature is greatly reduced, but do not reduce the number of features. Because Ameva uses the statistic χ2to determine the relationship between features and classes, it is possible to use this algorithm to determine the relationship between features. In this paper, a new methodology based on Ameva algorithm is developed in order to reduce the number of features of a data set. This method exploits the advantages of Ameva in runtime and brings a different approach which was developed on. The rest of this paper is organized as follows: first, the definition of the problem is presented in Section 2 to establish the notation of the rest of the paper. Also, the Ameva discretization algorithm and the Entropy coefficient are presented. Section 3 presents the new methodology to determine the dependence between features using the Ameva algorithm and the entropy coefficient. Section 4 reports the obtained results of applying the methodology in a toy example. The paper is finally concluded with a summary of the most important points and future works. 2 Discretization Let X={x1, x2, . . . , xN}be a data set of a continuous attribute Xof mixed-mode data such that each example xibelongs to only one of `classes of the variable denoted by C={C1, C2, . . . , C`}, ` ≥2(1) A continuous attribute discretization is a function D:X → Cwhich assigns a class Ci∈ C to each value x∈ X in the domain of the property that is being discretized. QR2011: 25th International Workshop on Qualitative Reasoning 1
Chapter 8: The CICA GRID - A cloud computing infrastructure on demand with open source technologies Context This research started as a result of a research project where researchers could increase or decrease resources in a cloud environment. It was applied in a real professional context as a result of one year of researching in the Cloud Computing area in the Scientific Computing Center of Andalusia where this PhD student worked. Research work information Figure 8.1: International Conference on Enterprise Information Systems cover. The purpose of the International Conference on Enterprise Information Systems is to bring together researchers, engineers and practitioners interested in the advances and business applications of information systems. This conference is held in conjunction with Evaluation of Novel Approaches to Software Engineering. It is indexed in SJR with a Impact Factor of 0.111 and H Index of 4 in one category: Information Systems and Management. Also, it is indexed in CORE with a Rank C. DOI: https://doi.org/10.5220/0003992603010304 Page 128
The CICA GRID A Cloud Computing Infrastructure on Demand with Open Source Technologies M. A. Alvarez1, A. Fernandez-Montes1, J. A. Ortega1and L. Gonzalez-Abril2 1Computer Languages and Systems Department, University of Seville, Seville, Spain 2Applied Economics I Department, University of Seville, Seville, Spain Keywords: Cloud Computing, Cluster, Cobbler, IaaS, OpenNebula, Profile, Puppet, ReCarta, Virtual Machine. Abstract: A new approach technology to enable the expansion and replication of resources on demand is presented in this paper. This approach is called CICA GRID and it provides service to research community in the Scientific Computer Centre of Andalusia (CICA). This approach is an alternative solution to the initial cost involved in building an own data center by public organizations for researches. This solution quickly provides resources with a minimal technical staff effort. Also, an architecture and user interface example called ReCarta was presented. This system supplies a private Cloud Computing system for non-technical end-users. 1 INTRODUCTION In the last years, Cloud Computing has been launched as a concept that it has potential to transform the way in which computers are used and managed. This technology promises to realize the objective of transforming the computing resources into a single process. This process can use any quantity of resources during the needed time. These features are especially interesting for the HPC/Grid Computing/Scientific area since they enable resources to be managed in a controlled environment. In this sense, researchers estimate their computing needs when a new project is considered. Therefore, researchers must spend their time to configure the available resources to satisfy their needs. Furthermore, the problem is bigger if researchers do not have technical computer knowledges. In response to the needs of researchers and to improve the Andalusian Supercomputing Network (RASCI)1, the Scientific Computer Center of Andalusia (CICA)2has implemented a technology solution called CICA GRID. It enables the expansion or replication of resources depending on research demands. CICA, in collaboration with the Spanish National Grid Initiative3, features a high scalability cloud with a quick resources configuration: a GRID environment 1http://rasci.cica.es 2http://www.cica.es 3http://www.es-ngi.es solution. The developed approach incorporates three tools to carry out its function: Cobbler4, Puppet5and Open- Nebula6. It was called ReCarta7and it hides these tools to user by a web interface. The paper is organized as follows: Cloud Computing technology is briefly presented in the next section. In Section 3, the project motivation and system architecture are analyzed and users’ tools and examples are given in Section 4. Benchmarks and features are shown in Section 5. Section 6 provides a final discussion and concludes this paper. 2 CLOUD COMPUTING Cloud Computing refers to hardware and software infrastructure which allows applications to be served across the web for end-users. Furthermore, it provides computational resources and virtual hosting to build their own applications for them and the hardware and software datacenter is called the Cloud. There are two kinds of Cloud: Public Cloud (Armbrust et al., 2009) and Private Cloud. The first one is available for commercial purposes and pay-per-use (Stuer et al., 2007). The second one is found in an in- 4http://cobbler.github.com 5http://reductivelabs.com/trac/puppet 6http://www.opennebula.org/doku.php 7http://trac.cica.es/recarta/ 301 A. Alvarez M., Fernandez-Montes A., A. Ortega J. and Gonzalez-Abril L.. The CICA GRID - A Cloud Computing Infrastructure on Demand with Open Source Technologies. DOI: 10.5220/0003992603010304 In Proceedings of the 14th International Conference on Enterprise Information Systems (ICEIS-2012), pages 301-304 ISBN: 978-989-8565-11-2 Copyright c 2012 SCITEPRESS (Science and Technology Publications, Lda.)
dividual organization and the access is only allowed to authorized members. Also, Cloud Computing systems can be classified as IaaS (Infrastructure as a Service), PaaS (Platform as a Service) and SaaS (Software as a Service). 3 PROJECT MOTIVATION AND SYSTEM ARCHITECTURE A cluster for HPC is supported by CICA and the applied model is basically IaaS inside a private cloud which is accessed only by users from RASCI. It uses SGE as the Local Resource Manager (LRM) with Sun Grid Engine. Furthermore, this cluster has about 30 machines ant it is part of the Spanish National Grid Initiative. The main motivation is to increase the requirements for access to excess computational resources of a working scheme in a cluster with an LRM. Thus, a project where authenticated and authorized users could design their own computational infrastructure and then use and manage it across a comfortable and simple interface was initiated. It was called “Recursos a la carta” (À-la-carte resources). To achieve these goals some technical issues must be solved: i) machine supply; and ii) how to distribute the available physical resources among these virtual machines which they need them. The presented proposal, called CICA GRID, is developed as follows. 3.1 Provisioning and Management of Large-scale Virtual Systems The CICA GRID is a private cloud with 35 virtual machines. It is composed by gLite’s working nodes and services (Andreetto et al., 2008). It is essential to have a tool that enables easy and flexible administration of these machines. The management of this cloud will be easier and more automated with it. Also, it must support the production control of the features and services of each machine. Hence, the problem of building the machines demanded by users has been resolved using Cobbler/Koan. This tool facilitates the provisioning of virtual machines according to options given by users when they select how they want to build their machines and establishes an object hierarchy which defines the configuration characteristics at the highest levels. From the highest to the lowest level, they are Distro, Profile, Subprofile and System. The relationship between objects that can be defined with Cobbler and the actual supplied machines are shown in Figure 1. Figure 1: Cobbler object hierarchy. At the time of computer installation, PXE boots the system while Cobbler shows a drop-down menu where the installation type can be chosen. If a virtual machine is going to be supplied, then it is possible to use the Koan command over the physical machine to specify what kind of machine is needed. In the CICA GRID, users initiate a guided installation through a Cobbler profile. In answer to this request, the designated virtual machines are kept in a shared space (machine repository [see Figure 2]) where they are left available to OpenNebula for deployment. Since provision and deployment of virtual machines does not resolve all infrastructure maintenance problems, a system for automating administration tasks is required and Puppet has been chosen. It provides a framework to simplify the work of system administrators, reusing the code as much as possible and allowing a modular system. Also, it is based on a client-server scheme and a declarative language that specifies administration tasks. Puppet is used in the CICA GRID to configure and ensure that the NTP service of machines works correctly. Also, it must ensure that users are authenticated by LDAP and a basic backup configuration, security updates and certain file systems are set up. Through Cobbler profiles, each newly supplied virtual machine has a Puppet installed client. Both Cobbler/Koan and Puppet have been proved to be capable of providing support for hundreds of machines. 3.2 Virtualized Systems Open Nebula has been chosen to solve the problem of finding a system for an efficient deployment on virtual machine. It is an open-source virtual infrastructure engine and it enables dynamic deployment and re-placement of virtual machines using a pool of physical resources. It has achieved to decouple the ICEIS2012-14thInternationalConferenceonEnterpriseInformationSystems 302
server not only from the physical infrastructure, but also from the physical location. Therefore, once Cobbler has provided machines requested by users and they have been saved in repository, the system will build needed files to enable OpenNebula to launch the deployment of machines as shown in Figure 2. Figure 2: Architecture: connection scheme. 4 USER TOOL The CICA GRID has a modular design. It facilitates its development and has been implemented in Python (Lutz and Van, 2001) language. Each module presents a well-defined interface so it can be easily used by other parts. They are Cobbler, DHCP and DNS management, Puppet, Open Nebula and User Interface modules. 4.1 ReCarta A minimalist approach which attempts to show users the possible options is required. Therefore, the main focus is not on writing less code, but providing users with a useful system. This system is called ReCarta. The created machine is composed for 2 steps. At first, users must define hardware and software features when they create a new group of machines. Later, users must indicate how many machines and the names of each have to be defined with these features. At the end of this process, created system user data is shown along with the information needed for connection and start-up. Therefore, users have a project control panel at their disposal and they can see systems that they have been defined. 4.2 Code Example A code example is given in order to illustrate the set of calls to defined API by different modules. They carry out tasks that a user has requested via web interface. A new Cobbler profile (a new project in the user terminology) is created. It defines machines with 1 CPU, 512 MB of RAM, 4 GB of hard drive and Java language support. import mod_cobbler import mod_dhcpDns import mod_puppet import mod_nebula miCobbler = mod_cobbler.Cobbler( ’john’ ) miCobbler.setProfile( { ’nombrePerfil’:’project’, ’kickstart’:’vm-kickstart.template’, ’diskSize’:’4’, ’ram’:’512’, ’cpus’:’1’, ’comment’:’project profile’, ’software’:[ ’X-WINDOW’, ’JAVA-SUPPORT’ ] } ) macs = miCobbler.setSystems( [ { ’nombre’:’project-vm’, ’comentario’:’project VM’, ’perfil’:’project’ } ] ) mapIpNames = mod_dhcpDns.addSystemsDHCP(macs) mod_dhcpDns.addEntryDns( mapIpNames ) miCobbler.provisionSystems( [ ’project-vm’ ] ) It is important to note two ReCarta design features8. One is the high abstraction level offered by different methods. The kickstart template is modified to adapt it to different user requirements and it do not appear nowhere. Also, DHCP/DNS server configurations are modified to assign a place to new systems in network. The other feature of ReCarta is the absence of system database to save information about defined projects and users, etc. ReCarta put the usernames as a prefix to data profiles and the project name to defined system names by users. This design decision has been taken to keep ReCarta as simple as possible. 5 BENCHMARKS AND FEATURES The CICA GRID is a private cloud with 35 virtual machines with the following virtualized features: 1 core and 1 GB RAM. 6 physical servers are used to virtualize them with the following features: 2 cores and 4 GB RAM. 8http://trac.cica.es/recarta/wiki/RecartaDevel TheCICAGRID-ACloudComputingInfrastructureonDemandwithOpenSourceTechnologies 303
Table 1: HPCC benchmarks. Intel 6400 Intel 6400 Physical Virtualized PTRANS(GB/s) 0.65 0.54 HPL(Gflops) 14.26 13.01 MPI Latency(ms) 0.00043 0.00053 MPI Bandwidth (ms) 1471.17 1477.64 Table 2: Bonnie++ write test - 2Gb blocks. Server Sequential Sequential Random type output (Kbs) input (Kbs) (seek/s) Virtual 14014 34851 150.7 Physical 45678 49719 64.7 Table 3: Bonnie++ create test - 1Gb blocks. Server type Sequential Random Create (s) Create (s) Virtual 0.0000 0.0000 Physical 1621 891 Table 4: Consumption of 6 physical and 35 virtual servers. Servers Consumption Total (KWh/year) (KWh/year) 35 virtual 222.6 7791 6 physical 516 3096 Nowadays, ReCarta creates systems compound of Xen (Barham et al., 2003) virtual machines. It has been used because it is proved that a paravirtualized virtual machine only loses 5-10% of CPU performances respect to equivalent physical machine. Table 1 presents HPCC benchmark execution results. As expected, performances of the physical machine are better than virtualized machine. However, it is observed that the performance is about the same in both cases, so we can conclude that the proposal can be accepted as valid. Table 2 and Table 3 show Bonnie++ execution results for virtual machine memory and equivalent physical machine. Also, a significant decrease in performance between virtual and physical machine can be seen for writing action to disc in these latter cases. In this case, the differences are slightly higher because the benchmark is performed on disk access. In this process, a virtual machine generates a very intense traffic on its virtual hard disk, especially reading. The power consumption can see in Table 4. The use of virtualization allows the power consumption to be reduced to 39% can be seen in it. 6 CONCLUSIONS Although the CICA GRID is still in its experimental phase, some case studies have been carried out. One of them is the creation of a small virtual cluster to be used with Apache Hadoop (Borthakur, 2007). Also, the project objectives have enabled that more job requests could be served without exceed the normal workload for a HPC cluster. From the point of view of the energy-saving involved in virtualized environments, the CICA GRID renders research advances for the research groups with less cost by releasing electrical consumption. We have learned during the launching of our pilot project of Cloud Computing that our users appreciate two advantages: i) the illusion of having a huge computing resource reserved exclusively for them; and ii) the possibility of increasing and decreasing the resources according to their needs. ACKNOWLEDGEMENTS This research is partially supported by the projects of the Spanish Ministry of Economy and Competitiveness ARTEMISA (TIN2009-14378-C02-01) and Simon (TIC-8052) of the Andalusian Regional Ministry of Economy, Innovation and Science. REFERENCES Andreetto, P., Andreozzi, S., Avellino, G., Beco, S., Cavallini, A., Cecchi, M., Ciaschini, V., Dorise, A., Giacomini, F., Gianelle, A., et al. (2008). The glite workload management system. In Journal of Physics: Conference Series. IOP Publishing. Armbrust, M., Fox, A., Griffith, R., Joseph, A., Katz, R., Konwinski, A., Lee, G., Patterson, D., Rabkin, A., Stoica, I., et al. (2009). Above the clouds: A berkeley view of cloud computing. Technical report, Technical Report UCB/EECS-2009-28, EECS Department, University of California, Berkeley. Barham, P., Dragovic, B., Fraser, K., Hand, S., Harris, T., Ho, A., Neugebauer, R., Pratt, I., and Warfield, A. (2003). Xen and the art of virtualization. ACM SIGOPS Operating Systems Review, 37(5):164–177. Borthakur, D. (2007). The hadoop distributed file system: Architecture and design. Hadoop Project Website. Lutz, M. and Van, G. (2001). Programming Python: Object-Oriented Scripting. O’Reilly & Associates, Inc., London, 2nd edition. Stuer, G., Vanmechelen, K., and Broeckhove, J. (2007). A commodity market algorithm for pricing substitutable grid resources. Future Generation Computer Systems, 23(5):688–701. ICEIS2012-14thInternationalConferenceonEnterpriseInformationSystems 304
CHAPTER 9 ACTIVITY RECOGNITION SYSTEM USING AMEVA METHOD Overview This article aims to develop a system of care and monitoring where the goal is to get a efficient way that allows to control the physical activity carried out by the user. It is based on the use of discrete variables which employ data from accelerometer sensors using an discretization and classification technique based on the chi2distribution. The system is designed to be deployed and executed on smartphones, so the system energy consumption is taken into account. In this case, the results show that the developed algorithm reduces the computational cost of the system by about 50% compared on neural networks. In other hand, the main problem of this system is the limit to the number of activities that can be recognized because is based on statistical learning. Also, working only with accelerometer sensors limits the number of variables that can be analyzed because they could lead to a strong correlation between them. Page 135
Chapter 9: Activity recognition system using AMEVA method The approach could be tested in a real scenario during the Evaluating AAL Systems Through Competitive Benchmarking (EvAAL) competition in 2012 and it was a great chance to make a real stress test of AMEVA system and it allowed to know other techniques in activity recognition and new perspectives about this field. Context This research was the first collaboration between two different areas in the research group: discretization and activity recognition. It was based on the advantage of Ameva in terms of computation performance and pass it into the activity recognition approaches for smartphones getting a significant reduction of battery draining. Also, it was thought to use it in the EvAAL competition in 2012. This paper is the result of over 1 year’s work and currently is one of the areas under investigation. Research work information Figure 9.1: Evaluating AAL Systems Through Competitive Benchmarking cover. The Evaluating AAL Systems Through Competitive Benchmarking conference aims at establishing benchmarks and evaluation metrics for comparing Ambient Assisted Living solutions. Since 2011 it has organised international competitions on indoor localization and indoor activity recognition. It is indexed in SJR with a Impact Factor of 0.140 (Q4) and H Index of 19 in one category: Computer Science (miscellaneous). DOI: https://doi.org/10.1007/978-3-642- 37419-7_11 Page 136
Activity Recognition System Using AMEVA Method Luis M. Soria Morillo1,LuisGonz´alez-Abril2, Miguel A. ´ Alvarez de la Concepci´on1, and Juan A. Ortega Ram´ırez1 1Computer Languages and Systems Dept., University of Seville, 41012 Seville, Spain {lsoria,malvarez,jortega}@us.es 2Applied Economics I Dept., University of Seville, 41018 Seville, Spain [email protected] Abstract. This article aims to develop a minimally intrusive system of care and monitoring. Furthermore, the goal is to get a cheap, comfortable and, especially, efficient system which controls the physical activity carried out by the user. For this purpose an innovative approach to physical activity recognition is presented, based on the use of discrete variables which employ data from accelerometer sensors. To this end, an innovative discretization and classification technique to make the recognition process in an efficient way and at low energy cost, is presented in this workbasedontheχ2distribution. Entire process is executed on the smartphone, by means of taking the system energy consumption into account, thereby increasing the battery lifetime and minimizing the device recharging frequency. 1 Introduction Just 30 minutes of moderate activity five days a week, can improve your health according to the Centers for Disease Control and Prevention. By enabling activity monitoring on an individual scale, over an extended period of time in a ubiquitous way, physical and psychological health and fitness can be improved. Studies performed by certain health institutes initiative [7,3,10,6] have shown significant associations between physical activity and reduced risk of incident coronary heart disease and coronary events. Their results can be seen in Figure 1, where the inverse correlation between the risk of cardiovascular incidents and physical activity level is shown through the comparison of four separate studies. In recent years, thanks largely to the increased interest in monitoring certain sectors of the population such those of as elderly people with dementia and of people in rehabilitation, activity recognition systems have increased in both number and quality. Furthermore, communication between relatives, friends and professionals can be improved by means of graphs of weekly activity (high relevant for sportsmen and for the relatives of elderly people) whereby the doctor can be automatically alerted if any strange activity is detected. By using data acquired from accelerometer, NFC, or even microphone sensors and applying S. Chessa and S. Knauth (Eds.): EvAAL 2012, CCIS 362, pp. 137–147, 2013. c Springer-Verlag Berlin Heidelberg 2013
144 L.M. Soria Morillo et al. 0,50 0,70 0,90 1,10 1,30 1 9 17 25 33 41 49 57 65 73 81 89 97 Processing time (sec) Time window Ameva Neural network Fig. 5. Processing time of the Ameva and neural network methods on the device 0 10 20 30 40 50 60 70 80 90 100 5 75 145 215 285 355 425 495 565 635 705 775 845 915 985 1055 1125 1195 1265 1335 1405 1475 1545 1615 1685 1755 Batteryreamaining Minutes RNA Decisiontree AMEVA Fig. 6. Battery life for Ameva compared to neural network and decision tree methods Based on Accuracy, Recall, Specificity, Precision, and F measure, Table 1 is presented. In this table, differences between the two methods, RNA and Ameva can be observed. Most values presented for each measure and activity show that the Ameva method performs better than RNA, especially as regards precision. That is to say, the number of false positive in the Ameva method is lower than that using the RNA method. Immobile and Drive are controversial activities due to their similar characteristics. Even under observation, it is difficult to differentiate between these two activities. For this reason and due to temporal nature of the Immobile activity, results from these two activities present a high level of disturbance in contrast to other activities.
Activity Recognition System Using AMEVA Method 145 Table 1. Performance comparison by using measures of evaluation Activity Accuracy Recall Specificity Precision F-measure (F1) Ameva RNA Ameva RNA Ameva RNA Ameva RNA Ameva RNA Walk 98.77% 97.93% 97.92% 93.95% 98.91% 98.57% 93.50% 91.36% 95.66% 92.64% Jump 99.35% 98.87% 97.03% 96.44% 99.70% 99.25% 98.00% 95.12% 97.51% 95.77% Immobile 98.69% 99.50% 94.57% 97.37% 99.42% 99.88% 96.60% 99.29% 95.58% 98.32% Run 99.27% 98.35% 97.61% 92.62% 99.49% 99.14% 96.36% 93.64% 96.98% 93.13% Up 98.93% 98.17% 95.40% 90.79% 99.43% 99.22% 96.00% 94.35% 95.70% 92.54% Down 98.64% 98.25% 95.20% 92.68% 99.04% 98.89% 91.95% 90.62% 93.55% 91.64% Cycle 99.32% 99.03% 96.13% 95.67% 99.73% 99.47% 97.91% 95.89% 97.01% 95.78% Drive 98.14% 98.74% 90.02% 95.01% 99.20% 99.23% 93.63% 94.16% 91.79% 94.58% 5 Conclusions and Future Work In this work, a highly successful recognition system based on discrete variables is presented, which uses the Ameva discretization algorithm and a new Amevabased classification system. It has therefore been possible to achieve an average accuracy of 98% for the recognition of 8 types of activities. Furthermore, working with discrete variables has significantly reduced the computational cost associated to data processing during the recognition process. By using this process to increase recognition frequency, it has been possible to obtain a physical activity reading every 5 seconds and to enter these readings into the user activity log. However, the main problem of this system based on statistical learning is the limit to the number of activities that can be recognized. Working only with accelerometer sensors implies a limit to the number of system variables and therefore may lead to a strong correlation between these variables. 6 AMEVA Running in EvAAL Competition During the competition, two test sessions were executed. In the first one, the training was performed prior to competition by an external actor not related to evaluation process. The training actor was 31 years old and the entire training process was performed with the smartphone in the hip, attached to the user’s belt. In the competition, the actor was in a similar age range and thus, the way in that physical activity was executed was very similar. In other case, the system should be retrained for a better accuracy. Once finished the first evaluation session, intermediate data was analyzed. From this analysis, it was concluded that some activities was not well-recognized such as bending or cycling. This was a substantial impact in the accuracy due to cycling session was long. The accuracy for the other activities was promising but we detect that something was wrong for cycling detection. By using discrete techniques to perform the activity recognition, cycling is a easy activity to be detected because of the acceleration patterns presents an evident component in the advancing direction. Unfortunately, cycling activity was carried out on a stationary bike and thus,
146 L.M. Soria Morillo et al. accelerations presented in movement direction was not detected. For the other controversial activity, bending, the system was not training to detect it because it was a important conflict with sitting activity. Both activities have a very similar acceleration profile and it can not be determine which is the right activity with a proper accurate. In the second test process, the system was retrained in order to achieve a most accurate recognition. Unfortunately, the Internet connection was not good enough to connect with training server placed at the University of Seville. For this reason, dataset from time windows was not properly sent to the server and therefore, the training parameters were wrong. After checking this problem, we decided to go on with the evaluation process to determine the impact of this problem in the accuracy. As it was thought, the second evaluation had a very low accuracy due to that problems. Furthermore, by studying intermediate data after the evaluation, temporal windows was misconfigured and it was set to 3 seconds and thus, some ”fast activities” such as walking or cycling wasn’t well recognized. Finally, EvAAL competition was a great chance to make a real stress test of AMEVA system since It’s not usual in humans to make a long activities set in so quickly and so fast. In this regard, statistical-discrete classification for activity recognition based on AMEVA algorithm was designed to medium-long time activities. Transitions in discrete classification systems are really difficult to detect and, in AMEVA case, was not implemented any change activity detector. In conclusion, EvAAL offered a junction to test many systems and generate new ideas for competitors’ systems. On the other hand, is very good to know other techniques in activity recognition and new perspectives about this field. Acknowledgments. This research is partially supported by the projects of the Spanish Ministry of Economy and Competitiveness ARTEMISA (TIN2009- 14378-C02-01) and Simon (TIC-8052) of the Andalusian Regional Ministry of Economy. References 1. Gonz´alez Abril, L., Cuberos, F.J., Velasco, F., Ortega, J.A.: Ameva: An autonomous discretization algorithm. Expert Syst. Appl. 36(3), 5327–5332 (2009) 2. Altun, K., Barshan, B., Tun¸cel, O.: Comparative study on classifying human activities with miniature inertial and magnetic sensors. Pattern Recogn. 43(10), 3605– 3620 (2010) 3. Ellekjaer, Holmen, Vatten: Physical activity and stroke mortality in women. Stroke 31(1), 14–18 (2000) 4. He, Z., Jin, L.: Activity recognition from acceleration data based on discrete consine transform and SVM. In: 2009 IEEE International Conference on Systems, Man and Cybernetics, pp. 5041–5044. IEEE (October 2009) 5. Khan, A.M., Lee, Y.-K., Lee, S., Kim, T.-S.: Accelerometer’s position independent physical activity recognition system for long-term activity monitoring in the elderly. Medical & Biological Engineering & Computing 48(12), 1271–1279 (2010) 6. Lee, I.-M., Rexrode, K.M., Cook, N.R.: Physical activity and coronary heart disease in women. JAMA 285(11), 1447–1454 (2001)
Activity Recognition System Using AMEVA Method 147 7. Manson, J.E., Greenland, P., LaCroix, A.Z., Stefanick, M.L., Mouton, C.P., Oberman, A., Perri, M.G., Sheps, D.S., Pettinger, M.B., Siscovick, D.S.: Walking compared with vigorous exercise for the prevention of cardiovascular events in women. The New England Journal of Medicine 347(10), 716–725 (2002) 8. Paiyarom, S., Tungamchit, P., Keinprasit, R., Kayasith, P.: Activity monitoring system using Dynamic Time Warping for the elderly and disabled people, pp. 1–4. IEEE (2009) 9. Ravi, N., Nikhil, D., Mysore, P., Littman, M.L.: Activity recognition from accelerometer data. In: Proceedings of the Seventeenth Conference on Innovative Applications of Artificial Intelligence(IAAI), pp. 1541–1546 (2005) 10. Sattelmair, J.R., Kurth, T., Buring, J.E., Lee, I.-M.: Physical Activity and Risk of Stroke in Women. Stroke 41(6), 1243–1250 (2010)
CHAPTER 10 AN ADAPTIVE METHODOLOGY TO DISCRETIZE AND SELECT FEATURES Overview This paper designs an efficient and low computational way of finding independent features for getting the best accuracy on classification problem where an automatic method to select the best features is proposed. The methodology uses and extends the functionality of Ameva coefficient and allows to use it in other tasks of machine learning where it has not been defined. One of the most important problems in classification processes is the selection of features. Usually, the obtained experimental data is not filtered about relevant features in systems and a lot of techniques for feature selection have been developed for this reason. The Ameva discretization algorithm performs the discretization process effectively and quickly, so the set of values of a feature is greatly reduced. Taking this advantage as a premise, it is possible to use this algorithm to determine the relationship between features because Ameva uses the statistic to determine the relationship Page 149
Chapter 10: An adaptive methodology to discretize and select features between features and classes. Thus, a new coefficient has been developed to determine the dependence between features that allows to reduce the number of values of features and the number of features from a qualitative reasoning. This approach can be satisfactorily applied when the data set has a lot of instances and features, and one of these features determines the class which each instance belongs to. Context As a follow-up to the first paper on feature reduction, this research extended the same idea improving the algorithm in terms of personalization and performance. Feature reduction was one of the areas that this PhD candidate continued researching during the stay in Toulouse and this paper was one of the obtained results. This paper had over 5 months’ work and is currently one of the areas under investigation. Research work information Figure 10.1: Artificial Intelligence Research cover. The journal Artificial Intelligence Research is a peer-reviewed, international scientific journal providing a forum for original research, reviews, experience exchange or conference reports related to the fields of Artificial Intelligence and Applications for researchers, programmers, software and hardware manufacturers. DOI: https://doi.org/10.5430/air. v2n2p77 Page 150
www.sciedu.ca/air Artificial Intelligence Research, 2013, Vol. 2, No. 2 Published by Sciedu Press 77 ORIGINAL RESEARCH An adaptive methodology to discretize and select features Miguel Ángel Álvarez de la Concepción1, Luis González Abril2, Luis Miguel Soria Morillo1, Juan Antonio Ortega Ramírez1 1. Computer Languages and Systems Department, University of Seville, Spain. 2. Department of Applied Economics I, University of Seville, Spain Correspondence: Miguel Ángel Álvarez de la Concepción. Address: Computer Languages and Systems Department, University of Seville, Spain. Email: maa[email protected]s. Received: June 20, 2012 Accepted: December 15, 2012 Online Published: February 18, 2013 DOI: 10.5430/air.v2n2p77 URL: http://dx.doi.org/10.5430/air.v2n2p77 Abstract A lot of significant data describing the behavior or/and actions of systems can be collected in several domains. These data define some aspects, called features, that can be clustered in several classes. A qualitative or quantitative value for each feature is stored from measurements or observations. In this paper, the problem of finding independent features for getting the best accuracy on classification problems is considered. Obtaining these features is the main objective of this work, where an automatic method to select features is proposed. The method extends the functionality of Ameva coefficient to use it in other tasks of machine learning where it has not been defined. Key words Ameva, Feature selection, Discretization, Entropy 1 Introduction The problem to obtain the best accuracy, sensitivity, specificity, etc. in classification is one of the main problems in a lot of research areas like analysis and pattern recognition. It requires the construction of a classifier, that is, a function that assigns a class label to instances described by a set of features. One of them is in medical area when a doctor needs to know if a patient has cancer or not through thousands of gen values. In this sense, there are a lot of classifiers in the bibliography that process data sets to get the best results. Also, it is a central problem in machine learning. For example, there are classifiers based on SVM [1], Naive Bayesian [2], C4.5 [3], etc. that have been developed in the last years. One of the most important preprocess in classification is the discretization because it allows algorithms to run very fast. This process establishes a relationship between continuous variables and their discrete transformation through developed functions. Therefore, it is possible to qualitatively model a series of continuous values if a label is assigned to them. Some studies [4] have shown that executing a prior process to discretize continuous features is more efficient than working directly with the continuous values. The discretization process reduces the computation memory usage and time in the application that develops classification algorithms. Also, it is used to manage the values of a feature more easily. As same as classifiers, there are a lot of discretization methods like GUDA-CCC [5], EDISC [6], CD [7] and others [8], [9]. Also, Ameva [10] is the discretization method that it is used in this paper.
www.sciedu.ca/air Artificial Intelligence Research, 2013, Vol. 2, No. 2 ISSN 1927-6974 E-ISSN 1927-6982 78 It has been confirmed as one of the most promising correlation algorithms due to its reduced execution time and the small number of intervals provided. This behavior is outstanding when the data set has a large number of classes, although it has a slight reduction in the capacity of identification [11]. The other important problem in the classification process is the selection of features [12]. Usually, the obtained experimental data is not filtered about relevant features in systems. A lot of techniques for feature selection [13]-[15] have been developed. Some of these techniques are based on SVM [16] or Naïve Bayes [17]. The Ameva discretization algorithm [10] performs the discretization process effectively and quickly, so the set of values of a feature is greatly reduced. Because Ameva uses the statistic to determine the relationship between features and classes, it is possible to use this algorithm to determine the relationship between features. In this paper, a methodology based on Ameva is developed in order to select the main features of a data set. This method exploits the advantages of Ameva in runtime and brings a different approach which was developed on. The rest of this paper is organized as follows: first, the definition of the problem is presented in Section 2. Also, the Ameva discretization algorithm and the entropy coefficient are presented. Section 3 presents the methodology to determine the best feature selection using the Ameva and the entropy coefficients. Section 4 reports the obtained results of applying the methodology in an example. The paper is finally concluded with a summary of the most important points. 2 Discretization Let ,,…, be a data set of a continuous attribute of mixed-mode data such that each example belongs to only one of ℓ classes of the variable denoted by ,,…,ℓ,ℓ2 A continuous attribute discretization is a function :⟶ which assigns a class ∈ to each value ∈ in the domain of the property that is being discretized. Let us consider a discretization which discretizes into intervals: ; ;,,… where is the interval , and is the interval ,,2,3,…,. Thus, a discretization variable is defined as ;; which verifies that, for all ∈, a unique exists such that ∈ for 1,2,…, and 1,2,…,. The discretization variable of attribute and the class variable are treated from a descriptive point of view. Having two discrete attributes, a two dimensional frequency table (called contingency table) as show in the Table 1 can be built. In Table 1, denotes the total number of continuous values belonging to the class that are within the interval . ⋅ is the total number of instances belonging to the class , and ⋅ is the total number of instances that belong to the interval , for 1,2,…,ℓ and 1,2,…,. So that: ⋅ ,⋅ ℓ , ℓ (1)
www.sciedu.ca/air Artificial Intelligence Research, 2013, Vol. 2, No. 2 Published by Sciedu Press 79 Table 1. Contingency table | ⋯ ⋯ ⋅ ⋯ ⋯ ⋅ ⋮ ⋮ ⋱ ⋮ ⋱ ⋮ ⋮ ⋯ ⋯ ⋅ ⋮ ⋮ ⋱ ⋮ ⋱ ⋮ ⋮ ℓ ℓ ⋯ ℓ ⋯ ℓ ℓ⋅ ⋅ ⋅ ⋯ ⋅ ⋯ ⋅ 2.1 The Ameva discretization Given Table 1, a discretization criterion based on the Contingency Coefficient () is defined which measures the independency between class variable and discretization variable . It is well known in Statistics that two given discrete attributes and are (statistically) independent if, for all and , ∙∙ ,1,…,ℓ, 1,…, that is, no association exists between the two attributes. Therefore, one way to measure the association (or independency) between class variable and discretization variable is to analyse the value ∙∙ ℓ Nevertheless, it is better to consider a relative measure denoted by ≝,|: ∙∙ ∙∙ ℓ By using (1), it is not difficult to prove that: 1 ⋅⋅ ℓ (2) and max , , minℓ,1 (3) In order to compare this coefficient against several discretization variables for 2, the Ameva coefficient, ≝,|, is defined as follows: