Keywords

1 Introduction

IoT is the acronym for Internet of Things, and it is a new technology that enables people to interact wirelessly with devices, a sensor that attached into physical object/environment [1]. On the other hand, the elderly and people keep increasing over time. Therefore, IoT has come up with technology for controlling the home equipment such as a lamp, water pump, ac or heater through the internet connection. Some researcher focused on providing the patient with wearable IoT equipment that can be used for rehabilitation [2]. The wearable device also planted or attached into the skin to analyse perspiration to conduct analysis on human physiological signal [3]. Nowadays, most of the elderly stayed in the home unattended due to their relative has activities such as working, shopping or any other activities that need to be done outside their home. Therefore, it becomes an obstacle for both parties: the elderly and their family members to do activities separately.

Therefore, this research proposed a unique solution by providing great devices and apps for the elderly and their relatives to continuously observe the health of the elder or patient without blocking out their activities. The structure of this chapter can be described as follows: The first section focuses on the introduction of the project that can explain the general idea of the project, followed by related works that discuss the theory, tools and algorithm that are used in the similar works. Section 3 concentrates on methodology and material of the project and then Sect. 4 on results and discussion. The last section depicts a conclusion of the whole project and future work of the research.

2 Related Works

The technology of IoT that relatively new has been exposed excessively in most of the field recently. The IoT is applied in medical, business, education or even industry [1,2,3,4]. The trend of self-monitoring for health also increased rapidly because of the era where everybody busy with their activities. While elderly people number also increased dramatically by 2020 [2], this condition has triggered the researcher to produce an innovative solution that can be attached to their clothes and did not suppress their daily activities [3]. The real-time and portable device that is capable of watching the heart based on digital signal processor (DSP) has been introduced almost two decades ago. Therefore, the appearance of IoT has attracted society attention easily due to the internet connection, and hardware technology has become cheaper and easy to be used in general [5]. Wearable devices and IoT have a lot of variation depending on their purpose of use: skin instrument, gas radar, cardio/pulse sensor, a soil sensor, etc. [6,7,8,9,10]. The sensor for human gait analysis also widely used to measure body activities or abnormality of the human body [11, 12]. While everything seems connected, security and automation can be considered an important factor in the development of IoT device and system [13, 14]. Al-Makhadmeh, Z., and Tolba A. (2019) focused on collecting and analysing the data set of the patient before and after the heart attack. They used higher order Boltzmann deep belief neural network to train the network about their past disease and come up with a solution to reduce heart disease death rate [15].

Meanwhile, some researchers also intensively studied IoT technology to come up with a wearable device for heart monitoring [16, 17]. Furthermore, the others concentrated on the acceptance model of an individual to wear an IoT device. They said that people tend to use a wearable device if they have confidence in devices [18].

3 Research Method and Material

This chapter discusses the material and research method used to develop the current project. The material used for development can be detailed out as follows:

  • IoT Devices: Arduino Board or Raspberry Pi.

  • Pulse sensor.

  • Heat sensor.

  • Cable/wired.

  • Battery.

  • Bluetooth transmitter/USB data cable.

  • PC/laptop.

  • Smartphone (Android based).

Figure 1 shows the system architecture that consists of smart cloth, database (cloud) and then mobile apps. The smart cloth has IoT devices that can capture the heart beat (HB), heart beat inconsistency (HBI) and human body temperature (HBT). Afterwards, data will continuously sent to NoSQL database (Google Firebase). The data in the cloud database will be pulled out by mobile apps that continuously displayed the heart rate of the elderly. The mobile apps will notify the relative that hold information for their elder. In case of an emergency, apps will alert the mobile phone and send the emergency assistance request to the health authority or nearby family members/neighbourhood to provide immediate assistance.

Fig. 1
figure 1

System architecture

Figure 2 shows that the IoT device is attached to the cloth of the elderly. At the final stage, it will be located in a special pocket that will not suppress any movement of the elderly. Furthermore, the detail of the business process of our proposed system is depicted as the use case diagram in Fig. 3. It has shown that user actor can observe the heart rate monitoring, body temperature and request for immediate health assistance. While system actor is responsible for sending data to the cloud database (Google firebase), if a certain condition is met (HB increase tremendously, or immediate body temperature drops or rise), it will send a notification to the guardian/relative as emergency information.

Fig. 2
figure 2

The prototype of wearable smart cloth

Fig. 3
figure 3

Use case diagram for WIOTE system

Table 1 is a sample of use case specification for heart monitoring that consists of a flow of use case, pre- and postcondition, as well as an exception condition.

Table 1 Use case specification for heart rate monitoring

In addition to the use case diagram, we generate the activity diagram for two conditions for heart beat (HB) and body temperature (BT). Figure 4 shows that if the heartbeat is either lower than 60 or more than 100, it will send notification and request for immediate health assistance.

Fig. 4
figure 4

Activity diagram for heart beat case

While Fig. 5 shows if body temperature more or less than 37.5 as standard human body temperature, it will trigger alert to the relative/guardian of the elderly.

Fig. 5
figure 5

Activity diagram for body temperature case

4 Design and Prototyping

The implementation of the projects involved three main components, as mentioned previously: IoT devices, cloud database and mobile apps. The IoT device used for this project is Arduino UNO. However, it can be replaced easily by raspberry Pi3 (refer to Figs. 6 and 7).

Fig. 6
figure 6

Arduino Uno, Image courtesy of Arduino [19]

Fig. 7
figure 7

Raspberry Pi 3, Image courtesy of Raspberry [20]

The data will be sent wirelessly through Bluetooth transmitter due to the IoT devices attached to the elderly cloth. Arduino board will keep sending the HB and BT to the cloud server and store once it synchronises with the server. Figure 8 shows the fragment of code for reading data from the pulse sensor, which initiates BPM (beat per minute). The initial test uses Arduino UNO R3 with pulse sensor from pulsesensor.com (refer to Fig. 8), while body temperature is measured using the LM35 sensor (refer to Fig. 9). The network communication is established by using Bluetooth HC-5 module.

Fig. 8
figure 8

Pulse sensor from pulsesensor.com. (Image courtesy of https://pulsesensor.com/)

Fig. 9
figure 9

Temperature sensor from pulsesensor.com. (Image courtesy of http://arduinolearning.com/code/lm35-temperature-sensor.php/)

In Fig. 2, we have shown the initial design of the wearable IoT; the cloth will have a pocket to keep the mainboard; meanwhile, the pulse and temperature sensor is attached to the skin of the body with tape. We aim to achieve a 96 kHz sampling rate with transfer speed of 115,200 bits/s (refer to Fig. 10). However, during testing, we still only achieve around 56 kHz. The cause might have come from Bluetooth transmitter limitation, while in the future we intend to use Wi-Fi card to amplify the transfer and sampling rate, as well as the coverage of the area.

Fig. 10
figure 10

Arduino code for reading data from the pulse sensor

Besides, the mobile apps will keep pulling the data from the cloud database and displayed the graph of HB, as shown in Fig. 11. In the case of irregularity emerged either in a heartbeat or in a body temperature, it will distress an alert towards the guardian of the elderly and request for immediate health assistance.

Fig. 11
figure 11

Heartbeat monitoring through mobile apps

5 Deep Learning Analysis for Elderly

The initial prototype has successfully read the pulse data of elderly heart, record it into a database and then displayed in the mobile apps. To give deep observation towards proposed elderly monitoring system, we use a standard data set from Janosi et al. [21], Aha et al. [22] and Gennari et al. [23], which contains more detailed heart failure description [21,22,23]. The data have been filtered and only select the elderly data with age 60+. The heart failure analysis uses multiple machine learning techniques such as KNN, random forest and deep learning. The KNN or K-nearest neighbour relied on the distance function such as:

$$ {\displaystyle \begin{array}{l}{D}_{\mathrm{Euclidean}} =\sqrt{\sum_{i=1}^k{\left({x}_i-{y}_i\right)}^2}\\ {}\end{array}}\vspace*{-12pt} $$
(1)
$$ {\displaystyle \begin{array}{l}{D}_{\mathrm{Manhanttan}} = {\sum}_{i=1}^k\left|{x}_i-{y}_i\right|\\ {}\ \end{array}}\vspace*{-12pt} $$
(2)
$$ {\displaystyle \begin{array}{l}{D}_{\mathrm{Minkowski}} = {\left({\sum}_{i=1}^k{\left(\left|{x}_i-{y}_i\right|\right)}^q\right)}^{1/q}\kern0.5em \\ {}\end{array}} $$
(3)

If the k value selection has been done, then the prediction of KNN might be computed through Eq. 4:

$$ {\displaystyle \begin{array}{l}Y=\frac{1}{K}{\sum}_{i=1}^k{y}_i\\ {}\end{array}} $$
(4)

Besides, the random forest algorithm is depicted by using the steps in Fig. 12.

Fig. 12
figure 12

Random forest algorithm

While, the cost function C of deep learning respect to any weight (▢) or bias inside the network(ƅ), for backpropagation, we need to consider two assumptions with quadratic function as depicted in Eq. 5.

$$ {\displaystyle \begin{array}{l}C=\frac{1}{2n}{\sum}_x\left\Vert y(x)-{a}^L{(X)}\right\Vert{}^2 \\ {}\end{array}} $$
(5)

where n, characterize the total number of training, the sigma ∑ is the summation of discrete training, while x;y = y(x) signify the output;L represent layers number and a L = a L(x) denote activation vector if x used as an input.

The statistic of the data set describes 57.8% male and 42.2% female as portrayed in Fig.13.

Fig. 13
figure 13

Gender statistic

There are four main types of pain in the data set: type 1: typical angina, type 2: atypical angina, type 3: non-anginal pain and type 4: asymptomatic, refer to Fig. 14. Figure 14 represents the blood pressure in the resting/relax position by a boxplot chart, refer to Fig. 14, the value hanging around 120–150.

Fig. 14
figure 14

(a) Blood pressure range – resting position, while (b) shows the cholesterol level in mg/dl

Figure 15 illustrates the general view of blood pressure condition of the patients, along with age as the second parameter. This figure reveals the correlation between age and resting blood pressure level.

Fig. 15
figure 15

Age and blood pressure correlation

Figure 16 provides a general graphic of age, blood pressure, cholesterol level and maximum heart rate of the patient.

Fig. 16
figure 16

The graphic of age, blood pressure, cholesterol level and maximum heart rate

The heatmap graphic, which is shown by Fig. 17, describes that the pain types reach quite high value of 0.48, followed by a high correlation between the major vessel and the old peak of depression situation test. Afterwards, the deep learning test along with random forest and KNN has shown that deep learning neural network is little bit superior compared to the random forest and superior compared to KNN with 75% accuracy (refer to Fig. 18).

Fig. 17
figure 17

The graphic of age, blood pressure, cholesterol level and maximum heart rate

Fig. 18
figure 18

Evaluation result of deep learning analysis testing

Then, we also provide ROC analysis and confusion matrix (refer to Figs. 19 and 20) for the deep learning neural network. It seems the deep learning neural network and random forest are comparable with each other, and both are superior to KNN. It can be predicted with accuracy 76%. We still be working towards greater recognition rate in the future.

Fig. 19
figure 19

ROC analysis of three classifiers

Fig. 20
figure 20

Confusion matrix of deep learning neural network

6 Conclusion and Future Works

Continuous monitoring is essential for the elderly when they have stayed alone in their house without an assistant. The proposed system has enabled the new concept of smart health monitoring that allows both patient and their family to keep mobile and live in confidence. Elderly may do their regular activities without lying on the bed, and their family members are also able to do their job and keep watching them remotely. The proposed system consists of IoT devices that are attached to the elderly cloth and the sensor with the skin. Initially, the apps can calculate and provide suggestion intelligently by analysing the data that sent through IoT sensor and compare with the standard physical signal. Currently, the proposed system still has limited data for complex analysis; however as mentioned, in Sect. 5, we did an extra exploration towards existing data set that is related to heart disease with deep learning analysis. The data set is preselected only for elderly with age more than 60. Also, the deep learning analysis has proven to be useful for giving analysis towards the heart failure/disease with 76% accuracy. This percentage might be improved further in the future works with a more suitable data set. The decision of deep learning analysis will notify or not notify the relative according to the elderly condition. The future improvement will focus towards a more advanced wearable sensor that can observe oxygen rate inside blood and sweat and even with a CCTV/portable drone to provide video data and analysis.