
ELECTROCARDIOGRAM HEARTBEAT CLASSIFICATION USING MACHINE
LEARNING AND ENSEMBLE CONVOLUTIONAL NEURAL NETWORKBIDIRECTIONAL LONG SHORT-TERM MEMORY TECHNIQUE
NIRMALA DEVI N1 and RATHI S2
1PG Scholar, Dept. of CSE, Government College of Technology, Coimbatore, India
2 Professor, Dept. of CSE, Government College of Technology, Coimbatore, India
Abstract - This project aims to improve the automated classification of electrocardiograms (ECGs) for the early detection of cardiac arrhythmias, which is essential for diagnosing cardiovascular diseases (CVDs). It tackles significant challenges such as time-series dependencies in ECG signals and class imbalance. The proposed approach uses the Random Forest method, an ensemble learning technique, for classifying ECG heartbeats. The model was trained using the MIT-BIH Arrhythmia Database, which consists of over 109,000 labeled heartbeats, and incorporates SMOTE to address class imbalance. Advanced preprocessing methods, including median and SavitzkyGolay filters, are applied to enhance the reliability of the dataset.Achievinganimpressivecorrectness of99.88%,this Random Forest model surpasses previous methods in detecting complex arrhythmias such as ventricular and supraventricular beats. These findings demonstrate the model’s potential for telemedicine applications and its ability to provide reliable CVD diagnoses. Future research should focus on utilizing larger datasets and improving feature extraction methods to further optimize model performance
Keywords Electrocardiogram, Cardiac Arrhythmia Detection, Deep learning techniques such as Convolutional Neural Networks (CNNs) and Bidirectional Long Short-Term Memory (BiLSTM) networks, Machine Learning, Ensemble Learning, Random Forest, Support Vector Machine, XGBoost, Adaboost, Stacked Ensemble, MIT-BIH Arrhythmia Database
1.INTRODUCTION
The paper highlights the significant impact of cardiovascular diseases as the primary cause of death worldwide, using a considerable proportion among deaths attributed to heart attacks. Detecting cardiac arrhythmias early is essential for effective disease management and improving patient outcomes. Electrocardiograms, as nonInternal and affordable diagnostic tools, are commonly usedtoidentifyirregularitiesinheartrhythms.Astandard ECG includes elements like the P-wave, QRS complex, and T-wave,andoccasionallytheU-wave,withdeviationsfrom these patterns often indicating arrhythmias. Undiagnosed
arrhythmias can impair circulation and potentially harm vital organs, including the brain and heart. However, manual examination of ECGs is labor-intensive, prone to errors, and unsuitable for processing large-scale data in clinical settings. Additional challenges, including noise in signals, imbalanced data, and the temporal nature of ECG signals, complicate automated analysis. These limitations emphasize the need for advanced, efficient systems for classifying heartbeats to support early arrhythmia diagnosis.
To address these challenges, the paper introduces an innovative methodology combining machine learning ensemble techniques with A combined deep learning framework that leverages CNN architectures and Bidirectional LSTM networks. This approach effectively addresses issues such as class imbalance and temporal dependencies in ECG data while enhancing classification accuracy.
Keyaspectsofthemethodologyinclude:
1.Dataset: The study uses the MIT-BIH Arrhythmias Database, a comprehensive resource containing over 109,000 ECG beats categorized into Normal, Supraventricular, Ventricular, Fusion, and Unknown classes.
2.Preprocessing: Advanced noise reduction techniques, including median and Savitzky-Golay filters, are applied. The signals are segmented into heartbeat intervals using establishedalgorithmslikePan-Tompkins.
3.ClassImbalance: The Synthetic Minority Oversampling Technique is utilized to address data imbalance, particularlyforunderrepresentedarrhythmiaclasses.
4.FeatureExtraction: Featuresareextractedusingatimeseries library, TSFEL, and optimized through recursive feature elimination (RFE) to focus on the most relevant attributes.
5.Classification: The proposed framework combines ensemble machine learning methods, including Random Forest and Support Vector Machines, XGBoost, as well as Adaboost,withaCNN-BiLSTMhybridmodel.CNNcaptures

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net
hierarchical features, while BiLSTM processes temporal dependenciesinthedata.
The ensemble CNN-BiLSTM model demonstrated exceptional accuracy of 99.88%, outperforming previous methods and achieving high precision and sensitivity, particularly for complex arrhythmia classes like Supraventricularand Ventricular beats. This robust hybrid model effectively handles imbalanced datasets and noisy signals, making it a reliable choice for real-world clinical applications. Communication. This helps candidates identify areas for improvement, refine their interview techniques, and boost their confidence for real-world interviews.
2. PROPOSED SYSYTEM
2.1
DATA PREPROCESSING:
The preprocessing phase for ECG signals is essential to preparerawdataforeffectiveclassification,addressingthe challenges posed by noise and non- stationarity. This process includes noise removal techniques such as baseline drift removal using a median filter (200-600 ms window) and high-frequency noise removal with the Savitzky-Golay filter, which smooths the signal while preserving essential characteristics like the P-wave, QRS complex,andT-waveare essential componentsoftheECG signal. Precise detection of the R-peak is accomplished using the Pan-Tompkins algorithm, which uses squaring, differentiation, bandpass filtering, and a moving window integrator to precisely locate R-peaks. The ECG signal is then segmented into individual heartbeats using a fixed window of 500 ms around each R-peak, enabling focused analysis of each cardiac cycle. Additionally, normalization techniquesensureconsistentscalingofthedata,improving model performance. These preprocessing steps result in a cleaned and structured ECG dataset, ready for feature extraction and classification, which is crucial for reliable arrhythmia
2.2 DATA AGUMENTATION AND BALANCING:
Thesyntheticoversamplingtechniqueforminorityclassis employed to address the class imbalance present in the ECG data pool, where certain arrhythmia classes (such as supraventricular and ventricular beats) are underrepresented compared to normal beats. SMOTE addressingtheimbalancebycreatingsyntheticsamplesfor the underrepresented classes, effectively enhancing the model’s capacity to categorize rare arrhythmias. It works by identifying the k- nearest neighbors of each minority class sample and creating new synthetic instances along the paths linking the samples for their surrounding entities.Thisprocessaugmentsthe minorityclasswithout simply duplicating existing data, thus reducing the bias toward the majority class. By teaching the model using a more broad and representative data pool, SMOTE
improves its performance in detecting rare arrhythmias while minimizing the risk of overfitting to the dominant class.consequently,thetechniqueleadstoamorebalanced dataset, enabling more accurate and reliable classification ofbothcommonandrarearrhythmiatypes.
2.3 FEATURE EXTRACTION:
To convert raw ECG signals into meaningful representationsthatcanbeFeedingintomachinelearning or deep learning models Feature extraction is key to the classification process in the preprocessing pipeline. The Time Series Feature Extraction package, a comprehensive Python packagemade toextracta varietyoffeaturesfrom time-series data, is used in this work to extract features. TSFELincludesmethodsforextractingspectral,statistical, and temporal features from ECG signals, each of which captures different aspects of the signal’s characteristics. Spectral features help capture frequency-domain characteristics,suchaspowerspectraldensity,thatreflect the energy distribution of the ECG signal over various frequencybands.Statisticalfeaturesincludemeasureslike Mean, spread, skewness, and tailedness which describe thisdistributionandshapeoftheECGwaveform,providing insights into its overall behavior. Temporal features include measures that describe the signal’s behavior over time, such as mean absolute deviation, signal energy, and autocorrelation, which are important for identifying patterns in the sequential data of ECG recordings. By leveraging TSFEL, a rich set of features is extracted that encapsulates both global and local properties of the ECG signal,aidingintheaccuratedetectionandclassificationof arrhythmias. These features are then used in machine learninganddeeplearning models,wheretheirdistinctive properties help enhance the functionality of the arrhythmiadetectionnetwork.
2.4 MODELING:
Inthe modelingphase,ECG heartbeatclassificationcan be efficiently achieved with The Random Forest model is an ensemble learning technique that builds multiple decision treesandcombines their predictionsto enhanceaccuracy. While reducing the likelihood of overfitting. Each decision Eachtreeistrainedonadistinctrandomsubsetofthedata and features, allowing the model to capture various patterns in ECG signals without overfitting to any specific part of the data. In the classification phase, each tree generates its own prediction, the final classification is made based on the majority vote from all the decision trees. This approach is especially effective for handling complex, high-dimensional data such as ECG signals, as it minimizes variance and enhances predictive performance. TheRandomForestmodelisalsorobustagainstnoise,itis also capable of handling missing data, making it highly suitable for real-world ECG datasets, which frequently contains noise and artifacts. By leveraging the power of multipledecisiontrees,theRandomForestmodelexcelsin

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
identifying patterns within ECG signals, making it an excellenttoolforaccuratearrhythmiadetection.
2.5
CLASSIFICATION:
In the proposed ECG heartbeat classification system, the Random Forest machine learning algorithm is used to detect and classify various types of cardiac arrhythmias from ECG signals. As an ensemble learning method, Random Forest is particularly effective in managing diverse data distributions and classification patterns. The model it operates by constructing several decision trees and aggregating their predictions to enhance overall accuracy and performance minimize overfitting. This approachmakesuseoftheMIT-BIHArrhythmiasDatabase and applies SMOTE to balance the dataset. Advanced Preprocessing methods, such as median filtering and Savitzky-Golay smoothing, are used to. enhance the data's quality. The system excels in detecting complex arrhythmiasbyutilizingRandomForest’sabilitytocapture patterns and reduce variance. The method achieves high accuracy in distinguishing both normal and abnormal heartrhythms,offeringstrongpotentialforreliablecardiac arrhythmiadetectioninpracticalapplications.

Fig-1: SYSTEMARCHITECTURE
2.6 PERFORMANCE AND EVALUATION:
The model's performance is assessed using several key metrics, including accuracy, sensitivity, precision, and the F1-score. These metrics provide a comprehensive evaluationof the model'sabilitytoaccuratelyclassifyECG heartbeats. Accuracy represents the proportion of correct classifications, while sensitivity (or recall) measures the model’s effectiveness in detecting positive instances, such as arrhythmic heartbeats, by reducing false negatives.
Precision reflects the ratio of true positive predictions to all predicted positives, indicating the model's reliability in identifying arrhythmic events without falsely classifying normal heartbeats as abnormal. The F1-score, calculated as the harmonic mean of precision and sensitivity, is particularly valuable when both false positives and false negatives are significant. To ensure robust performance and prevent overfitting, cross-validation is used. This involvessplittingthedatasetintomultiplefolds,wherethe model is trained and tested iteratively on each fold, guaranteeing a consistent performance evaluation across differentsubsetsofdata.
3. RELATED WORKS
Malleswarietal.proposedaBi-LSTMmodelforECG-based heartbeat classification, achieving 98% accuracy using the MIT-BIH dataset. Their method outperformed existing classifiers in sensitivity (96.9%), specificity (97.4%), and F1 score (97.5%), with simulations conducted in MATLAB 2020a[1].
Lim et al. introduced an advanced deep learning model integratingdynamicbeatsegmentationandcorresponding heart rate data for ECG classification. Their method achieved 99.81% sensitivity for normal beats and outperformed existing PAC detection techniques using PhysioNetQTandMIT-BIHdatabases[2].
DegachiandOunidevelopedaCNN-BiLSTMseq2seqmodel with an attention mechanism for heartbeat classification. Their model, using ADASYN for data augmentation, achieved 99.87% accuracy on the MIT-BIH database, demonstrating enhanced reliability through an interpatientparadigm[3].
Swaroop et al. presented an integrated CNN-LSTM model for ECG classification, achieving 98.94% accuracy on the MIT-BIHdataset.Theirapproachimprovescardiovascular diseasediagnosisandpatientmonitoring[4].
Vavekanand et al. developed a CNN model for binary ECG classification. While fine-tuned models achieved 93.5% accuracy, individual classifiers attained 94.6%, demonstratingtheeffectivenessoftransferlearning[5].
Sattar et al. explored CNN, LSTM, and SSL models for digitizedECGsignalclassification.TheCNNmodelattained the highest accuracy of 92%, highlighting its potential for real-timeECGmonitoring[6]
Yildirim et al. evaluated various machine learning models, including LSTM BiLSTM, GRU, SVM, and ensemble techniques for ECG classification. Ensemble learning methodssignificantlyimprovedclassificationperformance in handling imbalanced datasets using the MIT-BIH database[7].

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
Alkhawaldeh et al. introduced a DeepResidualBiLSTM model combining residual CNNs and BiLSTMs. The model addressed vanishing gradient issues, captured long-term dependencies, and achieved 99.4% accuracy, making it effectiveforearlyarrhythmiadetection[8].
AlharbiEtal.developedanLSTM-CNNensemblemodelfor the classification of ECG signals. achieving 94.52% sensitivity, 96.42% specificity, and 95.45% accuracy. This approach enhances cardiovascular disease diagnosis and preventivehealthcare[9].
Rekha and Miruthula developed two models for cardiac abnormality detection: a voting ensemble classifier (Random Forest, SVM, XGBoost, LightGBM) with 98.52% accuracy and a CNN model with 99.03% accuracy. These methodssupportearlydetectionofheartconditions[10].
Zhang et al. developed an inter-patient ECG heartbeat classification model using an adversarial convolutional neuralnetwork(CNN).Themodelenhancesgeneralization across patients by generating adversarial samples during training, supporting more robust arrhythmia detection [11].
Mondejar-Guerra et al. proposed a method that fuses temporal and morphological ECG information through an ensemble of classifiers. This technique achieved improved heartbeat classification by integrating diverse learning models[12].
de Lannoy et al. introduced a Weighted Conditional RandomFields(WCRF)modelforsupervisedinter-patient heartbeat classification. This method effectively modeled sequential dependencies and spatial relations in ECG signals[13].
Raj and Ray designed a personalized arrhythmia monitoring platform using machine learning models tailored to individual ECG patterns. Their approach supportspatient-specificmonitoringandearlydetectionof irregularities[14].
Alarsan and Younes analyzed ECG signals using machine learningalgorithmssuchasSVM,KNN,andDecisionTrees. Their method utilized handcrafted heartbeat features for heartdiseaseclassificationwithhighaccuracy[15].
Zhang et al. developed a disease-specific feature selection method for heartbeat classification. By selecting features tailored to particular cardiac conditions, their model enhancedtheprecisionofECG-baseddiagnosis[16].
Afkhami et al. proposed a model combining statistical and mixture modeling features for cardiac arrhythmia detection. Their method employed feature engineering to improve classification reliability across arrhythmia types [17].
Shi et al. introduced a hierarchical classification method usingweightedExtremeGradientBoosting(XGBoost).This method achieved high ECG heartbeat classification performance by leveraging a multi-stage learning approach[18].
Xuetal.developedanend-to-endECGclassificationmodel that processes raw signal input using deep neural networks (DNNs). This model eliminates the need for handcrafted feature extraction, enabling automated and scalableECGanalysis[19].
Singh et al. implemented Recurrent Neural Networks (RNNs) for ECG arrhythmia classification. Their model captured temporal ECG dynamics, allowing accurate sequence-basedpredictionofheartbeattypes[20].
Li et al. proposed a personalized heartbeat classification model optimized for long-term ECG signal analysis. The systemmaintainedhighaccuracybyadaptingtoindividual patientvariationsovertime[21].
Saadatnejad et al. presented an LSTM-based ECG classification model designed for continuous monitoring on wearable devices. The approach enabled real-time detection of heartbeat abnormalities with high performanceonlow-powerplatforms[22].
Akan et al. proposed ECGformer, a transformer-based model for ECG arrhythmia classification. Their approach achieved superior performance on the MIT-BIH and PTB datasets by effectively capturing long-range dependencies inECGsignals[23].
These studies highlight a wide range of approaches and performance metrics for ECG classification using machine learning and deep learning models. Table 1 provides a summaryoftheserelatedworks.
TABLE-1: SUMMARYTABLEOFRELATEDWORKS
TITLE
Malleswari et al.
Lim et al
Degachi and Ouni
DESCRIPTION
ProposedaBi-LSTMmodelforECG classificationusingtheMIT-BIH dataset,achieving98%accuracy.Their MATLAB2020a-basedsimulations outperformedexistingmethodsin sensitivity(969%),specificity(974%), andF1score(975%)[1]
Developedadeeplearningmodelwith dynamicbeatsegmentationandheart ratedata.Achieved99.81%sensitivity fornormalbeatsusingPhysioNetQT andMIT-BIHdatabases,outperforming PACdetectiontechniques[2]
DesignedaCNN-BiLSTMseq2seqmodel withattentionandADASYN-baseddata

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
augmentation,achieving99.87% accuracyontheMIT-BIHdatasetunder inter-patientevaluation[3].
Swaroop et al.
Vavekanand et al.
IntroducedahybridCNN-LSTMmodel forECGclassification,achieving98.94% accuracyontheMIT-BIHdatasetand supportingimprovedcardiovascular diseasediagnosis[4].
CreatedaCNN-basedbinaryECG classifierusingtransferlearning.Finetunedmodelsreached93.5%accuracy; individualmodelsattained94.6% accuracy[5].
Sattar et al.
Yildirim et al.
EvaluatedCNN,LSTM,andSSLmodels forECGclassification.CNNyieldedthe bestperformancewith92%accuracy, indicatingsuitabilityforreal-time monitoring[6]
AssessedMLandDLmodels(LSTM, BiLSTM,GRU,SVM,ensemble)forECG classificationonMIT-BIHdata. Ensemblemethodseffectivelyhandled classimbalanceandboostedaccuracy [7].
Alkhawaldeh et al.
Alharbi et al.
Rekha and Miruthula
ProposedDeepResidualBiLSTM, integratingresidualCNNandBiLSTM layerstoovercomevanishinggradient issuesandcapturelong-termECG dependencies.Achieved99.4% accuracy[8].
DevelopedanLSTM-CNNensemble modelforECGclassificationwith 94.52%sensitivity,96.42%specificity, and95.45%accuracy,improving preventivehealthcare[9].
Designedtwomodels:avoting ensemble(RF,SVM,XGBoost, LightGBM)with98.52%accuracy,anda CNNmodelwith99.03%accuracyfor cardiacabnormalitydetection[10].
Zhang et al.
MondejarGuerra et al.
de Lannoy et al.
Raj and Ray
Presentedaninter-patientheartbeat classificationmodelusingadversarial CNNs.Adversarialtrainingenhanced generalizationandarrhythmia detectionrobustness[11].
Introducedanensembleapproachthat fusestemporalandmorphologicalECG featurestoenhanceclassification accuracy[12].
ProposedaWeightedConditional RandomFieldsmodelthateffectively capturestemporalandspatial relationshipsinECGforinter-patient classification[13].
Developedapersonalizedarrhythmia monitoringplatformusingpatientspecificMLmodelsforearlyirregularity detection[14].
Alarsan and Younes
Zhang et al.
Afkhami et al.
UsedhandcraftedECGfeatureswithML algorithms(SVM,KNN,DT)for classifyingvariousheartdiseaseswith highaccuracy[15].
Developedadisease-specificfeature selectionmethodforECGclassification, enhancingdiagnosisprecisionby tailoringfeaturestospecificconditions [16].
Usedstatisticalandmixturemodeling featurestoclassifyarrhythmias, combiningmultiplefeaturestoimprove reliability[17].
Shi et al.
Introducedahierarchicalclassifier basedonweightedXGBoostthat achievedstrongresultsinECG classificationthroughamulti-stage strategy[18].
Xu et al.
Singh et al.
Li et al.
Saadatnejad et al.
Akan et al.
Developedanend-to-enddeepneural networkthatprocessesrawECGinput, eliminatingtheneedforfeature engineering[19].
AppliedRecurrentNeuralNetworksto capturetemporalECGsignaldynamics foraccuratearrhythmiaclassification [20].
Designedapersonalizedheartbeat classificationmodeloptimizedforlongtermECGmonitoring,maintaininghigh performanceovertime[21].
ProposedanLSTM-basedmodelfor real-timeECGclassificationon wearabledevices,enablingcontinuous monitoring[22].
Proposedatransformer-basedmodel (ECGformer)forECGclassification, achievinghighaccuracyonMIT-BIH andPTBdatasets[23].
4. EXPERIMENTAL RESULTS
The study demonstrates the effectiveness of various machine learning and deep learning models for ECG heartbeat classification, focusing on arrhythmia detection using the MIT-BIH Arrhythmias Data pool. The Random Forest classifier achieved 98% accuracy, with good sensitivity and precision, while SMOTE was applied to address class imbalance, improving performance. Crossvalidation ensured unbiased results, with XGBoost outperforming SVM in sensitivity and precision. The Ensemble CNN-BiLSTM model achieved the highest accuracy of 99.88%, demonstrating superior performance in detecting complex arrhythmias and addressing challengeslikeclassimbalanceandthetemporalnatureof ECGdata.

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
4.1 DATASET:
The MIT-BIH Arrhythmias Database used in this study consists of 109,443 labeled ECG beats from 47 subjects, including 90,589 normal beats, 8,039 supraventricular beats,7,236ventricularbeats,2,776fusionbeats,and803 unknown beats. Table 2 presents the number of training and testing instances for each ECG heartbeat class in the MIT-BIH Arrhythmias Database. The dataset is commonly used for cardiac arrhythmia classification and contains ECG recordings obtained from two electrodes at a sampling rate of 360 samples per second. The database is crucial for developing and evaluating automated ECG classification systems, as it provides a wide variety of heartbeat classes, which are essential for training and testing models aimed at detecting arrhythmias in clinical applications.
TABLE-2: DATASET
CLASS NO. OF TRAINING INSTANCES NO. OF TESTING INSTANCES
NB 67997 22592
SB 5953 2086
VB 5447 1789
FB
5. IMPLEMENTATION
5.1 SYSTEM SPECIFICATIONS:
The proposed ECG classification system was developed using specific tools and platforms. Table 3 lists the software packages used. Fig 2 illustrates the packaged environment used during model development and execution.
Table-3:PACKAGEDUSED
Operatingsystem
Windows
DevelopmentPlatform Googlecolab
Languageused Python
Dataset MIT-BIH
The images(Fig. 2 toFig. 6)demonstrate the step-by-step preprocessing of an ECG signal in a Google Colab environment. The process begins with the installation of key Python libraries such as `wfdb`, `numpy`, `scipy`, and `matplotlib` (Fig. 2), which are essential for working with ECG data, performing numerical operations, and creating visualizations. The raw ECG signal is then visualized (Fig. 3), showing noticeable noise and baseline drift that must
beaddressedbeforeanalysis.Tomitigatebaselinewander, a filtering technique is applied (Fig. 4), where the original and corrected signals are plotted for comparison highlighting improved signal stability. In the next step, high-frequency noise is removed from the signal (Fig. 5), resulting in a smoother and cleaner ECG waveform. These preprocessing steps (Fig. 6) significantly enhance signal quality and reliability, forming a crucial foundation for accurate heartbeat classification and diagnostic modeling inECG-basedapplications.

Fig-2: PACKAGEDUSED
The preprocessing phase for ECG signals is essential to preparerawdataforeffectiveclassification,addressingthe challenges posed by noise and non-stationarity. This process includes noise removal techniques such as baseline drift removal using a median filter, as illustrated inFig3.

Fig-3: BASELINEDRIFTREMOVAL

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
These preprocessing steps result in a cleaned and structured ECG dataset, ready for feature extraction and classification, which is crucial for reliable arrhythmia detection. Fig 4 summarizes the complete ECG signal preprocessingworkflow

Fig-4: ECGSIGNALPREPROCESSING
These preprocessing steps result in a cleaned and structured ECG dataset, ready for feature extraction and classification. Fig 5 illustrates the ECG signal after successfulnoiseremoval.

Fig-5: ECGSIGNALAFTERNOISEREMOVAL
Fig 6 illustrates the class distribution before and after applying SMOTE, demonstrating the improved balance acrossheartbeatcategories.

Fig-6: CLASSDISTRIBUTIONBEFOREANDAFTERSMOTE
6. PERFORMANCE METRICS
6.1 EPOCHS:
Anepochreferstoonefullpassthroughtheentiretraining dataset.Neuralnetworksusuallyrequireseveralepochsto learn patterns effectively from the data. After training the model for up to 10 epochs, plot the training and test loss valuesagainstthe number of epochs totrack the progress oflearning.
6.2 ACCURACY:
Accuracy evaluates how effectively a model can recognize patterns and correlations among variables. Test accuracy, calculated using data excluded from the training phase, indicatesthemodel’scapabilitytoperformonunseendata.
6.3 LOSS:
Model performance is assessed through evaluation metrics. The training loss quantifies the model's learning capability on the training dataset, whereas the test loss evaluates its generalization performance on previously unseendata.
7. CONCLUSION
The "Electrocardiogram Heartbeat Classification Using Machine Learning and Ensemble Convolutional Neural Network-Bidirectional Long Short-Term Memory Technique"projectusedtheMIT-BIHarrhythmiadatabase
2025, IRJET | Impact Factor value: 8.315 | ISO 9001:2008 Certified Journal | Page429

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
to successfully implement Machine learning and deep learning approaches for ECG-based cardiac arrhythmia classification. The ensemble ML classifier attained an overall accuracy of 98.67%, while the ensemble CNNBiLSTM model got an even greater accuracy of 99.88%, exceeding cutting-edge approaches regarding sensitivity, exactness,andprecision.Thispaperaimstodemonstrated the efficiency for using the synthetic minority oversamplingmethodfordatabalancingwithCNN-BiLSTM modelstoimproveheartbeat.
FundingDeclaration:
The authors declare that no funds, grants, or other financial support were received during the preparation of thismanuscript.
Declarations:
Conflict of Interest: The authors state that there are no conflictsofinterestregardingthisresearch.
Ethical Approval: Thisarticledoes notinvolve any studies with human participants or animals conducted by the authors.
AuthorContributions:
NirmalaDeviN:Conceptualization,Methodology,Software, Formal Analysis, Investigation, Writing original draft preparation.
Dr. Rathi S: Supervision, Validation, Resources, Writing reviewandediting.
Both authors have read and agreed to the published versionofthemanuscript.
CorrespondingAuthor
NAME:NirmalaDeviN
MAILID:nirm.71772377107@gct.ac.in
8. REFERENCES
[1]E.J.Benjaminetal.,“Heartdiseaseandstrokestatistics2018 update: A report from the American Heart Association,” Circulation, vol. 137, no. 12, pp. e67–e492, 2018.
[2]M.K.Ojha,S.Wadhwani,A.K.Wadhwani,andA.Shukla, “Automatic detection of arrhythmias from an ECG signal using an auto-encoder and SVM classifier,” Phys. Eng. Sci. Med.,vol.45,pp.665–674,2022.
[3] S. Bhattacharyya, S. Majumder, P. Debnath, and M. Chanda, “Arrhythmic heartbeat classification using ensemble of random forest and support vector machine
algorithm,” IEEE Trans. Artif. Intell., vol. 2, no. 3, pp. 260–268,Jun.2021.
[4]G.B.MoodyandR.G.Mark,“TheimpactoftheMIT-BIH arrhythmia database,” IEEE Eng. Med. Biol. Mag., vol. 20, no.3,pp.45–50,May/Jun.2001.
[5] P. de Chazal, M. O’Dwyer, and R. B. Reilly, “Automatic classification of heartbeats using ECG morphology and heartbeatintervalfeatures,”IEEETrans.Biomed.Eng.,vol. 51,no.7,pp.1196–1206,Jul.2004.
[6]M.LlamedoandJ.P.Martínez,“Heartbeatclassification using feature selection driven by database generalization criteria,”IEEE Trans. Biomed.Eng., vol.58, no.3, pp. 616–625,Mar.2011.
[7] P. deChazal and R.B. Reilly, “Apatient-adapting heartbeat classifier using ECG morphology and heartbeat intervalfeatures,”IEEETrans.Biomed.Eng.,vol.53,no.12, pp.2535–2543,Dec.2006.
[8] Testing and Reporting Performance Results of Cardiac Rhythm and ST Segment Measurement Algorithms, ANSI/AAMI EC57, Association for the Advancement of MedicalInstrumentation,Arlington,VA,USA,2012.
[9]S.Haotian,H. Wang,F.Zhang,Y.Huang,L.Zhao,andC. Liu, “Interpatient heartbeat classification based on region featureextractionandensembleclassifier,”Biomed.Signal Process.Control,vol.51,pp.97–105,2019.
[10]H. Huang et al.,“A new hierarchical methodforinterpatient heartbeat classification using random projections and RR intervals,” Biomed. Eng. Online, vol. 13, 2014, Art. no.90.
[11] J. Zhang, A. Liu, D. Liang, X. Chen, and M. Gao, “Interpatient ECG heartbeat classification with an adversarial convolutional neural network,” J. Healthcare Eng.,vol.2021,2021,Art.no.9946596.
[12] V. Mondejar-Guerra, J. Novo, J. Rouco, M. G. Penedo, and M. Ortega, “Heartbeat classification fusing temporal and morphological information of ECGs via ensemble of classifiers,”Biomed.SignalProcess.Control,vol.47,pp.41–48,2019.
[13]G.deLannoy,D.Francois,J.Delbeke,andM.Verleysen, “Weighted conditional random fields for supervised interpatient heartbeat classification,” IEEE Trans. Biomed. Eng.,vol.59,no.1,pp.241–247,Jan.2012.
[14] S. Raj and K. C. Ray, “A personalized arrhythmia monitoringplatform,”Sci.Rep.,vol.8,2018,Art.no.11395
[15] F. I. Alarsan and M. Younes, “Analysis and classification of heart diseases using heartbeat features
2025, IRJET | Impact Factor value: 8.315 | ISO 9001:2008

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 12 Issue: 06 | Jun 2025 www.irjet.net p-ISSN: 2395-0072
andmachinelearningalgorithms,”J.BigData,vol.6,2019, Art.no.81.
[16] Z. Zhang, J. Dong, X. Luo, K.-S. Choi, and X. Wu, “Heartbeat classification using disease-specific feature selection,”Comput.Biol.Med.,vol.46,pp.79–89,2014.
[17] R. G. Afkhami, G. Azarnia, and M. A. Tinati, “Cardiac arrhythmia classification using statistical and mixture modeling features of ECG signals,” Pattern Recognit. Lett., vol.70,pp.45–51,2016.
[18]H.Shietal.,“Ahierarchicalmethodbasedonweighted extremegradientboostinginECGheartbeatclassification,” Comput. Methods Programs Biomed., vol. 171, pp. 1–10, 2019.
[19] S. S. Xu, M.-W. Mak, and C.-C. Cheung, “Towards endto-end ECG classification with raw signal extraction and deepneuralnetworks,”IEEEJ.Biomed.HealthInform.,vol. 23,no.4,pp.1574–1584,Jul.2019.
[20] S. Singh, S. K. Pandey, U. Pawar, and R. R. Janghel, “Classification of ECG arrhythmia using recurrent neural networks,” Proc. Comput. Sci., vol. 132, pp. 1290–1297, 2018.
[21]P.Li etal.,“High-performancepersonalizedheartbeat classificationmodelforlong-termECGsignal,”IEEETrans. Biomed.Eng.,vol.64,no.1,pp.78–86,Jan.2017.
[22] S. Saadatnejad, M. Oveisi, and M. Hashemi, “LSTMbased ECG classification for continuous monitoring on personalwearabledevices,”IEEEJ.Biomed.HealthInform., vol.24,no.2,pp.515–523,Feb.2020.
2025, IRJET | Impact Factor value: 8.315 | ISO 9001:2008