Abstract
Nowadays, WSN-IoT may be used to remotely and in real-time monitor patients’ vital signs, enabling medical practitioners to follow their status and deliver prompt treatments. This equipment can evaluate the gathered data on-site thanks to the integration of edge computing, enabling quicker diagnostic and medical options with the need for massive data transmission to a centralized server. Making the most of the resources accessible without sacrificing monitoring efficiency is critical due to the constrained lifespan and resource availability that these intelligent devices still encounter. To make the most of the assets at hand and achieve excellent categorization performance, intelligence must be applied through a learning model. Making the most of the resources that are available without sacrificing performance monitoring is essential given the restricted lifespan and resource availability that these intelligent devices still suffer. A learning model must incorporate intelligence in order to maximize the utilization of resources while maintaining excellent classification performance. In this study, a unique Harris Hawks Optimized Long Short-Term Memory (HHO-LSTM) that categorizes Electrocardiogram (ECG) data without compromising optimum utilization of resources is proposed for Edge enabled WSN devices. We will train the model to correctly categorize various kinds of ECG readings by employing cutting-edge techniques and neural networks. Significant testing is carried out on fifty individuals utilizing real-time test chips with integrated controllers coupled to ECG sensors and NVIDIA Jetson Nano Boards as edge computing devices. To show the benefits of the suggested model, performance comparisons with various deep-learning techniques for peripheral equipment are conducted. Experiments show that in terms of classification results (98% accuracy) and processing expenses, the suggested model, which is based on Edge-enabled WSN devices, beat existing state-of-the-art learning algorithms. The ability of this technology to help medical personnel diagnose a range of heart issues would eventually enhance customer management.
Keywords
Introduction
The need for intelligent health status monitoring is growing rapidly along with the ongoing improvement of technologies aimed at tracking the heart illness, which has increased public awareness of cardiac ailments. Traditional heart condition monitoring techniques in hospitals call on the use of big, stationary devices that are expensive to buy and operate. Health care professionals find it challenging to easily monitor patients in numerous places or handle a boost in patient volume due to this lack of flexibility and scalability. Deep learning, a subset of machine learning, has received a lot of interest recently because of its capacity to analyze and extract meaningful patterns from large amounts of data [1]. Electrocardiogram (ECG) categorization is one area where deep learning has shown a lot of potential. A common diagnostic technique for tracking the electrical activity of the heart and identifying different cardiac disorders is the ECG [2]. Scientists have created reliable and accurate models for automated ECG categorization using deep learning approaches, allowing for the early identification and treatment of cardiac problems. Recently, “Convolutional neural networks (CNNs) and Recurrent Neural Networks (RNNs)” are two contemporary methods that have been utilized to evaluate ECG data [3]. However, there are still difficulties and restrictions when utilizing deep learning in this field, such as the requirement for sizable annotated datasets and the interpretability of the models [4]. Ultimately, deep learning has the power to transform ECG interpretation and enhance patient outcomes in cardiovascular care. Through the extraction of pertinent characteristics from the raw data, CNN has demonstrated promising results in automating ECG classification tasks [5]. However, CNN have proven to be efficient in capturing temporal correlations and constant trends in ECG data, making them appropriate for applications like arrhythmia identification [6]. Deep learning for analyzing electrocardiograms has a number of challenges, including the need for large annotated datasets, which can be challenging and take a while to produce [7]. In addition, it is difficult to decode deep learning models since it is important to comprehend how the predictions of the model relate to patient treatment [8]. Deep learning has an opportunity to revolutionize ECG interpretation and advance the detection and treatment of cardiovascular illnesses, provided that investigation and advancements are made [9, 10].
The design of this system included an intervention method called Harris Hawks Optimized Long Short-Term Memory to identify the ECG data while taking into account the aforementioned problems. This can significantly reduce the need for large annotated datasets and expedite the development of accurate models. The interpretability of deep learning models is also being improved, giving doctors more confidence in and comprehension of the model’s predictions. These developments along with the Harris Hawks algorithm’s potential for improvement may result in more accurate and efficient ECG analysis, which may eventually be helpful for patient care and diagnosis.
The following are the paper’s key contributions. The necessity for better accuracy and efficiency in evaluating electrocardiogram (ECG) data might be a promising topic in this regard. Investigating the potential of Harris Hawks Optimized deep learning models to improve their comprehension in order to investigate ECG interpretation. Analyzing the difficulties and restrictions posed by ECG interpretation algorithms and suggesting viable remedies or different strategies to get across these drawbacks. Outlining practical examples where improved ECG analysis efficiency and accuracy have significantly improved patient outcomes and medical decision-making.
Literature survey
A Support Vector Machine (SVM), Artificial Neural Network (ANN), and Convolution Neural Networks (CNN)-based method for ECG data categorization was created by Karthiga et al. in 2022. The accuracy of the CNN, which was 91.92%, is 4.98% greater than that of the SVM and 2.68% higher than that of the ANN. The disadvantage of this approach is its high computational complexity [11]. An IoT-enabled, cloud-centric approach for remote ECG monitoring was presented by Nisha Raheja et al. in 2023, with the potential to save lives in rural regions during Golden Hour. The Savitzky-Golay filter and deep learning Convolutional Neural Networks (CNN) are used by the framework to classify data, while triple data encryption and water cycle optimization methods are used to ensure security. Although this framework offers good accuracy, its temporal complexity is a downside [12].
An automated arrhythmia classification technique was created by Dinesh Kumar Atal et al. in 2020 utilizing a Deep Convolutional Neural Network (DCNN) with an optimization framework. the BaROA, or the Bat-Rider Efficiency Algorithm. The MIT-BIH Arrhythmia Database is used to assess the method’s accuracy, specificity, and sensitiveness. The disadvantage of this approach is its high computational complexity [13]. To identify abnormalities in ECG data utilizing IoT nodes, Abhishek Kumar et al.,2022, introduced a Coy-Grey Wolf Optimization-based DCNN (Coy-GWO-based Deep CNN) classifier. The classification accuracy of the Deep CNN powered by Coy-GWO was 95%. However, this framework’s primary flaw is that it is unsuitable for real-time situations [14].
For the purpose of predicting strain utilizing WESAD datasets, Syem Ishaque et al., 2022 developed machine learning methods, such as transfer learning and autoencoder algorithms. Excluding excessive fitting, the algorithms achieve 98.99% accuracy for Convolutional Neural Network (CNN) and 98.92% accuracy for VGG16. They performed well on data related to stress, but their framework needed more time and processing power [15]. With the use of machine learning and neural network techniques, Amin Ali et al., 2022, concentrated on ECG categorization. For maximum accuracy, it emphasizes the extraction of features and improvements. The present structure compares the effectiveness of Long Short-Term Memory (LSTM), Support Vector Machine (SVM), and Convolutional Neural Network (CNN) approaches for classifying ECG heartbeats. The drawback of this paradigm is that it is not appropriate for large-scale networks [16].
Using the MIT-BIH Arrhythmia Database and the MIT-BIH Noise Stress Test Collection datasets from Physionet, Nurmaini et al., 2020 introduced denoising Denoising Auto Encoders (DAEs) and Auto Encoders (AEs) for feature learning in DL. The DL model classifies ECG heartbeats with excellent accuracy, sensitivity, specificity, precision, and F1-score and has strong healthcare potential. The drawback of this approach is its high computational complexity [17]. An automatic extraction of features technique utilizing Convolutional Neural Network (CNN) and Long Short-Term Memory (LSTM) recurrent networks was presented by Asghar Zarei et al., 2022. For the UCDDB dataset, the technique obtained sensitivity, specificity, and accuracy of 93.70%, 90.69%, and 95.82%, indicating that deep-learning-based algorithms might enhance doctors’ decisions in the identification of sleep apnea. The shortcomings of this system included the fact that instruction took more time [18].
In order to classify cardiac arrhythmias using ECG information, Ramkumar et al., 2023 created a Deep Convolutional Neural Network (DCNN) tuned with hybrid marine predators and nomadic humans. reduced error rates, a higher AUC, and reduced error rates are all achieved by this approach. The disadvantage of this structure is its high temporal intricacy [19]. For the purpose of classifying bean illnesses, Annrose et al., 2022 created the High-Density Lipoprotein-Archimedes Optimization Algorithm (HDL-AOA), which combines Wavelet Packet Decomposition (WPD) and Long Short-Term Memory (LSTM). The technique employs four sub-series of input photos, and the accuracy of classification is improved via the Archimedes Optimization Algorithm (AOA). Accuracy, specificity, sensitivity, precision, recall, and F-score are all improved. The drawback of this approach is its high computational complexity [20].
The feature collection methods are outlined in the Improved Marine Predators Algorithm-Convolutional Neural Network (IMPA-CNN) model created by Essam H et al., 2022 which also determines the optimal hyper-parameter configuration. the Convolutional Neural Network (CNN) algorithms suggested. Groups associated with the Advancement of Medical Instrumentation (AAMI) were recognized. A 92.70% accuracy rate was reached. As this approach is used to address the ECG characterization issue, drawbacks arise [21]. A deep learning model’s evaluation on the MIT-BIH dataset, which contains ECG data for medical research, was contrasted by Maurya et al., 2022. For ECG categorization, a chain reaction model comprising Long Short-Term Memory (LSTM) and Recurrent Neural Network (RNN) was created. In identifying anomalies in ECG signal data, the experimental assessment revealed 89.9% accuracy, 80% sensitivity, and 82% specificity. For real-time data sequences like ECG, this cascaded paradigm is appropriate. Nevertheless, this approach needed additional time for the dataset’s training [22].
In order to analyze clinical 12-lead ECG pictures for the purpose of objectively detecting heart illness, Mitra et al., 2022 devised a method employing Deep Learning (DL) methods. The technique makes use of raw ECG pictures to automatically discover appropriate feature representations. For colorful pictures, this framework obtained 88 % accuracy and 88 % sensitivity, while for grayscale images, it achieved 88 % accuracy and 89% sensitivity. There is a lot of communication required by this structure [23]. From the literature survey, the research gap is found that still the existing frameworks have high time complexity, computational overhead and less accuracy of detection. Hence the intelligent frameworks are highly required to detect the heart disease for the early diagnosis. The quick summary of literature survey is presented In Table 1.
Quick summary of literature survey
Quick summary of literature survey
As shown in Fig. 1, there are three separate components in the planned deployed infrastructure. Embedded microcontrollers connected to ECG sensors and WiFi transceivers make up the initial unit. In the second module, HHO-LSTM is designed to produce a model that is complexity-aware while retraining the model to achieve considerable improvement. The developed model is next added to the Edge gateways as the third module, where it will carry out a collective analysis and use ECG signals to display the various degrees of arrhythmias in patients. Every module’s explanation is provided in detail in the following subsections. Figure 1 displays this framework’s general design.

Overview of the ECG classification system provided by the HHO-LSTM framework.
For this method to be useful for applications that operate in real time, the suggested HHO-LSTM framework needs a lot of resources, and it is anticipated to be challenging to apply these techniques on WSN-IOT devices. Because of this, the suggested model is implemented at the Edge devices to reduce transmission and aid in diagnosis applications. This module is made up of embedded microcontrollers connected to WIFI transceivers and ECG sensors. A total of 50 or so people were chosen, varying in age from 30 to 65. A little more than half of individuals are healthy, while the other half are intended to have cardiac conditions. One of the effective ECG sensors employed in the present investigation is the AD8232 ECG sensor, which is interfaced with ATMEga boards. The ECG signals are sent to the Edge gateways using Zigbee (Xbee) transceivers. The ECG signals from the test individuals are collected using these boards, and they are then stored in Edge gateways for additional analysis. The 3.3 V batteries that power the WSN boards can be swapped with other batteries when they run out of juice. The data gathering unit is depicted in Fig. 2.

Data collection unit.
The formation of the linked dispersed WSN devices involves the Edge gateways. Data are sent to the edge, which is an NVIDIA Jetnano version 2 device. The aforesaid method is used to construct edge gateways because these devices support the deployment of several artificial intelligence algorithms. The suggested methodology’s Edge gateways are shown in the Fig. 3. The specifications of the NVIDIA Jetson Nano board utilized in the investigation are shown in Table 2.

Edge gateways using HHO-LSTM for the proposed methodology.
Characteristics of the NVIDIA Jetson Nano Boards utilized in the study
The individuals have an ECG sensor and controller combo put on them, recording data every five seconds and storing it in the Edge devices’ internal memory. From healthy people and cardiac patients, accordingly, over 17,280 data points are gathered. These data are used to train the recommended network. Table 3 displays the overall amount of data.
Utilizing real-time data for evaluation and testing
The following subsection describes the structure for deep learning that has been suggested for categorizing various ECG data.
Recurrent neural networks
The hidden layers of each NN in an RNN are connected to the hidden layers of additional nodes in a different new network. Similar hidden layers’ nodes are linked to one another, as in recurrent NN. RNN’s ability to encode historical data in only a few milliseconds and its memory activity make it a popular choice for time series and big-data research. The RNN approach allows nodes with their sequences to directly form the graphs. Thus, it is possible to illustrate dynamic behavior for sequence synchronization. processes input sequences using internal memory (state). In order to forecast future values, the RNN makes use of historical data. This approach still has a vanishing gradient problem [24], which makes the results produced unsatisfactory in some real-time scenarios where the space of time among historical data and the future data is substantial in actual applications. With the addition of the LSTM network, RNN performance has increased in order to address this issue.
Long Short-Term Memory – An Overview
Due to its flexibility in storage and suitability for large databases, a “Long Short-Term Memory Network” is a well-liked learning model that is used in many situations [25]. Figure 4 illustrates the LSTM network.

LSTM structure.
Whale optimization and LSTM make up the suggested hybrid learning model. An LSTM is made up of four separate construction blocks: an input gate (I.G), a forget gate (F.G), a cell input (C.I), and an output gate (O.G). An example of a neural network that uses memory is the LSTM, which remembers values after each iteration. Let x t , the cell input be Ct, the cell output be Gt, the states of the three gates he is using be the states of the three gates, the unseen layer output be ht, its prior output be ht-1, and j t , T f , and T0. Similar to how both “Gt and ht” are sent to the following neural network in RNN, the development of LSTM. The output and forget gates are used in LSTM to update by fusing the previous unit’s output with the present input state, the memory is increased in capacity. To calculate Gt and ht, apply the formulae below.
In this context,
The aforementioned calculation is used to determine the final output score.
When used with huge variety datasets, LSTM suffers from a number of limitations [26]. As a result, many neurons in memory are used, which often ireases computational complexity and overfitting. A framework that can foresee the future and is structured numerically is required. various crop yields in order to get around this problem. A sple learning model has been looked at further in order to meet the requirements mentioned above. The main objective of this mixed approach is to develop a new hybrid algorithm by incorporating Hris Hawk techniques into LSTM networks.
Harris Hawk optimization
The numerous ways that hawks hunt and attack their prey are the inspiration for the HHO algorithm [27]. The three main steps of HHO, a based-on populations oimization technique, are research, Exploration and profit-seeking are transformed. Figure 5 shows the different phases of HHO.

An illustration of one of the several steps in the Harris Hawk’s Catching the Prey Improvement Method.
At this level, hawks perch at arbitrary positions depending based on more people or specific rabbit locales, which are represented as follows:
In this scenario, X (t + 1) stands for the location of the prey, X rabbit (t) for the position of the hawks, and X (t + 1) for the updated position in the subsequent generation of the hawks. The elements’ totals is indicated by the modulus. The integers r1, r2, r3, r4, and q are generated at random between 0 and 1. UB and LB are used to represent the upper and lower bounds of variables. The location of a haphazard hawk population is indicated by X rand (t) the typical position of the present hawk group is X m (t).
The prey’s behavior throughout the transitional period, which is evaluated utilizing the following equations, escape potential plays a significant role:
E0 is a prey’s starting power, which varies at random among –1 and 1, and T is the maximum number of repetitions, where t is the current repetition.
When the prey begins to flee, the hawks attack it utilizing four different pursuit techniques. A successful capture necessitates the presence of escaping energy (E) the possibility of escape (r). In the following equations, hawks executed a mild besiege at r 0.5 and |E| 0.5, meaning the prey had ample power but was unsuccessful in trying to flee.
Where X rabbit (t) denotes the jump power that fluctuates aitrarily wh each iteration and ΔX (t) indicates the disparity between the present location of their prey and the hawks’ position at iteration t. a number chosen at random from 0 to 1 is called r5.
Hawks attack their prey with a powerful besiege and minimal release power, as demonstrated by r ⩾ 0.5 and |E| 0.5 and the prey is unable to escape, according tthe following models.
When r < 0.5 and ||E ⩾ 0.5, hawks hunt through a more ielligent soft encirclement known as soft besiege with increasing quick dives, as seen in the following models.
In this situation, D stands for the problem’s dimension, represents a random vector of size 1 × D, and LF stands for the Levy flight function as specified in the equations.
Where is a constant that is restricted to having a value of 1.5, Both u and v are random normal distributions. vectors with a size of 1×d, β, is a constant, and Γ is a typical gamma function. The hawk’s positions can be updated by modeling
A rigorous besiege is formed when the prey’s vigor is exhausted. (r < 0.5 and |E|<0.5). Equations (19) and (20), which represent the computation of Y and Z, are used. Following is the update process:
The weights of dense layers of LSTM networks are optimized ung Harris Hawk techniques, as was covered in Section 3.4.4. In this instance, the primary term utilized to optimize the weights of LSTM networks is the Harris Hawk’s criterion for exploring and profiting from the procedure in identifying the prey. The LSTM cells are initially fed a random number of weights and biases. The fitness coefficient of the suggested model is defined as its accuracy. The algebraic equations (14), (15) and (16) are successfully used to determine input bias and weights for every iteration.
After that, the LSTM network receives each weight and calculates the physical fitness function. The loop will either stop or if the fitness function is greater than or equal to the threshold, go forward. The Harris Hawk optimization in this technique delivers a slower rate of convergence than other meta-heuristic approaches, which need less time for optimization and also improve detection speeds. Algorithm-1 presents the structure’s overall functioning mechanism.
Experimental setup
The suggested approach has been tested with the Jetson Nano and Edge devices utilizing the TensorFlow and koras libraries. In order to accelerate the suggested model on edge devices, the HHO-LSTM are implemented in edge devices. The host monitoring systems, WSN devices, and edge gateways all communicate via the Zigbee protocol. Nearly 36 individuals equipped with WSN devices are employed to send ECG data in order to replicate real healthcare systems. Three Edge gateways were chosen to analyse and categorize the ECG signals. Table 4 displays several conformations that were expedited for testing.
Shows the configurations used in the experiment
Shows the configurations used in the experiment
ECG signals are regarded as input data, and they are transmitted to the edge device gateways and stored in their RAM on a minute-by-minute basis. Using TDMA (Time Division Multiple Access) techniques, a single input ECG frame will be relayed from the WSN devices. The operation may be finished by loading the training weights into the edge devices’ storage. The acquired ECG datasets were used to construct and train the suggested model, which was then tested using the gathered equipment.
The recommended method was applied using NVIDIA Jetson Nano Version 2.0 Edge Boards with Keras Libraries and TensorFlow v. 2.1 as the backend. Metrics including accuracy, precision, recall, specificity, and F1-score were used to assess the architecture. The method of mathematics used to determine the performance measurements is shown in Table 5. In order to prove the superiority of the presented model, we additionally computed the AUC (Area under ROC) and confusion matrix. Quick stopping is employed to address the overfitting and generalization problems. This approach is used to halt an iteration when the validation efficiency of the model that is suggested shows no improvement over an extended period of time. The homogenous distribution of data is used in training and testing to overcome the problem of unbalanced classes. The Table 5 below contains the equation used to calculate the effectiveness metrics that were used to evaluate the proposed strategy.
Performance metrics used for the evaluation
Performance metrics used for the evaluation
True values that are positive or negative are represented bthe letters Tp and Tn, respectively, whereas false positive and false negative values are represented by the letters Fp and Fn. In this section, findings are discussed at every scenario conducted during the experimentation phases. The following discussions are as follows
For the varied ratios of training datasets, the Confusion matrix, ROC curves, and various performance indicators are assessed in this step. The confusion matrix discovered when evaluating the ECG real-time datasets is displayed in Fig. 6. Figure 6 carly shows that the recommended model classified the different stages of heart illness from the input ECG frames with the greatest accuracy. The suggested model achieves 98% detection accuracy in the 30% of testing data. This has been demonstrated by looking at the region of convergence curves in Fig. 7(a-c). The uniform properties of Fig. 7(a)–(c), where the Area Under Curve (AUC) is shown, have clearly been demonstrated by the suggested concept. for the detection of heart disease levels is determined to be 0.973.

Confusing classification matrix for the suggested model of various heart ailments.

AUC for the Proposed model in detecting a) Normal b) Heart disease-1 c) Heart Disease-2.
Following the provided technique while utilizing real-time datasets acquired from various WSN devices allowed us to evaluate how well the suggested model performed. All of the trials were built around an analysis of the stats of efficiency displayed in Fig. 8. The data sets are divided into training, validation, and testing segments. for each iteration of a portion. The hyperparameters of the suggested network are optimized using the Grid Search approach. In order to select the dropouts, learning rate, batch size, and epochs, trial and error was employed with the validation and testing set of data. With a predetermined rate of learning of 0.001 and changing batch sizes of 5, 10, 15, 20, 25, and 30, the dropout search has a range of 0.1 to 0.4. The range for epochs was also 10 to 30. The results of each search are shown in Fig. 6. Maximum performance for the suggested architecture was 98% accuracy, 98% precision, 98% recall, 98% specificity, and 98% F1-Score.

Performance evaluation of proposed methodology under different dropouts and learning rate of 0.001.
The suggested framework is contrasted with several frameworks already in use, including CNN [28], ResNet [29], RNN [30], and LSTM [31]. The outcomes are displayed in Fig. 9.

Evaluation of the suggested method in comparison to other current structures.
In terms of accuracy, precision, recall, specificity, and F1-Score, it is clear from the Figure that the suggested structure performs better than other frameworks already in use. The LSTM network’s performance was increased via HHO optimization approaches.
Based on the computational and reaction time of the model during evaluating with an expanded number of users, the computational complexity of the recommended structure and other cutting-edge deep learning components are determined. Figure 10 compares the computing times of the various learning systems.

Comparison of suggested frameworks’ time complexity with that of other frameworks already in use.
The graphic makes it evident that, thanks to the HHO optimization, the suggested framework has a very low time complexity (8.3 s) when compared to other ones already in use. Consequently, the suggested framework is used in the medical industry to categorize the ECG data.
In this study, an innovative WSN-IoT and Edge device framework-based HHO-LSTM architecture for the automated identification of heart illnesses is presented. The suggested architecture develops a complete system for identifying cardiac illnesses by integrating the capabilities of “Wireless Sensor Networks (WSN)”, the “Internet of Things (IoT)”, and edge computing devices. While IoT offers seamless connectivity and communication between the various system components, WSN facilitates the gathering of real-time physiological data from patients. In order to reduce latency and increase system efficiency, edge computing devices are also essential for processing and analyzing the gathered data. By offering early identification and fast management for those at risk, this comprehensive system for identifying heart illnesses has the potential to completely transform the healthcare sector. Numerous performance measures have been examined and computed as a result of significant experimentation. From the WSN-IoT based systems, about 17,280 ECG data points were gathered and stored in the edge devices for later analysis. The results of extensive assessment and ablation tests are compared to those of the other state-of-the-art deep learning components. The proposed framework is achieved better accuracy of 98%, precision of 98%, recall of 98%, specificity of 98% and F1-score of 98%. Healthcare practitioners may monitor patients remotely and decide on the best course of therapy using real-time ECG data gathered by WSN. IoT-enabled continuous connection guarantees that data is sent properly and securely across the various components, enabling prompt intervention. Overall, WSN, IoT, and edge computing device integration has the potential to considerably enhance patient outcomes and save healthcare expenditures. Future modifications to this suggested model in classification networks are still possible for improved performance and reduced computing load. Additionally, the proposed model has to be adjusted so that it may be used in small devices.
