:

This paper presents Vesta, a digital health platform composed of a smart home in a box for data collection and a machine learning based analytic system for deriving health indicators using activity recognition, sleep analysis and indoor localization. This system has been deployed in the homes of 40 patients undergoing a heart valve intervention in the United Kingdom (UK) as part of the EurValve project, measuring patients health and well-being before and after their operation. In this work a cohort of 20 patients are analyzed, and 2 patients are analyzed in detail as example case studies. A quantitative evaluation of the platform is provided using patient collected data, as well as a comparison using standardized Patient Reported Outcome Measures (PROMs) which are commonly used in hospitals, and a custom survey. It is shown how the ubiquitous in-home Vesta platform can increase clinical confidence in self-reported patient feedback. Demonstrating its suitability for digital health studies, Vesta provides deeper insight into the health, well-being and recovery of patients within their home.


Introduction
A significant challenge facing society today is how to better utilize technology to improve lives. One such method is the use of sensing technologies and the Internet of Things (IoT) to monitor health and well-being. Ambient Assisted Living (AAL) is vast and recently projects such as SPHERE [1] have been developing solutions for healthcare in the smart home environment. This typically involves the deployment of a myriad of sensors in the home, ranging from video cameras and wearable devices, to presence and energy sensors. Other systems include sensors that also monitor computer activity, medication consumption and vehicle driving [2]. The benefit of these systems to healthcare are clear [3,4]. However, with such systems, installation and cost is non-trivial; scaling such systems to large numbers of people quickly and efficiently remains a challenge [5].
Vesta was developed as part of the EurValve project [6]. One of the objectives of the project is to measure the health, quality of life, and recovery of heart valve intervention patients over different stages of their care. The ideal system would be self-deployable and cost-effective, yet precise in its measurements. Therefore, a smart home in a box was developed with these constraints in mind. The smart home in a box is an easily installable pervasive home health monitoring system that collects sensor data from the environment, but at a fraction of the deployment, sensing and maintenance costs of comparable systems. Ease of installation of the smart home in a box is vitally important for many reasons in the EurValve project. First, during a clinical consultation the smart home in a box will be given to the patient. The patient will then be expected to bring the smart home in a box home and set it up without any further help from their doctor. Secondly, the demographic of the patients is likely one of poor health and non-technical. Once deployed, it is intended that the system will be maintenance free, which is helped by having fewer sensors, lessening the potential for technical problems and failures.
The primary sensor in the smart home in a box is a wrist-worn wearable that contains a tri-axial accelerometer, that connects to four gateways that are placed around the home. Accelerometers measure acceleration along the x, y, and z directions and thus provide insight into the activities of the person wearing the device. Each gateway records Received Signal Strength Indicator (RSSI) values when they receive data from the wearable. This can be used as an estimation of the location of the wearable, and thus the person, in their home [7]. An automatically configured router is also supplied which securely transmits the sensor data to a remote server for analysis. As the smart home in a box is constantly sensing when the patient is at home, a large amount of data will collected. In order for a healthcare professional to make use of this data an analytic platform was developed that uses machine learning to help measure the well-being of the patient. This is achieved via recognizing activities in the data, tracking the patient continuously within their home, as well as measuring the quantity and quality of their sleep. The platform supports many visualizations to help understand the data via health indicators.
As part of the project, 40 patients who are undergoing a heart valve intervention were recruited. For each recruited patient, their levels of activity are measured using this platform in their home environment. In order to gain more quantitative insight into the health of patients undergoing heart valve interventions, this is measured over three stages of their care. The first stage occurs for two weeks pre-operation, the second stage for two weeks soon after the operation, and the final stage 12 to 16 weeks after the operation. Each of the three stages collect around two weeks of data. Throughout this text the stages will be referred to as pre-operation, post-operation and the follow-up period. Thus in total, the aim is to collect six weeks of in-home data for each patient. During these stages the patients are instructed to use the wrist-based wearable as much as possible, except when bathing, when it is suggested they can recharge the device. This results in a huge amount of sensor data collected for each patient over key points of their care. Ethical approval for the study was granted by NHS Research Ethics Committee (REC) under reference 17/LO/0283.
The main contributions of this work are as follows: • An end-to-end platform is proposed for digital health studies which consists of a lower cost, easy to use smart home in a box and a data analytics system for the analysis and visualization of health indicators derived from the data. The platform is designed such that patients are able to deploy the system within 30 min using the simple deployment procedure and immediately commence the data collection.
• The platform is deployed in the homes of patients, monitoring them before and after a heart valve intervention, demonstrating the ability of Vesta to infer relevant health and well-being indicators, and visualize them in a suitable way. This uncovers insight into the recovery of patients that is otherwise not possible using current common clinical measures, such as Patient Reported Outcome Measure (PROM) surveys and routine tests carried out within hospitals, such as the 6 Minute Walk Test.
• An analysis of twenty patients of the intervention is presented, analyzing health indicator trends throughout their intervention, as well as two in-depth patient case studies. The larger cohort analysis demonstrates each patients health indicator trend over each stage of the intervention, exemplifying health indicators such as duration outside, indoor mobility and sleep quality. Further, the individual case studies exemplify two different outcomes for patients and how Vesta captures this.
• The results are externally validated with both standardized surveys, as well as a custom survey, that were completed by the patients. While these surveys are limited by their subjectiveness or non-pervasiveness, they serve as a clinically validated method for assessing outcomes. By using these as the ground truth of patient outcomes, the performance of Vesta is measured, demonstrating the potential of using a pervasive home health monitoring platform to augment current clinical measures.

Related work
There is much research in the literature on IoT sensing technologies in the home [8], activity recognition and health monitoring using wearables [9,10], and indoor localization using RSSI [11], as well as combinations of both [12,13]. Such research is often known as 'Ambient Intelligence' [14], 'Ambient Assisted Living' (AAL) [15] as it concerns building smart environments, typically in the home, that are able to assist people in their daily lives.
An important application of AAL is for healthcare purposes, evidenced by the development of intelligent smart home environments for conditions ranging from Alzheimer's disease [16], dementia [17], diabetes [18], and surgery recovery [19]. Zheng et al. [20] provide a broad overview of different types of sensing and wearable technologies for health informatics, and Amiribesheli et al. [21] provide a review of smart homes in healthcare. Indeed there have been suggestions of using such systems for predictive monitoring [22]. However they are typically studied as isolated problems and not often within the larger context of a single smart home data collection and analytic platform for digital health.
Further, there are relatively few platforms available for digital health in the context of a smart home in a box, or more generally in the realm of lower cost and easily deployed systems for health analytics in the home environment. Abdulrazak and Hela [23] introduced the concept of a smart home in a box in their work which proposes a low-expertise method of integrating various in home devices. Beckmann et al. [24] proposed a smart home in a box where participants receive a system by mail, but the intent was to measure ease of use, and the focus was not on the collection of health related data. Further, neither of these systems cover the analytical aspect.
The most similar systems are those from the Center for Advanced Studies in Adaptive Systems (CASAS) [8,25]. While similar in principle, it contains many more sensors than the presented system and takes longer to install. The CASAS system deployed in [8] consisted of between 8 and 18 sensors, including motion, temperature and door sensors and a relay and server. They concluded that this system was intuitive for participants to install. This provides a degree of validation of the ease of installation of our system which consists of much fewer sensors. In terms of cost, our system consists of a wrist-worn accelerometer, four Raspberry Pis (as gateways) and one 4G router, thus we expect to be lower cost than the much more numerous sensors, relay and server of the CASAS system. The Vesta smart home in a box, including the calibration phase, takes around 20 to 30 min to set up and is specifically tailored for studies of digital health with feedback and input from clinicians, and refinement based on patient feedback. Nonetheless, without the low-cost and easily deployed constraints, there are a number of projects working towards deploying IoT sensing technologies into the home environment, and in particular for digital health.
Arguably the most notable system is the SPHERE project [1] which, aims to collect up to one year of data from 100 different homes, and consists of a multitude of different sensors capturing many modalities within a home environment. In fact, this system has been deployed in a healthcare study, as part of the HEmiSPHERE project, on patients undergoing hip and knee replacements [26,27]. The HEmiSPHERE system protocol paper states that the system deployment target is 30 homes, 10 less than the number of homes from which we collected data. However, a key difference is that the HEmiSPHERE system contains many sensors, thus increasing the cost, and requires technicians to install the system, thus affecting the ease of deployment.
There are a myriad of social and ethical issues to be considered when deploying AAL technology in the homes of patients, such as informed consent, privacy, security, safety and trust [28]. When used in research or clinical studies, such systems can collect sensitive information that relates to activities of daily living (such as sleeping patterns, movement patterns, time spent outside the home). Therefore, ongoing informed consent of such systems is required, as well as trust in the system and researchers to keep their data safe, secure and anonymous during transmission and storage [21,29].
Researchers have also studied the effect of information technology systems on patient health and behaviour change, indicating that they usually have a positive impact on patient behaviour [30]. While positive, it is nonetheless worth acknowledging that the presence of a home monitoring technology in medical studies may effect change in the patients behaviour [31].
Cost-effectiveness is also a concern as smart home technology has an inherent financial cost and can therefore affect health equity [28], with systems ranging from those requiring professional installation and many sensors [1] to what we propose, a smart home in a box which contains significantly fewer sensors, is self-installable and more cost-effective than similar smart home systems.

Platform overview
First, an overview of the entire Vesta platform is provided, from the collection of sensor data using the smart home in a box to deriving health indicators and visualization. Fig. 1 depicts the general structure of the platform, from the hardware kit itself to the analytic system which processes the collected data.

The smart home in a box
Each smart home in a box primarily consists of one wearable, four gateways and a router. The complete description of the kit is detailed by Pope et al. [6], but in essence the design of the EurValve smart home in a box was to be an energy efficient and lower cost smart home in a box, built with ease of use in mind.
The wearable [32] consists of a processor/radio, accelerometer, external flash, and a battery. The wearable uses a System on a Chip (SoC) CC2650 processor with an integrated Bluetooth Low Energy (BLE) radio. The wearable runs bespoke software developed using an embedded real-time operating system. The wearable takes 5 accelerometer samples over a 200 millisecond period (i.e., 1 sample every 40 ms) and transmits the samples in the payload of a BLE advertisement packet. Thus, 5 packets, each of which are 20 bytes containing 5 tri-axial samples and a sequence number, are transmitted per second. To conserve energy, the SoC enters a low power mode between accelerometer sampling and only enters full power mode when transmitting. The transmitted packets contain a monotonically increasing sequence number (the sequence number starts from zero each time the wearable boots) and the estimated battery level. The wearable uses the ADXL362 accelerometer. It is configured to take 25 samples per second, with each 8-bit sample representing ± 4 g. This is done for each x, y and z axis. The wearable has been shown to last for approximately 21 days without recharge [6], which is notably longer than each 2 week stage of the EurValve study.
Raspberry Pis that come equipped with a compatible BLE radio are used as static gateways. Software was developed to receive the raw BLE packets from the radio and record the RSSI. The packet is parsed and the sequence number, accelerometer samples, RSSI, and battery level are saved to a file along with a timestamp recorded when the packet was received. The gateways are configured to use common Network Time Protocol (NTP) servers to obtain their time and thus keep packets in sync. This timestamp, along with the packet sequence number, allows the data from each of the gateways to be aligned. The router acts as a WiFi access point for the gateways and provides a mobile network link controlled by a compatible national carrier SIM card, and facilitates the secure transmission of the data from the patients' home to a remote server.

Data
The primary sources of data are the acceleration information coming from the wearable device (for activity recognition and sleep quality), and the RSSI values collected from each of the gateways (for indoor localization). See Tables 1 and 2 for examples of each, respectively.
Generally these types of datasets are heterogeneous and complex in nature. They consist of different data formats and representations due to the variations in the way wearables record data, as well as the data they record. To represent the accelerometer data, later used for activity recognition and sleep analysis, the lowest common representation is used, that is, a timestamp t, followed by the x, y and z values for this time epoch. For localization, the format expects a timestamp t followed by a RSSI value for each gateway. If the dataset is for training, then the label is also permitted. Otherwise, it is expected that data collected from other devices can be converted to this format, thereby providing a common, simple, understandable representation. Thus, to use data from different devices with Vesta, one merely needs to convert the specific dataset to this standard representation.
In environments where there are multiple gateways, such as the smart home in a box within this platform, the monotonic sequence number of each packet sent from the wearable and received at the gateway is used as an identifier for merging packets from the multiple gateways. It should be noted that as the wearable does not currently maintain time of its own, and time may drift on the gateways where the packets are recorded. This, combined with the fact that the sequence number may reset to zero in different scenarios, can lead to cases where the sequence number may not be unique, where each gateway records a packet with the same sequence number at different timestamps t. Thus, a constraint is imposed on merging sequence numbers; only timestamp and sequence number pairs where the sequence number is identical and the difference in timestamps is not greater than 30 min are merged. In such cases the earlier timestamp is chosen as the authoritative one. Missing RSSI values for a given second indicates that no gateway is in range, and thus a missing value of −120 dB is instead used, which is a value not possible if in range of a gateway.
Periods of time where the patient is not wearing the wearable are excluded by measuring the standard deviation in acceleration over smoothed 30 min blocks of time. If the standard deviation of any two axis is less than 1.8mg, that block of time is excluded from analysis. Further, days in which the patient spent less than 10 h in their home were excluded.

Data analytics
This section will describe how data science underpins the overall platform.

Algorithms
The main learning tasks involve activity recognition and indoor localization. It is important that any digital health platform, that aims to be as flexible as possible, must provide the possibility for selection and configuration of different algorithms due to the no free lunch theorem [33]. For example, Twomey et al. [34] illustrate the vast array of features and algorithms typically used in the task of activity recognition. In Section 4 the specific choice of algorithms and features is discussed in detail.

Health indicators
There is no standard set of indicators that uniquely measure the health or well-being of a patient. While the platform is evaluated in the context of one specific study, with one specific clinical population, it is envisaged that it could be used for a range of other tasks within the wider area of digital health. Thus the choice of health indicators calculated from the data should not be fixed, but easily extendable. For example, with access to the wearable accelerometer and localization information, it would be possible to measure the patients speed at which the climb stairs. Health indicators can further be extended with the use of additional sensors, such as a video-based sensor that can measure changes in patients sit-to-stand movement after hip or knee replacement [35]. For the purposes of this study, the clinically interesting health indicators measured in the setting of patients undergoing a heart valve intervention, which were chosen after consultation with clinicians, are: • The duration spent walking over different stages of their care.
• The duration spent in various rooms and the number of transfers between rooms.
• The duration spent outside of the home.
• The quality and quantity of sleep.
Each health indicator will be analyzed over the three stages of intervention.

Visualization
A key aspect of Vesta is the ability to display the knowledge extracted from the data in a useful way for healthcare practitioners. Due to the large amount of sensor data that is continuously collected by each smart home in a box, in each home, this is vitally important. Effective visualization should give an overview of key behavioural patterns at various levels of granularity. The reader is referred to the evaluation in Section 4.4 for visualization examples from patient data.

Evaluation
As discussed, the motivation behind the development of this platform is the EurValve project. Recall that this involves pervasively monitoring patients who are undergoing a heart valve intervention pre-operation, post-operation and a 12 to 16 weeks follow-up period. However, due to the lack of ground truth, which would be invasive and time consuming to collect, the primary source of validation are subjective methods such as patient reported measures of their own health and well-being. They take the form of PROMs and are carried out once before the operation, and once after. However this is a strong justification for the use of Vesta, which provides longitudinal pervasive and quantitative measures of health and well-being over significant periods of time. Nonetheless, for external validation of the performance of the platform, both PROMs and the clinician's input are used. While this platform will be evaluated retrospectively, future work will study how such a system could be used in a decision support system.

Machine learning models and algorithms
As the focus of this work is not the development of novel machine learning algorithms, sensible methods are chosen that are known to perform well from the literature.

Activity recognition
Random Forests have been shown to be effective at the task of recognizing activities from accelerometer data [36], as well as generally being robust and efficient. Hyper-parameters for the Random Forest are found by a randomized search of the parameter space and 10 fold cross validation. As training data, the SPHERE challenge dataset [37] is used. This is a public dataset consisting of numerous sensor modalities, including accelerometer data using a similar wearable, collected from 10 participants who were following a script taking roughly 20 to 30 min to complete. Most participants completed the script twice. While the SPHERE challenge dataset has many ambulation and transition activities labelled, three specific activities walking, lying and sitting are selected for training the model. Further, as part of the EurValve project, patients are asked to perform a calibration procedure each time they deploy the system in their home [11]. During this calibration process patients perform 3 pre-defined activities, walking, sitting and lying. Thus, the patient-calibrated data can be integrated into the training data for activity recognition. A variety of features which are typically found in the literature [34,38,39] are used, and are extracted over 3 s windows, with 66% overlap; the mean, variation, standard deviation, min, max, median, 25 and 75 percent quartiles, the interquartile, skewness and kurtosis, number of zero crossings, and the spectral energy and entropy of each axis. For predictions the same process is applied to the patient accelerometer data.

Localization
Learning a model for indoor localization, particularly in the context of smart home in a box environments, is challenging. This is due to each model being specific to one home, and thus the sharing of models, unlike for activity recognition, is not possible. A further challenge is introduced by the fact we cannot collect accurate environmental information of patients homes and thus cannot be taken into consideration. However, previous work has studied the effect of the environment [13] and sensor placement [40] for RSSI based localization when this information was available. Further, these were evaluated in the context of high resolution localization within the room, but required significant training data for each location within the room. Thus, for this, we trade within-room localization to room-level localization in order to reduce the amount of training data to be collected and annotated. We refer the interested reader to the work of Byrne et al. [13] and Kozłowski et al. [40] to understand the capabilities of, and requirements for, more detailed within-room indoor localization using BLE RSSI.
To perform localization, the raw RSSI data is smoothed with a rolling 30 s window and the following features are calculated, from each of the four gateways over a 10 s window, with 50% overlap; the mean, variation, standard deviation, min, max, median, 25 and 75 percent quartiles, the interquartile, skewness and kurtosis. The same process is applied to the patient RSSI data and a Random Forest, with 250 estimators, is used for predictions. Random Forests, with this calibration process for indoor localization, has previously been shown to be effective in this setting and system [11,41] when compared with a number of other potential methods.
The calibration process generates training data that is typically viewed as a vector of RSSI fingerprints corresponding to each gateway, which can be used for location prediction. An example of what a calibration looks like from the RSSI values can be seen in Fig. 2. The calibration procedure for localization has been previously described and tested by McConville et al. [11] but can be briefly stated as follows. The patient is instructed to, for two minutes in each room, sit in the living room, walk in the kitchen, lie down in the bedroom, and carry out a typical activity in the room of the fourth custom gateway.
Due to the variability, multipath and interference effects associated with RSSI [11,42], in addition to the extremely limited amount of training data, the predictions are smoothed over by only predicting a room change when at least 2 s of walking activity is detected within the current localization time window. In addition, rooms in which the patient spent less than 60 s are considered as transitional rooms, and thus removed. Further, due to the large window of time in which the patient is monitored, up to around four months from the first to the last deployment, there is ample opportunity for the environment to vary. This is particularly relevant as, due to human factors, a successful calibration is not always carried out at each deployment. To account for environmental variability, the calibration data is augmented to simulate changing environmental conditions with an increase in dropped packets. Given the RSSI calibration data, up to 50% of the RSSI fingerprints with all gateways in range are duplicated for the simulation. For each of these samples, a random gateway is selected, and it is assigned the out of range value (−120 dB) before being added back to the training set as an additional sample.

Sleep
Sleep is considered to be vitally important to health and wellbeing [43]. From a wrist-worn accelerometer it has been shown possible to determine if the wearer is sleeping [44,45]. The algorithm in Vesta builds on these methods, with a few modifications. In their work, van Hees et al. [44] use a 5 min interval upon which the change in arm angle is calculated to determine if a wearer is sleeping. In their most recent work [45] they operate on smoothed 5 s intervals, automatically determine the threshold of permitted change by the 10th percentile, multiplied by 15, for each day. They identify the longest daily block consisting of values under the threshold, merging time gaps less than 60 min to discover the Sleep Period Time-window (SPT).
Instead, the sleep analysis of Vesta permits gaps of up to 120 min to be merged as part of the SPT, based on experimental validation from a subset of selected patients in the EurValve cohort. Further, Vesta also records sleep periods outside of the SPT to capture possible daytime somnolence. In addition, to improve robustness, location information is integrated into the sleep detection algorithm. For example, if the wearer has changed room within the 30 min window, then they cannot have been sleeping. This extra source of information can help distinguish natural movements during sleep (e.g., rolling over) from actual nonsleeping movements (e.g., going to the bathroom).  • Additional periods of sleep are calculated, i.e., sleep episodes, throughout the day. These can then be used to report the total number of daily sleeping episodes as well as the total duration spent sleeping per day.
• A sleep quality index is derived which is the length of the daily SPT, divided by the number of minutes spent awake during this period. This is further normalized over the distance duration of the SPT in hours, from 8 h. This causes a sleep duration outside the range of 7 to 9 h to be penalized.

Quantitative evaluation
To gain confidence in the analysis, a means of validating the models built using the patient training data is required. As each patient was asked when deploying the smart home in a box to carry out a short calibration procedure which generates activity and localization labels, this can be used as a form of quantitative evaluation.

Activity recognition
The evaluation of the performance of the activity recognition model is challenging due the small amount of labelled data available. The labels are gathered from the calibration process, typically carried out by patients in their own home, unsupervised, and with minimal instruction. Therefore, one relies on the patients precisely carrying out the calibration, which involves

Table 3
A selection of relevant questions from the PROM for patient A. In MLHFQ 0 corresponds to 'no', 1 'very little' and 5 'very much'. In WHOQOL 1 corresponds to 'very little', 2 'poor', 3 'neither poor nor good', 4 'good' and 5 'very good'. The patient reports that in almost all aspects they have improved, which corresponds to the analysis. One exception is sleep, with the patient reporting some difficultly sleeping at night (MLHFQ) and falling to sleep quickly (SEQ). This corresponds to the small decrease in sleep quality seen in Fig. 4. undertaking a specific activity for a set period of time. If the patient performs the activity for less time than instructed, or does not carry a single activity for the full duration, e.g., when instructed to be walking and periodically standing, noisy labels are obtained. The calibration is further limited in that patients may sit, lie and walk in a very specific way; e.g., if they lie in a single position in their bed during the calibration, this may not be representative of how they lie over the course of a night sleeping; consider lying on your side versus back versus front. Further, accelerometers capture each person's individual signature for various activities [46] which, due to the limited labelled data collected for each participant, means that combining the calibrations of many patients is not the equivalent to the same quantity of labelled data for a single person. Nonetheless, it is possible to combine activity calibrations for numerous participants, along with the SPHERE challenge dataset, or any other similar wristbased accelerometer data. The model built on the combination of patient specific activities and the SPHERE challenge activities will be evaluated using k-cross fold validation, where k = 10.

Localization
Building a radio map of the home via the collection of RSSI fingerprints during the calibration is essential for the indoor localization. As the radio map is specific to each home, there is a limited amount of labelled data. However, as each patient was asked to carry out the calibration for each stage, ideally calibrations were carried out on up to three occasions within the home of the patient. To ascertain a level of confidence in their effectiveness k-cross fold validation of each of the patients localization calibrations is used, where k = 10. It should be noted that the calibration training data is relatively controlled compared to the normal behaviour of patients in their home. However, in the predictive phase, a constraint requiring walking to be detected during room transfers is used in conjunction with the RSSI features, which should decrease false transitions. Readers are referred to previous work [11] which demonstrate that the same calibration procedure with Random Forests achieves high performance in an unscripted free-living localization task in a residential house.

PROM evaluation
While the calibrations provide some ground truth data, as the system is deployed in the homes of patients over long periods of time, this ground truth data does not provide a satisfactory performance evaluation of the long term effectiveness of the platform. However, to supplement this, patients completed a number of surveys at the beginning of the pre-operation and follow-up stages. Namely, they are the Minnesota Living with Heart Failure Questionnaire (MLHFQ), which has been validated in heart valve disease [47], the World Health Organization Quality of Life-BREF (WHOQOL) [48], the 6 Minute Walk Test (6MWT) [49,50] and the SPHERE EurValve Questionnaire (SEQ). Examples of relevant question and answers can be found in Tables 3 and 4.

PROM comparison
PROMs are standardized medical surveys used by hospitals which measure a patient's self-reported health and quality of life at a given point in time. They are typically administered before and after a procedure, and thus align with the deployment of the smart home in a box.
The WHOQOL is a standardized form which aims to assess how the patient feels about their own quality of life and health. Using these survey responses to the following questions may be useful for validating the proposed platform; 'How well are you able to get around?', 'How satisfied are you with your ability to Table 4 A selection of relevant questions from the PROM for patient B. In MLHFQ 0 corresponds to 'no', 1 'very little' and 5 'very much'. In WHOQOL 1 corresponds to 'very little', 2 'poor', 3 'neither poor nor good', 4 'good' and 5 'very good'. The patient self reports a decrease in many aspects of well-being. The MLHFQ asks the patient to evaluate the impact their heart valve disease has had on living as they wanted in the previous four weeks. Questions are answered on a scale of 0 to 5 with 0 representing 'No', 1 'Very little' and 5 'Very much'. Relevant questions in the MLHFQ include: has living with the heart valve condition prevented you from living as you wanted in the past four weeks by (a) 'making you sit or lie down to rest during the day', (b) 'making your walking about or climbing stairs difficult', (c) 'making your working around the house or yard difficult', (d) 'making your going places away from home difficult', (e) 'making your sleeping well at night difficult'.
The 6 Minute Walk Test (6MWT) is a clinically validated tool to assess exercise capacity and activity. The use of the 6MWT has been studied in aortic stenotic patients [51,52], i.e., those recruited as part of this study. This test will gather information, from a single point in time, of the patients ability to walk for a prolonged period of time. Specifically, it records how many meters they are able to walk and any issues that arose during it, such as if they had to stop. This makes it a suitable comparison for the activity health indicators of Vesta.

SPHERE EurValve questionnaire
The custom SPHERE EurValve Questionnaire (SEQ) is composed of a number of questions that attempt to capture information on the self-reported daily life on the patient undergoing the monitoring. It contains questions specifically tailored to help evaluate the platform performance. A number of these questions are selected to help evaluate the proposed platform.
In order to validate the activity recognition performance, the responses to questions such as how many estimated hours per week do they walk, garden, and exercise, are used. The possible responses to this question are either 'None', 'Less than 1 hour' or '1 or more hours'.
In order to validate the sleep analysis, the responses to the question which asks the patient to report the typical times they wake and go to sleep each day, is used. Further, the patient was asked to report if, and if so, how often they wake and get up during the night. The responses to these questions are either 'Never or Rarely', 'Sometimes', or 'Most days or Every day'.

Case studies
In order to demonstrate the platform, and evaluate both usefulness and relevance of the results, two case studies are provided on patients who have completed all three stages of the study.

Cohort analysis
Before commencing the detailed case studies of two patients, an analysis of 20 of the patients from the cohort will be carried out. The analysis of these patients over each stage of the intervention will measure the patient degree of change for measured health indicators, in the post-operation and follow-up stages, relative to the health indicator values in pre-operation stage. Thus, it provides a means of comparison for each case study patient, each of which demonstrates a specific interesting outcome, to a larger sample population. Fig. 3 plots each of the six health indicators of interest. If the pre-operation health of the patient is considered as the baseline, these plots measure how much the patient has changed in the measured indicators since their pre-operation level. In the first column within each plot, for the first four indicators (room transfers, duration outside, walking, sleep quality), the regression line begins in the negative area of the plot. That is, there was a negative change for each of these indicators in the post-operation stage. Further, from the placement of the points, the majority of patients fall below the 0 threshold, thereby exhibiting a decrease in this health indicator value, ranging from 65% of patients (room transfers) to 80% of patients (walking and duration outside). This is to be expected, as soon after the operation, the patients are expected to rest, and thus the amount of room transitions, walking, and time spent outside should decrease. The drop in sleep quality may be indicative of discomfort or pain, or increased sleep duration beyond typical levels (7-9 h). In fact, the main sleep time and total daily sleep time health indicators show 75% and 90% of patients have increased values for these indicators in the post-operation stage relative to the pre-operation stage. This is also unsurprising, as again, patients are expected to rest more after their operation.
The second column within each plot shows the patients follow-up stage change in health indicators relative to the preoperation levels. In contrast to before, the first four plotted indicators (room transfers, duration outside, walking, sleep quality), tend to increase in the follow-up stage, relative to the pre-operation stage. The slope of the linear regression line is positive for each, indicating patients are improving from postoperation levels, with varying levels of steepness across each of these four health indicators. For duration spent walking 85% of patients had a positive slope (with 70% having a higher value than pre-operation), for room transfers 80% of patients had a positive slope (with 50% having a higher value than pre-operation), for duration outside 80% of patients had a positive slope (with 55% having a higher value than pre-operation), while for sleep quality 60% of patients had a positive slope (with 60% having a higher value than pre-operation).  The daily main sleep length, and total sleep length, both have a negative slope indicating that for both indicators patients are spending less time sleeping in the follow-up stage, compared to pre-operation levels. 24% of patients measured a positive slope for their main sleep length (with 38% having a higher value than pre-operation), while only 19% of patients had a positive slope for their total sleep time (with 42% having a higher value than pre-operation). If considered independently, the meaning of negative trend is unclear. However, this length should be considered jointly with the sleep quality health indicator, which incorporates sleep length. As sleep quality increases over pre-operation levels, the duration of sleep for the patients decreasing may mean that patients were sleeping beyond the typical 7 to 9 h range in the pre-operation stage, but in the follow-up stage have dropped closer to this range.

Patient A
A small number of patients were selected randomly, and from within this set, two patients who had different experiences were selected. The first patient of the case study is patient A. They are a 74 year old male undergoing mitral valve repair (MVR), a tricuspid valve repair (TVR) and a coronary artery bypass graft (CABG), and they subjectively reported an improvement in symptoms following the operation. To gain confidence in the machine learning models used to estimate health indicators, an evaluation of the models on the training data is performed. In terms of localization, the quality of the calibrations for indoor localization is determined using the method described in Section 4.2.2. The F1 micro score was evaluated to be 0.99 for the calibrations carried out by patient A. The quality of the activity calibration was also evaluated using the method described in Section 4.2.1 and the F1 score to be 0.69. To ameliorate performance, the activity calibrations of the two case study patients were removed, as they were found to be causing a decrease in performance. When using only the SPHERE challenge activity labels, the F1 score was 0.73. The decrease in performance from the patient activity labels may be explained by the unsupervised nature of the data labelling, e.g., when calibrating the bedroom gateway, it is not known apriori how far the bed is from the gateway, and thus the time spent walking to the gateway would be mislabelled as lying. This is in contrast to the SPHERE challenge dataset which was labelled by multiple annotators observing recorded footage. Using the models and methods described in Section 4.1, activity recognition and indoor localization is performed on the data collected for patient A.
To begin the case study an evaluation of the sleep analysis component of Vesta is performed. In Fig. 4 three main health indicators of interest are plotted from the previously described method in Section 4.1.3. The sleep quality drops in the postoperation stage, but recovers in the follow-up period. Their total time spent sleeping each day increases by around four hours in the post-operation period, and the number of sleep episodes decreases only slightly, which recall, is any distinct period of sleeping (e.g., naps). In the follow-up period the total daily sleep time falls to around 8 h from around 10 h pre-operation, and 14 h post-operation. Thus, for this patient from a sleep quality point  Fig. 6(a) shows a decrease in room transfers post-operation, before increasing in the follow-up phase. In Fig. 6(b) the time spent outside of the home is shown, and a significant increase in time spent outside in the follow-up period is found. When all health indicators, including Fig. 6(c) are considered holistically, it can be inferred that the patient has an increased mobility by the follow-up stage, decreasing in the post-operation stage. of view, it appears that the intervention went well. The patient experienced an increase in time spent sleeping and decrease in sleep quality soon after surgery, before recovering in the followup period, with a higher sleep quality than the pre-operation level.
The output of Vesta is validated with the PROMs relating to sleep in Table 3. With regard to sleep quality, the patient self reports in both pre-operation and follow-up stages that they rarely wake up fairly fully during the night, and they sometimes get up during the night. As for feeling rested after sleep, they reported 'sometimes' pre-operation, and 'most days' in the follow-up. This is a positive improvement in their self-reported quality of sleep.
Knowledge of which rooms the patient spends time in contributes to building a narrative of the daily behaviour of a patient, providing clinicians with more insight into the well-being of the patient. For example, if the patient is sleeping in their living-room it may indicate that the patient is experiencing difficulty climbing stairs. An example of a more detailed visualization of the daily behaviour of the patient can be seen in Fig. 5. They plot the indoor location of the patient from midnight to midnight each day, with each bar representing a different room in the patients home.
At the pre-operation stage, on each of the included example days, there exists common behavioural patterns. The patient is in the bedroom from around 1 A.M. and 2 A.M. until 10.30 A.M. or 11 A.M. (first third of each chart). They leave their house each day (red blocks), spending the evening in the living room (blue) or custom room (green), which we know to the 'sun room' or 'study' from the floor plans before going to the bedroom in the early morning. In the post-operation stage there is a continuation of routine behaviour. In both days shown there are periods where the patient leaves the bedroom during the night, and on two occasions at approximately the same time (5 am). Finally, in the follow-up period there is a continuation of the behaviour seen in the pre-operation and post-operation stages, but with less frequent movement to other rooms during the night. In comparison to before, the patient is now spending considerably more time outside their home each day. This is reflected in the PROM question in Table 3 in which the patient reports that their condition has not prevented them from leaving the home in the follow-up period, whereas it has some effect pre-operation. The patients report in the SEQ forms that their normal sleeping  Another view of a patient's mobility around the home is the measurement of the number of transfers between rooms. By measuring the room transfers before and after the operation, it is possible to observe any changes that may occur in the in-home mobility. Fig. 6(a) plots the room transfers for patient A over the three stages. In the post-operation phase there is an average daily decrease in room transfers, but with an increase over the pre-operation level in the follow-up stage. However, a single individual measurement does not paint the complete picture. Fig. 6(b) reveals that the patient significantly increased their time spent outside the home in the follow-up state. Together, this may be indicative of increase in health and well-being. Fig. 6(c) shows the predicted daily average time spent walking during the three phases of the intervention; pre-operation, postoperation and the 12-16 week follow-up. This chart shows that the patient has, as expected, a decreased duration of daily walking the post-operation stage. However in the follow-up stage, the amount of walking has increased over both previous stages. These results are also reflected in Fig. 7, which is an insight into the average hourly behaviour of the patient. Further, it also demonstrates that the patient typically remains active until the early hours of the morning (around 2 to 3 A.M.), agreeing with the localization, sleep analysis, and patient reported sleep times.
The activity and mobility results are validated with the PROMs in Table 3, in which the patient reported an increase in ability to do ADL, e.g., their ability to get around, perform daily living activities, and ability to leave the home. The 6MWT shows that the patients increased the number of meters walked from 398 m to 478 m in the clinical setting. While PROMs are subjective, and the 6MWT is a single measurement at a single point in time, they agree with the more detailed results of the analysis, providing validation to the much deeper insight of the pervasive monitoring.
The analysis shows that this is a patient who appears to have recovered well from their heart valve intervention. Their key behaviours remained consistent and improvements in sleep and mobility (walking, room transfers and time spent outside) in the follow-up period are apparent. As a further demonstration of the proposed platforms capabilities, another case study is included on another patient, but does not follow the example cohort trends shown in Fig. 3 as closely as patient A, and subjectively reported issues post-operation.

Patient B
The second case study is patient B who is a 87 year old female undergoing a transcatheter aortic valve implantation (TAVI) procedure. Again an evaluation of the quality of the calibrations for indoor localization are carried out using the method described in Section 4.2.2, with the F1 score calculated to be 0.94. The same activity recognition model as before is used.
The sleep analysis of the second case study, patient B, over each stage is shown in Fig. 8. For patient B it is clear that their sleep quality decreased in the post-operation stage, and remains low in the follow-up stage. This is a clear downward trend relative to pre-operation levels. While they maintained a similar amount of total sleep per day in the pre-operation and post-operation stage, the number of sleeping episodes increased, i.e., their sleep became more fragmented after the operation. They still maintain the fragmented sleep in the follow-up period, but now with less time spent sleeping.
These results are validated with the PROMS in Table 4. For example, in the pre-operation stage they report that they rarely get up/wake up fairly fully during the night but in follow-up period they report that most days they wake up fairly fully, and get up, during the night. Similarly, during the pre-operation stage, the patients are reportedly well-rested after sleeping on most days, but never in the follow-up period. Clinical notes report that   Fig. 10(a) shows a fall in the number of room transfers in the post-operation stage, followed by an increase over the pre-operation levels in the follow-up stage. There is a significant post-operation fall in the time spent outside the home in Fig. 10(b). The patient spends very little time outside the home at all stages, and the large standard deviations highlight the wide variability in both the room transfers and time spent outside. There is a notable increase in the amount of walking in the follow-up stage, shown in Fig. 10(c). patient B has restless leg syndrome, which is known to impair sleep, and reportedly became worse after the operation.
Examples of this downward trend are also apparent in the location charts in Fig. 9. In their pre-operation example days the patient tends to spend considerable time in the bedroom between 1 A.M. and 8.30 A.M. In the post-operation stage their previously consistent time in the bedroom has become fragmented and more time is being spent in the living room, with fairly frequent movement to the kitchen. Finally in the follow-up period, again, there is much fragmentation in which room the patient spends the night in. This is a consistent trend. In the pre-operation stage the patient spent the majority of the night in the bedroom, which became more fragmented post-operation, and worse again in the follow-up. It is also clear throughout on many days that relatively little time is spent outside the home. Fig. 10 shows the activity levels of patient B over each stage of the intervention. In the two weeks of monitoring soon after the operation their amount of walking had decreased, indicating more rest was occurring, reinforced by more time spent inside the home. Moreover, clinical notes report that the patient required a walking stick as an aid after the operation. Finally, the increase in walking and room transfers in the follow-up stage may be explained by the routine physiotherapist recommendation of a gradual increase of physical activity following surgery. By week four patients are often told activity should include a 20 min walk each day, and following their procedure, the patient reported spending less time outside the home due to increased dizziness and less confidence in mobility. This is demonstrated in Figs. 9 and 10(a)-10(c). Thus, this patient may have followed the advice of the physiotherapists by exercising within their home, which is consistent with the analysis. This is demonstrated by Fig. 10 which shows that there is an increase in room transfers and walking at the follow-up stage, with relatively little time spent outside. Fig. 11 reinforces this by showing an increase in both room transfers and walking throughout the day.
While it is possible to compare the case study patients with each other, or with the sample cohort analysis, e.g., trends in room transfers, duration outside, walking etc., it should also be kept in mind that these indicators are not independent. As the room transfers increase, it is expected that the time spent walking increases. Further, as these two indicators are only captured at home, they also are dependent on the daily duration spent Fig. 11. The average hourly number of room transfers (a) and time spent walking (b) over the three stages of monitoring. Spikes in room transfers often occur with spikes in time spent walking, but not always. It is clear that the patient typically has lower levels of activity between 1 A.M. and 7 P.M. We can see that there are higher levels of room transfers and walking in the follow-up stage across most of the day. outside the home. Evidence of the importance of this is when comparing the room transfers of patient B with patient A. While both trends are similar over the stages, patient B did not increase their time spent outside the home in the follow-up stage, instead it remained relatively little. So while the absolute number of room transfers was higher for patient B, they also spent on average four less hours per day outside their home. Thus, when comparing patients, all health indicators must be judged in an holistic way. Finally, for patient B, and unlike patient A, in addition to the cohort analysis in Fig. 3, the sleep quality of patient B did not improve in the follow-up stage, rather it remained low, as did the average time spent outside the home. These results indicate that the patient may have experienced problems after the operation.
More generally, the provided analysis, covering various aspects of health and well-being, highlights the benefit of examining multiple health indicators and reinforces the importance of the more holistic view that this system provides.
The PROMs in Table 4 reveal a mixed picture of the selfreported recovery of the patient. The patient still finds that their condition requires them to rest during the day, and causes difficulty working around the house, albeit self-reported as 'very little'. This can be compared with patient A who self-reported that with the same questions, their condition no longer had any effect. However, like patient A, Fig. 10(b) shows that the time spent outside increases in the follow-up stage from post-operation. However, in the case of patient B, the time spent outside is similar to pre-operation, and less than one hour per day on average in the pre-operation and follow-up stage. This is in contrast to patient A whose time spent outside increased from around 2 h per day on average pre-operation to over four hours per day in the follow-up stage. The patient self-reports in Table 4 that their condition had 'very little' (2) effect on their ability to go places away from the home pre-operation, and an increased effect (3) in the follow-up period. Again, contrast this with patient A, who reported 'very little' effect pre-operation and 'no' effect in the follow-up period. Table 4 reports an increase in the amount of walking, and the patient also reported that their ability to perform activities of daily living remained 'good'. In the 6MWT they walked 268 m pre-operation, with clinical notes reporting that they had to stop for 30 s due to angina. In the follow-up stage 6MWT they walked 330 m, which is an increase of 62 m. While this is an improvement, clinical notes note that the patient suffered from dizziness. As discussed, this increase in the capacity for walking is reflected in the results from Vesta. As discussed previously, there is a clear decline in sleep quality reported by Vesta, as well as the patient in Table 4.
Finally, some examples of the power of Vesta in being able to quantify health indicators can be found in the previous analysis. Health indicators such as the time spent outside, for which both patients reported their condition had 'very little' effect preoperation on their ability to go away from the home, but yet the time spent outside for each patient differed by an hour each day on average. When self-reporting measures regarding their sleep patient B reported it was 'neither poor nor good' and then 'poor' quality sleep satisfaction in the follow-up period. The quantified sleep quality index within Vesta reflected this, with a 20% drop in the sleep quality between in the two periods. Interestingly, patient A reported that their sleep satisfaction was 'good' in the pre-operation stage, with a lower average sleep quality index (0.64) than patient B (0.67) who had reported lower sleep satisfaction. This may be indicative of the subjective nature of PROMs. Nonetheless, the trends of the individual patients over their intervention tend to reflect the trend of their own self-reported measures, validating the proposed system.

Conclusion
This paper presented a novel digital health platform, Vesta, an end-to-end lower-cost platform for interventions which monitor the activity, health and well-being of patients in their home environment. The platform's smart home in a box was discussed in detail, including how it was designed to be lower cost than similar systems and easy to use, yet ubiquitous in its data collection. The collection of accelerometer data from a wrist-worn wearable, along with RSSI values at four points throughout the home, was outlined, and how this collects a large amount of valuable inhome data. The analytics system was introduced, and how it uses data science and machine learning for activity recognition, indoor localization and sleep analysis to produce health and well-being health indicators. These are then visualized facilitating the derivation of useful insights from the large amount of raw sensor data collected by the smart home in a box. Finally the effectiveness of Vesta for digital health studies was evaluated on a sample cohort of 20 patients, as well as two detailed case studies, of heart valve intervention patients. Over three stages, one before and two after the operation, it was demonstrated how the platform could produce both granular and high level insights into the activity and behaviour of the patients within their home. Using a number of relevant measures, including activity levels and sleep quality, the results were validated with standardized clinical PROMs and a customized survey. The potential of the proposed platform, to augment current clinical measures with quantitative health measurements from pervasive home monitoring, in digital health studies is demonstrated.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.