Full text
Mobile activity recognition and fall detection system for elderly people using Ameva algorithm Miguel Ángel Álvarez de la Concepción , Luis Miguel Soria Morillo , Juan Antonio Álvarez García , Luis González-Abril Keywords: Activity recognition Artificial intelligent Cognitive computing Contextual information Mobile environment Smart-energy computing a b s t r a c t 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. 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
incidence of this kind of events are a social need. The automatic and unobtrusive identification of user’s activities, including falls, is one of the challenging goals of context-aware computing [8,9] and it is a fast-growing field in ubiquitous computing domain. Indeed, it is expected that activity recognition systems will be a practical solution to monitor elderly people in the coming years. Although there are many mobile activity recognition systems, most of them lack battery draining [10], and in thelastfewyears,developershavefocusedtheireffortstotacklethisproblem.Liang[11] used a low sampling frequency with a hierarchical scheme methodology in order to improve the battery consumption. Weng [12] described a similar approach but the hierarchical support vector machine is supported by an additional strategy that reduces the sensor data sampling rates. This addition allowed the authors to reduce the computational complexity. On the other hand, Rault [13] proposed a new decision metric in order to evaluate these systems. It takes into account latency, accuracy, and energy consumption requirements in order to select the best execution configuration. As an addition, some of the developed systems include automatic customization of the mobile device’s behavior. For example, Kozina’s system [14] sends calls directly to voicemail if a user is jogging and generates a daily/weekly activity profile to determine if a user is performing a healthy amount of exercise. Lu [15] implemented two simple proof-of-concept applications using a continuous sensing engine, JigMe, that automatically records a user’s daily diary and, GreenSaw, that gives users awareness of their daily calorie expenditure and carbon footprint. These add-ons increase the value of the research and evidence that they could be used out of the laboratory by common users. In this paper, we present a low-consuming battery system using the core of the Ameva algorithm [16] validated in the activity recognition track of EvAAL competition1in the editions of 2012 and 2013. The proposed system supports the inclusion of new activities once the training stage is completed, a feature that makes the system feasible for rehabilitation exercises recommended to elderly people by physicians. Furthermore, these new activities are automatically detected, inviting the user to perform a more exhaustive training on them if necessary. This last feature is especially interesting for unsupervised systems where users are free to perform any kind of activity, and not only for the elderly, whose set of activities tend to be more limited. The remainder of this paper is structured as follows. Section 2presents a review of activity recognition systems targeting elderly people. Section 3introduces the EvAAL Activity Recognition competition and the results of our system. Section 4 presents the AMEVA recognition system and its evolution. A comparative analysis is described in Section 5. Finally, Section 6 concludes the paper and discusses future extensions. 2. Activity recognition systems for elders Activity recognition systems (AR systems) have experienced an increase in both number and quality, mainly due to the growing interest in monitoring elderly people with dementia or people in rehabilitation. AR systems are classified into two categories: external sensor-based and wearable sensor-based. In external sensor-based systems, the devices are fixed in predetermined places. In wearable sensor based systems, the devices are attached to the user. Smart-home projects [17–19] include all kinds of sensors (temperature, smoke, humidity, presence, light and bed presence, NFC or RFID labels, etc.) but these systems have a pervasiveness issue: the only place where the activity is recognized is in the user’s home or where the sensors are located. Another kind of research venue focuses on the usage of cameras for the recognition of gestures [20–22]. This is especially suitable for security (e.g. intrusion detection), but privacy issues [23] make this option unfeasible to recognize ADL. On the other hand, these systems can only be used in controlled environments. Robots are another kind of external sensor [24,25] that can assist the elderly, but the cost of deployment and maintenance of these systems is currently a big disadvantage. Furthermore, this kind of system presents a common drawback: people are not always monitored and hence some activities and events like falls could be unnoticed. Wearable sensors are the preferred option for the latest generation of AR systems. Most solutions in this area employ various sensors placed in the body. Accelerometers are the most suitable option to detect movement, but accuracy improves when gyroscopes, magnetometers, and barometers are included in the system [26,27]. Smartphones, which embed all these sensors, can be considered a type of wearable due to their pervasiveness. Furthermore, the low adoption barrier on healthcare applications [28] through application markets such as Google Play or AppStore makes them the best option to target the mass market. Some of them are focused on fall detection [29,30], but normally do not cover both ADL and falls [31], so a classification system must be designed to consider them. In general, the most important problem with classification models is that a good training process is needed to get the best results. Therefore, in AR systems, 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 AR systems. Abdallah [32] developed a framework that incorporates incremental and active learning for real-time recognition and adaptation in streaming settings. However, the majority of existing solutions detect only a few activities. A major step forward would be the possibility for the system to recognize additional activities after the initial training [33,34]. All common learning processes have a test phase that normally is carried out in a laboratory setting. In AR, 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 as it is described in Section 3. 1Available from: http://evaal.aaloa.org.
5 Fig. 1. Map from CIAmI Living Lab and pictures of garden and living room. 3. EvAAL activity recognition competition The competition EvAAL (Evaluation of Ambient Assisted Living Systems through Competitive Benchmarking) was created with the idea of comparing and validating AAL solutions and platforms. It is an annual international contest that helps to measure the state of the art of AAL solutions by assessing the participants, level of autonomy, independent living, and quality of life they deliver to elders. The developed algorithm was presented in the Activity Recognition track, which has as main objective the measurement of hardware and software performance through the established set of benchmarks and evaluation metrics. In order to participate in the AR track, the system must be capable of detecting the following activities: lie, sit, stand, walk, bend, fall (any kind of fall) and cycle (using a stationary bike). There is no limitation to the number of devices that can be used and competing solutions can be based on a variety of sensors and technologies. The two editions of the track took place at the CIAmI Living Lab [35] in Valencia (Spain). Fig. 1 shows the CIAmI Living Lab. 3.1. Benchmark description Once the participant team installs the solution, an actor (an evaluation committee member) performs a predefined physical activity trip across the smart home wearing an elderly simulation kit (Fig. 2). Álvarez-García [36] explains the complete process. 3.2. Evaluation criteria The evaluation of the competing systems is carried out using five-evaluation criteria: •Accuracy. Represents the confidence of the system under evaluation recognizing the activities performed by the actor. Accuracy is computed from the recognized activity instances using F-measure. 2∗precision∗recall precision+recall . •User acceptance. Expresses how much the system is invasive in the user’s daily life and hence the perceived impact. This parameter is estimated with a questionnaire that considers aspects of usability like the invasiveness, visibility of the installation within the environment and the complexity of maintenance procedures. •Recognition delay. Measures the elapsed time between the instant when the user begins an activity and the time the system recognizes it. •Installation complexity. It measures the effort required to install the recognition system in a home. It is measured as a function of the person-minutes of work needed to complete the installation. •Interoperability. Measures how easy is to integrate the system with other systems. Interoperability is measured with a questionnaire that takes into account aspects like the availability of APIs and documentation, the licensing scheme, the presence of testing tools and the portability among different operating systems.
Fig. 2. Elderly simulation kit where elements 7, 8 and 9 were used to simulate the elderly’s movements. Table 1 Best performance results 2012. Team Accuracy Delay Installation User acceptance Interoperability Final score USSa4.33 9.00 10.00 7.47 7.63 7.39 CMUUb7.17 9.00 0.00 7.93 6.15 6.50 CUJc1.44 5.00 0.00 5.60 5.09 3.52 aUniversity of Seville from Spain. bCarnegie Mellon and Utah Universities from USA. cChiba University from Japan. Table 2 Best performance results 2013. Team Accuracy Delay Installation User acceptance Interoperability Final score JSISa6.94 10.00 10.00 8.55 7.20 8.36 CNRIb4.04 10.00 10.00 7.04 6.15 6.94 USS 4.68 9.00 10.00 6.99 5.54 6.89 aJožef Stefan Institute from Slovenia. bConsiglio Nazionale delle Ricerche from Italy. 3.3. Results After peer review, only four competitors participated in the challenge in both editions where University of Seville from Spain and Chiba University from Japan teams repeated with improved versions of their solutions in 2013. Table 1 shows the scores of the top three marked teams on the scale of 0–10 for the 2012 edition and Table 2 the ones for 2013 edition. The winner team of 2012 edition (USS team) [37], composed of three of the authors of this paper, obtained acceptable results in accuracy (it was below that of the CMUU team), but its simplicity (although it uses multiple mathematical methods it only relies on accelerometers) and interoperability allowed it to achieve good marks in all the evaluated criteria. The winner of the 2013 edition (JSIS team) [14,38] obtained very good results in all the evaluated criteria. The poor performance of the USS system in the 2013 edition is related to the lower priority associated to the activity ‘‘bend’’, penalized to give higher importance to ADL and fall. In addition, the Android mobile device was not properly secured on the right hip of the actor and it fell to the ground during the cycling activity penalizing the final result. In order to avoid this problem, which could be present in a daily use of this approach, next generations of the AR system will be installed into smart-watches. These devices allow to run the application and extract information about accelerometry and at the same time, increase the user acceptance and reduce the risk of forgetting. In the next section, the AR system and its improvements will be described.
Fig. 3. Common steps for training and recognition process. Fig. 4. Overall process of data analysis and interval determination. 4. The activity recognition algorithm The initial steps of the activity recognition and fall detection system (from now on activity recognition) are depicted in Fig. 3. These steps are common in training and classification processes, and they are always executed before the recognition stage. Theprocess starts with collectingdatafrom the accelerometer of themobiledevice at an averagefrequencyof25 Hz. Time windows of fixed duration are used to get training data (and later to get recognition data). Each time window is composed of a set of accelerometer readings from which it is possible to calculate a variety of features. After performance and system accuracy analysis, it has been determined in an empirical way that the optimum length for these windows is five seconds. Based on these time windows the module of the signal has been chosen in order to reduce the computational cost of the new solution and solve some problems related to the device’s orientation. Using it, the accelerometer module measures acceleration values in three spatial directions (x,y,z)in the form ai=(axi,ayi,azi). The norm of the vector is computed as follows. |ai| = (axi)2+(ayi)2+(azi)2. Finally, arithmetic mean, minimum, maximum, median, standard deviation, geometric mean and measures from frequency domain are generated. An important feature of the system is that the user can decide what activities must be recognized. This feature is critical for the application of the system to a specific scenario of interest. In our case the classes of the activities we wanted to recognize were immobile, walk, run, fall, drive, walk-upstairs, walk-downstairs and ride a bicycle. Once the activities are defined, the training phase is required in order to recognize them. To get a training set, the user wears the smartphone doing repetitions for each activity to get personal information and training data. The number of examples for each activity must be balanced in order to avoid over training. All the activities are trained by the research team but in order to adapt the system to the user they must be trained again by said user. Fallsconstituteanexceptiontothisprocessandtheirtrainingisperformedviasimulatedfalls.Walking,running,walkingupstairs and downstairs require only 20 s of training. Driving is an activity in which accelerations do not occur at a specific frequency so a small trip of 15 min is necessary to train the system. Finally riding a bicycle can be trained in three minutes. Once the training set is prepared, the statistic process can be carried out using data analysis and interval determination. Fig. 4 shows the steps. The first step of this process is the discretization of each variable in order to reduce the computational cost of the algorithm. This discretization process is based on the Ameva algorithm [16]. The aim of it is to maximize the dependency
Fig. 5. Overall recognition process from data sensors. relationship between the class labels Cand the continuous attribute L(k). Furthermore, the lower the number of discrete intervals k, the faster the classification will be. The application of the algorithm to each statistical value of the system allows obtaining a set of intervals associated with a particular Ctag. Thus, after processing all system statistics, a matrix denoted by Dm{C,L,S}is produced as output. The dimensions of the matrix are in the order: 1. the label C= {C1,C2, . . . , Cl},l≥2 of the activity; 2. the interval L= {L1,L2, . . . , Lk}where Li=(Llow i,Lup i],i=0,1,...,kdefining lower Llow iand upper limit Lup iof the range; 3. the statistics measurement of the data (arithmetic mean, minimum, maximum, etc.). After the data collection X, the probability associated with the statistical data for each activity is computed. In order to carry out this process, a matrix denoted by Cm{x,Li,S}is defined as follows: Cmx,i,s= |x∈X|,x≥Llow i∧x<Lup i∧xC=Cs. It means that each entry of the matrix Cm contains the number of instances x∈Xbelongs to a specific interval of the range of a statistical S. After Cm is computed, the relative probability matrix is carried out. This matrix is denoted by AIm{x,Li,S}and it determines the likelihood that a given value xassociated to an Sstatistic corresponds to a specific Ciactivity. This ratio is based on the quality of the discretization performed by Ameva. The contents of the array AIm are defined as follows AImc,i,s=Cmc,i,s totalc,s ·1 l−1 l j=1,j=c1−Cmj,i,s totalj,s where totalc,sis the total number of time windows of the training process labeled with the cactivity for the Sstatistic. Finally, Fig. 5 shows the overall process described on this section for recognition process from matrix AIm where it is based on a majority voting system. This process starts from the matrix AIm and uses a set of data x∈Xfor each of the statistics belonging to the set S. The process consists of finding an activity mpa ∈Csuch that the likelihood is maximized. The above rule is included in the expression mpa(X)=max s s=1 AImc,i,s|xs∈(Llow i,Lup i].(1) The expression shows that the weight of each statistical metric to the calculation of the probability is equal. This can be carried out under the assumption that all statistics provide the same amount of information to the system, and that there is no correlation between them. Thus, the mpa represents those activities whose data is more fitted to the AIm set values using a majority voting system. The final system with an innovative algorithm is developed and deployed in a smartphone to get the necessary data from the accelerometer and to identify the activity that user is doing. 4.1. Improvements of the system The main advantage of the approach is the reduced battery consumption caused by the usage of discrete variables instead of continuous ones. Also, the dependencies between them are eliminated from the system to get only the information and to reduce the noise. After the 2013 edition when the system achieved third position, several improvements over the original algorithm have been applied. The discretization process performed in the original algorithm needed to evaluate the cuts criterion using an iterative algorithm. Hence, its goal was to find the cut, which minimizes the variance of the class labels belonging to instances of each interval. The application of the algorithm to a multivariate dataset with a high amount of samples caused the time complexity of Ameva to explode and, therefore, the low performances. The optimization introduced allowed significant simplification. The main advantage consists in the need to compute the sample variance of the class label associated with each instance only once. This optimization generates a higher number
Table 3 Comparison between Ameva original and Ameva optimized algorithms. # of Ameva original Ameva optimized Ameva original Ameva optimized statistics time (s) time (s) # of intervals # of intervals 1 0.53 0.13 6 12 5 2.80 0.75 36 63 10 4.31 1.22 60 101 20 7.77 2.56 120 195 50 22.13 6.30 300 555 100 43.08 12.69 600 1097 200 90.13 25.13 1200 2168 400 167.84 50.00 2400 4074 of intervals than the original algorithm. Moreover, the intervals generated by the original algorithm are a subset of those generated by the optimization, which ensures that the results of the classification process are theoretically a superset of the ones carried out by the originals, but in practice are really close to them. In terms of runtime duration, a significant reduction was expected by the application of the improvement described. These expectations were met in the testing process, where execution time was reduced by 70%. Table 3 shows the comparison between both algorithm (Ameva original and Ameva optimized) in terms of execution time and it has obtained from a dataset of 10,299 instances and 561 statistical. 4.2. Definition of the used datasets The gathering data process was carried out with a group of 30 volunteers within an age bracket of 19–48 years wearing a smartphone on the waist and was randomly partitioned into two sets, where 70% of the volunteers were selected for generating the training data and 30% the test data [39]. Also, there were other datasets that were tested in the system: •USC-HAD [40]: the data was collected from a set of human subjects that have a mean of 30.1 years old, 170 cm height and 64.6 kg weight, doing 12 activities. To overcome the limitations of the existing datasets, thus serving as a standard benchmark for researchers in the ubiquitous computing community to compare performance of their human activity recognition algorithms. •WISDM [41]: it contains data from 36 users and six activities. Test data was collected from an extensive variety of Android smartphones (1.3–2.1 version), like the system presented here. •Shoaib [42]: this dataset contains smartphone sensor data for six physical activities collected using four participants. It was useful because the data was collected from four smartphones on four body positions, allowing for comparison to approaches using only one smartphone. Furthermore, the validation of results was not only tested on these datasets by cross-validation, but competition data were used to check their suitability for a real environment with elderly people. 4.3. Learning process Another problem in AR systems is the learning process for new activities. There are some scenarios, such as inexperienced users or elderly people usage, in which training is not performed in an accurate way, so learning process is reduced or nonexisting.The learning process isthus reduced or non-existent.Althoughthere are expert systemsthatdo not requirelearning processes, they suffer from low accuracy and reduced user adaptation. This was the reason why the accuracy values during the competition were lower than those obtained during the validation. On the other hand, the lack of training causes the set of recognized activities to be the same for every user, taking out the customization options of the system. This is the case of most commercial applications such as Moves [43] or Fitbit [44] among others. The presented approach allows not just the training phase, critical for getting an acceptable accuracy and high customization capabilities, but also the recognition of new activities without user supervision. Thanks to the far distance activitiesdetector(thisisthenamegivento the module withintherecognitionsystem), the algorithm isabletoautomatically recognize new activities based on the total score of the current time window obtained by the recognition process. The learning is performed for each particular user, so it is adapted to the way in which the user carries out the activities. For elderly, it is also personalized, but the classification of the accelerometric profile and all statistics generated are fitted to the user. In this stage, the system obtains the probability that a value belongs to each of the recognized activities maximizing the value computed in (1). However, if the value of the mpa is too low, it would be an indicator that the activity is not taken into account when conducting the training. This fact allows the far distance activities detector to generate an alert of new activity detected. The threshold value is set empirically, although experiments had determined that the value, which maximized the accuracy of the system, is equal to the number of statistics divided by four. This entails that, overall, the joint probability that a given time window is classified correctly as the activity is below 25%. Falls are considered a special kind of activity. This characterization is because the training of the system under these circumstances is not possible. Although there are studies that identify these events dynamically [45], the learning process is
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] used five positions usingafour motion sensors smartphonecollecting datainsome statistics in orderto detect sevenphysical activities through atimewindowapproach. The study consistsinwhichare the best placesforthesmartphone 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]usedtwoaccelerometers(righthipandnon-dominantwrist) and a GPS in order to monitor four activities 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
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