1 Introduction

Healthcare is one of the most important aspects in saving lives and lowering the cost of healthcare services. IoT [1, 2] is widely employed in a variety of areas, including health care, agriculture, e-commerce, and logistics. Everything is now linked to the internet, where all types of information are traded and communicated. Some wireless technologies, such as Bluetooth, WI-Fi, and Zigbee connectivity, make it simple to connect to the internet. Smart sensing is employed in the health IoT to determine a distinct sensor that links a patient's body for monitoring the health conditions of patients. The link connects to the internet effortlessly via a wireless network, which collects data and stores it on the server. They are less expensive and more convenient to use.

A wireless sensor provides information that is gathered from several sensors. As a preventative measure, regular monitoring is utilized to detect illness. Following the covid-19 pandemic crisis, health risks are rapidly increasing in 2021 [3]. People in remote areas should use this to determine if there is a mismatch in their health parameters. The patient's medical history is acquired and scrutinized before being studied. The examined data is delivered in the form of a statistical report. The statistical report summarizes the patients' health status month by month. This study uses IoT and cloud to continuously monitor the physical status of the human body, such as accelerometer, blood pressure, body temperature, ECG, heart rate, pulse, and other metrics. The information is automatically saved on a cloud server. It saves data indefinitely so that prior data can be retrieved from the cloud database. A variety of human bodily parameters, including blood pressure, body temperature, ECG, and heart rate, are obtained.

Wireless sensors are used for personalized purposes such as continual monitoring of blood pressure, diabetes, ECG, pulse rate, room temperature, and body temperature. Body wearable sensors are used to monitor health-related indicators and maintain track of the present state of health. These wearable sensors are less expensive and easier to use. A low pass filter is used to reduce distortion noise, often known as random interference. It detects noise in the signal and removes a higher frequency from the output. The Arduino UNO [4] is utilized to collect data from each sensor, which is then wirelessly transferred utilizing IoT. Sensors are connected to the IoT device as an output. IoT is used to link each item that provides human interaction in order to live a better life. In healthcare, IoT may be used to diagnose illness, treat it, and prevent the spread to other people. The vital signs of the patient must be constantly monitored in order to determine their vital parameters. Since the error rate exists, the precise rate of the outcome is lower. A noise distortion amplifier can lower the error rate [5].

The proposed method gathers a person's psychological signals using sensors that measure various human physiological parameters. In many recent applications, machine learning [6, 7] is considered a rapidly expanding field [8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]. It automatically detects the pattern based upon the data recognition. Machine learning determines vast data which confines every individual data set and finds out the patterns which are hidden out in data. Medical sensors give a measure of a patient's vital signs where determines the current health records of the patients. An optimist has predicted that machine learning and AI can able to diagnose disease better and in a compatible way. While using machine learning, supervised learning determines known labels by instance in the training phase. To assess the health condition of the human body, the IoT can be used in healthcare applications. This can improve the life quality and life expectancy growth of humans. An early way of diagnosis can be attained as it avoids complications and minimizes the cost of treatment. Cyber-Physical System (CPS) [24] computes electronic data records in the cloud server as the health record is vast in size and confidential in nature.

A medical diagnosis can be made easier with Artificial Intelligence (AI) [25] and machine learning. These approaches can help diagnose and treat illnesses more effectively. Recent advances in machine learning techniques may be able to provide more exact findings than a human comparison. Machine learning technique consists of both supervised and unsupervised learning to classify the data set, supervised machine learning is used. The Health Care Department cannot readily maintain large amounts of data as a statistical patient report. A patient’s vital signs can be validated by using medical sensors which indicate the vital parameters based upon the different conditions. As a result, a systematic approach to employing machine learning in the healthcare department can rapidly discover abnormalities in important metrics.

IoT with CPS provides a popular method for networks to connect through wireless media. Different strategies are used in machine learning to efficiently classify large databases. Some of the approaches used in supervised learning include KNN, linear SVM, random forest, and decision trees. Machine learning is used in an organized taxonomy that desires the outcome of the algorithm. In general, supervised learning generates a function which maps a set of inputs into desired outputs. The existing machine learning models suffered from low accuracy for medical data analysis and also utilizes high processing power [26,27,28,29,30,31,32,33,34]. To overcome this problem, a Honey Badger(HB) algorithm optimized Least-squares Support-Vector Machine (LS-SVM) architecture is proposed in this paper. The major contributions of this paper are listed below:

  • To increase the classification accuracy and minimize the processing time, HB optimized LS-SVM architecture is proposed in this paper. The width coefficient and regularization factor are the parameters optimized by the HB algorithm to improve its efficiency.

  • The prior data, which includes the patient's past health condition, are compared using the HB optimized LS-SVM architecture. The irregularity in the patient's health may be easily recognized in a precise manner utilizing this method.

  • The proposed model reduces time consumption and increases the life expectancy of the patients. The messages are sent to the patient's registered mobile number, which tends to provide a statistical report. This method can be used in rural regions to diagnose disease in its early stages. This may be utilized by both normal and elderly patients for the aim of early diagnostic intervention.

  • The database is maintained on a cloud server, from which the patient's prior records may be retrieved.

The rest of this paper is arranged accordingly, Sect. 2 provides the analysis of the literature review and Sect. 3 explains the sensors and the concepts used for designing the proposed methodology in deep. The IoT medical dataset formation approach is also presented in this paper. The experimental results obtained for our proposed methodology when compared with the state-of-art techniques are presented in Sect. 4 and the paper is concluded in Sect. 5.

2 Background Work

The author, Kadhim et al. [27], offered a specific methodology to the patient health monitoring system utilizing IoT, as well as broad outlines of various opportunities and difficulties encountered in the monitoring system. This study relies on a descriptive way of approach by analyzing patient health continuously without any physical interaction. Naik et al. [28] developed a concept to check patient’s health via wireless devices. By using Raspberry Pi with IoT a simple monitoring system has been proposed. It helps the doctors diagnose their patient’s diseases with remote instruments. By using this way, the doctors can able to save their patient's life by giving quicker services.

Yang et al. [29] proposed a new approach the monitor ECG monitoring system using IoT by smart Health Care. ECG data gets gathered in the wearable system which is connected to the IoT cloud using Wi-Fi. It helps by identifying the underlying causes of cardiac disease. The author claimed that it is significantly more trustworthy in terms of analyzing and displaying data. Kakria et al. [30] presented a study on real-time Healthcare monitoring using smartphones and sensors. The novel approach initiated is to facilitate the remote way of analyzing the cardiac patients by analyzing their data. The analysis indicates that the system is much more convenient and low in cost.

Latha et al. [31] presented a study that used IoT and Arduino UNO to monitor patients. It monitors and transmits important health indicators of the human body via a wireless connection. Arduino UNO is used to gather data from sensors and transmits those in wireless media. The security level is also maintained by securing the password of Wi-Fi, authentication, and security level of patient's details.

Kaur et al. [35] published a paper where different machine learning techniques are used for prescriptive Analytics. The author used a framework to determine the predicted data using random forest. These systems would make recommendations based on their knowledge of the data stored in the cloud. Clifton et al. [36] described a way of monitoring patients by combining clinical observations with data using a wearable type of sensor. This research explores a large amount of data by using machine learning where multiple psychological data are gathered. The free parameters of the models are presented using a roc curve and a support vector machine.

Patan et al. [37] proposed a grey filter Bayesian Convolutional Neural Network (CNN) to minimize the response time and communication overhead while offering smart healthcare services. The efficiency of this technique is evaluated using a Mobile health dataset(MHEALTH). However, this approach suffers from minimal time complexity and overhead. Garcia et al. [38] presented a cerebral stroke detection and monitoring m-health application using the cloud. This methodology mainly stores and analyzes data and provides the data collected to public institutions. This approach detects three cerebral stroke symptoms: smile detection, voice recognition to detect odd speech alterations, and arm raise. The results show that whether the person has a cerebral stroke or not.

Moghadas et al. [39] diagnosed the cardiac arrhythmia via the electrocardiogram data obtained from the patients. The system is formed via Arduinos electronic board and AD8232 sensor module. The different types of cardiac arrhythmia are identified via the k-Nearest Neighbor(k-NN). Hossain et al. [40] presented an energy-aware cyber-physical therapy system (T-CPS) to offer therapy sensing to elderly people who cannot physically minimize energy consumptions. This model is formed of multimodal sensing elements along with several therapists. Valero et al. [41] developed an application called Helena which serves as a health and sleep nursing assistant to monitor the elderly patients' sleep activities. The body movements and vibrations generated during sleep by the elderly persons are monitored via smart sensors and the machine learning model and advanced signal processing techniques are used to classify their sleep activities.

Even though the state-of-art systems offered higher accuracy it often suffers from high computational overhead, higher time consumption, low precision rate, low accuracy, poor real-time alert generation capability, and scalability issues. In an elderly monitoring system, speed, accuracy, and continuous monitoring play an important role. A single defect and slow communication can often result in injury or even death. Hence, timely advice is necessary, and to overcome this problem an HB algorithm optimized LS-SVM architecture is proposed.

3 Methods and Materials

In the proposed methodology, different types of sensors are used to validate the multiple vital parameters of the human body. The sensors used are temperature sensors, ECG sensors, Blood Pressure Sensors, Heart Rate, Pulse Oximetry sensors, and Respiration sensors are used to attain the vital parameters of elderly patients such as constant monitoring. Constant monitoring of the parameters can able to identify if there is any abnormality in the patient’s health condition. Patient health is affected by cardiovascular disease, diabetes, blood pressure, etc. The abnormalities present in the patient can be identified via the HB algorithm optimized LS-SVM architecture and a statistical report is generated. The statistical report of the patient’s health condition is sent to the caretaker such as a registered number. Early ways of identifying the abnormality can increase the life expectancy of the patients. In rural areas, the IoT has to be initiated with less computational cost and low power consumption. The hardware implementation details are presented in the first part of the section along with the proposed methodology in the second.

3.1 Hardware Implementation

3.1.1 Temperature Sensor

The Temperature sensor measures the temperature of the surroundings and turns its input data into electronic data, which may then be used to monitor, record, or communicate temperature changes. Infrared temperature sensors are generally very accurate which is a non-contact measurement used in medical field applications. It measures temperature more precisely than thermostats. The temperature sensor measures the body temperature of the patient with voltage. Lm35 sensor is used to measure temperature which can convert Kelvin to centigrade. It is much suitable for wireless-based applications such as smart and smartwatches. It can continuously monitor the human temperature spontaneously to detect abnormalities in temperature.

3.1.2 ECG Sensor

ECG sensor is used to detect the Heartbeat activities such as QPR waves which occur on the top of the skin. ECG traces the voltage produced by heart muscle per minute. By using electrodes, the heartbeat calculation can be simplified. It gives a clear signal from PR and QR intervals in a precise manner. An ECG amplifier detects the qualified amount of data that occurs. An ECG sensor records the pathway of impulse electrical signal which passes through the heart muscle signal. If the heartbeat occurs slowly or irregularly then it is said to be arrhythmias. Ad 8232 ECG sensor with Arduino UNO can detect the wave which occurs from the impulse electrical signal respectively. Arduino UNO can detect the wave which occurs from the impulse electrical signal respectively.

3.1.3 Blood Pressure Sensor

The blood pressure sensor is used to measure blood pressure such as hypertension and hypotension. A Hypertension sensor measures the systolic, diastolic, and Pulse rate of the human body. This gives a much accurate result than a sphygmomanometer. Blood pressure sensors are generally used to gather blood level pressure from the vessel walls or artery. BPM sensor is used to measure the blood pressure human body.

3.1.4 Heart Rate and Pulse Oximetry

Heart rate and pulse oximetry can be measured in Arduino UNO by using max30102. It is a new type of sensor which is used to detect heart rate and sp02 estimation in oxygen saturation level. The oxygen saturation level is above 95% for a normal person and less than 95% for an abnormal person. Max 30,102 is an inexpensive sensor that can calculate heart rate and oximetry. The data are analyzed by infrared reflection which is used to calculate the parameters of heart rate. It uses both reflected light and infrared light with the time series of responses. A gradient type of analysis over the reflectivity data gives the way to find peaks in the systolic behavior of the heart.

3.1.5 Accelerometer

The accelerometer is a sort of electrical sensor used to measure vibration or another type of motion acceleration. The accelerometer is used to monitor the psychological activity of the human track throughout daily activities. It is utilized to determine the proper acceleration of the patient's moveable track. It examines the action of the patient in a precise manner. Accelerometer used to identify the current activity recognition of the patient. Sensors like GPS; barometers are used to identify the location and physical condition of the person.

3.1.6 Arduino Uno

Arduino Uno senses the data in the form of signals. It is formed at the point where it analyses the data and transmits it via the Wifi module. This module can retransmit those data into the smartphone application via an app. These Arduino sensors detect the many sensors linked to the Arduino board. The Arduino side is made up of many library functions that communicate with various sorts of sensors. It is described as an open-source platform that employs an embedded sort of electronics platform. They are both hardware- and software-based. This Arduino can read those inputs because there is an active set of LEDs as well as the motor. The output is sent as a message over wireless media. The Arduino Uno microcontroller is presented in Fig. 1.

Fig. 1
figure 1

Arduino uno for medical diagnosis

3.1.7 Respiration Sensor

A respiration sensor is used to measure the human respiratory status by sensing the light type intensity variation that occurs during respiration. The sensor based on the Arduino Uno provides substantially more accurate real-time output. Respiration Rate is calculated as per breath per minute respectively. This monitoring system checks the overall breath rate of the patient. ATmega328 P high-quality type sensors can be used to detect the respiratory devices which measure the flow rate every minute. Bio-impedance type sensors can be used to measure the resistance of the human skin by determining the small range of electricity. Even an EDA sensor can be used to measure stress. The stress can be determined by detecting the small change in electrical changes and also sweat level (heat level) in the skin.

3.2 Implementation of Proposed Methodology

The implementation of the proposed methodology is explained in detail in this section and the flow of the proposed work is presented in Fig. 2.

Fig. 2
figure 2

Proposed workflow

3.2.1 Raw Data Collection

The patient’s data are gathered and collected from the wearable type sensors. These sensors are connected to the Arduino Uno to attain the data via wireless media. Arduino Uno senses the data in the form of signals. It processes the signals and retransmits those data through wireless media. The data may be checked using the Arduino Uno code, where the output obtained from the many sensors used to measure the human body is raw data. These data are unprocessed and contain noise distortion and irregular interference, both of which can cause errors. When the accuracy level is poor, the error percentage increases. The Arduino Uno board receives the raw data received from sensors such as temperature sensors, ECG sensors, Blood Pressure Sensors, Heart Rate, Pulse Oximetry sensor, and Respiration sensor. The features present in the dataset are provided in this section.

  • Heart rate

    The term "heart rate" refers to the rate at which the heart beats each minute. In general, the normal heart rate is about 60 to 100 beats per minute. When the heart rate gets lower the patient is in an abnormal state. The highest heart rate is said to be the maximum heart rate which is due to exercise stress. Heart rate is generally not in a stable state as it increases and decreases according to its own vibration such as equilibrium range. Heart rate can be described based on the different metrics. It consists of the SA node which has sympathetic stimulation and parasympathetic stimulation respectively. Based upon the beat per minute the heart rate can be detected. The heart rate chart which demonstrates the Beat per minute (BPM) range for the different age groups is presented in Table 1.

  • Blood Pressure

Table 1 Heart rate chart

Hypertension occurs when an improper diet is maintained which causes a heart attack or stroke. Blood pressure is commonly defined as the pressure of blood within the arteries. Blood pressure is produced by the contraction of the heart muscle. When the heart contracts, the after state is referred to as systolic pressure, whereas the before condition is referred to as diastolic pressure. Blood pressure elevation is called hypertension and the different types of blood pressure level computed is provided in Table 2.

  • Body Temperature

Table 2 Blood pressure chart

The body temperature of humans typically changes according to the different variations. Some of the variations are age, gender, exertion level, sleeping, and waking state. Normally the body temperature Ranges as thermoregulation whereas it gets triggered from the brain. Different types of methods are used for measuring temperature such as oral, rectal, tympanic methods. There is a temperature set point to maintain the proper temperature of the body. Hyperthermia occurs when the condition of the human body gets elevated from the normal state. The outermost face of the human body is considered as skin temperature where it does not clearly identify the internal body temperature. If the temperature is below 37 degrees Celsius, then it is said to be a normal temperature.

  • • Accelerometer

An accelerometer is used in medical applications to alert the devices by measuring the acceleration of the state. It is a type of force that is caused by vibration or motion which produces an electrical charge. The accelerometer has less sensitivity and can be used for monitoring the patient. It uses low amplitude and high amplitude vibrations. It can able to measure Gait. An accelerometer is considered as the ideal type of choice to evaluate the variability of movement and balance for noninvasive and portable method.

  • • Pulse Rate

Pulse rate is used to measure the heart rate where the number of times the heartbeat occurs per minute. The arteries expand and contract the flow of blood. Based upon heart rhythm, pulse strength the pulse rate can be detected.

  • • Respiration Rate

Respiration rate is the number of breaths taken per minute. It varies according to the age level. When the respiration rate gets high then it is said to be abnormal in the state. Even the normal respiratory rate can change based on an illness such as Asthma, pneumonia, heart failure, etc. when the heart does not pump properly, then the oxygen supply is not given to the other organs. As the heart rate increases, the blood pressure drops as it lowers the blood level since they are inversely proportional to each other. Similarly, when the heart rate decreases, the blood pressure becomes a stable state in condition. The stability condition of the patient based on different parameters in terms of both heart rate increase and decrease is presented in Table 3.

Table 3 Stability condition

3.2.2 Random Interference

The obtained raw data contains signal distortion, which is noise, as well as distortion error, which might damage the raw data. These raw data are organized in a periodic way that reduces the distortion of error. The low pass filter also called random interference is used to reduce the signal type noise ratio consumption. The problem of noise data can be solved by simply collecting a large amount of data. It is possible to detect errorless data generation when higher volumes of data are obtained. This type of noise in the signal distorts and corrupts the data. The noise signal which is generated consists of a low signal-to-noise ratio. Even a false type of accuracy can damage the signal accuracy level due to improper procedures. One of the data noises which occur in the large component of data is the random noise. Random noise is generally measured using a signal-to-noise ratio. Filtering of the data is carried out using a low pass filter. By treating the directly measured signal, improper filtering can be filtered.

3.2.3 Data Preprocessing

The term "preprocessing" refers to the act of transforming raw data into a more efficient format. When the data is preprocessed, some of the irregular data and missing values are adjusted. Data preprocessing is conducted out using an IDE environment to change the data to the appropriate level of forms. This idea works for the Arduino Uno microcontroller. The embedded device can be easily controlled using IDE which works in a computer platform. It consists of a set of library functions with the loop function. This processing IDE interfaces with the Arduino Uno IDE via serial communication. UART, which means Universal Asynchronous Reception and Transmission, is used as a serial-based communication protocol. It allows the controller as a host to communicate with the other serial devices. Since they have a set of serial libraries it makes an easy way to communicate with the microcontroller. Data gets preprocessed which examines accordingly. The data are cleansed and reduced to attain an accurate set of values.

3.2.4 Training Data Set

The initial set of data is used to train the data, which helps the software learn more about technologies like neural networks. Validation and training sets are the next set of data to be added. These can be also called a training set or learning typeset. These are used to process the information which trains up the model. Each trained dataset is evaluated based on the test set. Training data is labeled where it is enriched to increase the accuracy. The data must be cleaned and validated before it can be used to construct a model, test it, and validate it. From the prediction outcome, the algorithm is used to train up the data. Test data are basically used to measure the accuracy and efficiency performance. Training and testing the data are used to improvise the models. Recognize the data according to the right way of manner. Train up the datasets is used to get accurate results.

3.2.5 Data Validation

Before data is sent from the microcontroller to the wireless medium, it is verified. It determines whether the data is correct and that the application is being developed correctly. It's similar to predicting if the actual model obtained would produce an error-free output. Data validation is used to ensure that the data is accurate and of high quality. It is made up of sample data that is used to build a training model. It checks for any null or blank values to ensure that the data is complete.

3.2.6 Proposed HB Optimized LS-SVM Model for Patient Abnormality Detection

This section elaborates the HB-optimized LS-SVM model in depth and the overall architecture of the proposed methodology is presented in Fig. 3.

Fig. 3
figure 3

Proposed architecture

3.2.6.1 LS-SVM Model

Support vector machine algorithm is much better when compared to any other algorithms. SVM uses hyperplane in an n-dimensional type of phase. These hyperplanes can classify the data points based on the boundary between those data. SVM categorizes and predicts the data set in a deterministic manner. The LS-SVM [42, 43] is mainly used for nonlinear system modeling and it is superior when compared to the SVM since it avoids complicated differential equations. For an input training dataset consisting of M data points, the input data is represented as \(\left\{ {\left( {a_{n} ,b_{n} } \right)\left| {n = 1,2,....,M} \right.} \right\} \in R^{m} \times R,a_{n} \in R^{m}\) and \(O_{n} \in R^{m}\) is the output. The input space is mapped into a high dimensional feature space using a nonlinear function φ(.) and the mapping is represented as \(\phi \left( \cdot \right) = \left( {\psi \left( {a_{1} } \right),\psi \left( {a_{2} } \right), \ldots ,\psi \left( {a_{M} } \right)} \right)\). In the high dimensional feature space, the linear decision function is built using the below equation:

$$O\left( {a_{m} } \right) = \omega^{T} \psi \left( {a_{n} } \right) + \beta$$
(1)

Nonlinear function estimation is utilized in the original space, while linear function estimation is used in the feature space. For the quadratic loss function, the optimization problem is formed as follows:

$$\min J(\omega ,d) = \frac{1}{2}\omega^{T} \omega + \frac{\alpha }{2}\sum\limits_{n = 1}^{N} {d_{n}^{2} }$$
(2)

Such that \(O_{m} = \omega^{T} \psi \left( {a_{m} } \right) + \beta + d_{n}^{2} \,\,\,\,\,\,\,\,\,\,\,\,m = 1,2,...,M\). In the above equation, ω is the normal vector, \(\alpha\) is the regularization factor, β is the bias value, and the difference between the actual and predicted output is represented as \(d_{m}\). A lagrangian equation is formulated to solve the constrained optimization problem and it is presented as follows:

$$\min J(\omega ,\beta ,d,\ell ) = \frac{1}{2}\omega^{T} \omega + \frac{\alpha }{2}\sum\limits_{n = 1}^{N} {d_{n}^{2} - } \sum {\ell_{n} (\omega^{T} \psi \left( {a_{n} } \right) + \beta + d{}_{n} - O_{n} )}$$
(3)

In the above equation, \(\ell_{n}\) is the Lagrangian multiplier, and the optimality conditions are provided below:

$$\left\{ {\begin{array}{*{20}l} {\frac{\partial L}{{\partial \omega }} = 0 \Rightarrow \omega \Rightarrow \sum\limits_{n = 1}^{M} {\ell_{n} \psi \left( {a_{n} } \right)} } \hfill \\ {\frac{\partial L}{{\partial \beta }} = 0 \Rightarrow \sum\limits_{n = 1}^{M} {\ell_{n} = 0} } \hfill \\ {\frac{\partial L}{{\partial d_{n} }} = 0 \Rightarrow \ell_{n} \Rightarrow \alpha d_{n} } \hfill \\ {\frac{\partial L}{{\partial \ell_{n} }} = 0 \Rightarrow \omega^{T} \psi \left( {a_{n} } \right) + \beta + d_{n} - O_{n} = 0} \hfill \\ \end{array} } \right.$$
(4)

Using the above equations, the following linear equations can be gained.

$$\left[ {\begin{array}{*{20}c} 0 & {\vec{1}^{T} } \\ {\vec{1}} & {\mu + \alpha^{ - 1} I} \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} \beta \\ \ell \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} 0 \\ O \\ \end{array} } \right]$$
(5)

Here \(O = \left[ {O_{1} , \ldots ,O_{M} } \right]^{T} ,\vec{1} = [1, \ldots ,1]^{T} ,\ell = \left[ {\ell_{1} , \ldots ,\ell_{M} } \right]^{T} ,\,\mu_{xy} = \psi \left( {a_{x} } \right)^{T} \psi \left( {a_{y} } \right),\,\)\(x,y = 1,2, \ldots ,M\). In point z, the resultant LS-SVM model is assessed as shown below:

$$O\left( a \right)\, = \sum\limits_{n = 1}^{N} {\ell_{n} K(a,a_{n} ) + \beta }$$
(6)

In the above equation, \(\beta\) and \(\ell_{n}\) is the solution obtained for Eq. (6) and \(K(a,a_{n} )\) is the kernel function. The kernel function selection provides different functionalities and in this work, we have utilized the Radial Basis function (RBF). The RBF function for the LS-SVM is defined as follows:

$$K(a,a_{n} ) = \exp \left( {\frac{{ - \left\| {a - a_{n} } \right\|_{2}^{2} }}{w}} \right)$$
(7)

In the above equation, w represents the width parameter. The performance of the LS-SVM can be improved significantly via the regularization and width coefficients. If the value of w is very high means the performance will be the same as the performance of the first-order polynomial kernel and the significance of the RBF technique will be lost. A too low value for w results in overfitting of the model. The complexity of the model can be identified using the regularization factor and the penalty degree of simulation. To enhance the performance of the LS-SVM model, a honey badger algorithm is used for parameter tuning. The parameters that are optimized by the HB algorithm are width coefficient and regularization factor.

3.2.6.2 Honey Badger Algorithm

The HB algorithm [44] imitates the behavior of the honey badger in nature. This animal is mainly known for its courageous nature to attack predators stronger than that when it is vulnerable. It also tends to climb trees to sabotage the beehives and birds' nests for food. Using its mouse smelling skills, the honey badger identifies the location of the prey by slowly moving towards it. Even though honey badger loves honey it is not skilled enough to locate the position of it and honeyguide(bird) can easily identify the location of the honey but is not capable of obtaining the honey. Hence these two help each other and forms a team to identify the location of the honey and seizing the honey.

To locate the honey, the honey badger initially dugs pits or seeks the help of the honeyguide bird. The first phase is known as digging and the second phase is known as a honey mode. In the first phase, the smelling capacity is used to locate the prey location and when it reaches the location it moves around the prey and selects an appropriate place for digging to capture it on the spot. To directly locate the position of the beehive, the honey badger takes help from the honeyguide bird. The working of the two phases is described in this section.

The HB algorithm has two phases namely exploration and exploitation as present in every global optimization algorithm. The candidate solution population is initialized as follows:

$$A = \left[ {\begin{array}{*{20}c} {a_{11} } & {a_{12} } & {a_{13} } & {\begin{array}{*{20}c} \cdots & a \\ \end{array}_{1N} } \\ {a_{21} } & {} & {} & {\begin{array}{*{20}c} \cdots & {a_{2N} } \\ \end{array} } \\ \cdots & \cdots & \cdots & \cdots \\ {a_{m1} } & {a_{m2} } & {a_{m3} } & {\begin{array}{*{20}c} \cdots & {a_{mN} } \\ \end{array} } \\ \end{array} } \right]$$
(8)

where N is the dimensionality of the problem, A is the candidate solution population, and the jth position of the honey badger is described as \(a_{j} = \left[ {a_{j}^{1} ,a_{j}^{2} , \ldots ,a_{j}^{N} } \right]\). The steps used in our algorithm is described as follows:

  • Initialization stage: The number of honey badgers (M) and their position in the search space is initialized as follows:

    $$a_{j} = \ell_{j} + rand1 \times \left( {u_{j} - \ell_{j} } \right)$$
    (9)

    where rand7 is a random number between 0 and 1.

    where rand1 is a random number present in between 0 and 1, \(\ell_{j}\) is the lower bound, and \(u_{j}\) is the upper bound. where rand7 is a random number between 0 and 1.

  • Intensity (I): The distance between the jth honeybadger and the prey concentration strength is represented as intensity(I). The smell intensity of the honey is represented as Ij and if the intensity value is high the motion of the honey badger will be high as per the Inverse-square law and this process is demonstrated using the below equation:

    $$I_{j} = rand2 \times \frac{Z}{{A\pi p_{j}^{2} }}$$
    (10)
    $$Z = \left( {a_{j} - a_{j + 1} } \right)^{2}$$
    (11)
    $$p_{j} = a_{prey} - a_{j}$$
    (12)

    where rand7 is a random number between 0 and 1.

    The distance between the honey and the honey badger is defined as pj, rand2 is the random number between 0 and 1, and the source strength is represented as Z. where rand7 is a random number between 0 and 1.

  • Density factor update: The density factor (ρ) controls the time-varying randomization to ensure a swift transition between the exploration and the exploitation phases. The randomization with time can be minimized by decreasing the ρ value concerning different iterations.

    $$\rho = K \times \exp \left( {\frac{ - i}{{i_{\max } }}} \right)$$
    (13)

    where rand7 is a random number between 0 and 1.

    where the constant is represented as K whose value is greater or equal to one, i is the current iteration, imax is the maximum number of iteration, and the default value of K is taken as 2. where rand7 is a random number between 0 and 1.

  • Escape from local optimum: This step along with the consequent two steps is used to help the algorithm escape from the local optima. To explore the search space more efficiently, a flag F is used to offer higher opportunities to the search agents. where rand7 is a random number between 0 and 1.

  • Position update of the agents: The new position(anew) of the honey badger is divided into two namely digging stage and honey stage as shown as below: where rand7 is a random number between 0 and 1.

    1. o

      Digging stage: In this stage, the honey badger changes its shape into a cardioid and its motion is evaluated as shown in the below equation:

      $$a_{new} = a_{prey} + f \times \alpha \times I \times a_{prey} + f \times rand3 \times \rho \times p_{j} \times \left| {\cos (2\pi rand4) \times \left[ {1 - \cos \left( {2\pi rand5} \right)} \right]} \right|$$
      (14)

      The global best position of the prey identified is represented as \(a_{prey}\), the capability of the honey badger to locate the food source is represented as \(\alpha \ge 1\), f is the flag value, and rand3, rand4, rand5 represents the random number value between 0 and 1. The f value is obtained using the below equation:

      $$f = \left\{ {\begin{array}{*{20}l} 1 \hfill & {if\;rand\;6 \le 0.5} \hfill \\ { - 1} \hfill & {else,} \hfill \\ \end{array} } \right.$$
      (15)

      where rand6 is a random number between 0 and 1 respectively. In this stage, the honey badger relies on the smell intensity of the prey. Using the flag f, the honey badger can overcome the obstacles and explore the search space even further.where rand7 is a random number between 0 and 1.

    2. o

      Honey stage: In this phase, the honeyguide bird guides the honey badger towards the honey and this process is simulated using the below equation.

      $$a_{new} = a_{prey} + f \times rand7 \times \rho \times p_{j}$$
      (16)

      where rand7 is a random number between 0 and 1.

3.2.6.3 Formulation of the HB optimized LS-SVM model

To improve the accuracy of the LS-SVM model, the HB algorithm is used and the fitness function of the HB algorithm is provided below

$$f(a) = \frac{1}{M}\sum\limits_{j = 1}^{M} {\left| {\frac{{\hat{a}_{j} - a_{j} }}{{\hat{a}_{j} }}} \right|}$$
(17)

The actual and predicted output is represented as \(\hat{a}_{j}\) and \(a_{j}\). Initially, both the parameters of the LS-SVM model and HB algorithm are initialized during the formulation. Next, the position and motion of each honey badger are computed. Using the test data samples, the LS-SVM model is trained based on the starting position of the honey badgers. The dimensionality of the feature space is taken since we are only optimizing the two parameters namely the width coefficient and regularization factor. Using (14) and (16), the position of the honey badger is updated. After the optimal solution [width coefficient, regularization factor] is obtained, the algorithm is terminated and the value is taken to train the LS-SVM model. The optimal parameters retrieved for the model are [0.24, 80] for a total of 45 iterations.

4 Experimental Results and Analysis

The performance of the proposed HB algorithm optimized LS-SVM architecture is evaluated using a cloudSim simulator. The simulation process is considered by taking into account the different vital parameters presented in Table 4. The different vital parameters are observed in the patients by monitoring the changes in the sensor signals. Based on the input conditions obtained, the HB algorithm optimized LS-SVM architecture classifies the patient's symptoms into normal and abnormal. A total of 100 tests is conducted on both the female and male patients who came as volunteers and the age limit of the youngest volunteer is 27 and the eldest volunteer is 62.

Table 4 Risk factors that determine the health deterioration of the patients

4.1 Dataset Evaluation and 10 Fold Cross-Validation

The performance of the proposed model was evaluated using the test dataset. The input variable values are normalized into −1 and + 1 to be processed by the LS-SVM classifier. The programming was done in Matlab and based on the output of the LS-SVM classifier the decision value is altered for each instance in the test dataset. The robustness of the LS-SVM classifier is verified using a ten-fold cross-validation conducted on the training dataset. The training dataset was split into 10 equal size subsets. The 10 subsets are used as a test dataset and the model is trained on every instance present in the dataset. The performance of the models is validated using the test sets. Some of the models are over-fitted which has to be validated to avoid any potential type of bias. Here, the first set of input datasets is considered as a column state which is zero.

4.2 Performance Metrics

The ROC curve is used to generate linear statistics such as sensitivity, Positive value, negative value, specificity based on cross-validations. These curves predict the predicted outcome and also true outcomes from the test data values. Based on the actual and predicted outcome, the ROC curves are generated. The resultant model performance can be observed via the Area under the Curve (AUC) of the Receiver Operating Characteristic(ROC) and different performance metrics such as Positive predictive value (PPV), negative predictive value(NPV), sensitivity, and specificity. The performance values are computed using the following formulas:

$$Sensitivity (PPV) = \frac{{T^{( + )} }}{{T^{( + )} + F^{( + )} }}$$
(18)
$$Specificty (NPV) = \frac{{T^{( - )} }}{{T^{( - )} + F^{( - )} }}$$
(19)

In the above equation, the number of true positives, false positives, True Negative, and False negatives are represented as \(T^{( + )}\), \(F^{( + )}\), \(T^{( - )}\), and \(F^{( - )}\). The prediction accuracy is measured using the below equations:

$$Accuracy = \frac{Total\;number\;of\;samples\;correctly\;classified}{{Number\;of\;samples\;taken\;for\;\exp ermentation}} * 100$$
(20)

4.3 Results

The results obtained in terms of PPV, NPV, and AUC are presented in Table 5. By taking the crucial parameters that determine the abnormality of the patients such as Heart Rate, Pulse Rate, Blood Pressure, Systolic pressure, Diastolic pressure, Respiration Rate, and Body Temperature, the results were computed. The PPV and NPV values obtained by the proposed HB algorithm optimized LS-SVM architecture is relatively high when compared to the random forest [45], decision tree [46], and SVM [47] techniques as per the result. The AUC results are plotted in Fig. 4 along with the readings. The results show that the proposed methodology is capable of identifying the abnormalities present in a specific individual without the laboratory test results.

Table 5 Comparative analysis using PPV, NPV, and AUC
Fig. 4
figure 4

Comparison using ROC curve

The comparative analysis results in terms of prediction accuracy using different algorithms such as SVM, Random Forest, and Decision Tree is shown in Table 6. The results shown in Fig. 5 demonstrates that the prediction accuracy is not directly or inversely proportional to the number of samples present in the dataset. The highest prediction accuracy is mainly obtained by the proposed methodology due to the usage of the HB algorithm to take the computational efficient parameters by parameter tuning. The Random forest, decision tree, and SVM often miss out on the crucial parameters for identifying the abnormalities hence resulting in a low accuracy rate.

Table 6 Performance evaluation of the proposed model in terms of different vital parameters obtained from the IoT sensors
Fig. 5
figure 5

Comparative analysis using different vital parameters

The efficiency of the proposed methodology is evaluated in terms of processing time and the results are demonstrated in Fig. 6. The X-Axis represents the increase in the number of IoT nodes from 0 to 100 thousand. The processing time increases slightly when the number of IoT nodes increases but however, it is in the range of 820 ms which is negligible. The results show that the real-time performance of this model is acceptable.

Fig. 6
figure 6

Influence of IoT nodes in processing time

5 Conclusion

Thus in this paper, the machine learning supervised learning technique is used to diagnose the health condition of the patients. By implementing IoT, a patient's statistical report may be assessed for health monitoring. Statistical data is sent to the caretaker as a monthly statistical report via a smartphone application. This created a major impact among elderly patients and the people who live alone in remote areas. In rural areas, the IoT has to be initiated with less computational cost. As a result, this study uses IoT and cloud to enable continuous physical condition monitoring of the human body, including accelerometer, blood pressure, body temperature, ECG, heart rate, pulse, and other data. The information is stored on a cloud server automatically. The efficiency of the proposed methodology is evaluated using different performance metrics such as NPV, PPV, accuracy, AUC, and processing time by comparing it with different baseline classifiers such as random forest, SVM, and decision tree. For a total of 90 thousand nodes, the proposed model offers a processing time of 820 ms and the overall accuracy of the proposed methodology is 95.4%. The AUC score of the proposed methodology is 0.9658 which is relatively higher than the Decision tree, random forest, and SVM classifiers. The PPV and NPV score of the proposed methodology is 0.9478 and 0.9587 respectively. In the future, we plan to experiment with the risk factors present in gene expression profiles and genome-wide association data.