Heart disorders represent a vital role in global health challenge, contributing to high mortality rates and a substantial burden on healthcare systems worldwide. Timely and accurate diagnosis, as well as continuous monitoring of heart conditions, are critical for improving patient outcomes, reducing healthcare costs, and preventing severe cardiovascular events. However, traditional diagnostic methods often face several limitations, such as delayed detection, insufficient real-time monitoring, and the challenges associated with processing the large volumes of cardiovascular data generated daily[1–3]. These issues are further exacerbated by the increasing prevalence of heart disorders, especially in aging populations and regions with limited access to advanced healthcare facilities, highlighting the need for more efficient and accessible solutions.
The emergence of IoT innovation has brought revolutionary shifts to healthcare by facilitating immediate, remote monitoring through wearable devices and sensors. These IoT-enabled systems continuously collect large volumes of ECG and other significant data, providing the potential for early detection, personalized treatment, and proactive healthcare management. However, analyzing this large-scale, time-dependent data poses significant challenges. Not only must these systems capture complex temporal patterns within the ECG signals, but they must also operate efficiently on edge devices with limited computational resources[4]. Additionally, managing data noise, ensuring privacy and security, and maintaining high accuracy for real-time decision-making further complicate the problem.
To address these challenges, deep learning approaches have used as significant tools for examining sequential and time-series data, such as ECG signals [5–7]. In particular, CNNs are efficient in capturing spatial features from raw ECG signals, while LSTM models good at modeling the temporal dependencies and sequential nature of heart rhythms. However, deploying such models on IoT devices requires overcoming issues related to computational complexity, resource constraints, and real-time processing capabilities.
This research introduces a hybrid CNN-LSTM model for ECG classification, designed to leverage the benefits of both networks. The CNN layers extract relevant spatial features from ECG signals, while the LSTM layers capture long-range dependencies and temporal patterns crucial for accurate heart disease classification. By integrating these two models, the recommended approach intends to improve both the accuracy and performance of ECG analysis, making it feasible to deploy on edge IoT devices for real-time, continuous monitoring of cardiovascular health. This research seeks to overcome the challenges of current healthcare monitoring systems, offering a scalable, efficient, and accurate solution for early heart disease prediction in resource-constrained environments [8–11]. Through the integration of edge intelligence, DL, and IoT technology, the proposed framework possesses the capacity to substantially enhance patient care and enable more accessible, personalized healthcare solutions.
The research introduces a novel methodology integrating CNN and LSTM models to improve the classification of ECG systems within IoT-enabled edge intelligence environments.
The proposed framework addresses the limitations of standalone CNN or LSTM models by integrating both to improve classification accuracy, robustness, and real-time applicability in edge devices.
Extensive experiments using MIT-BIH, PhysioNet, and real-time IoT ECG data validate the model's effectiveness, with metrics like accuracy, sensitivity, specificity, and F1-score showcasing its superiority over traditional methods.
The study is presented in the following manner: Section 2 discusses a review of relevant study and discusses the limitations of existing systems. Section 3 represents a detailed explanation of the suggested CNN-LSTM framework. Section 4 details the experimental setup and evaluation metrics. Section 5 concludes the research by summarizing the results and exploring potential future improvements to enhance the effectiveness of edge intelligence in IoT devices for ECG system classification.
Kumar et al. (2024) [12] proposed an IoT-based smart healthcare system incorporating edge intelligence computing to enhance healthcare services by enabling real-time data processing and decision-making directly at the edge of the network. This method minimizes latency, reduces bandwidth utilization, and ensures quicker responses to critical health conditions. By utilising IoT devices and edge computing, the system can provide continuous monitoring of patients' vital signs, improve diagnostics, and support proactive health interventions. However, challenges remain, particularly with the computational limitations of edge devices and potential security concerns in decentralized environments, such as data privacy issues and vulnerability to cyberattacks.
Kolhar et al. (2024) [13] developed an AI-driven real-time classification system for ECG signals in cardiac monitoring utilising the i-AlexNet framework. Their approach utilizes deep learning to enhance the accuracy and speed of ECG signal classification, offering a potential solution for continuous cardiac monitoring. However, the system may face limitations in terms of scalability for large datasets and the need for further validation in diverse clinical environments to ensure its robustness and generalizability across different patient populations.
Ni et al. (2023) [14] developed an improved IoT-based electrocardiogram (ECG) monitoring method that leverages DL techniques to improve ECG signal analysis. The model is developed to provide real-time monitoring, enabling quicker and more accurate diagnoses of cardiac conditions and facilitating timely interventions for patients. By utilizing deep learning algorithms, the system enhances the accuracy of detecting abnormalities in ECG patterns. However, the system faces challenges, including the high computational demands required for processing deep learning models, which may affect its scalability. Additionally, there is the potential for false positives or negatives in ECG detection, which could impact reliability in critical healthcare environments.
Lazar et al. (2023) [15] proposed an approach for electrocardiogram (ECG) signal classification in an IoT environment using adaptive deep neural networks. They enhanced ECG signal analysis in real-time, enabling effective cardiac monitoring in IoT-based healthcare systems. By utilizing adaptive deep neural networks, the system dynamically adjusts to varying signal characteristics, improving performance across different patient populations. However, the system may face challenges related to the computational complexity of deep neural networks, requiring significant processing power. Additionally, its dependence on IoT connectivity may introduce reliability issues in environments with unstable internet access.
Saha et al. (2023) [16] developed an IoT-based smart ECG monitoring system designed to provide real-time monitoring of patients' ECG signals. The system aims to enhance healthcare outcomes by enabling early detection of cardiac abnormalities and facilitating timely intervention. By utilizing IoT devices, it ensures remote access to patient data for healthcare professionals. However, the system may face limitations in terms of data security and privacy, as the transmission of sensitive medical data over networks can be vulnerable to cyberattacks. Also, the accuracy of the system might be influenced by the quality and reliability of IoT device sensors.
Cañón-Clavijo et al. (2023) [17] proposed an IoT-based system for heart monitoring and arrhythmia detection using machine learning techniques. The system aims to provide continuous cardiac monitoring and early detection of arrhythmias, offering improved patient care and timely interventions. By integrating IoT devices and machine learning algorithms, it ensures real-time data processing and accurate classification of heart conditions. However, the system may encounter challenges related to the need for high-quality data from IoT sensors and the potential for model overfitting, which could affect the accuracy of arrhythmia detection. Additionally, data privacy and security issues could arise when transmitting sensitive health information.
Rahaman et al. (2022) [18] developed an IoT-based electrocardiogram (ECG) monitoring system utilising ML algorithms to enhance the detection of cardiac abnormalities. The system aims to provide real-time ECG monitoring, enabling early diagnosis and intervention for patients with heart conditions. By leveraging IoT devices and machine learning, it offers efficient data processing and remote monitoring capabilities. However, the system may face limitations related to the accuracy and robustness of the machine learning model, especially when dealing with noisy or incomplete ECG data. Additionally, ensuring the reliability of IoT devices and safeguarding patient data privacy may pose significant concerns.
Rahman et al. (2022) [19] developed an IoT-based ECG system aimed at improving healthcare services in rural areas. The system enables remote monitoring of ECG signals, facilitating timely diagnosis and intervention for patients in underserved regions. By utilizing IoT technology, the system allows healthcare professionals to access real-time ECG data remotely, overcoming barriers such as limited access to healthcare facilities. However, the system faces several challenges, including the reliability of IoT devices in rural areas with limited infrastructure and network connectivity. Data transmission in remote locations may be prone to interruptions, affecting the system's efficiency. Furthermore, the quality and accuracy of ECG signals could be compromised by environmental factors, such as electrical interference or poor sensor calibration. There are also concerns about data security, as the transmission of sensitive patient information over potentially insecure networks could expose the system to privacy risks and cyberattacks.
Karim et al. (2022) [20] proposed an enhanced CNN for the effective classification of ECG signals in an IoT environment. The used DL methods, which can facilitate real-time cardiac monitoring. The CNN model is optimized to process ECG data from IoT devices, ensuring timely detection of abnormalities and improving patient outcomes through early intervention. However, the system may face challenges such as the demand for large, high-quality datasets to train the model effeciently, as well as the computational cost associated with real-time processing of ECG data. Additionally, the performance of the system could be impacted by the variability in ECG signals from different patients or devices, potentially reducing classification accuracy. There are some limitations regarding privacy when transmitting sensitive medical data across IoT networks, which need to be addressed for broader adoption in healthcare settings.
Heaney et al. (2022) [21] developed an IoT-based ECG and vitals healthcare monitoring system designed to provide continuous, real-time monitoring of patients' cardiac and vital signs. The system integrates IoT sensors allowing healthcare providers to remotely monitor patients, especially in remote or underserved areas. This technology aims to enhance patient care by enabling early detection of health issues and timely interventions. Although, the system may face challenges related to the accuracy and reliability of IoT sensors, which can be influenced by environmental factors or hardware limitations. Additionally, the system’s dependency on continuous internet connectivity for data transmission could present difficulties in areas with unreliable networks. There is an challenges for securing sensitive medical data transmitted over IoT networks, which could expose patients to potential data breaches or unauthorized access.
The recommended architecture consists of three key levels: (i) the Data Collection Unit, (ii) the Data Preprocessing Phase, and (iii) the Classification and Prediction Phase. A block diagram illustrating the architecture is presented in Figure 1.

Proposed Architecture

LSTM Structure
The dataset used for ECG signal classification comprises data collected from IoT-based sensors that monitor key physiological attributes. These include heart rate, which measures the frequency of heartbeats; ECG waveforms, which record the electrical activity of the heart; and time stamps, providing the temporal sequence of the data. Additional information such as patient age, gender, and medical history is included to account for individual variations in ECG patterns. Environmental factors, such as temperature and humidity, are also recorded, as they may affect sensor performance. The collected data is used to analyze heart health over time, enabling accurate classification of ECG signals for early detection of cardiac issues.
The preprocessing steps for the ECG signal dataset include handling missing values and converting categorical data into a suitable format for analysis. NaN (Not a Number) values, representing missing data, are replaced using imputation strategies such as mean, median, or domain-specific values to ensure the integrity of the dataset. For instance, missing heart rate values could be filled with the average heart rate for the corresponding patient or time period. Additionally, signal normalization is performed to scale ECG waveforms to a standard range, improving model convergence and performance. Label encoding is applied to convert categorical variables such as patient gender or medical history into numeric values, making them compatible with ML algorithms. preprocessing guarantees that the information is clear, uniform, and prepared for effective classification of ECG signals.
It is a type of DL model which is especially ideal for handling data with a grid-like topology, like images or ECG signals. CNNs automatically learn spatial hierarchies of features through multiple layers of convolution, pooling, and fully connected operations. Here's an overview of the key operations in CNNs along with the relevant equations.
Convolutional Layer:
The core operation in a CNN is the convolution process, which applies a filter (also called a kernel) to the input data to extract features.
Let’s consider the input to the convolutional layer as a 2D matrix XXX (for example, an image or a segment of an ECG signal) and a filter WWW, also a 2D matrix. The convolution operation is represented as:
Where:
Y(i, j) is the output feature map at position (i, j).
X(i + m, j + n) is the value of the input at the position (i + m, j + n).
W(m, n) is the filter (or kernel) applied to the input.
The operation * denotes the convolution.
This equation essentially computes the sum of element-wise multiplications between the filter and the part of the input data it covers. The result is stored in the output feature map Y.
Activation Function:
After the convolution operation, an activation function, typically the Rectified Linear Unit (ReLU), is applied element-wise to introduce non-linearity into the network.
The ReLU activation function is defined as:
Where:
x is the input to the activation function.
Pooling Layer:
Pooling is used to decrease the spatial size of the feature maps and to perform the pooling, which chooses the highest value from a region of the input.
If we apply max pooling with a window size of 2 × 2 the operation for the input X is:
Where:
P(i, j) is the pooled value at position (i, j).
The pooling window covers 2 × 2 the region of the input.
Fully Connected Layer:
In the fully connected layers, each neuron is connected to every neuron in the previous layer. The output from the previous layer is flattened into a 1D vector and passed through a series of fully connected layers.
The output of a fully connected layer is computed as:
Where:
y is the output vector.
W is the weight matrix.
x is the input vector from the previous layer.
b is the bias term.
This equation computes the weighted sum of the inputs plus the bias.
Output Layer:
It produces the final classification or prediction. In the case of a binary classification (e.g., normal vs. abnormal ECG), the output layer usually applies a softmax or sigmoid activation function.
For binary classification using sigmoid, the output Youtput is computed as:
Where:
z is the input to the sigmoid function, typically the output from the fully connected layer.
e-z represents the exponential function.
For multi-class classification (e.g., detecting different types of arrhythmias), the softmax function is used:
Where:
eziis the input for the iii-th class.
The CNN algorithm consists of several layers, each performing a specific operation to transform the input data into more abstract and useful features. The key operations involve convolutions for feature extraction, activations for non-linearity, pooling for dimensionality reduction, fully connected layers for classification, and finally, the output layer for generating predictions. The model is trained to optimize weights using backpropagation and gradient descent, which minimizes the error between predicted and actual values.
It is a DL method specifically designed to process sequential data and capture long-term dependencies. This makes it highly effective for tasks like time-series predictions, commonly used in healthcare systems. As a variant of Recurrent Neural Networks (RNNs), LSTM addresses the vanishing gradient problem often encountered in traditional RNNs when working with long sequences. The figure below illustrates the structure of an LSTM network.
An LSTM network is composed of three primary gates: the forget gate, the input gate, and the output gate. These gates collaboratively manage the flow of information within the network, controlling the memory cell. This enables the model to determine which information to retain, update, or discard at each time step.
The core equations that define the operations of an LSTM cell are as follows:
Forget Gate: It decides which data from the previous time step should be discarded. The equation for the forget gate is:
ft is the forget gate output,
σ is the sigmoid activation function,
Wf is the weight matrix,
ht-1 is the previous hidden state,
xt is the input at time step t,
bf is the bias term.
Input Gate: It controls how much new information should be added to the memory cell. The equation for the input gate is:
where it is the input gate output, and the rest of the variables are similarly defined as in the forget gate.
Cell State Update: It is updated by combining the outputs of the forget and input gates. The equation is:
where
Output Gate: The output gate determines the next hidden state, and its calculation is expressed by the following equation:
Where Ot is the output gate output, and ht is the hidden state at time step t.
LSTM networks, a specialized deep learning (DL) model, utilize gates to selectively retain or discard information, making them highly effective for analyzing time-series data. These gates enable LSTMs to preserve long-term dependencies while filtering out irrelevant information, which is essential for processing sequential medical data. In healthcare, LSTM networks are employed to predict heart disorders and other medical conditions by integrating patient history with real-time health data. This functionality supports accurate and timely predictions, enhancing decision-making and enabling proactive healthcare interventions.
The incorporation of CNN and LSTM methods offers a powerful framework for effectively classifying ECG signals in edge intelligence-based IoT devices. CNNs excel at extracting spatial features from ECG signals, such as P waves, QRS complexes, and T waves, while LSTMs capture temporal dependencies crucial for understanding sequential data like heartbeats. In this approach, preprocessed ECG signals are first processed through CNN layers to identify spatial patterns, and the extracted features are then passed to LSTM layers to analyze temporal relationships. The combined features are used in fully connected layers for accurate classification, with the model deployed on IoT edge devices for real-time analysis. This integration enables robust and efficient ECG signal classification, reducing latency and ensuring timely detection of heart disorders, making it ideal for healthcare applications where proactive medical intervention is critical.
The proposed edge-based IoT system for ECG classification was implemented on a PC with an Intel Core i9 CPU, 240 GB SSD, and NVIDIA Titan V4 GPU. It used CNN and LSTM architectures for real-time signal processing. ECG data from IoT sensors was preprocessed and classified efficiently, ensuring low-latency performance for real-time healthcare decisions.
To showcase the superior performance of the proposed model, various evaluation measures, like accuracy, precision, recall, specificity, and F1-score, are assessed and evaluated against other advanced DL algorithms.
Evaluation Metrices
| SL.NO | Evaluation Metrics | Mathematical Expression |
|---|---|---|
| 01 | Accuracy | |
| 02 | Recall | |
| 03 | Specificity | |
| 04 | Precision | |
| 05 | F1-Score |
As demonstrated in Table 2, the proposed model surpasses all other models in accuracy, sensitivity, specificity, precision, and F1-score, emphasizing its superior capability in multimodal classification tasks.
Comparative Analysis between the Different Models in ECG signal classification
| Algorithm | Evaluation Metrics (%) | ||||
|---|---|---|---|---|---|
| Accuracy | Precision | recall | Specificity | F1-score | |
| GRU | 91.3% | 90.4% | 90.2% | 89.2% | 89.3% |
| RF | 92.5% | 92.34% | 92.48% | 92.35% | 92.6% |
| DT | 93.4% | 93.7% | 93.1% | 93.2% | 93.0% |
| SVM PROPOSED | 89.0% | 89.9% | 89.78% | 89.68% | 90% |
| MODEL | 99% | 99% | 98.96% | 99.1% | 99% |
Figure 3 presents a comparative assessment of the model's effectiveness with varying percentages of learning data, evaluated across key metrics. Panel (a) shows testing accuracy, panel (b) reflects sensitivity, panel (c) illustrates specificity, panel (d) measures precision, and panel (e) presents the F1-score. These panels collectively provide an overall view of the model's effectiveness in predicting health outcomes with different data proportions.

Comparative Assessment with Varying Learning Data Percentages based on (a) testing accuracy, (b) sensitivity, (c) specificity (d) Precision (e) F1-Score
The proposed edge intelligence-based IoT system for ECG signal classification, leveraging a hybrid CNN-LSTM algorithm, achieves an impressive accuracy of 99%, demonstrating superior performance in identifying key ECG patterns and capturing the sequential dynamics of heartbeats. This model excels in real-time, low-latency decision-making, making it suitable for deployment on resource-constrained edge devices. It outperforms existing ML models in terms of accuracy, sensitivity, specificity, and F1-score, offering an efficient solution for cardiac monitoring. Looking ahead, future work could involve integrating additional sensor modalities like blood pressure or oxygen levels, extending the model to detect a broader range of cardiovascular conditions, and optimizing the system for better efficiency through techniques like model pruning or quantization. Furthermore, deploying the system in real-world healthcare environments and incorporating Explainable AI (XAI) methods would enhance the model’s transparency, scalability, and usability in clinical settings.