Keywords

1 Introduction

The health sector is one of the most sensitive phenomena for densely populated countries. A mass number of people don’t maintain a regular health checkup and suffer in a long run. To motivate those people a low-cost health kit would be a fruitful solution. Various types of health kits are available in the market and people simply avoid those expensive Health kits. A cost-effective and user-friendly device would change this scenario. Again with the immense development of information technology, the Internet of Things, cloud technology, and artificial intelligence is playing a significant impact on the progress of this health sector. Consequently, researchers are also developing varieties of e-Health and m-Health devices.

The survey showed in [1], approaches that different types of wearable sensors have the profound potential for governing and diagnosing the early symptoms of the disease concerning contagious diseases. In the field of customized healthcare, IoT technology holds enormous potential and benefits. The wireless body area network is considered the primary enabler, which consists of communication modules and wearable sensor devices. The smartphone is used as a data processing, illustration, and transmission gateway in the greater percentage of existing wearable health monitoring systems. However, such types of a system need the program to run all day long, which has a significant impact on typical mobile phone usage. Wifi-based cloud technology can utilize for such kinds of wearable sensor data acquisition [2].

Patients’ health conditions could be monitored remotely on a real-time basis, emergencies can be correctly defined, and related people like doctors and family members can be notified as needed. Multiple types of wearable IoT wearable health device has been introduced in [3,4,5].

A rational IoT-based wearable health assistance system was also introduced in [6]. Intelligent systems like fuzzy logic, machine learning, deep learning, convolutional neural networks process are also used nowadays. Prediction systems through the ML and types of AI-based chatbots help us to take necessary precautions before any kind of serious health disease.

In our study, we tried to smooth collecting, analyzing, and evaluate the basic health parameters of the data through an IoT network. We designed a web and android application interface based on the various types of profiles. To keep the communication system running smoothly, the mobile app and web interface are linked together. Our targeted mid-aged people, who are at high risk of health issues will be able to use this device easily. Pop-up notifications from the app will notify the users to take the necessary steps. Finally, after the required data collection steps, we have applied logical regression to those data and tried to predict the illness. So, we can say that our study focuses to promote a low-cost and end user-friendly health assistant which is centered on the following objectives:

  • To collect the user’s health data using wearable sensors.

  • To process the data, and send it to the IoT server.

  • To make an authentication platform that will be capable of the store and make further notifications.

  • To approach the machine learning algorithm and forecast the illness of the user.

The whole study is allocated into five parts. Where Sect. 2 is focused on the literature survey. Section 3 discusses the proposed system architecture and Sect. 4 is the machine learning approach. The result is analyzed in Sect. 5, before fulfillment of our study with the epilogue and future works in Sect. 6.

2 Literature Survey

Numerous researchers worked on IoT-based healthcare systems. In this section, we tried to feature the gist of those.

2.1 Wearable Sensors in Healthcare

Wearable devices are becoming more technologically advanced day by day. As a result, contributions in this subject will never be obsolete because it improves the daily lifestyle of health-conscious people. A person’s breathing rate is a relatively new statistic that isn’t often used in wearable devices. This metric by itself can reveal data about a person’s health. Wearable sensors are also capable of predicting a heart attack, fall monitoring, and Cardiorespiratory inspection which could be utilized as a personal safety kit with real-time data monitoring [7, 8].

Heart rate and SpO2 detectors are primarily used for patients suffering from cardiovascular disease or respiratory arrest. Doctors suggest individuals must go through check-up his pulse rate and oxygen saturation level at least once a month. Folks can easily acknowledge their SpO2 level, heart rate, and body temperature using this health kit. Authors in [9] disclose that these sensors also can be used for patients who are unable to go to the healthcare center due to an emergency. Patient data will be encrypted, and the detector is affordable, so it saves patients time while also reducing their expenditure.

We chose three wearable sensors which are capable of monitoring heart rate, Oxigen Saturation, and body temperature.

2.2 IoT Network Platform

In the last decade, the IoT has made each thing internally connected, and it has been considered the next technical revolution. Boards and sensors are constantly monitored through various types of IoT dashboards. These IoT dashboards are modern tools and we use to display and arrange the data coming from sensing elements toward our machines. IoT platforms are loaded with graphs, charts, and various widgets.

It’s tough to keep track of patients in different locations where there aren’t enough skilled med techs. A researcher in [10] proposed a system use of Wi-Fi to enable access to any location having an internet service or a 3G/4G network by establishing an appropriate access point. A wireless IoT gadget that gathers ECG, respiratory airflow, and blood oxygenation of patients and communicates this information to the central database to track more patients effectively and can save working time.

The Authors in [11] implemented an IoT device that connects the fitness gears. Through IoT Network, the trainer provides a user workout prescription. According to the findings, people with an uneven exercise routine had significantly improved flexibility, power, muscular endurance, and cardiovascular fitness. We used an IoT platform “Thinkspeak” to demonstrate and store health data.

2.3 Prospect of Android Apps in Healthcare

An android mobile app helps the user to monitor fitness data easily. Various types of fitness apps are available nowadays. The Authors in [12] designed a custom app using the MIT App Inventor platform. They designed the hardware with body temperature and a pulse oximeter sensor which is connected to the App with Bluetooth.

In [13], scholars developed a Chatbot using the Convolutional Neural Network algorithm. They improvised the Facebook messenger apps API which is capable of replying to the solution of the disease.

Another m-Health approach has been developed by [14], where an android based app has been introduced for healthcare service. Their app also offers an intelligent symptom classifier, which takes user-provided symptoms and converts them into medical conditions. It then develops a collection of questionnaires and asks the user through interaction to forecast the most likely medical condition based on the user’s input, which the system understands. We also developed a custom app using the Android Studio platform to monitor and notify the user of health conditions.

2.4 Machine Learning as a Tool for Disease Prediction

Nowadays ML has plenty of uses in the healthcare industry, which are currently being discovered and researched. Early recognition of disease has a significant influence on the current process and it decreases the risk of survival. There has been numerous recent progress in ML technology, which is assisting the medical industry to treat patients effectively. To forecast health parameter conditions, researchers used various types of ML algorithms for instance, CNN, ANN, K-NN, random forest, Naïve Bayes classifier [15,16,17].

The Authors in [18] proposed a system that can predict and monitor the children’s health status applying the Ensemble technique. In another approach, Hidden Markov Model has been applied to monitor a patient’s heart status remotely [19].

Multiple binary classification techniques are available that can be used to diagnose health diseases. The best classification technique for classifying the risk of health disease is logistic regression. Researchers in [20, 21] worked with logistic regression to predict health status. On the other hand authors in [22] found better accuracy in ordinal forest classification than logistic regression to predict health fitness.

Analyzing all prediction algorithms we applied Random Forest classification to predict the user’s illness accessing the data from the IoT server.

3 Proposed System Architecture

Our proposed systems block diagram has been shown in Fig. 1. When the finger of a person is placed in the MAX30100 sensor the operation of the device begins, where the in-built photodiode of the sensor accomplishes the detection process of transmitted Red and IR light-based on getting power connection. By measuring the absorption ratio between Red and IR light the percentage of oxygen saturation (SpO2) is discovered. In the meantime, the variation of blood density throughout the finger facilitates the detection of pulse rate. Afterward, an Analog to Digital converter (ADC) converts the data with a renowned consecutive process of Sampling, Quantization, and Coding. The binary coded data of ADC is sent to 60 Hz Low Pass Filter where it filters out the power line and ambient noise.

On the other hand, the Temperature sensor measures the body temperature based on upgrading its output voltage by 10 mv with the increase of 1 ℃ of body temperature and address the data to WemosD1 mini ESP8266 Wi-Fi-based micro-controller.

Fig. 1.
figure 1

Block diagram of IoT based wearable health assistant

The data exchange pathway among sensors and micro-controller board is facilitated with I2C serial communication where WemosD1 mini does the duty of a master and sensor play the key rule for slave devices. Now controller board processes the data and upload it to the channels of an IoT live data Streaming server named as ThingSpeak. From the live Streaming Server allocated channel data will retrieve to the Android App after every 10 ms by reading and write the API key.

At last, the Android app data will be analyzed based on the data ranges are shown in Table 1. For normal range, it visualizes as normal, if the value is lower or higher than the normal range a pop-up notification will send to the Android app users by which a user can take the necessary step for ensuring life-saving First Aid.

Table 1. Data ranges for the notifications from the App.

3.1 Sensing System

Pulse Oximeter sensor is capable of sensing Oxygen saturation (SpO2) which is an indispensable component of the health care approach. Normal oxygen saturation levels in humans are 95–100.

SpO2 percentage can be expressed below:

$$ \% \,SpO2\, = \,110 - 25\,\, \times \,R\, $$
(1)

where R = (AC RMS of Red/DC of Red)/(AC RMS of IR/DC of IR)

Body Temperature is considered one of the prominent signs indicating infection in the human body. It differs based on age, person, activity, and time on the day. The Normal human body temperature is 97 ℉. The Infant and children may have a little higher temperature than usual. Temperature above 100.4 ℉ is considered as fever or infection. We used the LM35 sensor to detect the body temperature. The temperature measurement procedure of LM35 is expressed below:

$$ Vout\, = \,{{10\,mv} / {{}^\circ C\, \times \,T}} $$
(2)

3.2 Hardware Implementation

After collecting all the sensors and doing fundamental research work we implement all the sensors with the WemosD1 mini micro-controller board and attached a wrist band. Our final setup has been shown in Fig. 2.

Fig. 2.
figure 2

IoT-based wearable health assistant Hardware setup.

3.3 Android App

To visualize the Pulse rate, Oxygen Saturation, and Body Temperature data we develop an Android App, which is named “TeleKit”, as shown in Fig. 3. We used Android Studio to design the graphical user interface (GUI). It displays the numeric value of data as well as whether the data is low or high. If the health data goes to the abnormal range a notification will pop up on the user’s mobile screen to get notified about upcoming dangerous health conditions.

Fig. 3.
figure 3

Telekit android app (Developed in Android Studio)

3.4 Interfacing and Communication

Our device starts working when the DC power source is applied. Then system proceeded to initialize the I2C communication between sensors and micro-controller. The micro-controller board processes the sensor’s data and uploads it to the ThingSpeak server. Depending on the wi-Fi status our Telekit app is connected to the Hardware as well as the Thinkspeak server. ThingSpeak server has been used to store data for a future healthcare perspective. This IoT server data sync to the Android app after 10mili seconds. Then the android app will classify the data based on the Table1 data range. If the data is high a pop-up notification will visualize in the mobile window and terminate the process and in the case of the normal data range, it displays as normal in the app screen and end the full process.

4 Machine Learning Approach

Numerous machine learning approaches are available, which helps to train and test the dataset. This function takes a data input, executes a task, and then returns the result. In the case of assisting train and testing the dataset, numerous ML algorithms are available. These algorithms complete their task by taking input values to perform the associated function and results in the output. To train up our model 70% of data has been used and the rest 30% for testing. Classifiers take into account the elements like the temperature, heart rate, SpO2 type of health parameter, and correspondingly classify the patient concerning the illness.

4.1 Data Description

Our dataset has 75 rows with five independent variables shown in Table 2. The health condition value is dependant on these independent features.

Table 2. Data types and description

4.2 Data Preprocessing

It is plausible that the dataset used during training and validation contains errors and redundant data. The data screening technique is essential for creating a trustworthy dataset and enhancing data accuracy. Data cleaning is the process of cleansing data in an organized and precise manner so that it may be analyzed. Anomalies in the acquired data, such as incorrect data formats, lost numerical values, and errors throughout data collection, are common. The null value removal method and backward feature elimination methods were being used to cleanse the dataset. The steps for identifying and classifying errors are as follows.

  • The very first step in data cleaning is to look for missing data or void values to cope with them just to enhance the precision. There are 9 missing data out of 75 rows, corresponding to around 12% of the total data.

  • In this scenario, the best method is to delete any rows with null values.

4.3 Data Splitting

Data should be divided into two segments for algorithm training and testing. The classifier is constructed on the training dataset, which comprises well-known classified output, before getting applied to others. The test set data is then used to evaluate the model’s performance using trained data. Two situations would happen during data splitting: the model could be overfitting or underfitting. Both are terrible for the output of the system. In our system, we split the data in the proportion of 70–30%

4.4 Model Training and Testing

Our proposed system can detect the illness of a patient based on provided basic health data. One dependent variable and four independent variables exist in the dataset. The logistic Regression is originated from statistics and it is proved to be the most effective than any other Algorithm. An LR classifier with a single-degree hypothesis has been followed by Eq. 3.

$$H\left(x\right)=sigmoid({\theta }_{0}+{\theta }_{1}\times {x}_{1 }+ {\theta }_{2}\times {x}_{2})$$
(3)

H(x) is the proposition in Eq. (3). Ɵ0, Ɵ1, Ɵ2 are SpO2, Heartrate, and body temperature values respectively, x1 and x2 are the mean values of age and health condition. Sigmoid is a function that is defined in Eq. 4 as follows.

$$sigmoid\left(z\right)=\frac{1}{1+{e}^{-z}} $$
(4)

5 Result Analysis

5.1 Data Accuracy

We collect 75 different people’s Pulse, Oxygen saturation, and body temperature data with our device. At the same time, we also crosscheck the health data through a standard Pulse-oximeter and a medical Thermometer for comparing our device efficiency. After about three months of continuous data checking, we calculated the percentage error of received data. Finally get our device efficiency for Oxygen saturation, Pulse rate, and Body temperature sequentially in the percentage of 96.25%, 94.75%, 98.875%. Survey data and graph of the survey data compared with standard data is demonstrated below sequentially with bearing Fig. 4. The data comparison with the standard medical device has been shown in Fig. 5.

Fig. 4.
figure 4

Pulse, oxygen saturation and body temp data in IoT server (From thinkspeak channel)

Fig. 5.
figure 5

Device efficiency compared with standard data (Pulse Rate, SPO2, and Temperature)

The average error in Oxygen saturation (SpO2) is 0.75 and the percentage error is 3.75%. After subtracting the average error we found the efficiency is 96.25%. For the Pulse rate, we found the average error of 1.05, and the percentage error is 5.25%, which results in an efficiency of 94.75%. For temperature sensor LM35, the average error is 0.225 and the percentage error is 1.125%. And its efficiency came out 98.875%. Analyzing the price and availability the comparison result among professional medical devices delineates that, our low-cost device would be efficient than other kits available in the market.

5.2 Scatter Plot and Correlation Matrix

We have taken an approach to machine learning using received data from the Thinkspeak server. We used the ‘Google Colab’ platform to depict and predict the data output. We used Numpy, pandas, and Matplot library at the beginning of the computation. The scatter plot and correlation matrix between a label and its parameters are shown in Fig. 6, which is established during model training. This is a representation of the model with a series of dataset examples. Model training takes place when each representation emphasizes how each feature affects the label.

Fig. 6.
figure 6

Data analysis applying ML a. Scatter and the density plot of health data b. Correlation matrix

5.3 Illness Prediction

Applying logistic regression, binary classification has been done. The core of logistic regression is the sigmoid function and applying these 440 times of the iteration regression result graph shown in Fig. 7. We found the test accuracy 0.6 and train accuracy 0.67.

Fig. 7.
figure 7

Logistic regression to predict the Illness.

6 Conclusion and Future Scope

The utmost intent of this study is to enhance a low-cost efficient device in association with an IoT platform for checking and monitoring some vital health parameters and Fitness issues instantly. We hope this device TeleKit will reduce the hassle of going to the hospital and save transportation costs by notifying health data a user. The ThingSpeak server also helps the user for using data from a future health care perspective. Again, our developed ML approach is also capable of predicting the illness of the user. Some vital physical parameters like pulse rate, oxygen saturation, and body temperature will be updated continuously in the server and it will increase the model accuracy.

We have found the success percentage between the actual and observed data is identical for every aspect of the developed fitness assistance device. Finally, our optimistic mind motivates us that, this device will be a door-to-door wearable health assistant kit soon.