Modelling of IoT-WSN Enabled ECG Monitoring System for Patient Queue Updation

The advancement of communication technologies has led to the interconnection of different sensors using the Internet of Things (IoT) and Wireless Sensor Network (WSN). WSN for healthcare applications has expanded exponentially due to evolving advantages such as low power requirement of sensors, transmission accuracy, and cost-efficiency. For heart attack patients, the future lies in ECG monitoring in which wearable sensors can be used to acquire patient information. In this paper, an attempt has been made to develop a novel IoT-enabled WSN to record patient information for detection of heart attack and to update queue of patients to ensure prioritized medical attention to critical patients. In the WSN, the Rayleigh Fading channel has been used to transmit data that can be accessed using the cloud repository by the medical staff remotely. The distance from the patient to the medical staff is calculated using Euclidean distance. Further, SNR in comparison to throughput and BER has been computed. The higher SNR indicates the maximum information transfer from patient to hospital staff. The proposed system uses the Grasshopper Optimization and CBNN based disease classification system and bubble sort algorithm has been used for updating patient queue. The proposed GHOA and CBNN has shown improved accuracy of 2.14% over existing techniques like CNN which has accuracy around 82% for R-R feature selection of ECG signals as compared to 82.72% shown by GHOA-CBNN. Keywords—WSN; cloud; ECG monitoring; wearable sensors; IoT; queue updation


I. INTRODUCTION
Wireless Sensor Network (WSN) consists of various sensors used to sense the information and process the same for different applications. Internet of Things (IoT) can allow a seamless communication between patient and medical staff, by transferring data from a WSN to cloud computing platforms to always ensure uninterrupted health monitoring. In healthcare applications [1], availability of wearable sensors allows the continuous monitoring of patient parameters, with distinctive threshold levels for serious conditions such as heart failure, pulse rate, diabetes, and many others. Wearable devices enable long-term, continual assessment of the patient's critical indicators while allowing them total freedom of movement. The WSN-based healthcare systems use biosensors to collect physiological information from patients. The collected information can be shared using the Wireless networks directly with the server or doctors for clinical review. A promising technology in the healthcare field, Wireless Body Area Network (WBAN) offers higher-quality applications and services. Consequently, a more trustworthy analysis may be carried out by the doctors [2] using this vast amount of data rather than relying on the one recorded during a brief stay in the hospital. WBAN is a sophisticated monitoring system made from computing-capable wearable and implantable nodes that are positioned in, on, and nearby a person's body. This fastens the decision-making process and is useful for quick monitoring of the patient. Moreover, the integration of IoT with WBANenabled applications significantly reduce the cost of travel, and time, especially for long-term applications of monitoring in which doctors wait for a long time to record the ECG patterns. Researchers in [3] have been actively engaged in using the IoT and wearable sensor technology for the detection of cardiovascular diseases.
IoT-WSN based ECG monitoring systems in [4] are one of the powerful technological advancements to monitor the health of the patient remotely in real-time. An IoT-based ECG monitoring system enables the collection and analysis of ECG data for remotely monitoring patients. The data collected wirelessly can be directly stored or processed using the cloud computing devices. To create a decision support system that could aid in early diagnosis and treatment, the medical staff in [5] uses this data for additional analysis which can result in saving precious lives.
Heart disease is the leading cause of mortality worldwide. Hence, there is a need for the development of intelligent tools to detect heart-related diseases timely and accurately using a low-cost device. An IoT-WSN enabled ECG monitoring system has been developed in [6] which is a widely accepted method for the diagnosis of heart-related diseases. Conventional 12-electrode ECG monitoring systems are bulky and non-portable making it mandatory for the patient to be in the hospital for the process. A survey conducted in [7] presented trends and techniques related to IoT in healthcare applications. Researchers in [8] integrate the ECG monitoring and classification using IoT and deep neural networks that make the process easier and faster.
In contrast to the conventional approach presented in [9], 3 or 5-electrode ECG devices are now often utilized because they can provide precise ECG signals. These IoT-based heart rate monitoring sensors are portable that collect patient ECG signals and send the information to a mobile application via a wireless communication module. Numerous monitoring and analytic tools for heart rate monitoring such as RR wave peaks analysis were described in literature and related devices are being introduced in [10] and [11] for implementation. Additionally, several methods had been developed for peak detection, such as the Hidden Markov model and Pan Tompkin's. The major issues with such methods are absence of standardized features, lack of robustness, real-time monitoring of ECG samples, and portability, and lack of sustainable solutions and there is a need for medical acceptance for the analysis of the signal. Therefore, understanding these limitations, there is a need of WSN enabled ECG monitoring device that is faster and medically accepted. The proposed framework in this paper deals with acquisition of ECG data of a patient using wearable sensors which is transmitted to the medical team using the Rayleigh Fading channel, data can be stored and processed using cloud devices where a R-R peak analysis is performed. The R-R peak interval in healthy individuals ranges from 0.6 to 1.2 seconds. Any variation in the R-R interval helps to identify heart disease conditions. The proposed model uses the MIT-BIH Arrhythmia Dataset using five different classes such as N, S, V, F and Q. The main contribution of this paper is as follows:- • Modelling of IoT-WSN enabled ECG monitoring system that works for remote locations.
• The ECG signal acquired through wearable sensors is transmitted from the patient to the allotted medical advisor using the Rayleigh Fading Channel and evaluation of parameters like throughput, Signal to Noise Ratio (SNR) and Bit Error Rate (BER) has been done.
• An Application is developed for remote as well as local supervision for patients in which proposed system displays the initial queue and updated queue of patients based on their seriousness levels.
The main motivation of this article is to present an ECG monitoring system using the integrated IoT-WSN technology for a healthcare monitoring system that can address the challenges of the existing systems. The advancement in wearable sensor technology allows the practitioners to use the WSN and IoT for the development of cost effective and reliable patient monitoring system. The present study is a continuation of research conducted in [12] to collect the vital signs using the wearable sensors. Furthermore, the real motivation behind this research is to save time, patients have to wait for long hours in hospitals for medical care and in critical cases that can prove fatal also. So, with the development of this WSN-IoT enabled ECG monitoring application, queue is updated based on the patient seriousness, and thus ensuring immediate and precise medical care to the patient.
The organization of the article is as follows: Section II details the related work to discuss the existing techniques for ECG monitoring. The next section discusses the research methodology in which different techniques adopted for communication has been detailed. Results and discussion are illustrated in section IV and the conclusion is given in section V.

II. RELATED WORK
The authors in [13] proposed an IoT-based ECG monitoring for health care applications. The authors used the ECG sensor and development boards to send the information to remote locations. The Bluemix device had been used in conjunction with MQTT (Message Queuing Telemetry Transport) for the integration of different types of devices. The use of this protocol supports Machine to Machine communication without human intervention. The main advantage of the proposed system is its low cost but it also has limited ability to provide the results in a controlled manner.
The research conducted by Satija et al. [14] in which a novel ECG telemetry system had been developed for continuous cardiac health monitoring applications that is IoT enabled and lays emphasis on signal quality. The implementation of this work had been done using the ECG sensors, Arduino, Android phone, Bluetooth, and a cloud server. The interconnection of these devices enables the authors to create and build a lightweight ECG monitoring device for automatically categorizing the acquired ECG signal into acceptable or unacceptable classes and to implement Sensor enabled ECG monitoring program in real-time.
The study conducted by Gogate and Bakal [15] used the WSN for the development of the three-tier architecture for a healthcare monitoring system. The patient parameters such as heart rate, oxygen saturation, and temperature had been measured. The biosensors had been directly connected to the Arduino board to send the information to the server using wireless channel. The emergency patients were notified using alert systems from mobile phones and the accuracy of the developed system was about 95% with a minimum response time of around 10 seconds.
The authors of [16] created a wearable medical device that uses a three-lead ECG sensor to collect ECG data to detect arrhythmias in real-time. To detect arrhythmia and do real-time heart monitoring, this study offers a workable and simple method. It carries out ECG signal interpretation and wirelessly notifies the patient's doctor of arrhythmia at once. For instance, the Pan-Tompkins and adaptive filtering framework were used to find premature ventricular contractions (PVCs), a prevalent kind of arrhythmia. MIT-BIH arrhythmia database benchmark records were used to successfully test the robustness of the research work. The device is low-cost and uses the Raspberry Pi module for communication.
Practitioners in [17] proposed a novel system for the monitoring of remote healthcare using Machine Learning and IoT enabled devices. The authors allow the monitoring in realtime and associate the data with cloud computing. The paper also throws light to evaluate the prediction system for the measurement of heart diseases. The experimental results have been compared using machine learning classifiers such as Decision Tree, Random Forest, Support Vector Machine, and K-nearest neighbor. The highest accuracy of about 57.37% was obtained using Linear-Support Vector Machine. The limitation of the paper is that it is unable to provide the required security level for patient data.
Researchers in [18] integrated the concept of Big Data, IoT, and Nano-electronics to resolve the issue of inconspicuous monitoring. The use of Nano-electronic devices allows the users to send the data to numerous users such as physicians, medical advisors, and caretakers to analyse the data. The 299 | P a g e www.ijacsa.thesai.org transmission of signal had been done using the sensor considering the communication protocols such as Zigbee and LAN etc. The physicians at the remote location access the data and can view the reports using the sensor devices. The integration of these three technologies allows doctors to fasten the data analysis and decision-making process. The main limitation of this paper is increase in system complexity due to the use of different computational devices and system is less reliable due to the use of Nano tubes.
Huda et al. [19] developed a low-cost and low-power ECG monitoring system in conjunction with a deep learning model to facilitate the automatic detection of arrhythmia cardiovascular disease. The authors used the AD8232 chip to process the ECG signal and Convolutional Neural Network had been used for the classification of MIT-BIH arrhythmia disease. The accuracy of the developed system was 94.03% and provided effective results.
A low-cost ECG monitoring system to measure the seriousness of the patient was developed in [20]. The use of low-energy devices efficiently measures the arrhythmia detection, saturation level of oxygen, and temperature of the body that can be directly sent to the medical advisor via sensor devices. Further, the GSM module had been used to send an alert to the doctors in case of emergency conditions, and a web application equipped with deep learning facilitates the communication process between doctor and patient. The proposed device serves remote areas and is also helpful for telehealth care.
The authors in [21] offered a cloud-based method for remotely monitoring heart disease. To enable data visualization, fast reaction, and long-term connectivity between equipment and users, Hyper Text Transfer Protocol (HTTP) and Message Queuing Telemetry Transport (MQTT) servers had been employed. A communication technology called Bluetooth which relies on low energy (BLE 4.0) had been used to transmit information between a device and a wireless gateway. Filtration methods were used in the developed framework to suppress interruptions, background noise, and motion artifacts. It provides ECG signal analysis to identify several parameters, including beats, QRS complex intervals, PQRST wave, and breathing rate. The designed model was examined and found to be trustworthy for remote ECG monitoring. The main drawback is an inefficient system which is not portable. The research conducted by Ghafil et al. [22] had used medical sensors to collect physiological information from the patients. Wearable sensors had been used for the continuous monitoring of the patient. Holter machine had been used to access the ECG signals and WSN had been used for the transmission of the signal. Moreover, a cloud server had been used to store the recorded signals and the decision-making process finally had been done using medical sensors.
The authors in [25] used the cooperative Nano network for communication using the vivo technology. The authors used the WSN for communication and results show improvement from existing techniques.
The development of ECG monitoring systems has been an extensive field of research for the last many years. The need of timely medical care to cardiovascular patients motivated the authors to present a mechanism in the present paper that can overcome the delay in getting medical care. The study of literature and analysis of numerous projects related to this subject helped authors conclude that the queue Updation system has not yet been developed. This paper thus presents a novel system using IoT-WSN enabled ECG monitoring with the use of cloud repository, to maintain a queue based on the seriousness of the patient.
III. RESEARCH METHODOLOGY The system architecture is divided into two phases in which phase 1 includes the use of WSN architecture to sense and collect the information. The phase 2 includes the storage and processing of information on the cloud architecture.
In Phase 1, the interconnection of various devices such as sensors, cloud processors, etc. using IoT for the monitoring of ECG signal for the detection of arrhythmia diseases is shown in Fig. 1. WSN mainly consists of wearable sensors employed for the detection of ECG signal and the Wireless communication channel such as the Rayleigh fading channel that has been used to transfer the information from the remote location to the hospital. The real time implementation of this work will involve placing ECG sensors on the patient's body. The different types of wearable sensors used to acquire the information are already discussed in article [12].
The data set used for this research is the MIT BIH Arrythmia dataset, which is accessed from the Kaggle link mentioned below: (https://www.kaggle.com/datasets/shayanfazeli/heartbeat).
MIT-BIH arrhythmia database, The MIT BIH dataset consists of ECG recordings of 47 different subjects recorded at a sampling rate of 360 Hz. The MIT-BIH dataset includes five different types of classes N, S, V, F and Q which are labeled as 0, 1, 2, 3, 4 for current study. The main aim is to select the relevant attributes and then train the data using the appropriate training algorithm. Grasshopper Optimization algorithm and CBNN have been used to determine the relevant attributes from the Kaggle ECG dataset [24].

A. WSN Framework
The proposed WSN framework includes the registration of patients, active patients, and initialization of network, determining the patient information, initiating the medical procedure, and associating medical staff with active patients considering distance between the two.

Patient
Rayleigh Fading Channel Patient 300 | P a g e www.ijacsa.thesai.org The proposed framework is shown in Fig. 2. In the developed framework, it is seen that number patients who have been registered is 50 and the queue is updated by experimenting with different or same number of active patients during different iterations of the program. When the initiate network button is pressed then information about the patients is recorded. The entire information is stored and processed using the cloud technology. When the initiate medical procedure button is pressed, then the RR peak analysis and sorting of patients based on seriousness starts and updated queue is displayed along with the initial queue in which staff allocation to patients and throughput and BER of the channel are displayed for each patient.
Another important information that is displayed is the classification of heart disease based on RR peak analysis, patients are classified as being suffering from disease type 0,1, 2, 3 and 4 that corresponds to the N, S, V, F and Q categories of MIT BIH Arrhythmia database respectively.

B. Rayleigh Fading Channel
Rayleigh fading is a model for describing the kind of fading that happens when multipath propagation is present. The Rayleigh fading channel has been used to transmit the ECG information of patient in the form of RR peaks from a remote location. However, the studies conducted in [23] used the Rayleigh Fading channel with Internet of Medical Technology for the transmission of signals. The integrated technology helps the practitioners to transmit the patient information for better communication. This channel is used for amplification and transmitting or relaying the signal, a simple technique that can be employed with a lesser number of associated overhead bits and therefore chosen for implementation and analysis of the proposed work. The parameters of Rayleigh channel are shown in Table 1.

C. Channel Parameters
Specifically, there are two nodes -Source node and the Destination node. The simple computation and detection process has been done using the source node and data is transmitted using the relay nodes. The relay node receives the signal, amplifies the signal, and then simply forwards the signal further to the destination node which is located at a certain distance. The destination node transmits the information through the Rayleigh Fading channel to a remote hospital for the monitoring of the signal. The received data from the channel is analyzed using the Bit Error Rate (BER) and Throughput of the signal which is also referred to as signal strength. The mathematical representation for throughput and BER is as follows. 301 | P a g e www.ijacsa.thesai.org Where is the transmission power, pl is the path loss, and 'I' is the interference in the system as in (1). To calculate path loss, the following mathematical representation is used: Where d 2 h is the distance to the hospital from the user, fc is the central frequency viz. 3.5 GHz as in (2). BER is simply calculated by looking up a total false bit received to total sent bits.
Considering, that there are 'm' number of serious patients and 'n' number of relay nodes make the cooperative network for communication, the net SNR computed at the destination end has been determined as in equation 3 [25].
SNR has been computed using equation 3 T P is recommended to be less than 1mW in this case and Path Loss has been computed using equation 2.
ϵ is the permittivity and it is about 0.2625 for human tissue near the surface of the skin [2] and further, the comparative study of SNR has been done with throughput. The lower value of path loss and higher value of SNR signifies an error-free transmission process at the destination end. The collected information is stored in the cloud technology that can be further accessed by the doctors and medical advocates.

D. ECG Data Analysis and Queue Updation
After the computation of SNR in relation to throughput, the classification process has been carried out. The medical practitioners have been allotted based on the seriousness of the patient. The data communication with a hospital as shown in Fig. 2 has been taken place and the distance between the patient and medical staff has been computed.
The distance from the patient to the medical staff is calculated using Euclidean distance which is defined as follows.
where ux, uy, mx, and my are the geostationary coordinates of the ECG Data.
These are related to the patient and the medical staff. The nearest medical representative to the patient has been allotted accordingly. The patient is treated by extracting the RR features; the disease is classified using the Grasshopper Optimization algorithm (GHOA). The optimization algorithm plays a significant role in selecting the features having maximum information. The algorithm works on the behavior of grasshopper for both exploration and exploitation phase, and use the novel fitness function used to select the RR features. Further, training and testing has been done in which 70% data is trained using Conjugate based Neural Network (CBNN) and same technique is used for classification of 30% test data. The proposed technique was compared against CNN; GHOA-CBNN resulted in 82.72% accuracy and CNN was at 80.58%, resulting in an improvement for R-R feature selection accuracy by 2.14%.
When the patient data is received at the receiving end, it is first processed for the R-R peak analysis and then furthermore the type of issue is determined that a patient is suffering from. Here in this scenario in Fig. 3, the classification engine compares the supplied R-R peak values against the stored values. The matching score is calculated based on the correlation of the supplied data to the repository data. A high matching score represents more seriousness in the patient data whereas a low matching score represents less seriousness in the patient data. The patient with a high matching score is treated before any other patient if there is no other patient that has a higher matching score than that of the current patient. To update the queue, the proposed algorithm utilizes the factor of seriousness for the patient using the following equation (7). When the classified result is attained, the disease is decided on the basis of the classification score that represents the matching value with the original class.
If the classified score is close to the original score, the patient is close to the exact disease and hence requires special attention at the very same time.

IV. RESULTS AND DISCUSSION
The proposed work is analyzed using wearable sensors to monitor the ECG signal. The Rayleigh fading channel is used for wireless communication from the source node to the destination node. The information is transmitted with the preamble of 32 bits and a payload of 80 bytes of information transmitted using the ECG data acquisition system. The simulation has been performed for a different number of patients registered for monitoring of ECG. The simulation has been performed with SNR ranging from -10 to 30 dB. Further, throughput and Bit Error Rate (BER) analysis have been determined considering the proposed framework. In this paper, the queue is updated based on the seriousness of the patients. The seriousness is organized in descending order and patients are treated in that manner only. Staff allocation to patients and throughput and BER is listed in Table II. The serious patients have been prioritized and arranged accordingly in the list and then the queue is updated as shown in Table III. Table II shows the throughput for different patients and BER is listed which is 0.0002 for almost all patients. The throughput value varies from patient to patient. For instance, patient id 1 has throughput of 1.98 Mbps and for 47 th patient id, it is 1.99 Mbps as shown in Fig. 4. Table III shows the arrangement of patient queue based on the level of seriousness and different class of disease. It is seen that patient id 17 having maximum level of seriousness and thus arranged on the top in the queue. Patient id 14 suffered from type 2 disease had a seriousness of 66.92%, is listed as number 3 in the list. Patient id 1 suffered from type 1 disease and had a seriousness of 51.5916%, is queued at number 5.

V. CONCLUSION
In this paper, we proposed a model for healthcare applications which is based on IOT-WSN architecture. The ECG signal can be collected using the wireless wearable sensors but for this paper MIT BIH Arrhythmia dataset has been considered. The IoT-enabled framework performs better in terms of throughput and BER. The use of the optimization approach classifies the disease efficiently and updates patient queue based on the seriousness level of the patient. The presented study is simple and convenient and its real time implementation can help save precious lives. The proposed IoT-WSN system uses less power, and the complete framework has been simulated in MATLAB. This work can be extended further to display the queue in the hospitals that are visible not only to doctors but also to the patients and staff and such a system can be developed for disease specific applications or for random patients reporting in the emergency OPD.