Automated Cognitive Health Assessment Based on Daily Life Functional Activities

Dementia is increasing day-by-day in older adults. Many of them are spending their life joyfully due to smart home technologies. Smart homes contain several smart devices which can support living at home. Automated assessment of smart home residents is a significant aspect of smart home technology. Detecting dementia in older adults in the early stage is the basic need of this time. Existing technologies can detect dementia timely but lacks performance. In this paper, we proposed an automated cognitive health assessment approach using machines and deep learning based on daily life activities. To validate our approach, we use CASAS publicly available daily life activities dataset for experiments where residents perform their routine activities in a smart home. We use four machine learning algorithms: decision tree (DT), Naive Bayes (NB), support vector machine (SVM), and multilayer perceptron (MLP). Furthermore, we use deep neural network (DNN) for healthy and dementia classification. Experiments reveal the 96% accuracy using the MLP classifier. This study suggests using machine learning classifiers for better dementia detection, specifically for the dataset which contains real-world data.


Introduction
Smart homes are a well-known term nowadays and have become a basic need of people. Te primary purpose of smart homes is to provide quality life and improve the effciency in their home [1]. Smart homes provide a more secure and efcient life. Smart homes contain several sensor devices controlled remotely [2]. Smart homes play a vital role in the healthcare industry. Smart homes help medical professionals to monitor patients' health remotely and give urgent care.
Te term dementia goes to the loss of cognitive functioning like thinking and remembering with growing age. Dementia individuals cannot control their emotions and personalities and are unable to perform daily base activities [3]. In such conditions, smart homes become a basic need for these people to help them perform daily activities such as cooking, toileting, brushing teeth, getting dressed, watching tv, paying bills, and being social. Smart homes give the confdence to dementia patients to live on their own or with their loved ones. People with dementia are unaware of their mental health [4]. It is necessary to detect dementia early for proper care and mental health treatment [5,6]. Smart homes are essential in that way for medical professionals. Smart homes contain the Internet of Tings (IoT) and sensor base equipment capable of detecting dementia in people automatically. Medical professionals receive data every minute from smart homes and are alert to give treatment when abnormal behavior from older adults [7,8]. Several techniques have been proposed, such as camera-based assessment, acoustic, voice-based assessment, and robot-based assessment [3]. However, research notices security and privacy issues using these techniques [9][10][11]. Recent research has proposed AI-based techniques. Tat has fewer of these issues compared to the abovementioned techniques.
In recently proposed techniques, machine learning techniques are preferred to automatically detect dementia individuals in smart homes. Machine learning classifers have been categorized as healthy, mild, and dementia individuals [12,13]. Te subject was classifed into healthy, mild, and dementia using decision tree, Naïve Bayes, multilayer perceptron, and ensemble AdaBoost [3]. Machine learning uses smart home base generated data as input and gives real-time support to dementia impaired [14,15].
Real-time activity detection of dementia older adults living in smart homes and performing daily routine activities is essential; several senior older adults do not know about their mental health. Tus, the motivation of the proposed approach is to detect dementia in the early stage and adequately treat people with dementia. Existing studies have limitations for detecting dementia individuals with low detection rates, and we improve the accuracy using the proposed approach [3,12,16].
Following are the major contributions of this paper: (i) Proposes an approach to classify dementia individuals by analyzing their daily life activities at an early stage using machine learning and deep learning. (ii) Presents a comparison between machine learning and deep learning algorithms to evaluate the best model and provide a baseline study. (iii) Deep learning algorithm enhances dementia individuals' detection rate compared to a machine learning algorithm and overperforms the baseline paper detection rate.
Te rest of the paper is structured as follows. Section 2 explains the relevant studies for dementia individual's detection. Section 3 presents the proposed approach for cognitive dementia detection. Results and discussion are presented in Section 4. Section 5 provides the discussion on experimental analysis. Finally, Section 5 concludes the paper.

Literature Review
Tis section presents past literature studies. Relevant studies on recognizing daily life activities performed by dementia individuals are mentioned below. In the late 1960s idea of smart homes was introduced. One of the most familiar home PCs (ECHO-IV) was made for the accounting family when PCs at home were introduced [17].
Authors in [3] proposed a study to detect cognitively impaired individuals and improve the representation of dementia patients through signifcant features. Tey used the ensemble AdaBoost technique to classify the individuals into healthy, mild, and dementia impaired. Tey used the CASAS dataset. Te data was collected from 400 participants. In the dataset, 24 activities were involved, categorized as simple and complex daily life tasks. Tey achieved 96.02% and 99.6% accuracy compared to other existing techniques. Authors in [12] proposed a machine learning technique to detect the cognitively impaired individual's capability to perform daily base activities to how other individuals perform the same activities. Tey used the CASAS dataset, which contains 179 volunteers, and performed a complex set of activities in the smart home. Tey achieved an AUC score of 0.94%.
Author in [18] presented a novel technology integrated health management (TIHM) approach to monitoring dementia patients in their environment. Tey used machine learning and data analytics techniques to detect the mental health of dementia individuals. Tey evaluated the efciency of proposed algorithms by conducting classifcation.
Author in [16] proposed a machine learning-based approach to observe the performance of dementia individuals in smart homes automatically. To evaluate the proposed approach, they took some older adults to perform activities in a smart home test-bed. Tey extract features that show how participants perform activities and use them as an input and output in a machine learning algorithm. Tey assessed that machine learning techniques could diferentiate cognitively healthy individuals and individuals with dementia.
Te dementia problem that is not identifed timely is rising rapidly with the growing population. Author in [19] presented machine learning-based techniques (i. e., support vector machine, logistic regression, artifcial neural network, Naive Bayes, decision tree, random forest, and K-nearest neighbor) to detect dementia disease in the early stage. Tey assessed that support vector machines and random forests accomplish better results on given datasets. Smart and IoTbased technologies are improving the living style of dementia people and can ensure their safety during daily activities. Author in [20] summarized information about activity recognition of dementia individuals using machine learning methods. Tey merged sensor devices and smart devices during the monitoring process and used warning alarms to prevent abnormal activities in dementia people.
Using the machine learning method, the author in [21] presented a model to detect cognitive and behavioral symptoms of Alzheimer's dementia (AD). Te purpose of the proposed model is early detection of mental disorders such as AD, which could alert patients to take action timely. Tey collected smart home data for 29 older adults, labeled data with activity classes, and extracted ten behavioral features. Tey used SmoteBOOST and wRACOG algorithms to get reliable results.
Te author in [22] presented a robot activity support system (RAS) and explained the role of the smart home. RAS help to perform in-home activities independently. Tey also collected feedback from those twenty-six individuals who received assistance from RAS in smart homes to evaluate RAS usability. Tey achieved results of 6.09 out of 7 through the questionnaire. Intelligent robots are performing fully to the betterment of the living style of dementia individuals and help them in social engagement. Author in [23] proposed a proactive listener model to detect AD in older adults that can be implanted in the dialog system of conversational robots. Te proposed model classifes user speech into three categories: question, statement, and silence, which generate a particular response. Tey assessed that they overcome the limitation of speech and breakdown dialogues of dementia individuals with this approach.
To summarize, several research studies [7,21] exist on daily life activities detection of dementia individuals, but they lack a detection rate. To overcome these limitations, this study proposes an approach to detect dementia individuals by analyzing their daily routine activities at an early stage.

Proposed Approach
Te proposed approach focuses on detecting dementia individuals in the early stage. Te proposed approach is divided into four steps: data selection, preprocessing, features extraction, and machine learning classifers to categorize the subject into healthy and dementia individuals. Initially, data was collected from smart home living. Furthermore, features are extracted to detect dementia individuals using the dataset. In the last step, a machine learning and deep learning classifer are trained to detect healthy and dementia individuals. Figure 1 illustrates the overview of the proposed approach for dementia detection.

Data Selection.
We use a subset "Cognitive Assessment Activity (Kyoto)" of publicly available datasets (CASAS) to detect dementia individuals provided by [24]. As per our knowledge, CASAS is the only dataset that automatically detects healthy and dementia individuals using the data collected through simple daily activities in smart homes. Te dataset contains 400 individuals, from which 79 individuals (Mean age: 66) divided into 65 healthy and 14 are dementia individuals [3]. Tey performed daily life activities (i. e., dishes, paying bills, toileting, heating food, watching Tv, and reading newspaper) in smart homes. Data is collected from smart home sensors like motion, force, humidity, door, light, temperature, thermostat, and heat.

Data Preprocessing.
Data preprocessing is a procedure that transforms incomplete and inconsistent format data into a well-formed data set. Te data preprocessing procedure contains seven steps in machine learning. In the frst step, the dataset is acquired and all libraries are imported in the second step. Furthermore, dataset is imported and identifed and the missing values are handled . Te categorical data in the ffth step is encoded . Furthermore, the dataset is split, and in the last step feature scaling process takes place.

Missing Data
Handling. Data handling is a signifcant step in improving the efciency of the machine learning model. Frequently, real-life data sets are massive and hold many missing values that can afect the machine learning model's performance. We fnd a lot of missing values (null or ? Nan) in our data set. We removed some features that provided no information, whereas all features contained zero.

Minmax Scaler.
Sometimes machine learning models learn well if features are not scaled. Terefore, it is needed to scale the feature set for efcient model learning. Minmax scaler is the way of data scaling; it shrinks the data within the given range between 0 and 1 without changing the shape of the original distribution.

Features Extraction.
Te feature extraction step is applied to a raw dataset to convert it into a feature matrix for better understanding. Our dataset contains sensor data collected from a smart home with some dead and irrelevant sensors for simple life activities. To gain better insights and we extract relevant features of daily life activities.

Machine and Deep Learning Classifer.
In this section, we present the machine and deep learning algorithms used for healthy and dementia individuals detection. Machine learning and deep learning classifers are used in various healthcare applications such as cognitive health assessment, tumor detection, breast cancer detection, and lung cancer detection [13,25,26]. We use four machine learning algorithms: decision Tree (DT), Naive Bayes (NB), support vector machine (SVM), and multilayer perceptron (MLP). Furthermore, we use deep neural network (DNN) for healthy and dementia classifcation. DT is a rule-based classifcation or regression algorithm based on information gain and entropy. It consists of root nodes, decision nodes, and leaf nodes. Tese nodes are made based on information gain and entropy. Information gain must be the highest among all features to make a feature a root node. Tis is an iterative process until all features become nodes and reach the leaf node. We set the cross-validation parameter for DT to 10 and confdence to 1.0. We set the batch size to 100 for the NB classifer and kernel estimator to False. For the SVM classifer, we set the batch size to 100, kernel confdence to 1.0, kernel type to poly-kernel, and tolerance parameter to 0.0001. For the MLP classifer, we set the batch size to 100, the learning rate to 0.3, and momentum to 0.2.
We use a tuned deep neural network for cognitive health assessment. We tune various parameters to classify dementia and healthy individuals efciently. We use fve dense layers where in the frst dense layer, we set 12 neurons with Relu activation function. In second dense layer, we set 10 neurons with Relu activation function. In third dense layer, we set 8 neurons with Relu activation function. In forth dense layer, we set 6 neurons with Relu activation function. In the ffth dense layer, we set 1 neuron with a sigmoid activation function. A total of 711 trainable parameters are used to train the DNN model on the cognitive health assessment dataset.
To compile the DNN model, we use binary cross-entropy with Adam optimizer.

Experimental Analysis and Results
Tis section explains our experimental analysis and results through the proposed approach. Te purpose of our research work is to detect dementia individuals by evaluating daily life activities. Data splitting is an essential aspect of creating Computational Intelligence and Neuroscience a model based on data. In this way, the performance of the model can evaluate. Usually, train machine learning model data is divided into two parts: training data and testing data. We split the data is 80% as training data and 20% as testing data. Table 1 shows the results of decision tree classifer. For healthy individuals, the decision tree achieved a precision of 0.92%, recall of 0.92%, and f1-score of 0.92%. For dementia individuals, the decision tree achieved a precision of 0.91%, recall of 0.92%, and f1-score of 0.92%. Overall it achieved an accuracy of 0.92% for both individuals. It is seen that overall weighted average precision of 0.92%, weighted average recall of 0.92%, and weighted average f1-score of 0.92% for healthy and dementia individuals.   Figure 2(b) shows the ROC curve of the decision tree. Roc curves are frequently used to show a graphical representation of cut-of values. It can be noticed that the ROC curve started increasing from 0.0 to 0.9, and then it became fat. Table 2 represents the results of the Naive Bayes classifer. For healthy individuals, Naive Bayes achieved a precision of 0.63%, recall of 0.92%, and f1-score of 0.75%. For dementia individuals, the decision tree achieved a precision of 0.84%, recall of 0.45%, and f1-score of 0.58%. Overall it achieved an accuracy of 0.69% for both individuals. Te table shows the overall average precision of 0.73%, average recall of 0.69%, and average f1-score of 0.67% for healthy and dementia individuals. Figure3(a) depicts the confusion matrix of Naive Bayes for detecting dementia individuals. According to this fgure, out of 186 healthy individuals, Naive Bayes classifes 83 (63.47%) are healthy correctly and misclassifes the remaining 103 (36.52%) are dementia individuals. Furthermore, It is also shown that out of 195 dementia individuals, Naive Bayes predicts that 179 as dementia correctly and incorrectly, the remaining 16 are dementia individuals. It is noticed that the Naive Bayes classifer obtains low accuracy than the Decision tree. Figure 3(b) shows the ROC curve of the Naive Bayes. It is shown that the ROC curve started increasing from 0.0 to 0.3. Ten it gradually increased to 0.5 and kept increasing to 0.75. Table 3 demonstrates the results of SVM classifer. For healthy individuals, SVM achieved a precision of 0.86%, recall of 0.93%, and f1-score of 0.90%. For dementia individuals, the decision tree achieved a precision of 0.92%, recall of 0.84%, and f1-score of 0.88%. Overall it achieved an accuracy of 0.89% for both individuals. Te table shows the overall average precision of 0.89%, average recall of 0.89%, and average f1-score of 0.89% for healthy and dementia individuals. Figure 4(a) depicts the confusion matrix of SVM for detection of dementia individuals. Te graphical representation shows that out of 186 individuals, SVM classifes 157 as healthy correctly and misclassifes the remaining 29 as dementia individuals. Furthermore, SVM predicts that out of 170 dementia individuals, SVM predicts that 182 as dementia correctly and incorrectly, the remaining 13 are healthy individuals. It is noticed that the SVM classifer obtains low accuracy than the Decision tree. Figure 4(b) shows the ROC curve of the SVM. Te ROC curve started increasing from 0.0 to 0.79. Ten it gradually increases to 0.94. Table 4 shows the results of the decision tree classifer. For healthy individuals, MLP achieved a precision of 0.95%, recall of 0.98%, and f1-score of 0.96%. For dementia individuals, MLP achieved a precision of 0.81%, recall of 0.94%, and f1-score of 0.96%. Overall it achieved an accuracy of 0.96% for both individuals. It is seen that overall weighted average precision of 0.96%, weighted average recall of 0.96%, and weighted average f1-score of 0.96% for healthy and dementia individuals. Figure 5(a) depicts the confusion matrix of MLP for detection of dementia individuals. As per this fgure, out of 186 healthy individuals, MLP classifes 177 as healthy correctly and misclassifes the remaining 9 as dementia individuals. Furthermore, It is also noticed that out of 195 dementia individuals, MLP predicts that 191 as dementia correctly and the remaining 4 as healthy individuals incorrectly. MLP achieved high accuracy than decision tree, Naive Bayes, and SVM classifers. Figure 5(b) shows the

Deep
Neural Network. Figure 6 shows the accuracy and loss curve.

. Discussion
Tis paper proposed an approach to detecting dementia using machine learning (decision Tree, Naive Bayes, SVM, and MLP) and deep learning algorithms. We use CASAS simple daily life activities dataset for experiments. Te dataset consists of 1903 instances where healthy individuals are 976 and dementia individuals are 927. We used 80% data as training and 20% as testing. It is noticed that machine learning classifer perform well on data set in the compassion of deep learning. Specifcally, the MLP classifer outperforms all other classifers. It is expected that real-world datasets are small. Our study suggests using a machine learning classifer to get better performance in detecting dementia individuals.

Conclusion
Tis paper proposed a machine learning and deep learningbased approach to detect dementia in people. Tis approach focused on the automated detection of dementia individuals

Data Availability
Te [Cognitive health assessment] data used to support the fndings of this study are included in the article.

Conflicts of Interest
Te authors declare that they have no conficts of interest.