Designing a Smart Mobile Health System for Ecological Frailty Assessment in Elderly

: The increasing adoption of mobile computing technology in the health and social domains offers new possibilities, for instance, promoting active aging. Health deterioration in elderly people could be successfully assessed by monitoring activities of daily living (ADLs) through mobile technology. In particular, frailty affects several dimensions (physical, psychological, and social) of human functioning, which are required to perform instrumental ADLs (IADLs). Starting from the definition of a model, this paper proposes the design of an intelligent mobile health system to assess frailty in an ecological way: to automatize the frailty assessment through wearable sensors, unobtrusively in free-living environments, and using machine learning in order to reduce the traditional efforts of clinicians assessing frailty. It supports automatic data collection from sensors and artificial intelligence analysis during the performance of real IADLs by elderly. The proposed system uses mobile/wearable devices, follows a microservices software architecture, and implements machine learning algorithms. A technical validation of the proposal is shown.


Introduction
Great efforts focus on promoting active ageing, including prevention of frailty, a condition that makes the body prone to diseases [1].The frailty syndrome is defined as "a state of increased vulnerability of the deficit resolution of homeostasis after a stressful event as a result of the accumulation of agerelated problems in the physiological systems" [2].It affects approximately 11% of older adults living in the community, and around 30-70% of surgical patients of advanced age [3].This is a health and social problem with adverse health-related outcomes (increase of complications, falls, and even death) [4].
The classical and most accepted clinical approach to diagnose the physical dimension of frailty is the validated model of Fried, which assesses five core criteria: low energy, involuntary weight loss, slowness in mobility, muscle weakness, and low physical activity.According to Fried et al. [4], older people are considered: "fragile" if they meet 3 or more frailty criteria of the above; "pre-fragile" if they meet one or 2 criteria; and "non-fragile" if they do not verify any.However, the most consensual and updated definition by Gobbens et al. [5] shows that frailty also needs to be understood from the functional, psychological, and social viewpoints.
Concerning the current literature, from an ecological perspective, the consequences or even causes of frailty can be observed when elderly people reduce their performance level in the activities of daily living (ADLs) [6], which involve complex cognitive and motor skills (executive functions) such as house cleaning, small shopping tasks, and use of a telephone and mean of transports.The ADLs are all activities performed by the human being, belonging to the areas of occupation.These activities can be classified into three main groups: (1) personal or basic activities of daily living (BADLs) include all activities essential for survival, such as selfcare activities, functional mobility, sexual activity, toilet hygiene, and the care of personal devices; (2) instrumental activities of daily living (IADLs) include activities such as driving, house cleaning, small shopping tasks, using a telephone, and means of transport, which involve complex cognitive and motor skills since they need adequate levels of higher cognitive aspects (executive functions), and higher levels of social and environmental interactions than BADLs; and (3) advanced activities of daily living (AADLs) include employment, traveling, hobbies, and participation in social and religious events.These are the most complex ADLs that usually involve voluntary physical and social functions, although AADLs are not essential to maintain independence.
On the other hand, new paradigms are needed to better explain the related factors of frailty in a more ecological manner.An ecological approach could enhance new political, clinical, and research strategies that promote higher levels of quality of life of elderly people from different populations.The elder frailty assessment could get clear benefits by taking into account all the information collected from the clinical setting by the health professionals, and from the real environment of the individual in an ecological way, without disturbing the users' life.
Information and Communications Technologies (ICT) are contributing to develop many domainspecific intelligence systems [7].In the health and social domain, new advances in ICT such as mobile computing technology, context-aware systems, Internet and wireless communications, cloud computing, service-oriented architectures (SOA), and data science, are successfully applied [8].Mobile/wearable devices can be used as a low-cost complement to medical measuring instruments, getting measures while patients are performing ADLs.For example, they can provide location and measurements of psychophysiological signals with precision and efficiency [9].The mobile technology has huge potential to detect frailty everywhere, including outdoors.The mobile/wearable platforms/devices with built-in sensors most used to retrieve frailty indicators are [10][11][12][13][14][15]: electronic stickers, bands, bracelets, and smartphones/smartwatches.
Architecture-based approaches in computer-based health systems are proved to be a viable solution to guarantee relevant quality properties such as interoperability, integration, mobility, selfadaptation, and fault-tolerance [16][17][18][19][20]. Microservices are also a promising architectural software design pattern to go a step further in extensibility, reuse, and evolution by taking into consideration specific characteristics of the Internet of Things (IoT) paradigm [21].Microservices allow to integrate machine learning algorithms to infer useful insights from the raw data collected from sensing devices.This paper proposes the design of a smart mobile health system to assess frailty in an ecological manner: to automatize the frailty assessment through wearable sensors, unobtrusively for the users and in their free-living environments, and using machine learning in order to reduce the traditional efforts of clinicians assessing frailty.Starting from the definition of a model, the system supports data collection and analysis while elderly perform a real IADL.The proposal uses sensing mobile/wearable devices, follows a microservices oriented software architecture, and implements Machine Learning algorithms.
The paper is organized as follows.Section 2 defines the model for the frailty assessment by selecting variables according to general and specific requirements related to the performance of an IADL ("do shopping").Section 3 introduces the design of the technological system for the automatic data collection from built-in sensors in mobile/wearable devices.Section 4 describes the technical validation of the system accomplished by an experiment and a follow up questionnaire to elderly and experts in terms of acceptance, usability, and feasibility of the proposal.The last section summarizes conclusions and future work.

General and Specific Requirements
The approach aims to assess frailty in an ecological way, as in previous studies [14,22].However, traditional assessment of frailty ignores the relationships between frailty and the performance level in the activities of daily living.New paradigms can explain the related factors of frailty in an ecological manner and assess it while the elderly are performing their activities.An ecological approach could enhance political, clinical, and research strategies promoting higher levels of quality of life of elderly from different populations.To this end, the consequences or even the causes of frailty could be observed when elderly reduce their performance level in the IADLs [22].The elderly frailty assessment could take into account not only information collected by professionals, but also from the real environment of the elderly when accomplishing IADLs (i.e., ecologically).
The IADL proposed in this paper for assessing frailty is "do shopping".This activity allows the ecological assessment of three dimensions of frailty (physical, psychological, and social) by getting some relevant indicators.In the case of physical dimension, we can measure for example the number of steps, time spent in walking, heart rate, etc.Some indicators of the psychological dimension, such as stress or disorientation, could be also derived from the heart rate and GPS for the path followed to reach the shop.The social dimension could be measured, analyzing whether the elderly usually shop by themselves or accompanied and observing their emotional changes.
The main steps for the frailty assessment are: (1) to collect the demographics variables and frailty status labeling (pre-frail, frail, non-frail) using Fried phenotype [4]; (2) to gather data from the sensing devices (smartphone and smartwatch); and (3) to analyze of the collected data by using machine learning algorithms.

Model Definition
According to the previous requirements, we define the model for frailty assessment as a combination of sociodemographic and mobile/wearable sensors variables (Table 1).
Several sensor variables are identified and categorized in two groups: triaxial and non-triaxial.The former refers to accelerometer, gyroscope, linear acceleration, and gravity sensors, and the latter refer to heart rate, step counter, and light sensors.The sensor variables have been proposed by following statistical measures such as arithmetic mean, median, standard deviation, minimum and maximum values, and correlation, discretizing the collected data.For triaxial sensors, these statistical measures are calculated by each axis.In addition, we include a magnitude variable, which is defined as x + y + z , where x, y, and z are the three axes of the sensor, and an amplitude variable, which is defined per each axis as |(c) − min (c)|, where c is the corresponding axis.

System Design
A system based on mobile/wearable platforms and microservices has been designed.It follows the IoT paradigm as introduced in [21]: "IoT system is constructed of fine-grained and self-contained microservices which are independently developed and deployed".

General Description
A microservice is responsible of a single task (i.e., with minimum level of responsibility) thus enabling its update independently of the rest of microservices and ensuring the maximum decoupling and extensibility.There are two types of microservices [23]: Functional microservices (FM) and Infrastructure microservices (IM).FM are in charge of supporting business functions and operations, can be shared and accessed externally via an API layer.IM are responsible of lower level tasks such as monitoring, information communication and microservices interaction.They provide a local context and are not exposed to the outside client requests (e.g., due to security issues).
The API gateway is the interface to aggregate microservices.It can distribute information to external clients (applications and other microservices) through communication endpoints.The clients can also be deployed everywhere (mobile/wearable devices, cloud, and desktop).External software applications and microservices can act as clients by sending requests.
The microservices architecture maximizes autonomy and decoupling [24].Service choreography is usually preferred to orchestration, which needs a central mediator to coordinate multiple services.Usually, microservices architecture lacks a middleware component for the orchestration, therefore it cannot support solutions based on the use of an Enterprise Bus Services (EBS) present in the SOA pattern [23].If orchestration is required, an alternative is the publish/subscribe pattern, where some microservices publish events asynchronously, and other microservices subscribe to these events and react [24].

Architecture for Frailty Assesment
The purpose of the software architecture for frailty assessment is to provide support to the defined model.In particular, we seek to collect and analyze data from built-in sensors from mobile/wearables devices on the basis of a software architecture with applications and microservices to be deployed in the mobile devices (smartphones/smartwatches) and cloud servers.The architecture is shown in Figure 1 and described as follows.

Mobile/Wearable Functional Microservices
Functional microservices in the wearable are related to sensors, such as Accelerometer, Gyroscope, etc.They require interacting, by means of an API Gateway, with other microservices deployed in the mobile/wearable devices and cloud server.Clients (applications and other functional services) deployed in the smartphone request to collect and analyze data in the cloud.

Infrastructure Microservices
Infrastructure microservices could be used in different health domains.The following infrastructure microservices are deployed in the cloud: (1) the Microservice Discovery is used by microservices to discover other functional microservices; (2) the Device Discovery is used by devices to discover nearby devices; and (3) the Pub/Sub enables communication of events between microservices in an event-driven manner (i.e., as an alternative to orchestration services), thus maximizing decoupling.

Microservices and Apps in the Smartphone
The Frailty Risk App is subscribed to the publication of frailty risk published by the Classifier microservice deployed in the cloud server.In the training phase, the Data Receiver microservice provides in real time data collected from the sensors in order to build the model (Table 1).In the classification phase, the Classifier microservice provides a frailty classification based on the model for risk frailty assessment.As an ongoing extension, the social and psychological dimensions of frailty could be addressed by new functional microservices.The People Proximity App can provide a list of identified people around the elderly.The Orientation Help App shows the participant the route based on the information provided by the GPS.In addition, other environmental-oriented microservices (e.g., Ambient Noise), could contribute to assess frailty in a holistic way.

Machine Learning Functional Microservices
The system includes functional microservices to provide advanced data analysis to assist the experts on frailty assessment (clinical decision making) by following a data-driven processing approach.In particular, we implement supervised learning methods [19].The Machine Learning microservices work in choreography.They are started by an API request from the Frailty Risk App to the Data Receiver microservice, which is in charge of receiving and parsing raw data collected from sensors.The resulting dataset is a matrix where the rows represent participants, and columns represent variables in the model defined in Table 1.This matrix is the input of the Train/Test Splitter microservice, which divides stratified partitions for training and testing the model.The Feature Selector microservice performs a feature selection method to obtain the most relevant variables.The Model Selector microservice uses different Machine Learning algorithms such as kNN, SVM, Random Forest, etc.Each algorithm is implemented by a microservice, which tunes their parameters and evaluates the resulting model with the 5-fold stratified cross validation technique, thus obtaining the best performance model.The Classifier microservice requests to the Model Selector microservice the learned model.Finally, the Classifier microservice performs the classification ("pre-frail", "frail", or "non-frail") to be sent to the Frailty Risk microservice.

Frailty Risk Notification Example
Figure 2 shows in detail some specific microservices in enacting for the frailty risk notification.Firstly, the Frailty Risk App deployed in a smartphone requests to start the data collection to all the functional microservices in the smartwatch.For the sake of simplicity, only the accelerometer and the heart rate microservices are shown.The request publication is issued to the cloud Gateway API, which is based on Topics 1 (movement/accelerometer) and 2 (vitalsignals/heartrate).The API could also be a REST API or a gRPC.Then, Frailty Risk App starts the Ambient Noise microservice deployed in the same device (smartphone) with a simple request.Afterwards, the sensors start to publish their own collected data to the API Gateway deployed in a cloud server on the basis of Topics 1, 2, and 3 (ambient/noise).The Data Receiver microservice (deployed in the cloud) is subscribed to all of these topics related with the sensor microservices.Thus, when these microservices publish the data that they are collecting, the API Gateway sends these data to Data Receiver microservice.Later on, the Data Receiver sends these data to the Classifier microservice with a request.This microservice requests the best model trained by the Model Selector microservice.The Classifier microservice receives the model by sending another request, thus enabling the frailty risk prediction.The result is published through the Topic 4 (prediction/frailtyrisk), to which the Frailty Risk App is subscribed for notifying the real risk of frailty.

Technical Validation
A pilot study has been carried out for the technical validation of the system prototype by endusers, i.e., experts and elderly.The participants were five adults from community centers in Granada (Spain); three women (1 frail and 2 non-frail) and two men (1 frail and 1 non-frail).The arithmetic means were: 84 years old; none/primary educational level; and 2 children.The inclusion criteria were to be aged 65 years and older; without cognitive impairment, measured through the Mini-mental State Examination (i.e., the scale to evaluate the cognitive state of the person [25]) with a result lower than 16.The participant frailty status was assessed by using the Fried phenotype [4].
All the participants performed the IADL "do shopping" following the next protocol.Participants start sitting on a chair without armrests, with €1 in their pockets and wearing the smartwatch in the non-dominant hand.A therapist, who is in charge of the activity supervision, pushes the start button in the smartwatch to start capturing data.Then, participants stand up and walk for 50 m to the store.At the entrance of the store, the therapist indicates to the participants where the soft drinks aisle is.Participants collect a 300 mL water bottle and pay it (receiving change back).Finally, participants go back to the starting point, sit down on the chair, and the therapist pushes the stop button.
To collect physiological data while performing this activity, we developed a software app deployed in a sensing Samsung Gear S3 smartwatch.An offline R script was used to extract all of the variables from the defined model (Table 1).This allows us to validate the system-provided frailty with the Fried-based status.
We used the preliminary exploratory data analysis (EDA) with the designed systems.The EDA reported that heart rate data could be a relevant feature to distinguish between frail and non-frail individuals (Figure 3), because they have distinct values.In frail individuals, the values are between 50 and 100, and in non-frail individuals, the values are between 80 and 100.In addition, mean values were less than 88 in frail individuals, and greater than this in non-frail individuals.This sample is not representative, but the system is technically ready to assess frailty in a larger sample and consider more variables from the sensors and test.
What we could validate with this pilot was the usability, acceptance, and viability of the technological solution.Elderly were informally assessed in a "real-world" setting while performing the "do shopping" IADL as in [26].The therapist observed the users while they were participating in the IADL, and interviewed them about this experience, asking whether the wearable affected their comfort and mobility.The main findings are in line with those of Ehmen et al. [27], the system: (1) can be used by people with low cognitive or low sensorimotor abilities; (2) requires little time of use (in our case just to press one bottom); (3) does not require any technological competence; and (4) does not require extra personnel to train the users or to use the system.All the participants reported that the system was simple to handle and could be used in an independent way, although a brief initial lesson is required to know how to use the basic functions on the smartwatch (start and stop).Participants also reported it is easy to learn and wear, and the collected data is secured.All of these attributes are the most frequently used to evaluate usability.

Conclusions and Future Work
Currently, most of the approaches to address frailty assessment are experimental studies that use the traditional methods (i.e., manual questionnaires).New instruments should be used to assess frailty and its related factors.To the best of our knowledge, there is no proposal to make the assessment in an ecological way.
Since the prevention of frailty is important to guarantee active ageing, we have proposed the design of a smart mobile health system to assess frailty status and to predict it in the future.The system automatically collects data in an ecological way supporting a defined variable-based model and analyzes the data using a Machine Learning technique.This system is designed to support the ecological frailty assessment through the IADLs performed by elderly in a reliable and non-intrusive way, thanks to the use of mobile computing technologies.It could be easily extended to manage future data sources and functionalities with additional capabilities by using other mobile/wearable devices and the microservices-oriented design approach.By following the ecological approach, a holistic frailty assessment is feasible by collecting data from more sensors, thus addressing other elder ageing decline situations (e.g., Alzheimer).
The frailty assessment of the proposal has been carried out by a bigger group of end users (experts and elderly) for technical validation purposes in terms of acceptance, usability, and viability of the implemented prototype, with some interesting results.The proposed system could help professionals to assess, and to perform personalized interventions in the form of IADLs to decelerate or even improve the frailty status.Elderly could receive suggestions to improve their status, based on notifications, in an adapted and personalized way and under professional supervision, according to his or her real frailty status.
Current work is focused on the development of a formal study accomplished in a holistic way, with about 100 participants.It will allow us to collect enough data to perform a statistical analysis and artificial intelligent analysis.The system will also allow health professionals to design personalized and adapted intervention programs.The aim will be to provide a personalized healthcare system to assists elderly in promoting active ageing and independence.In addition, we need to address other features such as data protection and security, and additional technological restrictions (such as battery consumption and network disconnections).
Accelerometer, Gyroscope, Linear acceleration and Gravity sensors Amplitude Heart rate, Step Counter, Light sensors, Accelerometer, Gyroscope, Linear acceleration and Gravity sensors