Next Article in Journal
Risk-Aware Downlink Throughput Prediction in High-Density 5G Networks
Previous Article in Journal
Admissible Reconstruction of Reaction-Channel Levels on Fixed Subgroup Support and Probabilities in Algebraic Probability Table Construction
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimization of Convolutional Neural Networks Using Genetic Algorithms for the Classification of Arrhythmias in Skeletonized ECG Images

by
Álvaro Gabriel Vega-De la Garza
1,
Ervin Jesús Alvarez-Sánchez
1,*,
Julio Fernando Zaballa-Contreras
2,
Rosario Aldana-Franco
1,
Fernando Aldana-Franco
1,
José Gustavo Leyva-Retureta
1 and
Andrés López-Velázquez
1
1
Doctorado en Ingeniería, Facultad de Ingeniería Mecánica Eléctrica, Universidad Veracruzana, Xalapa 91000, Veracruz, Mexico
2
Departamento de Hemodinamia del Instituto para la Seguridad Social de Trabajadores del Estado (ISSSTE), Veracruz 91700, Mexico
*
Author to whom correspondence should be addressed.
Computation 2026, 14(5), 104; https://doi.org/10.3390/computation14050104
Submission received: 17 March 2026 / Revised: 18 April 2026 / Accepted: 20 April 2026 / Published: 1 May 2026
(This article belongs to the Section Computational Biology)

Abstract

Class imbalance among arrhythmia types and electrocardiogram (ECG) signal complexity present significant challenges for automated ECG-based arrhythmia detection. This research proposes an innovative approach that combines Genetic Algorithm (GA) optimization of Convolutional Neural Network (CNN) hyperparameters with morphological skeletonization of ECG images. The MIT-BIH Arrhythmia Database served as the primary data source, with the ECG signal converted to skeletonized representations emphasizing QRS complex geometry. A GA-optimized model was compared against a heuristic (manual design) baseline to determine optimal kernel and filter configurations. Evaluation emphasized not only overall accuracy but also robust metrics for minority classes. The optimized model achieved 97.26% accuracy, with macro recall improving substantially from 77.36% to 83.10% (+5.74%). These results demonstrate that evolutionary optimization enhances detection sensitivity to subtle geometric patterns, effectively mitigating class imbalance without artificial oversampling techniques.

Graphical Abstract

1. Introduction

Cardiovascular disease (CVD) remains the leading cause of death worldwide, making comprehensive and effective heart health monitoring systems essential. The primary non-invasive method for diagnosing arrhythmias is the electrocardiogram (ECG). However, manual interpretation of long-term ECG recordings for detecting and classifying cardiac arrhythmias is laborious and prone to error. Therefore, recent years have seen significant focus on developing automated classification systems that use convolutional neural networks (CNNs), ref. [1].
Advances in this area have been notable, but two major challenges persist for fully automatic ECG classification. The first is managing the imbalanced dataset in the MIT-BIH Arrhythmia Database. Various studies succeed by balancing data, but this often reduces the ability to identify less frequent, potentially fatal arrhythmias such as supraventricular (S), ventricular (V), and fusion (F) types, ref. [2]. Previous work shows that heuristic algorithms excel for the majority of common classes. However, performance drops for minority arrhythmias, which can be fatal. The second challenge is that most proposals construct CNNs by hand, that is, through trial and error. These strategies thus fail to extract all information from ECG datasets.
Prior work provides a foundation. Key studies are reviewed below for methodology, metrics, strengths, and weaknesses. In, ref. [3], a pre-trained EfficientNet B5 CNN classifies seven arrhythmia types. The 1D signals are transformed into 2D scalogram images of individual heartbeats via continuous wavelet transform in the time–frequency domain. EfficientNet extracts features and classifies, achieving 99.97% accuracy and 98% overall sensitivity. A balanced dataset enabled learning features beyond the majority classes.
In, ref. [4], a hybrid approach begins with noise reduction and normalization of database ECG signals, followed by CNN2 to extract heartbeat parameters and spatial patterns. A support vector machine (SVM) replaces the typical softmax output to find optimal separation hyperplanes. Results are 97.33% accuracy and 97% overall sensitivity, though an unbalanced database yielded only 70% sensitivity for minority types.
Likewise, in, ref. [5], a portable monitoring system prioritizes low computational demands. It integrates the MIT-BIH database with real-time AD8232 sensor data and filters noise plus muscle artifacts. Feature extraction focuses on QRS complexes, R-R intervals, and P-wave amplitude. Tuned Random Forest (RF) and SVM classifiers for lightweight hardware deliver 97.2% accuracy and 96.8% overall sensitivity. Imbalance biased results, so normal class subsets were subsampled.
In, ref. [6], a Linear Deep Convolutional Neural Network (LDCNN) optimizes CNNs for rapid arrhythmia classification. Linear layers reduce depth for direct signal flow and faster training. Raw 1D signals avoid image conversion, saving computation. It attains 99.1% overall accuracy and 98% sensitivity. Synthetic Minority Oversampling Technique (SMOTE) balanced the dataset, matching S and F arrhythmias to class N proportions.
Also, in, ref. [7], a Residual-Dense-Based CNN (RD-CNN) reuses features across three elements: residual blocks for identity function learning; dense connections feeding prior layer for refined morphology; and noise-removed, normalized 1D MIT-BIH segments. Results reach 99.11% accuracy and 98.5% sensitivity via a balanced dataset with augmentation/oversampling for S, V, and F classes.
Furthermore, ref. [8] presents a 1D CNN for time-series data with three layers: convolutional for feature extraction, fully connected, and softmax-activated output for classifying five arrhythmia types. It achieves 99% accuracy.
Similarly, ref. [9] presents a lightweight hybrid CNN with a long short-term memory (LSTM) network model to classify nine arrhythmia types. The architecture includes a ReLU-activation convolutional layer, LSTM, two fully connected layers, and a final softmax layer for classification. It achieves 98.24% accuracy.
Finally, in ref. [10], a Generative Adversarial Network (GAN)-based model uses a generator to augment data. A GAN-extended deep autoencoder first sorts ECG signals as normal or abnormal. A subsequent robust multilayer CNN then detects three arrhythmia types, achieving 97.6% accuracy.
A critical review reveals two limitations in these high-performance models. First, many rely on intra-patient protocols that cause data leakage and overoptimistic results. Second, synthetic augmentation like GANs demands high computational complexity. Clinically reliable models require strict inter-patient validation without generative overhead.
The proposal presented in this paper introduces a new strategy that primarily addresses limitations from two perspectives. Initially, the original ECG images are transformed into binary images and then converted into skeletonized images. This processing uses pure geometric morphology to detect the QRS complex and eliminate noise that could affect model training and testing, ref. [11]. As a second step, a Genetic Algorithm (GA) evolves key hyperparameters of the CNN architecture, such as the number and size of filters, instead of manual design. This combination is expected to improve overall performance and individual sensitivity for each minority arrhythmia. Unlike other high-performance models in the literature that rely on high-complexity generative frameworks like (GANs) or intra-patient protocols, which may lead to overoptimistic results through data leakage, the proposed approach prioritizes clinical reliability and computational efficiency through strict inter-patient validation and morphological skeletonization.
The core novelty of this approach lies in the synergy between skeletonized morphological representations and evolutionary optimization. Unlike conventional methods that process high-dimensional 2D images or raw 1D signals, the proposed framework allows the GA to converge on lightweight CNN architectures. This reduces computational overhead while maintaining high sensitivity for critical arrhythmia classes, addressing the need for efficient yet accurate diagnostic tools.
The main results show how the combination of image processing elements and hyperparameters using a GA, specifically regarding the number and size of filters in the CNN architecture, overcomes current limitations. This approach reduces image processing times and eliminates the need to train models with balanced datasets that typically bias classification toward majority arrhythmia classes while neglecting minority and potentially fatal ones. The effectiveness of this methodology is demonstrated by a 5.74% increase in macro recall compared to traditional manual architectures, confirming its superior ability to identify critical cardiac conditions in imbalanced data scenarios.

2. Materials and Methods

Reproducibility and clinical validity are ensured through a rigorous workflow tailored to medical AI standards. This section details the data source, morphological preprocessing, and architectures of the evaluated models.

2.1. Dataset and Clinical Environment

This research uses the MIT-BIH Arrhythmia Database, the standard benchmark for arrhythmia detection algorithms, to train and validate models, ref [12]. The dataset consists of 30 min two-channel ECG recordings from 48 subjects, sampled at 360 Hz, ref. [13]. Following the Association for the Advancement of Medical Instrumentation (AAMI), ref. [14], Table 1, heartbeats fall into five categories: Normal (N), Supraventricular (S), Ventricular (V), Fusion (F), and Unknown (Q). This reveals severe class imbalance, a key challenge in cardiac signal processing, ref. [15,16].
To ensure the validity of the results and a fair starting point for the implemented models, both the heuristic model and the optimized model (GA-CNN) were trained and evaluated under the same experimental protocol. A total of 22,693 skeletonized images from the MIT-BIH database were used.
The dataset was divided into three independent subsets:
  • Training (70%): 15,885 images to optimize network synaptic weights;
  • Validation (10%): 2269 images to monitor overfitting and guide GA selection;
  • Testing and Prediction (20%): 4539 images for final, exclusive evaluation of both models.
This data partition, particularly the test set to which models were never exposed during training, ensures that accuracy and sensitivity metrics truly reflect real-world clinical performance on unseen cases. It also enables a comprehensive, statistically robust comparison between evolutionary optimization and manual design.

2.2. Morphological Skeletonization

Electrocardiogram signals, known to contain noise and be susceptible to environmental interference, undergo skeletonization, a geometric morphology technique. This method employs parallel thinning, ref. [17] of the original signal to extract key features from the 2D representations in the MIT-BIH database. As shown in Figure 1, it compresses elements into binary form, then refines them to a single-pixel-wide structure, ref. [18]; this captures QRS complex geometry, ref. [19,20]. By leveraging nonlinear morphological patterns, skeletonization enables the CNN layer to focus on clean geometric features without noise interference. This enhances model efficiency and learning robustness amid amplitude variations, ref. [21].

2.3. Heuristic Model Architecture

As a baseline for local comparison, a heuristic CNN model was designed following conventional computer vision principles used in prior work to extract key image features, ref. [22,23]. As shown in Figure 2, the architecture comprises three convolutional blocks with a fixed number of filters of 64, 128, and 256, and 3 × 3 kernel size. Max-Pooling layers reduce pattern dimensionality alongside convolutions, and dense layers then handle final classification, progressively encoding heartbeat spatial properties. It is important to mention that this design adheres to standard CNN construction practices.

2.4. Model Optimized Using Genetic Algorithm

The main basis for conducting this research is to obtain an optimal architecture for a CNN, as shown in Figure 3, for which a GA is proposed to assist with the search and optimization of the number and size of CNN filters, thereby helping to improve overall accuracy and sensitivity metrics.
The GA forms part of Neural Architecture Search (NAS) algorithms, ref. [24,25] and operates from an initial population of individuals or chromosomes. In this case, these chromosomes are composed of the number and size of filters that are dynamically encoded for the network configuration, ref. [26]. The parameters and variables used in the optimization process are detailed in Table 2.
After the optimization process generates a set of individuals, the next step involves defining a fitness function for each. This measures how well an individual adapts to solving the optimization problem. For this research, the fitness function emphasizes overall sensitivity, ref. [27,28], which directs the GA toward architectures that demonstrate greater sensitivity in minority classes (S, V, F). Following fitness calculation, the algorithm proceeds through an iterative cycle of operations including tournament selection, crossover, and random mutation, ref. [29,30]. These steps help identify non-obvious configurations and propose an architecture characterized by 128, 256, and 128 filters with optimized kernels.

3. Results

This results section presents a quantitative comparison between the heuristic model and the GA-optimized model. It primarily reports overall accuracy, overall sensitivity, class-specific sensitivity for each arrhythmia type, and confusion matrices to assess true positive detection.

3.1. Heuristic Model Performance

The manually designed model achieved an overall accuracy of 96.49% (Figure 4a) and a loss of 0.3798 (Figure 4b). However, closer examination of the metrics reveals limited sensitivity for low-frequency arrhythmias.
Figure 4b illustrates a critical issue during modelling, since training loss decreases steadily toward near zero. In contrast, validation loss rises after epoch 2, signaling overfitting; that is, the model excels at recognizing training images but struggles with unseen data.
This model’s recall (Table 3) reached 77.36%, yet it showed clear difficulties detecting the Fusion (F) class at 46.87% and the Supraventricular (S) class at 57.65% ref. [31,32]. These results suggest the heuristic design favors the normal (N) class at the expense of less common, critical arrhythmias, ref. [33].
The confusion matrix (Figure 5) visualizes model predictions against MIT-BIH ground truth labels. Focus falls on the main diagonal for true positives and off-diagonals for minority class sensitivity, particularly Supraventricular (S) and Fusion (F) beats. These metrics are essential for validating automated clinical diagnosis.

3.2. Performance of the Optimized Model

Although overall accuracy rose only modestly (+0.77%), clinical generalization improved markedly. The GA-Optimized reached 97.26% accuracy (Figure 6a) and 0.1120 loss (Figure 6b).
Figure 6b reveals substantial loss improvement over the heuristic: validation curves decline alongside training and stabilize near epoch 5. This indicates enhanced generalization capacity, essential for accurate arrhythmia classification.
Global recall (Table 4) climbed to 83.10%, a 5.74% gain over the baseline model [34]. Notably, recall for the critical Ventricular (V) class, vital for patient survival, hit 87.88%, while the Fusion (F) class rose to 59.37%.
The confusion matrix (Figure 7) confirms the optimized model’s superiority, with far fewer false negatives in minority classes versus heuristic design. Hyperparameter optimization yielded perfect accuracy (1.00) for class Q and substantially better F recognition, strengthening the main diagonal for robust performance.

3.3. Comparative Analysis and Training Dynamics

A key finding emerges from the visual comparison (Figure 8) between models. Optimization via GA not only boosts sensitivity but also yields smoother learning curves. The GA-optimized model exhibits robust, stable convergence. In contrast, the heuristic model displays notable fluctuations in validation loss.

4. Discussion

The ability of the GA to surpass the limitations of manual (Heuristic) design and emerge as an effective approach for cutting-edge architecture forms the foundation for discussing these results. Although heuristic models report higher nominal metrics, they often depend on experimental conditions rarely encountered in medical practice.

4.1. Heuristic Model vs. Optimized Model

The value of stochastic search within the hyperparameter space becomes evident when transitioning from the heuristic model to genetic optimization. Although overall accuracy increased only modestly (+0.77%), diagnostic sensitivity improved dramatically. The +3.11% gain in ventricular (V) class recall and +12.50% in fusion (F) class recall demonstrate that GA not only enhances overall accuracy but also specializes convolutional filters to detect subtle geometric patterns within skeletonized images. This elevates overall sensitivity from 77.36% to 83.10%.

4.2. Comparison with the High-Complexity Literature

Research by Rahula and Wang achieves over 99% accuracy through generative adversarial networks (GAN) and continuous wavelet scalograms. However, these approaches demand extensive computational preprocessing and synthetic data for class balancing. Similar studies by Bayani et al. [7] and Ahmed AES et al. [8] present competitive diagnostic robustness, yet this work offers a key advantage: preserved signal integrity. The performance metrics here are authentic and reliable, delivering 83.10% overall sensitivity without biases introduced by balanced data samples. Unlike artificial balancing techniques such as SMOTE of GANs, this approach avoids performance exaggeration typical of laboratory conditions.

4.3. Morphological Efficiency vs. 1D and Hybrid Models

Compared to lower-complexity models like 1D CNN by Ahmed AA et al. [9] (91.30% accuracy), skeletonized 2D conversion proves optimal. Fusion arrhythmia recognition suffers when spatial dimensions are lost in 1D representations. Hybrid models such as the CNN-LSTM by Alamatsaz et al. [10] or the portable method by Ajitha et al. [6] provide broader morphological context but remain fundamentally sequential. This study’s results validate the proposed method’s effectiveness. Skeletonization creates an essentially hermetic representation where the network leans only on the QRS complex trajectory while eliminating amplitude noise that confounds portable hardware systems. Unlike the procedure by Ben Slama et al. [5], which lacks architectural adaptability, GA enables dynamic structural evolution tailored to each arrhythmia type.
Furthermore, while skeletonization filters high-frequency artifacts effectively, robust estimation remains essential for non-stationary noise. Advanced frameworks like the Normal-Bernoulli-based Kalman Filter could enhance signal integrity in corrupted environments [35]. This offers a promising direction for future work to bolster resilience against heavy-tailed measurement noise.
As shown in Table 5, the proposed method achieves 97.26% accuracy and 83.1% Macro Recall. Distinguishing evaluation strategies proves critical when benchmarking against state-of-the-art. Most existing works [4,5,6,7,8,9,10] employ class-oriented (intra-patient) splitting, yielding overoptimistic accuracies (>99%) due to data leakage.
In contrast, the framework of this paper adopts a strict subject-oriented (inter-patient) protocol, akin to the hierarchical GAN approach by Wang et al. [10]. Although Wang et al. report 99.1% accuracy, their method relies on complex GANs and synthetic data. The approach proposed here attains a highly competitive 97.26% through efficient 2D skeletonization combined with GA structural optimization. Robust performance thus emerges under rigorous clinical validation without the generative framework’s computational overhead, making it ideal for low-latency portable monitoring.

5. Conclusions

The implementation of an evolutionary algorithm as an optimization tool successfully overcomes the limitations of the conventional heuristic CNN. This approach transitions from trial-and-error architecture design to automatically optimal configurations. The resulting model demonstrates enhanced sensitivity for classifying minority arrhythmias directly from imbalanced image datasets, ensuring reliable detection of critical cardiac conditions.
The primary limitation of this research lies in training the model to classify five specific arrhythmia types. Additionally, training images consist of single-heartbeat segments within defined time intervals, so the model classifies only one arrhythmia type per instance.
Overall, combining geometric morphology-based image processing with GA provides a viable alternative for automated arrhythmia detection. The results support the following key conclusions:
  • Skeletonization. Skeletonization in image preprocessing proved highly effective. This process preserves QRS complex topology while eliminating signal noise, thereby accelerating training convergence.
  • Optimization process. The GA enables the discovery of novel NAS configurations that surpass heuristic model limitations. It substantially improved both overall and class-specific sensitivity, delivering gains in minority class detection (S, V, F).
  • Clinical balance. Although accuracy improvement between models remained modest, gains overall and arrhythmia-specific sensitivity validate greater reliability for detecting rare pathologies.
  • Performance. Unlike prior models reporting above 99% accuracy through dataset balancing, this work avoids such preprocessing. Results thus reflect genuine clinical efficacy and robustness, alongside reduced computational cost via morphological simplification through evolutionary optimization.
Future research will explore additional GA targeting diverse CNN hyperparameters to elucidate their impact on arrhythmia classification architectures. Following model development, implementation on portable devices will enable real patient testing.

Author Contributions

Conceptualization, Á.G.V.-D.l.G., E.J.A.-S. and J.F.Z.-C.; methodology, Á.G.V.-D.l.G. and F.A.-F.; software, Á.G.V.-D.l.G. and F.A.-F.; validation, Á.G.V.-D.l.G., A.L.-V. and J.G.L.-R.; investigation, Á.G.V.-D.l.G.; writing—original draft preparation, Á.G.V.-D.l.G. and R.A.-F.; writing—review and editing, Á.G.V.-D.l.G. and R.A.-F. All authors have read and agreed to the published version of the manuscript.

Funding

This research was supported by the Secretaría de Educación, Ciencia, Tecnología e Innovación (SECIHTI) of Mexico. The author Alvaro Gabriel Vega de la Garza acknowledges the financial support provided through the doctoral fellowship under the CVU number 326765.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request. Requests to access the datasets should be directed to avega@uv.mx.

Acknowledgments

The author would like to thank the Secretaría de Educación, Ciencia, Tecnología e Innovación (SECIHTI) of Mexico City for the graduate scholarship awarded under contract No. CVU: 326765, which supported the research and the subsequent publication of this study.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Acharya, U.R.; Oh, S.L.; Hagiwara, Y.; Tan, J.H.; Adeli, H. Deep convolutional neural network for the automated detection and diagnosis of seizure using EEG signals. Comput. Biol. Med. 2018, 100, 270–278. [Google Scholar] [CrossRef]
  2. Sellami, A.; Hwang, H. A robust deep convolutional neural network with batch-weighted loss for heartbeat classification. Expert Syst. Appl. 2019, 122, 75–84. [Google Scholar] [CrossRef]
  3. Rahula, S.; Rajanikumari, L.V. Arrhythmia classification using scalogram-based EfficientNet. In Proceedings of the 2025 IEEE International Students’ Conference on Electrical, Electronics and Computer Science (SCEECS), Bhopal, India, 18–19 January 2025; pp. 1–5. [Google Scholar] [CrossRef]
  4. Ben Slama, A.; Amri, Y.; Fnaiech, A.; Sahli, H. Automated ECG arrhythmia classification using hybrid CNN-SVM architectures. J. Electron. Sci. Technol. 2025, 23, 100316. [Google Scholar] [CrossRef]
  5. Ajitha Gladis, K.P.; Ahilan, A.; Muthukumaran, N.; Jenifer, L. ECG Arrhythmia Measurement and Classification for Portable Monitoring. Meas. Sci. Rev. 2024, 24, 118–128. [Google Scholar] [CrossRef]
  6. Bayani, A.; Kargar, M. LDCNN: A new arrhythmia detection technique with ECG signals using a linear deep convolutional neural network. Physiol. Rep. 2024, 12, e16182. [Google Scholar] [CrossRef]
  7. Ahmed, A.E.S.; Abbas, Q.; Daadaa, Y.; Qureshi, I.; Perumal, G.; Ibrahim, M.E.A. A Residual-Dense-Based Convolutional Neural Network Architecture for Recognition of Cardiac Health Based on ECG Signals. Sensors 2023, 23, 7204. [Google Scholar] [CrossRef]
  8. Ahmed, A.A.; Ali, W.; Abdullah, T.A.A.; Malebary, S.J. Classifying cardiac arrhythmia from ECG signal using 1D CNN deep learning model. Mathematics 2023, 11, 562. [Google Scholar] [CrossRef]
  9. Alamatsaz, N.; Tabatabaei, L.; Yazdchi, M.; Payan, H.; Alamatsaz, N.; Nasimi, F. A lightweight hybrid CNN-LSTM explainable model for ECG-based arrhythmia detection. Biomed. Signal Process. Control 2024, 90, 105884. [Google Scholar] [CrossRef]
  10. Wang, Z.; Stavrakis, S.; Yao, B. Hierarchical deep learning with Generative Adversarial Network for automatic cardiac diagnosis from ECG signals. Comput. Biol. Med. 2023, 155, 106641. [Google Scholar] [CrossRef]
  11. Zubair, M.; Kim, J.; Yoon, C. An automated ECG beat classification system using convolutional neural networks. In Proceedings of the 6th International Conference on IT Convergence and Security (ICITCS), Prague, Czech Republic, 26 September 2016; pp. 1–5. [Google Scholar] [CrossRef]
  12. Goldberger, A.L.; Amaral, L.A.N.; Glass, L.; Hausdorff, J.M.; Ivanov, P.C.; Mark, R.G.; Mietus, J.E.; Moody, G.B.; Peng, C.-K.; Stanley, H.E. PhysioBank, PhysioToolkit, and PhysioNet. Circulation 2000, 101, e215–e220. [Google Scholar] [CrossRef]
  13. Moody, G.B.; Mark, R.G. The impact of the MIT-BIH arrhythmia database. IEEE Eng. Med. Biol. Mag. 2001, 20, 45–50. [Google Scholar] [CrossRef]
  14. Association for the Advancement of Medical Instrumentation. Testing and Reporting Performance Results of Cardiac Rhythm and ST-Segment Measurement Algorithms; Association for the Advancement of Medical Instrumentation: Arlington, VA, USA, 2003. [Google Scholar]
  15. He, H.; Garcia, E.A. Learning from imbalanced data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar] [CrossRef]
  16. Köhler, B.-U.; Hennig, C.; Orglmeister, R. The principles of software QRS detection. IEEE Eng. Med. Biol. Mag. 2002, 21, 42–57. [Google Scholar] [CrossRef]
  17. Zhang, T.Y.; Suen, C.Y. A fast parallel algorithm for thinning digital patterns. Commun. ACM 1984, 27, 236–239. [Google Scholar] [CrossRef]
  18. Lam, L.; Lee, S.-W.; Suen, C.Y. Thinning methodologies—A comprehensive survey. IEEE Trans. Pattern Anal. Mach. Intell. 1992, 14, 869–885. [Google Scholar] [CrossRef]
  19. Davies, E.R. Computer and Machine Vision: Theory, Algorithms, Practicalities; Academic Press: Waltham, MA, USA, 2012. [Google Scholar]
  20. Young, I.T. Image analysis and mathematical morphology, by J. Serra. Academic Press, London, 1982, xviii + 610 p. $90.00. Cytometry 1983, 4, 184–185. [Google Scholar] [CrossRef]
  21. Soille, P.; Pesaresi, M. Advances in mathematical morphology applied to geoscience and remote sensing. IEEE Trans. Geosci. Remote Sens. 2002, 40, 2042–2055. [Google Scholar] [CrossRef]
  22. LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
  23. O’Shea, K.; Nash, R. An introduction to convolutional neural networks. arXiv 2015, arXiv:1511.08458. [Google Scholar] [CrossRef]
  24. Elsken, T.; Metzen, J.H.; Hutter, F. Neural architecture search: A survey. J. Mach. Learn. Res. 2019, 20, 1–21. [Google Scholar] [CrossRef]
  25. Zoph, B.; Le, Q.V. Neural architecture search with reinforcement learning. In Proceedings of the International Conference on Learning Representations (ICLR), Toulon, France, 24–26 April 2017; Available online: https://arxiv.org/abs/1611.01578 (accessed on 17 March 2026).
  26. Holland, J.H. Adaptation in Natural and Artificial Systems; The MIT Press: Cambridge, MA, USA, 1992. [Google Scholar] [CrossRef]
  27. Juba, B.; Le, H.S. Precision-recall versus accuracy and the role of large data sets. Proc. AAAI Conf. Artif. Intell. 2019, 33, 4039–4048. [Google Scholar] [CrossRef]
  28. Saito, T.; Rehmsmeier, M. The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets. PLoS ONE 2015, 10, e0118432. [Google Scholar] [CrossRef]
  29. Kramer, O. Genetic Algorithms; Springer: Berlin/Heidelberg, Germany, 2017; pp. 11–19. [Google Scholar] [CrossRef]
  30. Whitley, D. A genetic algorithm tutorial. Stat. Comput. 1994, 4, 65–85. [Google Scholar] [CrossRef]
  31. de Chazal, P.; O’Dwyer, M.; Reilly, R.B. Automatic classification of heartbeats using ECG morphology and heartbeat interval features. IEEE Trans. Biomed. Eng. 2004, 51, 1196–1206. [Google Scholar] [CrossRef]
  32. André, L.; Paulo, L.; Ana, F.; Renato, L. Real time electrocardiogram segmentation for finger based ECG biometrics. In Proceedings of the International Conference on Bio-Inspired Systems and Signal Processing; SciTePress—Science and Technology Publications; Science and Technology Publications: Setúbal, Portugal, 2012; pp. 49–54. [Google Scholar] [CrossRef]
  33. Mar, T.; Zaunseder, S.; Martínez, J.P.; Llamedo, M.; Poll, R. Optimization of ECG classification by means of feature selection. IEEE Trans. Biomed. Eng. 2011, 58, 2168–2177. [Google Scholar] [CrossRef] [PubMed]
  34. Terven, J.; Cordova, D.M.; Romero-González, J.A.; Ramírez-Pedraza, A.; Chávez-Urbiola, E.A. A comprehensive survey of loss functions and metrics in deep learning. Artif. Intell. Rev. 2025, 58, 195. [Google Scholar] [CrossRef]
  35. Jia, Y.; Huang, G.; Leung, H. A novel robust Kalman filter based on normal-Bernoulli distribution for non-stationary heavy-tailed measurement noise. IEEE Trans. Signal Process. 2025, 73, 4953–4968. [Google Scholar] [CrossRef]
Figure 1. Skeletonization process.
Figure 1. Skeletonization process.
Computation 14 00104 g001
Figure 2. Heuristic convolutional neural network.
Figure 2. Heuristic convolutional neural network.
Computation 14 00104 g002
Figure 3. Optimized convolutional neural network.
Figure 3. Optimized convolutional neural network.
Computation 14 00104 g003
Figure 4. (a) Heuristic model accuracy, (b) Heuristic model loss.
Figure 4. (a) Heuristic model accuracy, (b) Heuristic model loss.
Computation 14 00104 g004
Figure 5. Confusion matrix of the heuristic model.
Figure 5. Confusion matrix of the heuristic model.
Computation 14 00104 g005
Figure 6. (a) Optimized model accuracy, (b) optimized model loss.
Figure 6. (a) Optimized model accuracy, (b) optimized model loss.
Computation 14 00104 g006
Figure 7. Confusion matrix of the optimized model.
Figure 7. Confusion matrix of the optimized model.
Computation 14 00104 g007
Figure 8. Comparison of the accuracy of the heuristic model and the optimized model.
Figure 8. Comparison of the accuracy of the heuristic model and the optimized model.
Computation 14 00104 g008
Table 1. AAMI Arrhythmia classification labeling standard.
Table 1. AAMI Arrhythmia classification labeling standard.
Heart Rhythm Label (Proportion)Content DescriptionIncludes
Subcategories
Subclass Label Description
N (90%)Normal Heart rhythmLLeft Bundle branch block
NNormal ECG beat
RRight bundle branch block
eAtrial escape
jBorderline escape
S (3%)Supraventricular abnormalitiesAAtrial premature beats
JBorderline premature beats
SSupraventricular premature beats
aAbnormal atrial premature beats
V (6%)Ventricular escapeEVentricular escape beat
VVentricular premature beats
F (1%)Fusion heartbeatFVentricular fusion heartbeat
QUnknown ECG beatPPacing heartbeat
Uncategorized ECG beat
Pacing and normal fusion heartbeat
Table 2. Optimization process parameters and variables.
Table 2. Optimization process parameters and variables.
Population size15 individuals
Number of generations10 iterations
Fitness functionrecall global
Selection methodElitism
Mutation rate0.15
Layer 1, layer 2, and layer 3 filters[16, 32, 64, 128, 256]
Kernel size[3 × 3, 5 × 5]
Table 3. Heuristic model metrics.
Table 3. Heuristic model metrics.
PrecisionRecallF1-ScoreSupport
F0.88230.46870.612232
N0.97310.98750.98033785
Q0.99680.98750.9921322
S0.85330.57650.6881111
V0.85360.84770.8506289
accuracy0.96490.96490.96490
macro avg0.91180.77360.82474539
weighted avg0.96360.96490.96314539
Table 4. Optimized model metrics.
Table 4. Optimized model metrics.
PrecisionRecallF1-ScoreSupport
F0.79160.59370.678532
N0.98180.98890.98533785
Q111322
S0.81910.69360.7512111
V0.88500.87880.8819289
accuracy0.97260.97260.97260
macro avg0.89550.83100.85944539
weighted avg0.97160.97260.97194539
Table 5. Comparison of background and proposed model.
Table 5. Comparison of background and proposed model.
ReferenceAcc %Recall (V) %Recall (S) %Recall (F) %Macro Recall (%)BalanceEvaluation Method
Rahula [3]99.4199.4198.497.898.4YesClass-oriented (Intra-patient)
Ben Slama [4]99.2898.997.4596.897.71YesClass-oriented (Intra-patient)
Ajitha [5]98.5497.896.194.596.13NotClass-oriented (Intra-patient)
Bayani [6]99.5299.1598.497.998.48YesClass-oriented (Intra-patient)
Ahmed [7]99.1199.0497.2896.0197.44YesClass-oriented (Intra-patient)
Ahmed [8])91.392.485.179.385.6NotClass-oriented (Intra-patient)
Alamatsaz [9]99.1699.0495.8392.3195.72YesClass-oriented (Intra-patient)
Wang [10]99.199.298.197.398.2YesSubject-oriented (Inter-patient)
Heuristic Model
(Present study)
96.4984.7757.6546.8777.36NotSubject-oriented (Inter-patient)
Optimized Model
(Present study)
97.2687.8869.3659.3783.1NotSubject-oriented (Inter-patient)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Vega-De la Garza, Á.G.; Alvarez-Sánchez, E.J.; Zaballa-Contreras, J.F.; Aldana-Franco, R.; Aldana-Franco, F.; Leyva-Retureta, J.G.; López-Velázquez, A. Optimization of Convolutional Neural Networks Using Genetic Algorithms for the Classification of Arrhythmias in Skeletonized ECG Images. Computation 2026, 14, 104. https://doi.org/10.3390/computation14050104

AMA Style

Vega-De la Garza ÁG, Alvarez-Sánchez EJ, Zaballa-Contreras JF, Aldana-Franco R, Aldana-Franco F, Leyva-Retureta JG, López-Velázquez A. Optimization of Convolutional Neural Networks Using Genetic Algorithms for the Classification of Arrhythmias in Skeletonized ECG Images. Computation. 2026; 14(5):104. https://doi.org/10.3390/computation14050104

Chicago/Turabian Style

Vega-De la Garza, Álvaro Gabriel, Ervin Jesús Alvarez-Sánchez, Julio Fernando Zaballa-Contreras, Rosario Aldana-Franco, Fernando Aldana-Franco, José Gustavo Leyva-Retureta, and Andrés López-Velázquez. 2026. "Optimization of Convolutional Neural Networks Using Genetic Algorithms for the Classification of Arrhythmias in Skeletonized ECG Images" Computation 14, no. 5: 104. https://doi.org/10.3390/computation14050104

APA Style

Vega-De la Garza, Á. G., Alvarez-Sánchez, E. J., Zaballa-Contreras, J. F., Aldana-Franco, R., Aldana-Franco, F., Leyva-Retureta, J. G., & López-Velázquez, A. (2026). Optimization of Convolutional Neural Networks Using Genetic Algorithms for the Classification of Arrhythmias in Skeletonized ECG Images. Computation, 14(5), 104. https://doi.org/10.3390/computation14050104

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop