Next Article in Journal
Balanced Circular Packing Problems with Distance Constraints
Next Article in Special Issue
A Comparative Study on Denoising Algorithms for Footsteps Sounds as Biometric in Noisy Environments
Previous Article in Journal
Analysis of Electrical Models for Photovoltaic Cells under Uniform and Partial Shading Conditions
Previous Article in Special Issue
An Experimental Study on Speech Enhancement Based on a Combination of Wavelets and Deep Learning
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Rapid Detection of Cardiac Pathologies by Neural Networks Using ECG Signals (1D) and sECG Images (3D)

by
Evelyn Aguiar-Salazar
1,2,*,
Fernando Villalba-Meneses
1,3,
Andrés Tirado-Espín
4,
Daniel Amaguaña-Marmol
1 and
Diego Almeida-Galárraga
1,*
1
School of Biological Sciences and Engineering, Universidad Yachay Tech, Urcuquí 100650, Ecuador
2
Faculty of Medical Sciences, Universidad UNIANDES, Ambato 180166, Ecuador
3
Aragón Institute of Engineering Research (I3A), Universidad de Zaragoza, 50018 Zaragoza, Spain
4
School of Mathematical and Computational Sciences, Universidad Yachay Tech, Urcuquí 100650, Ecuador
*
Authors to whom correspondence should be addressed.
Computation 2022, 10(7), 112; https://doi.org/10.3390/computation10070112
Submission received: 28 April 2022 / Revised: 28 June 2022 / Accepted: 28 June 2022 / Published: 30 June 2022
(This article belongs to the Special Issue Bioinspiration: The Path from Engineering to Nature)

Abstract

:
Usually, cardiac pathologies are detected using one-dimensional electrocardiogram signals or two-dimensional images. When working with electrocardiogram signals, they can be represented in the time and frequency domains (one-dimensional signals). However, this technique can present difficulties, such as the high cost of private health services or the time the public health system takes to refer the patient to a cardiologist. In addition, the variety of cardiac pathologies (more than 20 types) is a problem in diagnosing the disease. On the other hand, surface electrocardiography (sECG) is a little-explored technique for this diagnosis. sECGs are three-dimensional images (two dimensions in space and one in time). In this way, the signals were taken in one-dimensional format and analyzed using neural networks. Following the transformation of the one-dimensional signals to three-dimensional signals, they were analyzed in the same sense. For this research, two models based on LSTM and ResNet34 neural networks were developed, which showed high accuracy, 98.71% and 93.64%, respectively. This study aims to propose the basis for developing Decision Support Software (DSS) based on machine learning models.

1. Introduction

According to the World Health Organization (WHO), by 2030, approximately 23.6 million people will die from cardiovascular diseases, as they are the leading cause of death globally [1]. Cardiac diseases are disorders that affect the heart and blood vessels [1]. In 2011, deaths from ischemic heart disease accounted for 10.3%, and premature mortality from cardiovascular diseases was reported at 19,1% [2]. In 2014, the National Institute of Statistics and Census of Ecuador (INEC) reported 4430 deaths from ischemic heart disease, 1316 from heart failure, 168 from cardiac arrhythmias, and 106 from cardiac arrest [3]. Finally, according to the Ministry of Public Health (MSP), in 2019, 26.49% of deaths corresponded to heart disease [4].
Risk factors are essential in a person’s likelihood of developing cardiovascular disease. The more risk factors a person has, the more likely he or she is to suffer from heart disease [5]. The solution to all these problems is constantly monitoring as many risk factors as possible to make the necessary lifestyle and medication changes to reduce cardiovascular risk [5]. A correct and timely diagnosis can prevent and help treat this type of disease.
The electrical signal produced by the heart is called an electrocardiogram (ECG); that is, the complex ECG represents electrical events that occur during the cardiac cycle [6]. These signals are traditionally used and are represented in the time domain or frequency (x-axis) and voltage (y-axis) [7]. A complex wave consists of five waveforms marked with P, Q, R, S, and T [8] (Figure 1a). ECG signals are measured in two dimensions: time and frequency domain.
One of the little-explored techniques for diagnosis is sECG, that is three-dimensional images (two dimensions in space and one in time) constructed using frames divided into pixels corresponding to the electrodes whose signals evolve in time, where each dashed line represents a square [9]. The colors represent the instantaneous potential amplitude distribution, which is evolving [9]. It is a two-dimensional distribution of the instantaneous map of the surface potential (i.e., voltage) of the chest [10]. Its potential distribution is an analogue (continuous) “electronic image” or “map” that evolves like a movie. The two-dimensional analogue signal is sampled in space (through electrodes) and time (through electronic samplers) to provide a sequence of sampling time frames. A frame is divided into pixels corresponding to the electrodes (Figure 1b). The number of electrodes can vary from two (unipolar system) to hundreds. For example, high-density sECG (multichannel system) generates two-dimensional sECG images in space and time [9,11]. This study used six channels to convert it into a three-dimensional sECG. These concepts have been taken from surface electromyography (sEMG) studies and adapted to meet the stated objectives [9,11,12,13,14].
Leads are specific electrode arrangements that record the potential difference generated by cardiac electrical activity at these points [6]. These can be bipolar and monopolar [7]. Additionally, the plane is divided into frontal plane shunts or limb shunts and horizontal plane leads or precordial leads, with their electrodes on the anterolateral chest wall [7]. This research considered the six precordial leads that provide information about the heart’s horizontal plane and are monopolar [7]. They require only a single electrode. The opposing pole of those leads is the center of the heart, as calculated by the ECG. The precordial location of the electrodes is shown in Figure 2.
Some studies have developed in software detect cardiac pathologies, heartbeat detection, monitoring, motion detection, gesture recognition, and others. For this, artificial intelligence (AI) methods are used: machine learning (ML) and neural networks (NN). First, studies using ECG signals (one-dimensional) have used up to 15 channels from one channel. Second, no studies have used ECG signals (three-dimensional). However, there are studies on EMG signals (three-dimensional) from 24 to 129 channels. All these aspects are shown in Table 1. In this way, the scientific aim of this paper is to open up the field of research based on surface images. Currently, research in this field is scarce.
This study aims to propose the basis for developing DSS based on ML models, which is achieved through the design of two NNs to compare ECG signals (one-dimensional) and sECG images (three-dimensional) to determine the best predictive tool for cardiac pathologies. The main contribution is to use ML models to support the primary care physician to better assess cardiac pathologies, that is, to be a diagnostic support software.

2. Materials and Methods

The developed project in the present research has two parts: first, the design of databases of numerical data and sECG images; next, the creation of NN architectures is presented and illustrated (Figure 3).

2.1. Databases

The PTB-XL ECG record set from Pyshionet [23] was used as an open-access database for this work. It is a set of 21,837 clinical ECGs, each recording 12 leads in 18,885 patients within 10 s [23]. The ECG recordings comply with the Standard Communication Protocol for computer-assisted electrocardiography (SCP-ECG) [24]. This is a standard data format for ECG recording and defines the patient’s ECG data structure, basic demographic format, and data exchange rules between digital ECG and computer systems [25]. It is the most highly recommended alternative to an ECG database.

2.1.1. Database 1: Process of ECG Signals

For the present study, only the data of the precordial leads (V1, V2, V3, V4, V5, and V6) were considered. This consideration was because leads V1 and V2 explore the septal area, V3 and V4 explore the anterior area, and V5 and V6 explore the lateral area of the heart. For the subsequent design of the sECG images, it is necessary to work with several channels. On the one hand, three channels (I, II, and III or aVR, aVL, and aVF) are very limited, and on the other hand, 12 channels (I, II, III, aVR, aVL, aVF, V1, V2, V3, V4, V5, and V6) raise the computational cost too much. In addition, the database contains 21,837 records of cover diagnostic, form, and rhythm statements, for which only cover diagnostic records were considered. This is because the records of form and rhythm statements do not have the necessary characteristics for the objective of this research. With this data selection, the new database contains 11,718 records, as shown in Table 2. The database used classifies the data into five classes. This distribution of the dataset data was performed according to SCP-ECG standards.
The dataset comprises 11,718 clinical ECG recordings of 6 leads of 10 s durations (Figure 4a). These records were obtained from 10,319 patients, of which 53.4% were male, and 46.6% were female, with ages ranging from 4 to 95 years (mean: 56; mode: 65). The dataset is a complete collection of several concurrent pathologies and healthy control samples. The waveform files are stored in WaveForm DataBase (WFDB) format with 16-bit precision at a resolution of 1 μV/LSB and a sampling rate of 500 Hz [23].

2.1.2. Database 2: Construction of the sECG Images

For the construction of the sECGs, the entire Database 1, i.e., the 11,718 recordings, was considered. First, the WFDB files were converted to .xlsx format using Python functions. Then, each of the .xlsx files was passed through MATLAB using the function [num,txt,raw] = xlsread (___). The variable x is a vector corresponding to the number of measurements, and the variable Y is the number of channels. The function [X, Y] = meshgrid (x, y) was then used to transform the domain specified by the x and y vectors into X and Y matrices to evaluate three-dimensional mesh and surface diagrams. The rows of the output matrix X are copies of the x vector; the columns of the output matrix Y are copies of the y vector. Then, the matrix Z was defined as num, which is the numerical data of the .xlsx file. Finally, the mesh function was used to draw a mesh of wires with the color determined by Z, so the color is proportional to the surface height (voltage); that is, (X(j), Y(i), and Z(i, j)) are the intersections of the grid lines of wires; X is the columns; and Y is the rows of Z. This resulting grid image is the surface ECG image, i.e., the sECG. See the file “Create Images” [26]. This plot created the value in the matrix representing the z-value in the plot (Figure 4b). The dimensions of the matrix are based on the x and y values. The dataset comprises 11,718 sECG images of six leads of 10 s durations designed using Database 1.
Next, data underwent the same process to obtain the sECG image corresponding to each one. In addition, to spatially understand the formation of the sECG images, see these three types of three-dimensional plots offered by MATLAB [27] (Figure 5).

2.2. Neural Networks

The models were built in Google Colab in Python language. GPU and the High RAM function were used due to the large amount of data to train. Both had the 11,718 records divided into training and validation. The construction of two models is described below: model 1 (LSTM) works with cardiac signals (1D), and Model 2 (ResNet34) works with sECG images (3D).

2.2.1. Computational Analysis: LSTM NN

An LSTM network can “remember” relevant data in the sequence and preserve it for several instances; that is, it can have both short-term memory (such as essential recurrent networks) and long-term memory (LSTM). This characteristic makes the LSTM network suitable for the study since it can analyze large data sequences, such as the numerical recordings of the ECG signal (1D). This model imported several libraries: WFDB, tqdm, os, math, matplotlib, Keras, sklearn, NumPy, pandas, and time. Then, the WDFB files were read, and the training and validation datasets were distributed. To construct a sequential model, a stack of layers must be planned, where each layer has exactly one input tensor and one output tensor. The model has three layers: LSTM, Dropout, and Dense. The coupling of the layers was performed with a fixed feature map dimension (F) = [256, 128, 64, 32, 5]. Additionally, other resources were used, such as optimizers, dropouts, and activation functions, as mentioned later. Subsequently, although the parameters of each of the classes were balanced in quantity, an adjustment of the weights was made [28,29,30] to match the values obtained by the network for each of the classes. The model’s architecture showed the order of the layers and the number of values that entered and exited each one (Figure 6). In this model, the proportions of the training and validation datasets were 82% and 18%, respectively, meaning that the ECG signals (1D) were distributed to 9535 for the first set and to 2183 for the second set.

2.2.2. Computational Analysis: ResNet34 NN

Convolutional Neural Networks (CNNs) are used for image classification. They present the problem that the higher the number of layers used, the higher the error rate. This is why ResNet networks were created, using the concept of connection hopping. It allows specific layers to be skipped in training, so that if any layer harms the architecture’s performance, regularization will skip it. This feature makes the LSTM network the right one for the study since it allows for training an intense neural network without the problems caused by the vanishing/exploding gradient characteristic of CNNs. For this model, the last version of the fastai repository and all the required libraries were imported. Then, the WDFB files were read, and the training and validation datasets were distributed. The model’s architecture showed the order of the layers and the number of values that entered and exited each one (Figure 7). ResNet34 consists of one convolution and pooling step followed by four layers of similar behavior. Each of the layers follows the same pattern. They perform 3 × 3 convolution with a fixed feature map dimension (F) = [64, 128, 256, 512], bypassing the input every two convolutions.
Furthermore, the width (W) and height (H) dimensions remain constant during the entire layer. The dotted line shows a change in the dimension of the input volume (a reduction due to the convolution). The reduction between layers is caused by an increase in stride, from 1 to 2, at the first convolution of each layer. In this model, the proportions of the training and validation datasets were 80% and 20%, respectively, meaning that the sECG (3D) images were distributed to 9331 for the first set and to 2387 for the second set.

3. Results

3.1. Database Obtained

The first database contains 11,718 records, which are classified into five classes. The dataset comprises 6-lead clinical ECG recordings of 10 s duration taken every 2 ms; there were 5000 samples. The sECG images of Database 2 were constructed using the numerical values of Database 1. To see an example of the sECG images, see Table 3, which collects two random images for each class. The number of images produced was equal to the number of records, i.e., both databases contained the same number of parameters. Each image contained one axis x = 125, i.e., from the 5000 samples of Database 1 (samples every 0.002 s), samples were taken every 0.080 s. It is attributed to the fact that the high amount of data did not allow visible plots to be obtained. Therefore, they were evaluated empirically until this value was reached. In addition, the y = 6 axis corresponds to each of the channels of the leads. Finally, the Z-axis corresponds to the color provided by the amplitude of each signal.
According to Table 3, the sECG images of the normal class present sections where the colors were noticeably light (yellow) due to the increase in voltage. At the same time, there were sections where dark colors (blue) were observed, showing that the voltage was decreasing. In the CD class, the dominant color was yellow, which may be due to the fact that the heart rate was elevated in this condition. It also presented specific columns with dark colors, which may be due to the variations suffered by the signal in the R-R interval characteristic of this condition. In the HYP class, the dominant color was bluish green, possibly due to negative T waves, negative P waves in lead V1, and depressions of S waves in leads V1 and V2. At the same time, the transparent sections may be due to high R waves and S-T segment elevation. In the MI class, dark colors dominated since this condition decreases heart rate and T-wave inversion. At the same time, the few sections with light colors may have been caused by S-T segment elevation. Finally, the STTC class was also dominated by dark colors and several columns maintaining light colors, due to S-T segment elevations.

3.2. Results of Neural Networks

3.2.1. Hyperparameters

To describe the model is essential, whilst mentioning the hyperparameters used. This term refers to configuration variables and their value external to the model itself [31,32]. The data could not be estimated, and the programmer adjusted the learning algorithms. First, the hyperparameters of two models related to the learning algorithm level: LSTM was trained for 12 epochs at approximately 4 h, using a batch size of 500 and a learning rate of 1 × 10−3. ResNet34 was trained for 48 epochs at approximately 2.5 h, using a batch size of 14 and a learning rate of 1 × 10−3. Second, the hyperparameters related to structure and topology were the layers. The LSTM model comprises nine layers, excluding the input and output layers, and ResNet34 has 34 convolutional layers. All hyperparameters are shown in Table 4.

3.2.2. Plots of Learning

First, the training results of the two networks show how they evolved in terms of accuracy during the training after each iteration (Figure 8). From these graphs, it can be seen that both networks progressed to reach a high training accuracy (blue lines) and increased linearly with the epochs until they reached almost 100%. There was a high accuracy when classifying data not seen before. However, the first network achieved a better result, with fewer iterations than the second. On the other hand, the validation test classification was based on the previously learned features. In this evaluation (orange lines), the first network had a maximum of 98%, while the second network exceeded 90%.
Second, the evolution of the loss function values was analyzed during the training. The LSTM model presented the characteristic behavior of a model with overfitting. Here, the validation data reached its minimum after a few epochs and then increased. In contrast, the loss of the training data decreased linearly until it reached almost 0, where it was maintained (Figure 9a). Then, the ResNet34 model showed that the training loss decayed after a few iterations, while the validation loss remained almost constant (Figure 9b). Both decays resulted in low errors, showing the model’s efficiency.
Figure 8 and Figure 9 are related since the higher the accuracy, the lower the value of the error in the network. Both graphs show constancy, the first network in 6 iterations and the second in approximately 30 iterations. It can be interpreted as the networks starting to overfit the training data. Therefore, for future improvement, the amount of data could be increased.

3.2.3. Confusion Matrix

Then, the confusion matrix was used to evaluate the efficiency of the neural network (Figure 10). The central diagonal data representation (drawn in blue) represents the number of hits in the model. Figure 10a shows the matrix confusion of LSTM NN, where 2183 data were used in the validation dataset, of which 1493 were correctly classified, with an accuracy rate of 68.39%. The bottom of the main diagonal line shows false negatives or type II errors (the disease was not detected when it did exist); there were 253 such errors. Conversely, the upper of the main diagonal reflects the classifier error: false positive or error type I (disease detected but not present); there are 437 such errors. Additionally, there are 162 types II errors and 147 errors in type I. On the other hand, Figure 10b corresponds to the ResNet34 NN, where 2387 data were used in the validation dataset, of which 2078 were correctly classified, with an accuracy rate of 73.81%.

3.2.4. Evaluation Metrics

Standard evaluation metrics, including sensitivity, recall, and accuracy, were implemented to perform a comprehensive performance evaluation. These metrics were calculated with the confusion matrices in Figure 10. These metrics were calculated for each of the classes from the following formulas:
Recall = T P T P + F N
Sensitivity = T N T N + F P
Accurancy = T P + T N T N + F P + T P + F N
The recall values focus on type II errors (FN). A type II error occurs when a false null hypothesis is accepted, that is, when the prediction says that the disease has not been detected when it does exist. For both models, recall is >62. Specificity values focus on type I errors (TF). A type I error occurs when a false null hypothesis is accepted, that is, when the prediction says a disease has been detected but is not present. For both models, the specificity was >88. Finally, accuracy indicates how close the result of a measurement is to the actual value. For both models, the sparsity was >84. All three metrics had values >50, indicating that the classes were balanced, and a good model fit. On the other hand, Model 2 had higher values in each metric and each class (Figure 11).

4. Discussion

According to the analysis of ECG signals, the traditional way of performing an electrocardiogram has advantages such as the high sampling rate and the innumerable existing studies [33]. However, the most used files for their storage, SCP-ECG, Digital Imaging, and Communication in Medicine Waveform Supplement 30 (DICOM-WS 30) and Health Level Seven Annotated Electrocardiogram (HL7 aECG), are complex to manage, which makes their processing difficult [34].
On the other hand, the sECG imaging proposed in this study is a new technique. It allows signal patterns to be represented that are difficult to identify in traditional signals, which is quite tricky considering that there are more than twenty types of pathologies. At the same time, sECG can be used to develop computer vision, which is the latest artificial intelligence technology and has excellent technological potential for the future. However, among its disadvantages are the many channels required for its construction and the lack of studies of this type of sECG image, making a comparison with previous studies impossible.
This research described how to use RNNs (LSTM) and CNNs (ResNet34) to detect cardiac pathologies. First, the role of LSTMs is to classify number sequences [18]. In other words, it transforms the data entered so that they circulate through the network even in the following instant. On the other hand, the function of ResNet34 can be defined as extracting high-level visual features over time [35]. It extracts these visual characteristics from the mesh on the Z-axis projected in time and the channels, X and Y axes.
Model 1 (LSTM) works with cardiac signals (one-dimensional), and Model 2 (ResNet34) works with sECG images (three-dimensional). Both models were designed to classify ECG signals into five classes: Norm, CD, HYP, MI, and STTC. Their databases used 11,718 records of ECG signals of 6 precordial leads. It can be affirmed that the LSTM is more economical since it can be trained with a normal CPU and RAM according to the hyperparameters sectioned. ResNet34 needs a GPU and High RAM; therefore, it demands more computational resources. On the other hand, the training time of the LSTM (4 h) is longer than that of ResNet34 (2.5 h).
According to the training accuracy in the training set, LSTM reached a higher value (98.71%) than ResNet34 (93.65%). However, the training accuracy of the validation set, the LSTM, was surpassed by 68.39% by ResNet34 (87.05%) (Figure 8). Here, it is essential to highlight that the validation set is where the efficiency of the network is evaluated, so ResNet has better results than LSTM. In turn, this training accuracy of the validation set was reflected in the confusion matrices (Figure 10), where the LSTM had 230 type ii errors and 437 type I errors. While ResNet had 162 types II errors, there were 147 type I errors. Finally, in the metrics analysis, the values obtained in recall and specificity were higher for ResNet, while the accuracy was higher for the LSTM. Therefore, LSTM has better learning while training, while ResNet is better at making accurate predictions. These characteristics, as shown in Table 5, confirm that ResNet performed better.
This study used two learning models; the difference between them is the type of input used. Therefore, this comparison was based on several aspects, such as input, application, and the number of channels used; see Table 6.
For the first model, the LSTM NN obtained a recall of 89.06%, a specificity of 92.13%, and an accuracy of 98.71. All three metrics were excellent and comparable with other similar models. It was compared with other classifiers for cardiac conditions, such as the CNN, FIS, N-Net, MSN-Net, and LSTM. All of them are usually used as classifiers. Although the values of the metrics are similar to those of existing studies, it is important to highlight three features:
  • The amount of data in numerical networks is high when standardizing and collecting from several databases or low when using a single database [8].
  • Although most apply the classification or detection of pathologies, there is no variety in classes since they are limited to only two.
  • The number of channels analyzed is1 or 12, performed with devices at the clinical level; there is no variety in the analysis by channels.
For the second model, ResNet34 NN obtained a recall of 89.64%, a specificity of 93.42%, and an accuracy of 93.65. The same values are at the same level as other models that use sECG images as inputs. The methods to which it can be compared include the KNN, HD, CNN, and SQI. While the values of the metrics are similar to existing studies, it is important to highlight three features, namely:
  • There are studies in sEMG images, not with sECG images.
  • There is a study of electrocardiographic signals with spectrogram images, but it comes back to the issue of channels since there is only one channel.
  • There is no database for surface images (sECG, sEMG, sECG, and others), so the images that exist are electromyography images and are limited [37].

5. Conclusions

It can be concluded that there are many ECG signal databases, but they usually contain a short number of signals. Putting these databases together represents a challenge since standardizing them is complicated due to the equipment, channels, and conditions such as frequency. The database used in this study is the only one that contains a significant amount of data, which allowed for a better study.
It was also found that no studies focus on precordial leads, even though they are fundamental for detecting anomalies. Moreover, in the field of surface signals, it is an entirely new and unexplored field. Particularly for sECG images, no studies have been found that mention or study them. Biomedical signals are vast, and proposing new ways to perform measurements helps the physician provide a more accurate diagnosis and treatment as soon as possible.
Finally, it was found that this DSS has been used more in recent years. It is recommended to work with machine learning models that allow the construction of a new DSS to evaluate cardiac pathologies better. Machine learning models are ideal for supporting the primary care physician, as a software to support the diagnosis, but will not replace the health professional. The proposed models are at the level of previously conducted studies, with certain advantages, such as the number of data; the number of channels; and new inputs, such as the sECG images. Finally, it is recommended that the field of sECG be further explored since the results of this study show that it can represent a significant improvement in how cardiac diagnosis is performed on an active basis.

Author Contributions

Conceptualization, E.A.-S. and D.A.-G.; methodology, E.A.-S. and D.A.-G.; software, E.A.-S.; formal analysis, D.A.-G.; investigation, E.A.-S.; data curation, E.A.-S.; writing—original draft preparation, E.A.-S. and D.A.-M.; writing—review and editing, D.A.-G., F.V.-M., and A.T.-E. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Zenodo: Repository of Rapid Detection of Cardiac Pathologies by Neural Networks Using ECG signals (1D) and sECG images (3D). https://zenodo.org/record/6459733#.YleK5ejMJPY (accessed on 14 April 2022) [26]. Source code available from: https://github.com/Eviaguiar/Detection-of-Cardiac-Pathologies-by-Neural-Networks/tree/v1.0.0 (accessed on 14 April 2022). License: Data are available under the terms of the Creative Commons Zero “No rights reserved” data waiver (CC0 1.0 Public domain dedication). Database 1 was obtained from Physionet https://physionet.org/content/ptb-xl/1.0.1/ (accessed on 26 February 2021) [24]. Database 2 contains the surface ECG (sECG) images built-in MATLAB from Database 1. This was created in this research and uploaded to Google Drive due to the considerable number of files it contains: https://drive.google.com/drive/folders/1BP3_K2oTRsDvGsseHBRFW75tNfJyfgSk?usp=sharing (accessed on 6 June 2021).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. WHO. Cardiovascular Diseases (CVDs). Available online: https://www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds) (accessed on 28 July 2021).
  2. MPS. Indicadores Básicos de Salud Ecuador-2012. WHO Statistical Profile. Available online: https://www3.paho.org/ecu/index.php?option=com_docman&view=download&category_slug=documentos-2014&alias=471-indicadores-basicos-de-salud-ecuador-2012&Itemid=599 (accessed on 9 July 2021).
  3. INEC. Anuario de Estadísticas Vitales—Nacimientos y Defunciones. Available online: https://www.ecuadorencifras.gob.ec/.pdf (accessed on 30 July 2021).
  4. MSP. MSP Previene Enfermedades Cardiovasculares con Estrategias Para Disminuir Los Factores de Riesgo. Available online: https://www.salud.gob.ec/msp-previene-enfermedades-cardiovasculares-con-estrategias-para-disminuir-los-factores-de-riesgo/ (accessed on 9 July 2021).
  5. Busnatu, S.S.; Serbanoiu, L.I.; Lacraru, A.E.; Andrei, C.L.; Jercalau, C.E.; Stoian, M.; Stoian, A. Effects of Exercise in Improving Cardiometabolic Risk Factors in Overweight Children: A Systematic Review and Meta-Analysis. Healthcare 2022, 10, 82. [Google Scholar] [CrossRef] [PubMed]
  6. ECG & Echo Learning. Cardiac Electrophysiology: Action Potential, Automaticity and Vectors. Clinical ECG Interpretation. Available online: https://ecgwaves.com/topic/cardiac-electrophysiology-ecg-action-potential-automaticity-vector/ (accessed on 14 June 2021).
  7. Williams, L.; Wilkins, P. ECG Interpretation Made Incredibly Easy! 5th ed.; Wolters Kluwer: London, UK, 2011. [Google Scholar]
  8. Jung, W.H.; Lee, S.G. ECG Identification Based on Non-Fiducial Feature Extraction Using Window Removal Method. Appl. Sci. 2017, 7, 1205. [Google Scholar] [CrossRef] [Green Version]
  9. Merletti, R.; Muceli, S. Tutorial. Surface EMG Detection in Space and Time: Best Practices. J. Electromyogr. Kinesiol. 2019, 49, 102363. [Google Scholar] [CrossRef] [PubMed]
  10. Merletti, R.; Botter, A.; Troiano, A.; Merlo, E.; Alessandro, M. Technology and Instrumentation for Detection and Conditioning of the Surface Electromyographic Signal: State of the Art. Clin. Biomech 2009, 24, 122–134. [Google Scholar] [CrossRef] [PubMed]
  11. Urbanek, H.; van der Smagt, P. IEMG: Imaging Electromyography. J. Electromyogr. Kinesiol. 2016, 27, 1–9. [Google Scholar] [CrossRef]
  12. Shin, H.; Zheng, Y.; Hu, X. Variation of Finger Activation Patterns Post-Stroke Through Non-Invasive Nerve Stimulation. Front. Neurol. 2018, 9, 1101. [Google Scholar] [CrossRef]
  13. Geng, W.; Du, Y.; Jin, W.; Wei, W.; Hu, Y.; Li, J. Gesture Recognition by Instantaneous Surface EMG Images. Sci. Rep. 2016, 6, 6–13. [Google Scholar] [CrossRef]
  14. Shaw, L.; Bagha, S. Online Emg Signal Analysis for Diagnosis of Neuromuscular Diseases By Using Pca and Pnn. Int. J. Eng. Sci. 2012, 4, 4453–4459. [Google Scholar]
  15. Kachuee, M.; Fazeli, S.; Sarrafzadeh, M. ECG Heartbeat Classification: A Deep Transferable Representation. In Proceedings of the 2018 IEEE International Conference on Healthcare Informatics (ICHI), New York, NY, USA, 4–7 June 2018; pp. 443–444. [Google Scholar] [CrossRef] [Green Version]
  16. Saadatnejad, S.; Oveisi, M.; Hashemi, M. LSTM-Based ECG Classification for Continuous Monitoring on Personal Wearable Devices. IEEE J. Biomed. Health Inform. 2020, 24, 515–523. [Google Scholar] [CrossRef] [Green Version]
  17. Ardan, A.N.; Ma’arif, M.; Aisyah, Z.H.; Olivia, M.; Titin, S.M. Myocardial Infarction Detection System from PTB Diagnostic ECG Database Using Fuzzy Inference System for S-T Waves. J. Phys. Conf. Ser. 2019, 1204, 012071. [Google Scholar] [CrossRef]
  18. Jian, J.Z.; Ger, T.R.; Lai, H.H.; Ku, C.M.; Chen, C.A.; Abu, P.A.R.; Chen, S.L. Detection of Myocardial Infarction Using Ecg and Multi-Scale Feature Concatenate. Sensors 2021, 21, 1906. [Google Scholar] [CrossRef]
  19. Granados, J.; Westerlund, T.; Zheng, L.; Zou, Z. IoT Platform for Real-Time Multichannel ECG Monitoring and Classification with Neural Networks. In Proceedings of the International Conference on Research and Practical Issues of Enterprise Infor-mation Systems, Shanghai, China, 18–20 October 2017; 2018; 310, pp. 181–191. [Google Scholar] [CrossRef]
  20. Darmawahyuni, A.; Nurmaini, S.; Sukemi; Caesarendra, W.; Bhayyu, V.; Rachmatullah, M.N.; Firdaus. Deep Learning with a Recurrent Network Structure in the Sequence Modeling of Imbalanced Data for ECG-Rhythm Classifier. Algorithms 2019, 12, 118. [Google Scholar] [CrossRef] [Green Version]
  21. Topalović, I.; Graovac, S.; Popović, D.B. EMG Map Image Processing for Recognition of Fingers Movement. J. Electromyogr. Kinesiol. 2019, 49, 102364. [Google Scholar] [CrossRef]
  22. Moin, A.; Zhou, A.; Rahimi, A.; Benatti, S.; Menon, A.; Tamakloe, S.; Ting, J.; Yamamoto, N.; Khan, Y.; Burghardt, F.; et al. An EMG Gesture Recognition System with Flexible High-Density Sensors and Brain-Inspired High-Dimensional Classifier. In Proceedings of the 2018 IEEE International Symposium on Circuits and Systems (ISCAS), Florence, Italy, 27–30 May 2018; pp. 1–5. [Google Scholar] [CrossRef] [Green Version]
  23. Physionet. PTB-XL, a Large Publicly Available Electrocardiography Dataset v1.0.1. Available online: https://physionet.org/content/ptb-xl/1.0.1/ (accessed on 11 August 2021).
  24. Wagner, P.; Strodthoff, N.; Bousseljot, R.D.; Kreiseler, D.; Lunze, F.I.; Samek, W.; Schaeffter, T. PTB-XL, a Large Publicly Available Electrocardiography Dataset. Sci. Data 2020, 7, 154. [Google Scholar] [CrossRef]
  25. Mandellos, G.J.; Koukias, M.N.; Styliadis, I.S.; Lymberopoulos, D.K. E-SCP- ECG + Protocol: An Expansion on SCP-ECG Protocol for Health Telemonitoringpilot Implementation. Int. J. Telemed. Appl. 2010, 2010, 1–17. [Google Scholar] [CrossRef] [Green Version]
  26. Aguiar, E. Eviaguiar/Detection-of-Cardiac-Pathologies-by-Neural-Networks: Detection of Cardiac Pathologies by Neural Networks. Repository 2022. Available online: https://doi.org/10.5281/ZENODO.6459733 (accessed on 14 April 2022).
  27. Raponi, M. Programación en MATLAB: Procesamiento Digital de Imágenes. TDI—UNSAM. 2006. Available online: http://www.unsam.edu.ar/escuelas/ciencia/alumnos/tutorial_matlab_tdi.pdf (accessed on 14 April 2022).
  28. Databricks. DeepLearningECGs. Available online: https://databricks.com/notebooks/iot-medical/deep-learning.htm (accessed on 9 September 2021).
  29. Huang, C.; Tang, J.; Niu, Y.; Cao, J. Enhanced bifurcation results for a delayed fractional neural network with heterogeneous orders. Phys. A Stat. Mech. Appl. 2019, 526, 121014. [Google Scholar] [CrossRef]
  30. Xu, C.; Zhang, W.; Aouiti, C.; Liu, Z.; Liao, M.; Li, P. Further investigation on bifurcation and their control of fractional-order bidirectional associative memory neural networks involving four neurons and multiple delays. Math. Methods Appl. Sci. 2021, 1–24. [Google Scholar] [CrossRef]
  31. Li, Y.; Zhang, Y.; Cai, Y. A New Hyper-Parameter Optimization Method for Power Load Forecast Based on Recurrent Neural Networks. Algorithms 2021, 14, 163. [Google Scholar] [CrossRef]
  32. Xu, C.; Liao, M.; Li, P.; Guo, Y.; Liu, Z. Bifurcation Properties for Fractional Order Delayed BAM Neural Networks. Cognitive Computation 2021, 13, 322–356. [Google Scholar] [CrossRef]
  33. Merone, M.; Soda, P.; Sansone, M.; Sansone, C. ECG Databases for Biometric Systems: A Systematic Review. Expert Syst. Appl. 2017, 67, 189–202. [Google Scholar] [CrossRef]
  34. Bond, R.R.; Finlay, D.D.; Nugent, C.D.; Moore, G. A Review of ECG Storage Formats. Int. J. Med. Inform. 2011, 80, 681–697. [Google Scholar] [CrossRef] [PubMed]
  35. Gao, M.; Chen, J.; Mu, H.; Qi, D. A Transfer Residual Neural Network Based on Resnet-34 for Detection of Wood Knot Defects. Forests 2021, 12, 212. [Google Scholar] [CrossRef]
  36. Rubin, J.; Parvaneh, S.; Rahman, A.; Conroy, B.; Babaeizadeh, S. Densely Connected Convolutional Networks and Signal Quality Analysis to Detect Atrial Fibrillation Using Short Single-Lead ECG Recordings. Comput. Cardiol. 2017, 44, 1–4. [Google Scholar] [CrossRef]
  37. Phinyomark, A.; Scheme, E. EMG Pattern Recognition in the Era of Big Data and Deep Learning. Big Data Cogn. Comput. 2018, 2, 1–27. [Google Scholar] [CrossRef] [Green Version]
Figure 1. Examples of signals used: (a) ECG signal in 1D; (b) sECG images in 3D.
Figure 1. Examples of signals used: (a) ECG signal in 1D; (b) sECG images in 3D.
Computation 10 00112 g001
Figure 2. Precordial leads: V1 is placed in the fourth intercostal space. V2 is placed in the fourth intercostal space. V3 is placed in the middle of electrodes V2 and V4. V4 is placed in the fifth intercostal space, on the midclavicular line. V5 is placed on the same line as V4 but on the anterior axillary line. V6 is placed on the same horizontal line as V4 and V5 but on the mid-axillary line.
Figure 2. Precordial leads: V1 is placed in the fourth intercostal space. V2 is placed in the fourth intercostal space. V3 is placed in the middle of electrodes V2 and V4. V4 is placed in the fifth intercostal space, on the midclavicular line. V5 is placed on the same line as V4 but on the anterior axillary line. V6 is placed on the same horizontal line as V4 and V5 but on the mid-axillary line.
Computation 10 00112 g002
Figure 3. Block diagram of the research: the signal processing and construction of the models.
Figure 3. Block diagram of the research: the signal processing and construction of the models.
Computation 10 00112 g003
Figure 4. Explanation of sECG image formation: (a) Example of 125 numerical data; records taken every 80 ms. (b) Representation of the sECG image.
Figure 4. Explanation of sECG image formation: (a) Example of 125 numerical data; records taken every 80 ms. (b) Representation of the sECG image.
Computation 10 00112 g004
Figure 5. Three-dimensional plots in MATLAB corresponding to Patient 5803: (a) Mesh surface used to give effect to a two-dimensional x×y matrix. (b) The surface plot creates a colored three-dimensional surface instead of a mesh. Here, from the top shows the sECG. Over time, the composition of the six channels provides a three-dimensional image that is also an sECG distinguished by its colors. (c) Contour plot that represents two-dimensional and three-dimensional surfaces. (d) Combination of the contour plot with a surface.
Figure 5. Three-dimensional plots in MATLAB corresponding to Patient 5803: (a) Mesh surface used to give effect to a two-dimensional x×y matrix. (b) The surface plot creates a colored three-dimensional surface instead of a mesh. Here, from the top shows the sECG. Over time, the composition of the six channels provides a three-dimensional image that is also an sECG distinguished by its colors. (c) Contour plot that represents two-dimensional and three-dimensional surfaces. (d) Combination of the contour plot with a surface.
Computation 10 00112 g005
Figure 6. LSTM network architecture and parameters at each layer.
Figure 6. LSTM network architecture and parameters at each layer.
Computation 10 00112 g006
Figure 7. ResNet34 network architecture and parameters at each layer.
Figure 7. ResNet34 network architecture and parameters at each layer.
Computation 10 00112 g007
Figure 8. Plots of training and validation accuracy of the networks: (a) LSTM NN and (b) ResNet34.
Figure 8. Plots of training and validation accuracy of the networks: (a) LSTM NN and (b) ResNet34.
Computation 10 00112 g008
Figure 9. Plots of training and validation loss of the networks: (a) LSTM NN and (b) ResNet34.
Figure 9. Plots of training and validation loss of the networks: (a) LSTM NN and (b) ResNet34.
Computation 10 00112 g009
Figure 10. Confusion matrix: (a) LSTM model and (b) ResNet34 model.
Figure 10. Confusion matrix: (a) LSTM model and (b) ResNet34 model.
Computation 10 00112 g010
Figure 11. Recall, specificity, and accuracy of two models of each class.
Figure 11. Recall, specificity, and accuracy of two models of each class.
Computation 10 00112 g011
Table 1. Summary of the literature referring to ECG prediction models.
Table 1. Summary of the literature referring to ECG prediction models.
AIApplicationType of LeadsRef.
NNECG heartbeat classification1 lead II ECG[15]
NNECG continuous monitoringsingle channel ECG signal[16,17]
MLDetection of MI12 channels ECG bipolar and unipolar[18,19]
NNMI and Norm condition classification15 channels ECG bipolar and unipolar[20]
MLEMG signal of finger movement detectionimages sEMG of 24 channels[21]
MLEMG signal of finger movement detectionimages sEMG of 64 channels[22]
NNEMG gesture recognitionimages sEMG of 129 channels[13]
Table 2. SCP-ECG ID descriptions for classes and subclasses.
Table 2. SCP-ECG ID descriptions for classes and subclasses.
IDNameRecords
NORMNormal ECG2682
CDConduction Disturbance2009
HYPHypertrophy2083
MIMyocardial Infarction2538
STTCST/T Change2406
TOTAL11,718
Table 3. Example of sECG images of Pyshionet in MATLAB for each of the classes.
Table 3. Example of sECG images of Pyshionet in MATLAB for each of the classes.
Norm-Patient 5803CD-Patient 2044HYP-Patient 25MI-Patient 1124STTC-Patient 9765
Computation 10 00112 i001 Computation 10 00112 i002 Computation 10 00112 i003 Computation 10 00112 i004 Computation 10 00112 i005
Table 4. Hyperparameters are used in the training of LSTM and ResNet34 neural networks.
Table 4. Hyperparameters are used in the training of LSTM and ResNet34 neural networks.
HyperparametersEpoch
Number
Time of TrainingBatch SizeLearning Rate# LayersActivation FunctionOptimizer# Training Dataset# Validation Dataset
LSTM12~4 h5001 × 10−39SoftMaxAdam9535 (82%)2183 (18%)
ResNet3448~2.5 h141 × 10−348ReLU9331 (80%)2387 (20%)
Table 5. Summary of evaluation of two models.
Table 5. Summary of evaluation of two models.
MethodEnvironment UsedMetrics (%)Errors
Acc.Rec.Spcf.Type IType II
LSTM NNCPU98.7189.0692.13437230
ResNet34GPU93.6589.6493.42147162
Table 6. Different methods of using numerical and image data present in the literature.
Table 6. Different methods of using numerical and image data present in the literature.
MethodApplication# ParametersMetrics (%)Ref.
Rec.Spcf.Acc.
Numerical dataLSTM NN
Present work
Classification of Norm, CD, HYP, MI, and STTC11,718 records of 6 precordial leads89.0692.1398.71-
Deep residual CNNECG heartbeat classification290 records of lead II95.10-95.90[15]
LSTM and algorithmsContinuous cardiac monitoring~50,000 records of single channel ECG signal99.2093.0099.20[16]
LSTM and algorithmsClassification MI and Norm condition12,359 records of 15 leads98.4997.97-[20]
FIS (ANN) and algorithmsClassification MI and Norm condition200 records of single channel ECG signal73.00--[17]
N-NetDetection of MI240 records of 12 leads--95.76[18]
MSN-NetDetection of MI240 records of 12 leads--61.82[18]
Images dataResNet34 Present workClassification of Norm, CD, HYP, MI, and STTC11,718 sECG images of 6 precordial leads89.6493.4293.65-
KNNDetection EMG signal of finger movements240 images sEMG of 24 channels-95.7097.70[21]
HDDetection EMG signal of finger movements30 images sEMG of 64 channels--96.64[22]
Deep CNNGesture recognition79 images sEMG of 129 channels-96.7065.10[13]
SQI with dense CNNClassifier AF from normal sinus rhythm, other rhythms, and noise8528 spectrograms of single channel ECG signal--80.00[36]
Rec: recall; Spcf: specificity; Acc: accuracy; ML: machine learning; CNN: convolutional neural network; ANN: artificial neural network; FIS: Fuzzy Inference System; N-Net: multi-lead features–concatenate narrow network; MSN-Net: multi-scale features–concatenate networks; KNN: K Nearest Neighbor (supervised ML algorithm); HD: high-dimensional computing (supervised ML algorithm); SQI: Signal Quality Index; AF: atrial fibrillation.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Aguiar-Salazar, E.; Villalba-Meneses, F.; Tirado-Espín, A.; Amaguaña-Marmol, D.; Almeida-Galárraga, D. Rapid Detection of Cardiac Pathologies by Neural Networks Using ECG Signals (1D) and sECG Images (3D). Computation 2022, 10, 112. https://doi.org/10.3390/computation10070112

AMA Style

Aguiar-Salazar E, Villalba-Meneses F, Tirado-Espín A, Amaguaña-Marmol D, Almeida-Galárraga D. Rapid Detection of Cardiac Pathologies by Neural Networks Using ECG Signals (1D) and sECG Images (3D). Computation. 2022; 10(7):112. https://doi.org/10.3390/computation10070112

Chicago/Turabian Style

Aguiar-Salazar, Evelyn, Fernando Villalba-Meneses, Andrés Tirado-Espín, Daniel Amaguaña-Marmol, and Diego Almeida-Galárraga. 2022. "Rapid Detection of Cardiac Pathologies by Neural Networks Using ECG Signals (1D) and sECG Images (3D)" Computation 10, no. 7: 112. https://doi.org/10.3390/computation10070112

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