Ambient Intelligence Based on IoT for Assisting People with Alzheimer’s Disease Through Context Histories

: New Internet of Things (IoT) applications are enabling the development of projects that help with monitoring people with different diseases in their daily lives. Alzheimer’s is a disease that affects neurological functions and needs support to maintain maximum independence and security of patients during this stage of life, as the cure and reversal of symptoms have not yet been discovered. The IoT-based monitoring system provides the caregivers’ support in monitoring people with Alzheimer’s disease (AD). This paper presents an ontology-based computational model that receives physiological data from external IoT applications, allowing identiﬁcation of potentially dangerous behaviors for patients with AD. The main scientiﬁc contribution of this work is the speciﬁcation of a model focusing on Alzheimer’s disease using the analysis of context histories and context prediction, which, considering the state of the art, is the only one that uses analysis of context histories to perform predictions. In this research, we also propose a simulator to generate activities of the daily life of patients, allowing the creation of data sets. These data sets were used to evaluate the contributions of the model and were generated according to the standardization of the ontology. The simulator generated 1026 scenarios applied to guide the predictions, which achieved average accurary of 97.44%. The experiments also allowed the learning of 20 relevant lessons on technological, medical, and methodological aspects that are recorded in this article.


Introduction
According to the World Health Organization (WHO) [1], about 50 million people around the world have Alzheimer's disease or another type of dementia. As reported by the Pan American Health Organization (OPAS) [2], Alzheimer's is one of the top ten death-causing diseases in the world. Alzheimer's is one of the most prevalent diseases of dementia, which is characterized as a syndrome-usually of a chronic or progressive nature-for which there is no cure or treatment, with deterioration of cognitive function (ability to process thoughts), which can be expected from normal aging. The impairment of cognitive function is usually followed and sometimes preceded by deterioration of emotional control, social behavior, or motivation. Although dementia mainly affects elderly people, the demonstration of symptoms can begin to occur even before the aging stage, which influences the fact that there are almost 10 million new cases each year around the world [3]. The total number of people with dementia is expected to reach 82 million in the field of the study of this work. In Section 2.2, we introduce concepts of Alzheimer's disease (AD).

Ambient Intelligence and IoT
The exponential growth of the development of technologies such as mobile devices, wearables, and IoT devices enables the expansion of services to assist users in their daily lives [17]. In addition to the quantity, there was an increase in intelligence and integration among these computational elements [18,19].
The IoT's smartness has been possible on account of the massive adoption of artificial intelligence, mainly machine learning (ML), natural language processing (NLP), and computational vision (CV) techniques. This kind of environment allows a more natural and spontaneous human-computer interaction [20].
In terms of communication and integration of these complex and heterogeneous computational artifacts, cloud computing's approach has also been evolving. For instance, edge and fog computing contribute as architectural alternatives approach to make the ambient IoT vision feasible [21].
IoT enables the integration of objects from the physical environment into the virtual. It also promotes machine-to-machine communication over the Internet, which makes the sharing of data and information to achieve specific goals possible. This is achieved by integrating devices, sensors, and systems [22], generating specialized intelligent services.
Smart environments [20] aim to seamlessly add computational power to the ambient to broaden and support day-to-day activities (ADLs). Ambient intelligence (AmI) is another term to name a space that is designed to understand and adapt to the people's presence, preferences, and needs to free them from the manual and explicit control of surroundings [23].
Intelligence services can be created based on AmI methods. In this sense, the environment is capable to manage different data sources dynamically. The data fusion can consider systems, IoT objects, people, and other environmental entities to be processed and derive the proper information to meet the user's needs [20].
The AmI model promotes smart services, which provide characteristics such as context awareness, adaptation, proactivity, and other features envisioned by Mark Weiser [24]. According to his vision about ubiquitous computing, technology becomes indistinguishable from everyday life by being present all the time and in various formats. It aims to make the human-ambient interaction invisible or most natural for people.
Although scientific advances have already been made toward u-health [44], a more specific model for ubiquitous healthcare in an ambient intelligent space for people with Alzheimer's disease in their home environment, according to the situation awareness perspective [45,46] of their ADLs, is still unknown.

Alzheimer's Disease
Alzheimer's is one of the most prevalent diseases of dementia; it stands out as a syndrome-usually of a chronic or progressive nature-for which there is no cure or treatment, and with which there is a deterioration of cognitive function (that is, the ability to process thought) beyond what can be expected from normal aging. It affects memory, thinking, guidance, understanding, calculation, learning ability, language, and judgment, but consciousness is not affected. The impairment of cognitive function is usually accompanied and sometimes preceded by deterioration in emotional control, social behavior or motivation. Alzheimer's disease is the most common form of dementia and can contribute to 60-70% of the total cases [47].
Individuals with Alzheimer's and other forms of dementia usually experience a period of significant behavioral and psychological symptoms of dementia (BPSD) [48]. According to Cohen-Mansfield (2008), BPSDs are generally divided into several categories, physical and nonphysical agitation or aggression and verbal agitation. Nonphysical behaviors include undressing, expressing, hiding things, and leaving search behavior. Physical aggressive behaviors include biting, hitting, kicking, pushing, scratching, and unwanted sexual advances. There may also be verbal agitation, such as cursing, shouting, and repeated actions of attention.
BPSD behaviors are difficult to be managed by caregivers and are positively correlated with the caregiver's suffering [49]. They also contribute to the increased cost of care for people with dementia and are the main reason for institutionalization [8,11,48]. Behavioral problems are a safety concern for family members and professional caregivers, as well as for other elderly people living in community settings. There are well-validated nonpharmacological methods used to manage BPSD. These methods include redirection, music therapy, individual socialization, art therapy, and animal-assisted therapy [50].
A crucial issue about BPSD is the caregiver's recognition of triggers or events that generally precede unwanted behavior [51,52]. Even if the triggers cannot be identified, the simple recognition that a patient is agitated can be beneficial, as a caregiver can be called in as needed. It should be noted that caregivers are generally not present at the beginning of these triggers. Because Alzheimer's disease can only be detected currently after symptoms start to appear, follow-up solutions appear with the use of devices to care for these patients in the most diverse stages of the disease; therefore, technology presents possibilities for palliative care support. According to Burleson et al. [5], recent research work on information and communication technologies (ICTs) for the treatment of dementia demonstrated how the successful incorporation of technology in everyday practices implies a set of judgments and attitudes of value about the best way to care and make decisions for someone else. Over the years, the use of smart devices and wearable sensors has increased in the health field. These sensors are used for a variety of applications, from security to monitoring health measures, such as quality and quantity of sleep [53]. The majority of caregivers who use technology (as support help) obtained benefits for their patients from at least one activity of daily living (ADL) in the past year (86%).
On average, the caregivers provide assistance in three of the six activities listed. The ADLs that caregivers usually help with are: getting up and lying/sitting on beds and chairs (73%), dressing (61%), and eating (52%). About one in three (caregivers) helps in the bath (37%) or in the bathroom (34%), and 26% help to deal with incontinence [9]. The WHO has developed a global action plan in which it is proposed that by 2025, the global production of research on dementia should double the number of scientific publications, 50% of countries should routinely collect data on the main indicators of dementia, and 75% of countries should have support for dementia care providers [10]. The alarming prevalence of Alzheimer's disease and the absence of any effective treatment made this disease an relevant issue, highlighted as a priority by the G8 nations [11]. It can be noticed, only in Brazil, that there are more than 30 million people over the age of 60, according to the data from the Brazilian Institute of Geography and Statistics (IBGE in portuguese). In 2013, almost 2 million people have dementia; around 40% to 60% of them have Alzheimer's disease [54].
Although dementia mainly affects elderly people, the demonstration of symptoms can starts even before the aging stage, which influences the fact that there are almost 10 million new cases each year around the world [3]. There is often a lack of awareness and understanding of dementia, resulting in stigmatization and barriers to diagnostics and care. The impact of dementia on caregivers, the family and society in general can be physical, psychological, social, and economic [1]. It also is one of the main causes of disability and dependency among the elderly worldwide.
Caregivers who provide assistance to individuals with dementia often feel stressed, frustrated with the amount of time needed and emotionally challenged. In addition, cogni-tive function may progressively decrease over time in patients, in variations that fluctuate throughout the day or over the long term, as the system is used (for example, weeks to months or years) [5]. These behaviors are difficult to be managed by caregivers and are positively correlated with the caregiver's suffering [6]. They also contribute to the increased cost of care for people with dementia and are the main reason for institutionalization [7,8].
In 2015, the society's total cost for dementia care was estimated at 818 billion dolars, equivalent to 1.1% of the global gross domestic product (GDP). The total cost as a proportion of GDP with a variation of 0.2% in low-and-middle-income countries to 1.4% in highincome countries [1]. According to WHO [1], about 50 million people around the world are carriers of Alzheimer's disease or other dementia. According to PAHO [2], Alzheimer's is on the list among one of the top ten death-causing diseases in the world. The total number of people with dementia is expected to reach 82 million in 2030 and 152 million in 2050, and much of this increase is attributable to the growing number of people with dementia living in low-and-middle-income countries [4].

Related Works
The research to identify the state of the art in the theme follows the criteria described in the systematic review developed in the article by Machado e Barbosa [55], and it was conducted by listing three main perspectives: (1) monitoring of vital signs; (2) location monitoring; and (3) analysis of the data collected in the monitoring.
The works were selected through searches in the following databases: ACM Digital Library, IEEE Xplore Digital Library, Journal of Medical Internet Research (JMIR), PubMed Central, Science Direct, and Springer Library. Among them, PubMed Central and JMIR stand out as literary bases in the area of health and natural sciences, while the other databases are a reference in computing.
The searches were based on terms synonymous with the subject of the work and its derivations, defined as ("Alzheimer" OR "Alzheimer's Disease" OR "Alzheimer Patients" OR "Alzheimer's Care") AND ("care" OR "detect" OR "track" OR "monitoring" OR "Assistive Technology" OR "Patient Monitoring" OR "device" OR "smartphone" OR "smartphones" OR "mobile application" OR "mobile" OR "mHealth" OR "app"). These groups of terms were interleaved with each other to increase the reach of the search. The choice of works was selected considering the following elements: Alzheimer's disease; vital signs monitoring features; and data analysis, resulting in better patient care.
The examination of the articles resulted in five papers that were selected as the basis for the research, which were analyzed as follows.
Thorpe et al. [56] presented a computational model that uses smartphones and smartwatches to calculate a set of metrics for spatial, temporal, and step-based mobility. This work has as its main objective the measurement of the mobility of people who have dementia. The work presented by Wan et al. [57] consists of a monitoring system in the dementia treatment process to support caregivers in meeting the specific needs of each person with the symptoms of cognitive loss and memory loss. Nesbitt et al. [48] approaches the monitoring of vital patient information via sensors, and the objective is to monitor the location of individuals and measure physical and physiological changes, such as limb movements, vocalizations, and heart rate that occur during the state of agitation. In order to explore an application of remote monitoring technologies, the work developed by Amato et al. [58] can detect the onset of crises in patients affected by Alzheimer's disease and aims to reduce the psychological burden suffered by caregivers. Lai Kwan et al. [59] presented in 2019 a work with the objective of detecting significant moments of people with dementia, making visible what is most significant to them and maintaining a sense of interpersonal connection between their caregivers and family members.
The differential of the proposed work in comparison with the related works is listed according the criteria below: • Vital signs monitoring: It performs vital signs data collection through a wearable, which is used daily by the patient.
• Monitoring by geolocation: It performs collection of geolocation data, which is used daily by the patient. • Data analysis: It performs analysis on the collected data. • Result of the momentary data analysis: It performs the analysis of the collected data instantly, with no further analysis. • Danger alert: It performs real-time alert triggering if the patient is committed to any danger to his health or safety. • Action predictions: Behavior predictions based on historical data.
All works presented include the data analysis criterion. The solutions presented in the works of Thorpe et al. [56] and Wan et al. [57] aim to make specific reference to monitoring the patient on his geolocation, identifying his position to control his caregivers, not covering the rest of the criteria specified in the comparison with DCARE. Another point to consider is that only the solution of the work of Thorpe et al. [56] presents an approach to validate the vital aspects in order to legitimize the necessary actions to guarantee the safety and health of the patient (danger alert), also not covering the rest of the criteria specified in the comparison with the DCARE.
With regard to the work carried out by Nesbitt et al. [48] and Amato et al. [58], the definitions demonstrate that although a set of sensors is also used, data analysis and later presentation of results are performed, covering some of the criteria. The computational models proposed in these works do not present in their architecture an approach to process the various mental disorders and behaviors that a patient with Alzheimer's disease can trigger, not covering one of the main criteria proposed in the DCARE model, which is to ensure the information already processed is displayed immediately in real time to the caregiver, and an alert is sent in case of danger.
In the computational model developed by Lai Kwan et al. [59], context sensitivity is used to correlate the user's vital signs with the analysis of mental health in order to identify in which situations the user may have reached reactions of affective commitment with their caregivers or family members. In this case, no type of evaluation is sent to the caregiver; therefore, it is a model in which the information is analyzed later and only used for the purpose of identifying peaks in mental health. Therefore, the monitoring of vital data is not carried out, and the sending of information is not performed immediately to the caregiver in case of danger to the patient's health, and does not cover the requirements indicated in this sense. Figure 1 shows the comparison between the related works analyzed and the proposed work. The figure allows to observe that the models presented do not reach the proposed objectives to complete the general aspects of monitoring vital data, GPS location monitoring, analysis and results of momentary data, presentation of data to the caregiver, and warning of danger on the health of the immediate patient or in the model of prediction to the caregiver. In addition, it is important to note that making predictions about behaviors is not considered in any of the works studied. Therefore, in Section 4, we present DCARE, which means Dementia Care, a computational model that covers the proposed objectives for general monitoring, data processing, and sending alerts to the caregiver in case of danger to the patient. The main benefit in using the DCARE model, concerning the existing five approaches, is that the model developed helps patients be more independent and gives the caregivers a tool for helping them, monitoring the patients in their daily activities, and ensuring their safety. DCARE uses a context histories framework, which collects context information from the environment. Subsequently, this information is processed, generating user context predictions, allowing to automatically detect future actions, allowing the caregiver to have greater control and care for the patient. The main scientific contribution of this work is the specification of a model for monitoring people with Alzheimer's disease during activities of daily living (ADLs), with the promotion of access for a tool to health care and patient safety, in addition to contributing to the development of a data set simulator with ADL scenarios for patients with Alzheimer's disease.

The DCARE model
This section describes the proposed computational model for monitoring and caring for patients with Alzheimer's disease. The section is divided into three subsections. In Section 4.1, we detail the architecture of the model and its components. In Section 4.2, we present the context entities that make up the model, and finally, in Section 4.3, we discuss the details of context predictions.

Architecture
The DCARE architecture was designed based on the technical modeling TAM (Standard for Technical Architecture Modeling), created by the company SAP [60].  The architecture on the DCARE application server has five components and a database. First, the architecture presents the communication between the model and the data availability application, which is an external design application that provides the GPS location information and the patient's heart rate signals collected from a wearable. DCARE makes requests to the application of data availability through an API; this communication is carried out through the Web Service component, which has the responsibility to perform the communication between external applications. The types of IoT/Wearable that can be used as a data source are based on the literature review carried out in Section 3. According to the state of the art, the most used and those that have great potential for usability are smartwatches and smartphones. In terms of estimated implementation costs, none of the related works reported information about this subject. DCARE was designed to be agnostic of implementation, being feasible and having a sustainable cost-effective relation, even to countries in developing or teams with low budget. In this case, the DCARE model could be implemented using open hardware and software to minimize the costs. In contrast, industrialized countries or groups with no economical restriction the solution could be implemented using market top IoT devices, wearables, and cloud IT infrastructure. In this sense, this research group has been gathering data related to the user's gait and hand movements based on different IoT devices, which were the Samsung Galaxy Watch to collect movement data, the Smartbelt H10 Polar to collect heart rate data, and the Smartphone Xiaomi Lite9 to collect user's geolocalization and sounds of the environment.
After receiving the data from Web Service component, the Context Recognition component performs data processing operations, identifying contexts in a standardized way and storing them in the Context Histories component (database).
The Behavior Recognition component presents processing methods based on the use of context histories to identify patient behaviors related to the concept of behavioral and psychological symptoms of dementia (BPSD). The analysis according to behavior is based on the criteria provided in the work of Nesbitt et al. [48], which indicates that individuals with Alzheimer's and other forms of dementia usually experience a period of significant BPSD. According to Cohen-Mansfield [50], BPSDs are generally divided into several categories, the most common are physical and nonphysical agitation or aggression and verbal agitation. Nonphysical behaviors include undressing, expressing, hiding things, and searching behavior. Physically aggressive behaviors include biting, hitting, kicking, pushing, scratching, and unwanted sexual advances. There may also be verbal agitation, such as cursing, shouting, and repeated actions of attention. These behaviors are difficult to be managed by caregivers and are positively correlated with the caregiver's suffering. According to the work of Nesbitt et al. [48], based on these concepts, it is possible to relate the extracted data through a wearable with the most common symptoms listed, listing routine activities, or possible dangerous behaviors for the health and safety of the patient. Thus, the analysis of the data that are made available by the consumer application allows a comparison with the patterns already detected by the work of Nesbitt et al. [48], identifying what type of behavior the patient is performing.
The Context Prediction component is developed based on the machine learning concept, specifically regression algorithm, using the scikit-learn (https://scikit-learn.org, accessed on 10 April 2021) Python programming language library and PLSRegression technique, which provides functions that perform the analysis of data based, used to make predictions of future patients' behaviors. The objective of this component is to assist the caregiver, with the analysis of the data, making possible predict behaviors that are dangerous to the health and safety of the patient.
At the end of the data processing, DCARE sends the results of context prediction to the gateway Alert Generation component. The Alert Generation component is built based on the message queue architecture. Message queue is a type of software engineering component used to communicate between processes or threads of the same process. Thus, when the results of the analyzes carried out by the Behavior Recognition and Context Prediction components are finalized, this information is sent to the message queue that the caregiver's application is connected to. The consumer application, built externally, which is used by the caregiver, performs the data request for DCARE via API made available for access by the Web service component. The consumer application receives the data processed by DCARE, and then takes care of carrying out the alert action to the caregiver.

Context Entities
Context-sensitive architectures that use not only present contexts, but also contexts about the past, need to store observed contexts for later use [13]. These works generally have a well-defined domain representation through an ontology. Ontology represents knowledge about low and high levels of contexts, presenting the entities involved, as well as their relationship in a semantic way [61].
The Context Entities component of DCARE model approaches the use of the concepts of the autonomic nervous system (ANS), which controls the physiological processes of the human body (for example, cardiovascular, digestive, and respiratory systems) and intervenes in involuntary responses to external stimuli [62,63]. Recently, the reach of emotions [64,65], in relation to this aspect has received attention. Physiological measures have been used to assess autonomic activity. The most common measures found in the psychophysiology literature are cardiovascular activity, skin electrical conductivity, breathing, and muscle activity [63,66]. Heart rate variability (HRV), extracted from cardiovascular analysis (ECG-electrocardiogram), is a noninvasive physiological indicator of SNA functions that examines fluctuations in heart rate (HR). This fluctuation is represented by the time difference between two consecutive beats, also known as R-R intervals. HRV is a reliable marker of SNA activity [64,67] and a relevant marker of psychological well-being [68]. For these reasons, DCARE uses HRV as a key measure in the model. Figure 3 shows the context data modeling used by DCARE, both in data acquisition and processing. The DCARE ontology is used to obtain and classify the context information of the project. The entity Caregiver represents the person responsible for providing assistance and monitoring the patient. The entity Patient has the patient's identification and the type of dementia of the patient. The reference and identification entities of the context history are Identity, which guarantees the unique identification by the user, and Timestamp, identifies the instant over time. The entities that make up the model for the processing of patients' behavior data are: Activity, HeartRate and SemanticLocation. The HeartRate entity is the representation of the variation of HRV signals, obtained by monitoring the heartbeat. The entity SemanticLocation represents the representative location of where the patient is at the moment, relating it to his geolocation. The entity Activity represents the type of movement that the patient is performing, according to HeartRate and SemanticLocation, and can illustrate four possible types of movements, which are: Stopped, Walk, Run and InVehicle. In addition, Activity also plays an essential role in how the user relates to the environment.

Context Prediction
DCARE provides the monitoring of people with Alzheimer's disease during their daily lives, monitoring the user and collecting daily information about GPS location and vital signs of the patient, which can help in more appropriate and personalized care for users, providing greater support for caregivers in the tasks of preserving the health and safety of the patient.
The DCARE is based on a tool for analysis and processing of contexts using the concepts of Context Histories and Context Prediction, allowing to record data according to the selection of relevant contextual information.
The operation of DCARE is managed by two stages, each of which performs a specific set of tasks for the functioning of the modules. The stages are divided into: (1) Data acquisition, processing/identification of contexts, and generation of Context Histories; and (2) Identification of behavior, context predictions and alert generation. The execution starts as soon as the data is made available by the external application that collects the data. The first stage performs the collection of patient data and associates it with the model's ontology, then stores the data in the database, that is, resulting in the generation of Context Histories. The second stage, in the first step, performed in the Behavior Recognition module, performs the identification of behaviors based on the BPSD concept, performing the data identification processing, according to the scenarios addressed and validated in the Section 5. Still in the second stage, in the second step, performed in the Behavior Recognition module, the prediction of the patient's behavior contexts is generated and the data is forwarded to the message queue. The Context Prediction module is executed using the scikit-learn library, which provides functions that perform data analysis based on the concept of Machine Learning, and uses as a basis for processing the stored data of Context Histories. Finishing the execution flow, the consumer application has access to the final data generated by the model from the message queue.

Implementation and Interviews
The implementation of a prototype following the specifications of the model was carried out using the programming language Python, in order to allow its evaluation. Thus, to develop the architecture of the project, an SQL database was used to implement the Context Histories component, and the Alert Generation component was made using the gateway tool RabbitMQ (https://www.rabbitmq.com/, accessed on 10 April 2021), for the message queue. The implementation of Context Prediction component of DCARE model was develop using the Machine Learning scikit-learn library, approaching specifically the module Cross Decomposition/PLSRegression, to perform the model training. The implementation of Context Recognition and Behavior Recognition components was based on the knowledge database obtained through literature and interviews with specialists.
The interview technique was utilized to collect the information that was used in the development of the model's scenarios to identify the different contexts that make up the daily lives of Alzheimer's patients and their caregivers. This technique was chosen taking into consideration the wide range of possible situations in which the patient may find himself and seeking to enrich the work with scenarios that are not usually highlighted in the academic literature. According to Ribeiro [69], the interview is used whenever there is a need to obtain data that cannot be found in records and documentary sources, which may be provided by certain people. Also according to Ribeiro [69], the interview is the most pertinent technique when the researcher wants to obtain information about his object, which allows to know about attitudes, feelings and values underlying the behavior, which means that one can go beyond the descriptions of the actions, incorporating new sources for the interpretation of the results by the interviewers themselves. In order to detect the view of caregivers and health professionals about their daily routine in different environments, some relevant scenarios were developed based on the academic literature, where the interviewees were invited to comment and contribute with information about the scenario in addition to proposing new scenarios based on the objective of the work. The scenarios developed based on the literature that make up the research items of the interviews are described in Table 1. Table 2 shows the interviews that were carried out with the volunteers who fit the caregiver positions, being a family member or health professional. The interviews were conducted via video call by an application for smartphone, and were recorded and saved for later analysis, according to the consent of the interviewees. The profile of the interviewees is diverse, and is composed of caregivers who have experience between 1 and 28 years of age working in the care of people with Alzheimer's disease. With regard to occupation, 60% of the interviewees have a profession in the health area, caregiver of the elderly and/or caregiver of patients with Alzheimer's disease, with the other 40% of the interviewees being family members of the patients.
The interviews allowed to construct a synthesis of the data and identify common behaviors performed by patients with Alzheimer's disease that can be identified as dangerous to the patient's health and safety. As a result of the interviews, the scenarios previously identified based on the literature were approved, and four more scenarios were added for validation according to Table 3. Resulting in ten scenarios to be used by the model.

Evaluation and Results
This section describes the evaluation and results. The section is divided into two subsections. Section 6.1 details the evaluation aspects. Section 6.2 describes how model was evaluated, using the DCARE Dataset Simulator Tool, and finally, Section 6.3 presents the lessons learned and limitations of this work.

Evaluation Aspects
The tests were performed with a data set with 1026 samples generated by DCARE Dataset Simulator. The observations were generated randomly, taking into account the impartiality of the simulator in the choice. The sample was segmented in 80% for training the model and 20% for the test to evaluate the ML model, following the pattern commonly used in the machine learning projects.
The main regression machine learning algorithms were researched to enable the prediction of the risk of BPSD of patients with AD to preventively notify caregivers and familiars. The linear Regression (LR), k-Nearest Neighbor (kNN) and PLSRegression were evaluated. The strong correlation between the State Heart Rate and Caregiver Alert Required was found. After the data analysis and experimentation, the PLSRegression resulted in the best performance metrics among the ML algorithms tested.
The tests were carried out using scikit-learn library, approaching specifically the module Model Selection/Cross Validation Predict. The evaluations, with already trained model, were made to generate context predictions with ten splits, that is, ten different ones executions with different cuts from the data set. The generation of the metrics from the tests were made using too scikit-learn library, approaching specifically the modules Metrics/R2 Scores and Metrics/Mean squared error. Table 4 shows the average accuracy of the model in relation to context predictions according to different sample quantities. The smallest amount of samples used (100) allowed to identify the lowest average accuracy with 97.3%, and with the largest amount of samples (1026) it is possible to identify that the average accuracy is high, reaching 97.5%.
From the different tests performed, changing the amount of samples used, it was possible to identify that the general accuracy of the model is 97.44%. Based on the simulations carried out on the data, it can be concluded that the model was effective, in order to predict scenarios dangerous to the health or safety of the patient in a predictive way. The analysis of the model metrics' performance indicates that the strong correlation between the features State Heart Rate and the Caregiver Alert Required exists. It is constant and is present in the different number of samples tested. Given the characteristics of BPSD events, the PLSRegression model fits the data in order to predict with high accuracy the events.
A confusion matrix (Figure 4) allowed to further detail the results. In this way, it is possible to identify results related to false positives (15 cases), false negatives (11 cases), true positives (22 cases), and true negatives, in which 978 cases were found. The additional performance metrics indicate the mean precision of 59.45%, recall of 66.66%, and general f1-score of 62.85 %. The number of false positives (11 cases) is considered elevated concerning the true positives. It reflects in a medium model precision and represents that a considerable portion of BPSD would not be reported. On the other hand, 15 cases were erroneously registered as positive. In this case, despite false notifications could be launched, the proportion about the real negative cases is lower.

DCARE Dataset Simulator Tool
The evaluation was carried out using the acceptability test based on the data collected through the interviews described in Section 5. The records that represent instances of the scenarios used in the tests were generated with the DCARE Dataset Simulator Tool.
The application was built using the Python programming language as a base. The simulator takes into account each of the items specified in Section 4.2. Each simulation is generated according to the random choice of items in the structure. During the simulations, all items are replaced by a dictionary model, where each element receives an enumerator as an identifier.
The construction of the simulator was carried out according to the enumerated data identified with a dictionary model, presented in Table 5. For the generation of the data set, the scenarios identified in Section 5, were built with the structure: (1) id_cenario: enumerated identification of the scenario; (2) heart_rate_state: state of the heart rate for the duration specified in the context; (3) activity: behavior of the patient specified in the context duration; (4) semantic_location: significant patient's location according to the daily living space; (5) duration im minutes: duration of the context (in minutes); (6) timestamp: start and end date of the context; (7) necessary_alert_caregiver: if there is a need to send a danger alert to the caregiver.  (3), houseKitchen (4), houseBalcony (5), houseCourtyard (6), houseOutsideCourtyard (7) Caregiver Alert Required false (0), true (1) The scenarios used in the construction of the data set were built according to the Table 6, and generated in the file format csv.

Lessons Learned and Limitations
This research focused on a solution that approaches smart environments [44] oriented to the healthcare of people with Alzheimer's disease. During this study, many lessons were learned as a consequence of this applied project. Alongside the main activities, some insights emerged resulting from technical experience of design, modeling, and development of software artifacts, besides the implementation of DCARE Simulator. Moreover, other ideas were documented reporting medical and social aspects learned while the relationship with patient's familiars and healthcare professionals happened.
Therefore, twenty learned lessons were organized into three groups, that is, technological, methodological and medical. Table 7 summarizes these items, mapping these observations of this work.
In addition, this study is an initial validation of the viability of the clinical use of the DCARE model. Therefore, some limitations were identified during its execution. The first limitation was the reduced number of pairs of caregivers and patients who used the DCARE, and none of the patients were final users.
The second limitation was that the time using the prototype was not sufficient to collect enough insights to analyze both the engagement and effectiveness in DCARE usage in contrast to the traditional approach.
To overcome these limitations the new steps of this project should encompass the recruitment of real AD volunteers to evaluate the proposal as a whole during long-term monitoring for some months.
Another limitation of this study is related to the use of synthetic data instead of real sensor data to represent the vital signs, movements and sounds. To cope with this limitation, several IoT and wearables have been tested to be integrated into future assessments in the clinical and domestic setup. Challenges regarding the software integration, device battery duration, unobtrusive and ubiquitous use as well as safety issues should be faced to achieve these goals. 3 Medical Vital signal analysis, mainly the heart rate variation and sweating, besides movement and location data are highly valued by experts.

Medical
The monitoring, follow-up and diagnostic are important. However, the predictive approach, in order to support caregivers and family members, is even more strategic as it can assist in the treatment and prevention of damage from the disorders manifested by the person with AD.

Medical
The holistic view of the context's history, encompassing not only isolated events, is of great value to the caregiver, doctors, and family members, as it helps in monitoring and serves as a support for decision-making in terms of treatments, medications and other clinical interventions. Allowing even more detailed monitoring of disease progression.

Medical
The use of technologies for the monitoring and follow-up of patients with neurodegenerative diseases in a nonintrusive way in their ADLs is a more natural approach. It tends to generate more qualified results because the conditioning of tests in offices or clinics may not accurately represent the reality of the patient or there may be losses due to time lapses between the assessment and the BPSD events that are sporadic and random. Therefore, the detection or even more positively the prediction of BPSD events can contribute significantly to the increase in the quality of life of people with AD. The storage and management of context's history can add new insights for caregivers and family members involved in daily patient's healthcare routines.

Technological
The alert notification proved to be a important resource and valued by the evaluators, as it expands the capacity for monitoring and assisting the patient, even remotely. It was praised both by family members and by specialists participating in this study. This feature is a promising resource that can positively assist the healthcare of peolple with Alzheimer's disease.

Technological
The development of an app with an accessible interface is helpful for people with Alzheimer's disease. There are few solutions for monitoring and predicting adverse events for these people.

Technological
The use of data related to vital signs, especially HR, proved to be fundamental for the analysis of BPSD events.

Technological
The use of unobtrusive wearables is more natural and accepted by patients. This approach enables health monitoring without overexposing privacy like some approaches that use video monitoring.

Technological
Ontology was an essential software artifact for modeling the simulated scenarios and standardizing attributes. It enables easy communication between those involved in the project and aligning the technical aspects of the application.

Technological
The application of machine learning algorithms using the Python language and the scikit learn library proved to be assertive and effective for the modeling and assessment of the experiments. 13 Technological Smart environments that employ diverse sensors and wearables are a promising approach to aid in the monitoring and treatment of AD People.
14 Technological The absence of standardized data sets was observed. DCARE Simulator allows the sharing of the generated data set. It also could generate new customized data sets.

Technological
The generation of simulated scenarios contributes to experimentation, especially because the people are patients with special needs. Nowadays, it is a period of restriction due to the pandemic. Therefore, the DCARE simulator can help to overcome the limitations of assessments.

Technological
Simulator could have considered profile customization and profile balancing to avoid possible bias in the generated data set.

Technological
People's location is a key aspect in supporting the healthcare of AD people, mainly indoor. However, it appears that the precision in an indoor location still lacks greater accuracy and accessibility as occurs outdoors.

Methodological
The mixed approach of obtaining scenarios via literary review combined with the description of scenarios via interviews with specialists and family members of AD people was an assertive choice. It was essential to make the evaluation process more assertive and to qualify the generation of the scenarios generated by the simulator. This approach makes possible a great approximation of the reality of AD people, without exposing them to risks, nor to any resistance or inconvenience of eventual long term and continuous monitoring.

Methodological
The use of the Technical Architecture Modeling (TAM) modeling methodology, created by the SAP company, proved to be favorable in the standardization of DCARE architecture.

Methodological
The evaluation of usability, usefulness, and technology acceptance by users would add even more value to the solution. It could shorten the distance between the application interface features to the real needs and preferences of AD people.

Conclusions and Future Works
This work presented in detail the model DCARE for monitoring people with Alzheimer's disease, in a scenario of day-to-day care by their caregivers. Based on studies of the works related to the theme, the opportunity to develop a model to offer monitoring of patients with Alzheimer's disease was noted, enabling individual care for each user, in which the analyzes performed result in the prediction and/or alert possible dangers to the health and safety of the patient. The data collected based on the Context Histories concept are analyzed and processed, resulting in the understanding of behaviors or prediction of future behaviors of the patient, generating an alert to the caregiver if it demonstrates any type of danger to the health or safety of the user, these being the great differentials in relation to the current state of the art.
The construction of the scenarios that were used in the development of the model, was carried out in the interviews with five volunteers, with profiles of health professionals and family members. The mass of data for carrying out the tests was generated by DCARE Dataset Simulator. The results of the tests based on the predictions of contexts showed that the developed model met the objective of the project, reaching 97.44% of general rate of accuracy of prediction of scenarios. Based on the simulations performed on the data, it can be concluded that the model was effective, in order to predictively predict scenarios of danger to the health or safety of the patient, in a predictive way.
The main scientific contribution of this work is the specification of a model for monitoring people with Alzheimer's disease during their daily lives, resulting in helping their caregivers, interacting with technological resources, promoting access to a tool for health care and patient safety, in addition to contributing to the development of a data sets simulator with scenarios of daily activities of patients with Alzheimer's disease.
As a social contribution, we can highlight the development of a new resource for use within the area of mental health care, collaborating with the development of an application that can be widely used by caregivers.
Based on the studies of this work, new possibilities arise for the continuation of future works. The use of the model for people with other types of progressive neurodegenerative diseases is promising, especially due to the daily monitoring feature, generating important information for caregivers about the individual health of each user. Furthermore, the use of real data obtained from specialized IoT devices and wearables could enrich the results and approximate the solution of the end-user.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: This research did not require ethical approval in accordance with the regulations of the University of Vale do Rio dos Sinos (UNISINOS). The subjects who participated in the evaluation were not patients in treatment for Alzheimer's disease, but voluntary caregivers. They assessed the usability aspects of DCARE and not the effectiveness of its application in the treatment. In addition, the participants agreed to participate in the evaluation of DCARE.
Data Availability Statement: Not applicable.