Edge Computing-Based Localization Technique to Detecting Behavior of Dementia

Wireless localization systems have significant impact in the field of human-driven edge computing (HEC). It became very attractive among the researchers and used in applications of numerous areas such as medical, industrial, public safety, logistics, and so on. Ultra-wideband (UWB) technology used in localization systems owing to achieving high accuracy in real-time. In this paper, we exhibit a UWB based localization system based on the edge computing (EC) paradigm to analyze the wandering behavior of the patients who are suffering from dementia disease in the large-scale form. Physical changes in the brain are responsible for dementia disease. The appearance of wandering behavior is a common manner of the patients, which also a threat and interference for caregivers. We used the UWB standard appliance to symbolize various sorts of wandering patterns, including pacing, lapping, and two random movements in the large 2D map. The flow of all the movements illustrated in the X and Y-axis. Support vector machine (SVM) and k-nearest neighbor (k-NN) algorithms used to classify all the patterns and accuracy result is above 99%. The result shows that the proposed system can achieve high accuracy in classification and satisfactory for applications in the medical area.


I. INTRODUCTION
The introduction of edge computing makes cloud services and resources convenient for end-users [1]. Implement resource-limited devices to execute real-time computation is the aim of edge computing [2]. Because of remarkable features, currently, edge computing techniques used in different kinds of applications. A combination of edge computing and localization draws significant attention to solve several kinds of problems. Implementation of the localization system based on edge computing reduces the heavy computational tasks from user end devices. It also decreases data transmitting time to improve localization performance in real-time. Therefore, reducing the computational task and minimizing transmitting and receiving time to servers can improve the performance of real-time localization systems.
Localization systems become very famous by contributing to automated object position detecting tasks [3]. Realworld applications using wireless indoor location systems comprehensively such as location detection of patients or The associate editor coordinating the review of this manuscript and approving it for publication was Lu Liu . important medical equipment in a hospital, location detection of workers and products in the industry, location detection of polices in a building, and so on. The procedure of detecting location using wireless technology is known as geolocation, location sensing, or position location, and it has a high requirement for exact positing in indoor and outdoor environments [4], [5]. Various sorts of location-based information used by different applications where physical location is famous for expressing on a 2D/3D map. In recent years, various distinct technologies used for wireless indoor location systems.
UWB used in location systems for position estimation in indoor and outdoor environments. UWB is a come up technology with various approaches in wireless technologies and has many feasible applications that help to build extensive research interests in it. UWB technology consumes low power, transfer data at high rates, and can easily identify by the use of high bandwidth, which is at least 500MHz [6]. The capability of high bandwidth helps UWB to resolve lots of problems in different fields. Several UWB based location systems available to use for positing where our used system made up with IEEE 802. 15.4a UWB standard and also a combination of low power CMOS chip [7].
Wandering behavior is a frequent manner of the patients who are suffering from dementia and Alzheimer's disease (AD), and studies show that it exhibits as a disease progresses in 67% of peoples with dementia [8], [9]. Patients with dementia disease always suffer from memory loss, exhaustion, and orientation problems, and those responsible for adverse issues such as accidents, malnutrition, fall-down, and injure himself [8]. Detecting wandering patterns help to study the abnormal behavior of people with dementia. Types of wandering behaviors combined with distinct patterns, and they can be detected using several ways [10]. Various approaches covered to detect wandering patterns. Sometimes the patients examine in indoor environments, and lots of specialized indoor location systems invented to track people. Indoor location systems applicable to detecting wandering problems in indoor environments.
This paper aims to detect the wandering problems of the patients using UWB based indoor location system. The UWB based location system helps to define the wandering behavior by using the instruments, and with machine learning algorithms, we classify the measured data for recognizing every wandering behavior. SVM and k-NN are two popular machine learning algorithms where SVM used for classification and regression tasks, and k-NN used to determine the single point from classes in classification tasks [11], [12].
With introduction, the remainder of this paper is as follows: Section 2 review the motivation of the work, Section 3 describes about related works, Section 4 discuss about preliminaries of the study, Section 5 contains system model, Section 5 presents about methodology, Section 7 illustrates the experimental result with discussion and Section 8 concludes the paper.

II. MOTIVATION
In the last ten years, the progress of using localization systems is high, and it's new in the research area; that's why peoples are focusing on research and development of these systems [3]. Currently, researchers focus on using GPS, RFID, cellular-based, UWB, WLAN, and Bluetooth technology in indoor location systems to make the solution for several complications [13]- [19]. UWB technology performs considerably well in indoor location systems, which make curious the peoples of academic and industrial. UWB based localization systems famous for use in tracking purposes. Lots of healthcare technologies and systems made of tracking ability to support the daily life of patients like dementia. Techniques like GPS, CSI, mobile applications, video, and image processing used for tracking patients with dementia (PwD); in contrast, the UWB technique diverse and reliable than others which motivate to use in this study [9], [13], [20]. Patients with dementia disease are occasionally suffering wandering problems because of memory loss and other problems when the disease progress, which acts as a serious major concern for the patient's family members and caregivers. To defend the patient's life from wandering problems and enhance their life with the help of technologies like tracking is the motivation of the study.

III. RELATED WORKS
Wandering behavior commonly showed up to patients with dementia and various technologies used by the people in academics for detecting wandering patterns. Various tracking systems used in indoor and outdoor environments to detect wandering patterns in previous works. Numerous commercial products are available recently, and many of them can be utilized in tracking patients with dementia disease.
Using mobile phones for tracking patients with dementia is a great example. In [20], they developed an android device-based mobile application for detecting dementia to improve the quality of treatment. In [21], they use mobile phones for supporting patients with wandering problems by locating them. Their systems also can send notifications through messages and emails to the caregiver's mobile phone when the patient goes out from home. In [22], they developed a mobile healthcare application for detecting wandering behaviors in indoor environments, and it also sends an alert message when wandering behavior detected. In contrast, the above mobile-based approaches performed well. Still, some conditions remain such as the poor network problem which stops to send notifications, the chance of losing mobile phones and stop working on the mobile application. Our UWB scheme is different than the mobile-based scheme because there is no network related problem, no need to concern about losing mobile phones and stop working on any applications. The global positioning system (GPS) is attractive in tracking purposes and used for tracking dementia patients in prior works. In [23], they used a GPS based personal digital assistance (PDA) to examine the patients in the COGKNOW project, which also can be utilized for disoriented patients to get back home safely. In [8], they developed a system called GPSshoes, a geo-defense device that specifically designed for tracking patients with dementia disease. In [24], they used a GPS system with a normal mobile phone to monitoring and detecting disorientations in the walking of patients with dementia. In [25], GPS attached with a drone that acts as a flying sensor and used for monitoring. Above GPS-based schemes worked well though have some limitations of working in an indoor situation like low signal problems, dependency on other devices, however in our UWB scheme, there is no problem of low signals and it is run smoothly without the help of other supporting devices.
With the mobile phone and GPS technology, other technologies such as travel pattern recognition, S-band sensing technique, accelerometer sensors, and image processing techniques applied to solve the peoples wandering problems. In [26], they inspected patients with dementia problems using travel patterns. In the time of inspection, an electronic ankle tag attached to the subject's ankle, and the tags traveled with the subject in all areas and subjects travels activity monitoring VOLUME 8, 2020 in real-time by using a video recording system. In [9], they use the S-band sensing technique to detect wandering problems of patients with dementia. In [27], they used a tri-axis accelerometer-based system to gather data and make a combination with temporal information to determine the activates of elderly peoples and also decrease the risk of wandering problems associated with dementia. In [28], they proposed a system which applied image processing based fluorescent dye technique to identify the risk of wandering problems in elderly persons. In [29], they designed device-to-device communication systems for indoor localization using 5G. In [30], they used wireless sensor network-based devices named with Zigbee for indoor localization. All the above schemes are different than others and have issues also like as wearing a device on ankle not always comfortable, use of S-band sensing not always provide better information for usage and use of image processing cost lots of time to process data. Over against in our scheme, the device is comfortable to wear, provides accurate information and data processing are quick and easy.
Overall, compared with the discussed prior works, we use a UWB standard tools for indoor location systems for investigating wandering patterns in the indoor environment, and there is no need for any technologies or techniques like mobile phones, accelerometer, GPS, and travel pattern recognition. UWB based indoor location system is popular for providing accurate results with consuming low power in real-time.

IV. PRELIMINARIES
A. ULTRA WIDEBAND TECHNOLOGY UWB technology grows massive consideration at the laboratory level in current years for indoor and outdoor location estimation tasks. Some location estimation systems use ultrasound, which has some drawbacks like limited range and cannot go through walls while UWB has no such problems. UWB technology established by spreading ultra-short pulses, which are less than 1ns with a lower duty cycle (typically 1:1000), and bandwidth is 500MHz on a spectral-domain [3]. UWB technology always performs with exceptionally higher bandwidths, which is similar to other narrow-band signals such as GPS, GSM, UMTS, and so on.
The Federal Communication Commission (FCC) of the USA decided the bandwidth is larger than 500MHz, and the center frequency is larger than 2.5GHz for the UWB systems [6]. Therefore, the fractional bandwidth can be defined by, where FBW is the fractional bandwidth, B is the bandwidth, and f c is the center frequency. The bandwidth estimated at -10dB point, and high frequency and low frequency regulate the location of the point. Based on high and low frequency, center frequency f c can be defined by, where f H is the high frequency, and f L is the low frequency.
Using the center frequency value in equation 1, we have fractional bandwidth as like, Direct and two-step are two accepted approaches for position estimation in UWB. UWB signals transmitted in short duration pulses and proper use of time-of-arrival (TOA) can resolve UWB short-pulse waveforms in an accurate way [31], [32]. UWB location systems help to accomplish higher indoor location accuracy (20 cm) by imitating the behaviors of time synchronization of UWB communication [3]. Therefore, UWB location systems applicable to 2D and 3D localization in real-time. UWB signals can go through walls, clothes, and apparatus easily but cannot go through liquid materials. More definite theories on UWB given in [31]- [34]. More benefits on UWB discussed in [18], [35]. Along with benefits, UWB technology has some regulations in use. The FCC set up a restriction on the power of signals to avoid interference with others [6]. Recently, various sorts of UWB based toolkits are available such as decawave, Ubisense series 7000, and SpoonPhone.

B. SUPPORT VECTOR MACHINE
The support vector machine (SVM) is efficient and suitable for classification large numbers of data and classifies given data in the definite class [36], [37]. SVM proposed by Vipnik [36] and capable of providing high performance in classification tasks than other machine learning algorithms [39]- [41]. SVM maximizes the geometrical margin and minimizes the empirical classification error that why it's called a maximum margin classifier and belongs to the family of generalized linear classification [42]. SVM creates a map of spread vectors in a high dimensional space where a maximal separating hyperplane created [43] and two parallel hyperplanes created with a maximum separating hyperplane in the middle. The separating hyperplane always tries to maximize the span of two parallel hyperplanes. Assume, we have some data points in (X 1 , Y 1 ) , (X 2 , Y 2 ) , . . . . . . . . . , (X n , Y n ) form and n stand for the number of samples where every single X n is an s-dimensional real vector. Therefore, the separate hyperplane can be defined by, In Equation (4), w is the s-dimensional vector, and b is the scalar. In the separating hyperplane, w marks perpendicularly, and the margin increase with the help of offset parameter b [43]. The maximum margin is the main reason to put the focus on SVM.
Based on the linearly separable training data, both hyperplanes can possible to select. Samples of SVM known as support vectors (SVs) and stay with hyperplanes. The separating hyperplane with the highest margin can be defined by M = 2/|w|which use to establish support vector means of training data. Kernel function helps to operate in high dimensional, which is also famous for using in SVM. Lots of kernel functions are available for use, where we used radial bias function (rbf) and sigmoid function. One-against-one and one-against-all are the approaches where one-against-all used in the experiment. More definite theories on SVM was given in [38]- [44] and on the multiclass classification given in [39], [45].
C. K-NEAREST NEIGHBOR k-nearest neighbor (k-NN) known as an admirable statistical machine learning algorithm and can be used for classification and regression predictive issues. k-NN is very straightforward in use and broadly use for data classification issues in the industry [42]. Measuring the distance between all the training and testing samples, the appropriate choice of the neighbors with greater distance, is the common behavior of k-NN [12]. In k-NN, classification performs depends on the maximum vote of its neighbors, and the value of neighbor is constant, which also depends on the selection of the users. Euclidean, Manhattan, Minikowski and Hamming function are four popular distance calculation functions used in k-NN. Euclidean, Manhattan, Minikowski use for continuous variables and Hamming is using for categorical variables. In the experiment, all used data are continuous, therefore the Minikowski distance function chosen for the calculation. Equation 9 presents the formula of Minikowski distance function. More specific theories on k-NN presented in [12], [42]- [45].
In this portion, we explain the system model, which helps to figure out how the system worked. Our system model divided into six sections, and they are wandering patterns, client layer, capturing data, edge layer, classification and cloud layer.

A. WANDERING PATTERNS
Recent statistical reports are indicating that we are now in the era of an aging population. Older peoples face various sorts of problems because of decreasing their health status by increasing their age [46]. Dementia diseases commonly show up in the people of old age because of a lack of mental ability, and wandering behavior commonly shows up because of dementia. Older people present wandering behaviors like repeating movements with no specific goals, random movements, lack of adjustment in time. Wandering behaviors responsible for serious problems like accidents, injuries, getting lost, and so on, which is a serious concern to the caregivers. Lots of technology is available for detecting the wandering behaviors of patients with dementia. Wandering behaviors can be classified with the help of movement patterns. Several attempts were taken to define wandering behavior, and widely accepted definition still not visible because this behavior is  very complex [47]. Algase [48] defined wandering behavior as a syndrome of dementia-related locomotion behavior which has frequent, repetitive and temporally-disorder and they can be illuminated in lapping, random or pacing patterns. In [49], they use three spatial movements, including pacing, lapping, and random, as wandering patterns. In [50], they use spatial and temporal movements as wandering patterns where spatial movements include pacing, lapping, and random movement, and temporal movements include non-walking stages. In [46], they use pacing, several lapping steps, and random movements as wandering patterns. We define mainly three wandering behaviors and those are pacing, lapping, and random. We define two forms of random behavior named random1 and random2. We did not include the direct pattern because it is not recognized as wandering behavior and not complex like others. From Figure 1 to 4,  we illustrate four separate travel patterns of patients with dementia.
The Patient will start walking from the starting point to the destination point and again come back to the starting point in the time of the pacing pattern. For the lapping pattern, the patient moves circularly from the starting point to the destination point. At the time of the random pattern, the patient will walk randomly. The random pattern is different from other patterns and can be in several forms, therefor we choose two random patterns, and they are separate from each other.

B. CLIENT LAYER
The client layer consists of devices, which continuously collect data from the UWB device. Before sending the data to the client layer need to process the data and make it meaningful.  After finish processing, all data transfer to the edge layers using the data transmission technique. The advantages of our model are that device for the client layer is independent which help to use different types of device in the client-side. For example, a mobile or raspberry pi device can easily be attached to the system without changing the edge and cloud layer.

C. CAPTURING DATA
At the time of the experiment, a log file creates by the software, which contains all the information. Log file adds data after every 300 milliseconds. More about log file describe in gathering tracking data portion of the methodology section. From the log file, every location estimation (LE) line contains the value of X, Y, and Z coordinates in third brackets. From the value of X, Y, and Z, we collect and use only the values of X and Y because we use the device for two-dimensional tracking. The values of X coordinates for all wandering patterns of one person present in Figure 5, and the values of Y coordinates for all wandering patterns of one person present in Figure 6.
All wandering patterns are separate from each other because their behavior and performing time is different. From  Figures 3 and 4, we can observe the performance time of all patterns is different. The performance time of pacing, lapping, random 1, and random 2 was 30, 60, 33, and 33 seconds accordingly. At real-time data can be stored for a long time but for the experiment purpose, we perform in a short time. We performed the experiment in a furnished room like Figure 2 with the presence of the people, which helps to observe distortion in the data. During the experiment, pacing pattern performed as usual and their signs were different in both the X-axis and Y-axis. Lapping pattern performed in the circular path as like as Figure 2(b). Various sorts of random patterns can be possible that why we only present two random patterns and those are different from others. Points defined in the random paths and subject instructed to walk each point randomly. In the X-axis and Y-axis, the sing of two random patterns is different and clearly differentiable then pacing and lapping.

D. EDGE LAYER
The edge layer performs heavy computation tasks to calculate localization in real-time. In our model, the edge layer receives meaningful data from the client layer for classification. After classification, it predicts the location result and sends it to the cloud layer using a web-socket. It reduces the computation power of the client layer by performing heavy computational tasks.

E. CLASSIFICATION
Classification is a technique where ideas and objects are recognized and differentiated, which is also relevant to categorization. Several sorts of ML-based algorithms using for classification tasks. In our experiment, we use SVM with kernel functions and k-NN algorithms to classify captured wandering patterns data. In the prior works, using ML-based algorithms is low and most of them use GPS sensors for tracking for that reason customized algorithm used. In [9], they use the only SVM with kernel functions and in [51], they used principal component analysis (PCA) to filter the dataset. SVM and k-NN both algorithm good in classification and used in lots of prior works. We used SVM and k-NN because both work well on small datasets, easy to implement, very powerful learning algorithms with well-defined theory, and can accept different parameters. SVM and k-NN better than linear regression (LR) because SVM handle outliers better than LR and k-NN is not parametric like LR. The complexity of the decision tree (DT) is downside which is not visible in the SVM and k-NN model. K-NN does a better job than naïve bias to finding similarity between observations. SVM is better than naïve bias to capturing features because naïve bias treat features independently.
Train and test are two portions where data divided at the time of classification. Data on the train portion used for training the model and data of a test portion used for testing the trained model. All data split up into train and test depends on percentages, and the proportion of the percentages depends on the user. For our experiment, we make four groups by splitting data into train and test based on percentages. A list of four groups with the proportion of the percentages presented in Table 1. Value of X and Y coordinates of all wandering patterns prepare by the following four groups.
Algorithms classify data based on groups and helps to understand which algorithms perform nicely on which group or groups; that's the advantage of the use of group-based train and test split data.

F. CLOUD LAYER
The cloud layer stores all the information in its storage. All information related to user behavior and their location information. Those stored data helpful for further processing. With the help of the cloud layer, any kind of quires can run on historical information and possible to get relevant results. Accessing the data and getting valuable information from anywhere in the world is the advantage of the cloud layer.

VI. METHODOLOGY A. SETUP FOR TRACKING
In our research, we used tools compliant with IEEE 802.15.4-2011 UWB standard sensors, and they fully unified low power and single-chip CMOS radio transceiver IC. Using two-way ranging TOF measurements, appliances have the ability of proximity detection (1-D) to an accuracy of ±10 cm and in real-time location (2D and 3D) the proximity detection to an accuracy of ±30 cm using two-way ranging TOF measurements or one-way TDOA systems. The RF bands of the tools are 3.993 GHz with 110 kbps data rates and in ideal conditions, the highest detectable range of the modules is 300m. The tools commonly used for tracking, geo-fencing, and navigation use case. As we use tools for tracking, that's why the setup of the tool kits follow the setup of the tracking use case.
In the experiment, four same types of equipment used, and at the mounting time, it recommended to place equipment 15cm away from the nearest wall or any other objects. All the tool kits consist of fully functional EVB1000 evaluation board complete with UWB standard chip, ARM programmable processor, LCD display and an omnidirectional antenna. Among four equipment, one worked as a tag and the other three worked as anchors for tracking operation. From 3 anchors, anchor 0 connected with a PC or laptop. It recommended to mount three anchors at the same height, and the mounting height lies between 2-3m. In Figure 7, we present a typical scenario of setup tool kits for tracking.

B. GATHERING TRACKING DATA
A portable software used in the PC, which one connected with anchor 0 to records all the performance between anchors and tag in real-time. The Software runs an interface that contains four panes, and they are anchor table pane, tag table pane, display pane, and setting pane. The software with the interface helps to understand the operations and data observation in real-time. A log file is created, which records all the operation between anchors and tag in real-time and applicable for analyses after the test. In Figure 8, we present a scenario of a log file with the specification. Log file records the position of the tag after every 300 milliseconds and also contains lots VOLUME 8, 2020  of information, including timestamp, code version, channel no, anchor no, anchor positions, range reports, locations estimate, tag statistics. The value of X, Y, and Z stays in the location estimate line accordingly, which helps to understand the position of the tag. Log file saves as a text file format, and it is applicable for analyses after the test.

C. DATA PROCESSING AND PATH RECOGNITION
After performed the operation between anchors using the tag, log files were gathered to analyze. To analyze the data, only the value of X, Y and Z collect from the log file and separate them in class wise. After separating all the data, we used two ML-based methods to classify the data and recognize the path. In our study, after collect data and before using the data in ML-based algorithms, we did not use any automatic process which collects data from the log file and label the data class-wise for classification purposes. This issue discussed as future work in the conclusion. Few prior studies design own methods for data processing such as in [47], they used an infrared sensor to track wandering behaviors and developed two algorithms to identify special patterns. In [51], they used GPS sensors and also used three algorithms to recognize paths because every behavior effects on angles. In [52], GPS used in there study and developed θ _WD named algorithm to recognize wandering paths. In our study, we used advanced UWB sensors for which no need to develop any method for gather data and collected data easy to handle in a manual way for preprocessing. Processed data easy to use in SVM and k-NN algorithms and possible to get good accuracy results because provided UWB sensors data is sensitive and easy to separate.

VII. RESULTS AND DISCUSSION
In this portion, we explain the result of the experiment and make discussion based on the result, which helps to understand the performances of the UWB based sensors and methods.

A. DATA ACCUMULATION
In this study, we used UWB based sensor for tracking patients with dementia diseases and collect wandering patterns data then classify using ML algorithms. As we used the tools for 2D tracking, therefore we collected X and Y axis data for every four patterns. We used ten human subjects with IRB approval to perform wandering patterns at the time of the experiment. Five subjects are male, and five subjects are female, from 10 human subjects where all subjects are students in the profession. The experimental area was 10m long in length, 10m long in width and 3.3m long in height. Experimental area furnished with sofa, table and shelves like Figures 1 to 4 where the students can work. In Figure 9, we present a typical scenario of the experiment and the process of data collecting. As we state above that, we used four devices, and from them, for tracking, we use three devices as anchors and one device as a tag.
The placement distance between anchor 0 and anchor 1 was 8m, and that distance acts as the Y-axis. The placement distance between anchor 0 and anchor 2 was 8m, and that distance acts as the X-axis. The height of all three anchors was 2m from the floor, and we used stands to hold anchors. Selected all human subjects to wear a tag by hanging from the neck and performs wandering patterns.
Every human subject instructed to perform according to four predefined wandering patterns and also instructed to perform one pattern ten times. Therefore, after performing  all patterns, we captured a total of 400 data (10 subjects × 4 patterns × 10 times) for both X and Y-axis. As patterns performed in a two-dimensional area, that why depends on the subject movements value of X and Y axis changed at the same time. For these reasons, we used the value of X and Y all together for classification. At the time of classification, all the patterns known as class. Science, the repetition for each class is 100 for both X-axis and Y-axis so, a totally 800 data of patterns used for final classification.

B. EXPERIMENTAL RESULT
In this section of this paper, we present the experimental result of the X-axis and Y-axis data after classification by using ML algorithms. SVM with three kernel functions and k-NN with five neighbors used for classification tasks. Classification tasks performed on the computer with the help of software and programming libraries. A List of used software and programming libraries presented in Table 2.
We use the radial bias in short rbf function and sigmoid function as a kernel function of SVM in the time of classification, and for the k-NN, we fixed the value of k = 3, which means k-NN classify data by depends on its three nearest neighbors. As we captured 400 data for both the X and Y axis for all five wandering patterns, we classify the X-axis, and Y-axis data altogether (total 800 data) by splitting data into train and test depends on the proportion of percentages followed by groups (refers to Table 1). Accuracy results of the classification of all data using ML algorithms presented in Table 3.
From Table 3, all the classification results of every group are acceptable, and the accuracy result lies between 95%-99%. The activity classification result commonly presented as a confusion matrix, which helps to understand how the accuracy result came out and which class miss predict with which class. The confusion matrix of every group for the SVM-rbf algorithm Figure 10.
From Figure 10, we can observe that few values of ran-dom1 class mismatch with random2 class in group 1 and 2. In groups 3 and 4, values of random 1 did not mismatch with random 2. In contrast, in every group, values of random2 mismatch with random1. There is no mismatched between pacing and lapping classes. The confusion matrix of every group for the SVM-sigmoid algorithm presented in Figure 11.
From Figure 11, we can observe that in group1, 2 and 3, mismatch happens between random 1 class and random 2 class. There is no value of random 1 mismatch with random 2 in group 4. No mismatch visible with pacing and lapping class. Ratio of mismatch in group 3 and 4 is lower than group 1 and 2.
From Figure 12, in every group, there is no mismatch in class pacing and lapping. Values of random 2 misclassified with random1 in each group. Except for group-1, values of random 1 class is not misclassified with random 2 class. Therefore, after analyzing the confusion matrix of all data using two algorithms by following four groups, we can observe that all classes are different from each other, and the similarity rate between all classes is so low and also depends on the performance. To figure out the performance of the used ML methods for classification, we utilize three metrics and those frequently used in statistics. Precision (PR), recall (RE), and f1-score (F1) are three metrics and the precision defined as, F1-score defined as, Precision, recall, and f1-score of all classes followed by groups presented in Table 4.
From Table 4, it is clearly visible that pacing and lapping have a high accuracy rate in precision, recall, and f1-score. In contrast, the accuracy rate of both random patterns is low and stays between 91% to 98% in precision, recall, and f1score. So, after analyzing the result from three above matrics, we observe that data gathered from the UWB sensor for pacing, lapping and random patterns are clearly separable using ML-based methods.

C. DISCUSSION
In this section, we discuss the accuracy results of both X and Y-axis data. We used the SVM algorithm with two kernel functions; they are rbf and sigmoid function and used a k-NN algorithm with the value of k=3 for the classification task. In Figure 13, we present a figure of the bar chart to present the accuracy results of all data in algorithm wise. From Figure 13, SVM with two kernel functions and k-NN with a value of k=3 algorithms performed well with all data of the X-axis and Y-axis and the result is acceptable where accuracy result lies between 95% to more than 99%. SVM with rbf performed well in group-3 where accuracy is 99.37%, and in other groups, accuracy lies in 98.33% to 98.75%. SVM with sigmoid performed well in group-4 where accuracy is 97.50%, and in group-1, 2 and 3, the accuracy result is lower than other results. k-NN3 performed well in group-3 and accuracy is 99.37%.
So, from the above discussion, SVM with the sigmoid function performed lower then SVM with rbf and k-NN3 in all groups for all data. From SVM-rbf and k-NN3, k-NN3 performed better.
In the previous works, GPS, infrared sensors, media devices, accelerometer, and S-band sensing used for the tracking path of dementia patients. Different schemes performed well and provided good results with their own limitations. In [47], they used infrared sensors and achieved 98% accuracy for path recognition. The grid-based layout scheme used for tracking in [53] and identification accuracy was 90%. S-bend sending used to detect the path of wandering patients in [9] and gained an accuracy of 90%. Using the GPS scheme is famous to recognize wandering paths and in [52], they used GPS device with algorithms and the accuracy result was 90%. In our study, we used UWB sensors to gather paths and recognize using ML methods and achieved more than 98% accuracy for path recognition which is better than those results.
Lots of complexity visible in the prior works like for the preprocess data from GPS, and infrared sensor need to developed algorithms wherein our study we easily preprocess the UWB sensors data manually and classify it. Benefits of using UWB sensor is comparable than other schemes such as no need to develop extra algorithms, no problem when it wears with clothes, easy setup than S-bend sending, no signal problem like GPS schemes and the data is easy to understand for further work.

VIII. CONCLUSION
In this paper, we proposed a unique system by using edge computing-based localization techniques with machine learning algorithms to detect wandering behavior patterns of patients with dementia disease. The fundamental uniqueness stays in the system design to detect patterns of the dementia disease by use of edge computing technique; use of UWB device to capture pattern related data and use of ML methods to classify data. UWB device used to work in 2D or 3D area and by using it in the open area, we collected the data on wandering patterns. As we use the 2D area, we separated data in X and Y coordinates and classify using an SVM algorithm with two kernel functions and k-NN with the value of the k = 3 algorithm. The classification result was as expected and lies between 97% -more than 99%. The experiment performed in an indoor environment, and with the results, it shows that the proposed system is dependable, capable and perfect for use in the experiment. Along with the better result, still limitations visible using the UWB sensor, which manually processes of data for labeling and making solutions for this limitation can be considered as future work. Therefore, depending on the experimental result, we can conclude that higher ability and good accuracy make the proposed system can be a good solution for patients with dementia in healthcare systems.
FADI AL-TURJMAN received the Ph.D. degree in computer science from Queen's University, Kingston, ON, Canada, in 2011. He is currently a Professor at Near East University, Nicosia, Cyprus. He is a leading authority in the areas of smart/cognitive, wireless, and mobile networks' architectures, protocols, deployments, and performance evaluation. His publication history spans over 250 publications in journals, conferences, patents, books, and book chapters, in addition to numerous keynotes and plenary talks at flagship venues. He has authored/edited more than 25 books about cognition, security, and wireless sensor networks' deployments in smart environments, published by Taylor & Francis and Springer. He has received several recognitions and best papers' awards at top international conferences. He also received the prestigious Best Research Paper Award from Computer Communications journal (Elsevier), for the period 2015-2018, in addition to the Top Researcher Award for 2018 at Antalya Bilim University, Turkey. He has led a number of international symposia and workshops in flagship communication society conferences. He currently serves as a lead guest editor for several well reputed journals, including the Computer Communications (COMCOM) (Elsevier), Sustainable Cities and Society (SCS), IET Wireless Sensor Systems, and Springer EURASIP and MONET journals.
XIAODONG YANG (Senior Member, IEEE) has published over 100 articles in peer-reviewed journals. His main research area is body area networks. He received the Young Scientist Award from the International Union of Radio Science, in 2014. He is on the editorial board of several IEEE and IET journals. He has a global collaborative research network in the related fields. VOLUME 8, 2020