ALZO: an outdoor Alzheimer's patient tracking system using internet of things

ABSTRACT


INTRODUCTION
Alzheimer's or dementia Alzheimer's is a disease that attacks the human brain.Most Alzheimer's patients are above 65 years old [1], [2], but it is also possible that younger people are affected, which is known as the early onset.People with dementia Alzheimer's have changes in their behavior, intelligence, and motoric [2]- [4].The stages of Alzheimer divided into three stages: early (such as forgetting a little thing), mild (such as forgetting the way back home), and moderate (i.e., fully dependent on others and requiring assistance) [5], [6].Until now, no medicine could cure this disease [7], but there is a method to prevent the degenerative process by being active outdoors, especially in open green spaces.Being outdoors could stimulate the patient's brain to learn again so that the degenerative process will be [8].When using this method, the problem of getting lost back home will likely increase.Therefore, monitoring patients' outdoor activities is essential to avoid patient loss due to disorientation [9].
The technology could support Alzheimer's patients in daily life.The most common technologies are wearable devices and smartphones to track patient activity outdoors.In recent years, wearable devices have been developed to assist daily human life [6].Wearable devices are electronic devices that can be attached to the human body, such as a smartwatch, belts, shoes, necklaces, and glasses [10].A wearable device consists of electronic components, sensors, and a microcontroller.Wearable devices are closely related to internet of things (IoT).In contrast, IoT could be described as a concept of interconnecting devices to the internet and facilitating data exchange between devices through the internet [6], [10].In addition, IoT data could be integrated with artificial intelligence (AI) to provide advanced solutions [11].
A wearable device could be equipped with global positioning system (GPS) sensors to track patient location outdoors in real-time [9], [12].Some studies have already used GPS technology for tracking Alzheimer's patients outdoor [13]- [16].Adardour et al. [17] uses a wearable device shaped like a belt to track patient location using GPS and Wi-Fi to send patient location to a server.
In addition to monitoring patient location, monitoring Alzheimer patients' body movement is also essential.Alzheimer's patient's motoric function is also affected, leading to the risk of stumbling and falls.A fall detection algorithm can use another sensor, such as inertial measurement unit (IMU).Considering the IMU sensor position in a wearable device, it is essential to determine where the wearable device should be attached.Possible wearable device attachment includes the torso, thigh [18], waist [19], wristband [20], eyeglasses [21], and foot [22].All of those positions could be used to monitor the movement of the human body.
Wearable devices also need network connectivity to communicate through the internet, preferably using wireless technology.The most common wireless technology for wearable devices is mobile cellular (2G, 3G, 4G, 5G), Wi-Fi, long range radio (LoRa), and narrow bandwidth IoT (NB-IoT) [23], [24].In our work, we use mobile cellular with a 2G signal.In addition to network connectivity, an IoT system also needs a communication protocol such as message queuing telemetry transport (MQTT), constrained application protocol (COAP), extensible messaging and presence protocol (XMPP), and representational state transfer (REST).The MQTT is the most commonly used because it is simple and lightweight.MQTT consists of three entities: a publisher (an entity that publishes data through the MQTT topic), a subscriber (an entity that listens or subscribes to an MQTT topic for reading data), and a broker (a medium that connects the publisher and the subscriber) [25].
This paper describes the development of Alzo, a wearable device with an android-based mobile application that can be used for tracking Alzheimer's patient activity outdoors in real-time.Alzo will be attached to the patient belt and it consists of an IMU sensor, a GPS module, and a mobile cellular (2G) transceiver.The contribution of our work is: − We leverage IoT technology to support Alzheimer's patients' daily activities.

−
We develop an efficient falling algorithm based on IMU data.

−
We develop an interactive Alzheimer patient monitoring application with many essential features such as real-time and live patient tracking, geolocation route suggestion, and real-time alarm reporting.This paper is structured as follows.Section 2 explains our research methodology for designing the wearable device, mobile application, and system algorithm.Section 3 discusses the results of our experiments.Section 4 describes the conclusion and future work.

METHOD
In this section, we describe Alzo architecture, components of Alzo, tracking and fall detection algorithms, the role of the server in maintaining data, and the design of its accompanying mobile application.The overall architecture of our system is shown in Figure 1.It consists of three parts.The first part is a wearable device that contains a GPS module, an IMU sensor MPU6050, push buttons, an ESP32 microcontroller, and a global system for mobile communications (GSM) module SIM 800L.The second part is a dedicated server for storing data in a database, operating as a broker for MQTT, communicating with the firebase cloud messaging (FCM) service that triggers push notifications [26], and for responding to data requests from Android clients.The third part is the Android mobile application that will be used by caregivers to track the patients.Alzo consists of some modules and electronic components.As mentioned before, the wearable device used by the Alzheimer's patient was designed to track the patient location, body position, and orientation.Collected data will be sent to the server as GPS data (latitude, longitude, and timestamp), which will be sent through a mobile cellular signal.Figure 2 shows the schematic diagram of the proposed wearable device.The wearable device consists of a GPS module U-Blox NEO-6M, an IMU sensor MPU6050 that consist of accelerometer and gyroscope sensors, an organic light-emitting diodes (OLED) display to show current timestamp, and two push buttons (for turn on the device and send GPS data to the server manually).It is also equipped with a 400 mAH lithium polymer (LiPo) battery and a charging module, including a battery management system (BMS).Moreover, SIM 800L module was used for internet connectivity.Alzo is packaged into a casing made using a 3D printer, as shown in Figure 3. Figure 3(a) is the right side which consists of a charging port, Figure 3(b) is the bottom side which consists of a button for turning on/off the system; Figure 3(c) is the backside which contains a hook part for attaching to the patient belt; Figure 3(d) is the front side which consists of help push button and OLED display.The dimension of the wearable device in total is 14.5×3.5×7.5 (including the casing).In the future, it could be resized smaller by embedding all the components and modules into one board.The workflow of the Alzo program is shown in Figure 4.When the device is turned on, the first thing that will be executed is the initialization of the GPS module, MPU6050 sensor, OLED display module, and general-purpose input output (GPIO) pins of the LilyGo.Afterward, the program connects to a provider of subscriber identity module (SIM).If successful, the program will attempt to connect with the access point name (APN) provider for internet access.With internet access capability, Alzo could connect to an MQTT broker.After connecting to the MQTT broker will show a timestamp on OLED display, which indicates the wearable device's readiness.The program also detects whether the help push button was pressed; if pressed, Alzo will send GPS data (latitude, longitude, timestamp, and lost condition) to the server through the declared MQTT topic.Otherwise, the program will try to detect the patient body position that will be used by the fall detection algorithm.If a fall is detected, then it will send GPS data (latitude, longitude, timestamp, and fall condition) to the server through the same MQTT topic as before.

Fall detection algorithm
We use a fall detection algorithm using a threshold mechanism similar to [27].In our proposed algorithm, three types of thresholds will be used: lower-alpha threshold, higher-alpha threshold, and theta threshold.Lower alpha indicates the patient is active or doing some activity, while higher alpha means rapid acceleration of patient activity.Moreover, theta indicates the patient's body orientation changed rapidly after quick acceleration.
Alpha is the sum of acceleration in triaxial axes; when the patient moves, they will produce acceleration in every axis.The sum could be calculated to make the total acceleration of patient movement.Furthermore, theta is the calculation of quaternion in triaxial axes, where quaternion is a complex mathematical calculation to detect rotation.The authors considered the threshold-based algorithm suitable for this compact wearable device because of the simpler computation for LilyGo.In contrast, machine learning algorithm has complex computational requiring higher microcontroller specification.In addition, alpha and theta are given by the following (1) and ( 2 (2) Figure 5 visualizes the computation flow of our proposed fall detection algorithm.This latter begins with capturing accelerometer and quaternion data from digital motion processor (DMP) feature in MPU6050.Afterwards, the program will calculate the alpha value from accelerometer data.If the value is greater than the lower-alpha threshold, it indicates the patient is actively doing everyday activities.It then continues to calculate the alpha value again, and if this time the alpha value is greater than the higher-alpha threshold, then it indicates the patient accelerates significantly.If the patient's acceleration cuts through higher-alpha threshold, then the algorithm will continue calculating the theta value.Next, if theta value is bigger than the threshold it indicates the patient's body orientation changed significantly.If the theta value is greater than the threshold for more than 10 seconds, then it could be concluded that the patient is fallen.

Figure 5. Fall detection algorithm
Table 1 shows all the thresholds that were obtained by doing some experiments on everyday activities such as standing up, walking, jumping, cycling, sitting down, jogging, bowing, and squatting, as well as falling actions such as falling forward, backwards, fall to the left and fall to the right.Figure 6(a) visualizes alpha, and Figure 6(b) theta values corresponding to the experiment's every day, while Figures 6(c) and (d) show fall activities.Everyday activities were analyzed by calculating the lowest, highest, and average alpha and theta values.In contrast, falling conditions were analyzed by calculating the lowest, highest, and stationary alpha and theta values.From Figures 6(a) and (b), we can see that alpha and theta values in everyday activity are not directly proportional, whereas, in Figures 6(c

Server configuration
A dedicated server is used for maintaining data.The server has functions for storing data in the database, communicating with FCM, receiving data from a wearable device (Alzo), and responding to the android client application requests.Flask is used for handling HTTP requests, MySQL is used for the database, and an MQTT broker is used for handling telemetry messages between Alzo and the server.The overall server workflow is shown in Figure 7.The server will retrieve the patient deviceID from the database; then, the deviceID will be used for the MQTT topic subscription.If the MQTT topic receives data, the server will notify the FCM server first and store the data in the MySQL database.Flask will detect the incoming request from the android client and retrieve data from the database to be sent back to the Android client.

Mobile monitoring application
Patient caregivers will use an android-based mobile application to monitor patient activities.Figure 8 represents the use case diagram of the Android mobile application, where the user is the caregiver.The caregiver must first login when opening the application with the username and password registered in the database.After login, the caregiver can view program features such as caregiver profile information and patient activity dashboard.Within the patient activity monitoring dashboard, the caregiver can refresh data, back to the home page, or find a direction to the patient's location.The tracking visualization is shown in Figure 9; caregivers could track the patient's location using a map including the last timestamp, patient condition, address of patient's location, and caregiver's current location.Caregivers can also find the direction to the patient's location and refresh the tracking data.

RESULTS AND DISCUSSION
The experiments were conducted by operating Alzo and the accompanying android application.Two main aspects need to be evaluated: the tracking algorithm (lost and fall detection algorithm) performance and the durability of the wearable device battery during operation.Alzo was operated using a 400 mAH battery.Alzo sends GPS data 1-5 times during the experiment while working for 3 hours and runs a fall detection algorithm.The experiment was performed twice in which Alzo operated for 3 hours 15 minutes and 3 hours 2 minutes, respectively.We measure the current consumption during the operation, and the result is listed in Table 2.The battery durability seems to be affected by some factors, such as lousy signal while connecting to GSM, MQTT broker, GPS satellite, and the environment's temperature.
For testing the fall detection algorithm, we used the wearable device attached to the belt and does the everyday as well as fall activities by letting the body to fall to the floor.There are three types of falls that were tested: fall forward, fall backward, and fall aside as shown in Figure 10.As a for mentioned (see Table 1 as well), there are four conditions that can be used to detect the fall: i) 1 st condition=alpha value>lower-alpha threshold (235); ii) 2 nd condition=1 st condition is met and alpha value>higher-alpha threshold (8,108); iii) 3 rd condition=2 nd condition is met and theta value>theta threshold (70); and iv) 4 th condition=3 rd condition is met and theta value>theta threshold (70) for more than 10 seconds.These conditions were summarized in Tables 3 and 4. As shown in Table 3, Alzo doesn't produce a false statement about the condition.In fact, the 3 rd and 4 th conditions were never met.Therefore, the fall condition is not detected.Table 4 shows that the fall activity is detected accurately.In every fall testing activity, the 4 th condition was always met.

Table 1 .Figure 6 .
Figure 6.Experiments to determine each threshold; (a) alpha data in everyday activity, (b) theta data in everyday activity, (c) alpha data in fall experiment, and (d) theta data in fall experiment

Table 2 .
Current measurements of Alzo during experiments