1 Introduction

The heart is an essential organ composed primarily of muscle tissue. The function of the coronary arteries is to supply oxygenated blood to the heart muscle. Thus, coronary artery disease obstructs the arteries, and reduces the blood supply to downstream muscle, potentially causing damage to the heart muscle and the possibility of myocardial infarction (MI) (Thomas 2015). If the extent of the MI is large, the affected poorly contracting wall segments can introduce increased mechanical stress to the heart, resulting in morphological and conformational alterations in response, i.e., left ventricular remodeling, which results in inefficient pump functioning and contributes to heart failure. The MI segments can undergo substrate alterations, e.g. fibrosis, that renders the tissue arrhythmogenic, which can be lethal. Symptoms of acute MI involve breaking into cold sweats, chest pain, shortness of breath, feeling faint, nausea, as well as discomfort that may radiate to the arm, shoulder, and neck (Setiawan et al. 2014). Major risk factors associated with MI are high cholesterol, diabetes, high blood pressure, physical inactivity, obesity, and unhealthy diets. These risk factors promote atherosclerotic plaque formation in the coronary artery wall that results in arterial narrowing. As fat content in the plaque increases, it becomes vulnerable and susceptible to surface rupture. The latter triggers a secondary pathophysiological phenomenon that activates blood clot formation within the coronary artery lumen to interrupt the distal blood supply suddenly and completely, resulting in MI (Roger 2007).

In 2017, 800,000 Americans died from MI (WHO fact 2012; Ley 2015). Of these, 280,000 had prior MI and the remainder were first-time presentations (Ley 2015) underscoring the need for accurate diagnostics. There are several diagnostic instruments utilized to characterize MI. The diagnostic tests include the exercise stress test (EST), cardiac catheterization, and electrocardiogram (ECG). Cardiac catheterization is an invasive procedure that requires expertise and training. In addition, patients are exposed to procedural risk, albeit small, as well as radiation and potentially nephrotoxic contrast. With EST, ECGs are recorded during treadmill exercise, which can be associated with a very small risk of cardiac arrest (Robert et al. 2013). Hence, not all MI patients can undergo this test due to the associated risk. Thus, the standard ECG remains the most common diagnostic tool for detection of MI, especially in the acute setting. As the ECG abnormalities associated with MI, both acute and chronic, can be subtle, experts’ readings are crucial to ensure the accuracy of interpretation. To overcome these drawbacks, computer aided diagnostic systems (CAD) should be designed to extract the pertinent parameters. These parameters can then be input to classifiers for the categorization of normal versus MI patients (Robert et al. 2013; Liu et al. 2014).

CAD tools are developed to detect a disorder and to minimize intra- and inter-observer variability (Jahmunah et al. 2019a, b). In general, CAD systems can be classified into online- and offline-based systems. Table 1 shows the summarized works for MI detection using a CAD system.

Table 1 A summary of studies using CAD systems for the classification of MI using ECG signals

2 Literature review

Herein, a novel algorithm involving an offline processing system for diagnosing MI with the ECG is described and discussed. Acquired ECG signals were subjected to CAD after pre-processing to remove noise. A nonlinear feature extraction (Paul et al. 2019) operation was implemented to extract suitable features from the signals. These features were then subjected to a feature selection process, wherein the system selected the best features which would improve analysis speed. Student’s t-test was utilized to obtain significant features, which were ranked based on their t-values and then input to the classifier. The classifier was designed to distinguish between normal and MI signals.

3 Computer aided diagnostic systems (CAD)

ACAD system comprises four main units: preprocessing of signals, nonlinear feature extraction, selection of the most significant features, and classification of these selected features into normal versus MI. Figure 1 illustrates a proposed CAD system.

Fig. 1
figure 1

Proposed CAD system

3.1 Raw ECG signals

ECG signals were obtained from PhysioBank, the Physikalisch-Techische Bundesanstalt (PTB) Diagnostic ECG database (Goldberger et al. 2000). This database contains publicly available digitized ECG data from patients with different heart diseases, for training of models. The signals were recorded using a PTB sample recorder. The database contained 52 healthy and 148 subjects with acute and/or chronic MI and the entire dataset was used in this study. The normal and MI signals were sampled at a rate of 1000 Hz. In this work, only Lead II ECG signals were considered.

3.2 Pre-processing

At this phase, the discrete wavelet transform (DWT) was utilized for noise removal. DWT was employed to decompose the signals, using the Daubechies wavelet 6 (db6). The approximate and detail coefficients with high and low pass filters were obtained to eliminate noise including baseline wander (0–0.5 Hz) and power-line interference (50–150 Hz) (Acharya et al. 2016a, b).

After DWT, empirical mode decomposition (EMD) (Pal and Mitra 2012) was then employed. Various intrinsic mode functions (IMFs) were obtained by decomposing the EMD signals, and low frequency components were removed using a notch filter. The denoised signals were reconstructed once the low frequency components were removed.

DWT is dependent on a prior choice of wavelet basis and taps on experts’ experience in determining the level of decomposition to extract the signals (Labate et al. 2013). EMD on the other hand, does not require the level of decomposition to be set beforehand and hence, overcomes the limitations of DWT (Labate et al. 2013). After the baseline wander and power-line interference were removed, the Pan-Tompkins algorithm was employed for R-peak detection (Pan and Tompkins 1985). Once the R point was detected, a two-second signal segmentation was done, considering 1749 samples to the left of R peak and 250 samples to the right of R peak at a 1 kilo Hertz sampling rate. Thus, a total of 2000 sample points were selected for each ECG beat analysis.

Two-second segments were extracted, comprising 16826 normal 3796 MI segments, respectively. Figure 2 shows the 2-s ECG signals in (a) normal and (b) MI.

Fig. 2
figure 2

Two seconds duration of ECG Signals: a normal and b MI

3.3 Feature extraction

Naturally, ECG signals are disorderly and vary over time. These characteristics cause the extraction of nonlinear features to be used preferably in the development of CAD systems for MI diagnosis. Time, frequency, and time–frequency domain analyses are unable to detect the inherent variations in the ECG, but nonlinear techniques can be used to extract characteristic features. Many studies have reported using various nonlinear methods (Jahmunah et al. 2019a). The computational demands and time increase when nonlinear methods are utilized to obtain features from DWT coefficients, but it facilitates the extraction of large numbers of suitable features (Acharya et al. 2017a; b, c, d, e). In our study, we extracted the following nonlinear features: Bispectrum, Recurrence Qualitative Analysis (RQA), Approximate Entropy, Permutation Entropy, Detrended Fluctuation Analysis, Fractal Dimension, Largest Lyapunov Exponent, Sample Entropy, Rényi Entropy, Hurst Exponent, Tsallis Entropy, Kolmogorov Sinai Entropy, Fuzzy Entropy, Modified Multiscale Entropy (MMSE), Wavelet Entropy, and correlation Dimension.

3.3.1 Bispectrum

The Higher order spectrum (HOS) is a used to evaluate non-stationary and non-Gaussian signals (Acharya et al. 2015, 2017a; b, c, d, e; Pham et al. 2020a, b). It detects the diversion from phase correlations and Gaussian level among frequency components of the signal (Jahmunah et al. 2019a, b; Acharya et al. 2015). HOS retains phase information as it is more immune to noise.

3.3.2 Recurrence qualitative analysis (RQA)

The RQA computes the total number of recurrences in order to calculate ECG signal complexity (Webber and Zbilut 1994). The RQA includes parameters of transitivity, determinism, laminarity, mean diagonal line length, the entropy of diagonal length, trapping time, recurrence time, recurrence rate, and recurrence time entropy (Zbilut and Webber 1992; Zbilut et al. 2002).

3.3.3 Approximate entropy (ApEn)

This entropy helps to characterize the instability or irregularity (Pincus 1991) in the ECG signal. The approximate entropy is higher for more irregularity.

3.3.4 Fractal dimension (FD)

It is a powerful tool used to measure the complexity of fractals by changing the measurement scale. The fractal patterns are characterized by quantifying their complexity as the ratio of change in the detail to the change in scale (Acharya et al. 2011).

3.3.5 Permutation entropy (PEnt)

Permutation entropy is a measure of random time series data depending upon the examination of the permutation pattern. It measures the complexity in ECG signals by calculating the coupling between time series data (Bandt and Pompe 2002).

3.3.6 Detrended fluctuation analysis (DFA)

To obtain the self-similarity characteristics of ECG signals, DFA is used (Peng et al. 1996). The variants such as multi fractal DFA and root mean square (RMS) are implemented along with DFA features (Jahmunah et al. 2019a, b).

3.3.7 Hurst exponent (HE)

The Hurst Exponent (Hurst 1956) is an evaluation of self-similarity and predictability in the ECG. If the magnitude of the Hurst exponent is high, it indicates a smoother and simpler signal (Acharya et al. 2019).

3.3.8 Largest Lyapunov exponent (LLE)

The LLE is evaluated to assess the degree of chaos existing in the signals (Rosenstein et al. 1993). If the value of LLE is higher, then the signals are more complex.

3.3.9 Sample entropy (SampEn)

This technique calculates the complexity and regularity of a physiological time series signal, and is not constrained by the pattern length (Richman and Randall 2000; Song and Liò 2010). If the value of SampEn is high, then the time series signal is less predictable; if SampEn is of low value, then it implies that the signal is more predictable.

3.3.10 Tsallis entropy (TEnt)

It is used to calculate the differences and memory consequences in the signal (Acharya et al. 2018a, b). Tsallis coefficients help in characterizing ECG bursts, spikes, and continuous rhythms.

3.3.11 Fuzzy entropy (FEnt)

Fuzzy entropy is used to estimate ECG signal unpredictability (Acharya et al. 2018a, b). This entropy indicates the degree of randomness, and is calculated as the entropy of a fuzzy set whose elements have varying degrees of membership.

3.3.12 Kolmogorov-Sinai entropy (K-SEnt)

Kolmogorov Sinai entropy is used to calculate the uncertainty in the ECG over time (Acharya et al. 2019; Ziv and Lempel 1977).

3.3.13 Multivariate multi-scale entropy (MMSEn)

In MMSEn, nonstationary ECG signals are considered to calculate the intrinsic correlation and express the degree of correlation in the time series (Acharya et al. 2018b, a; Hu and Liang 2012).

3.3.14 Rényi entropy (RE)

Rényi entropy is commonly known as the generalized type of Shannon entropy. The sudden variations in the time series data can be elucidated through RE (Renyi 1961; Shannon 1948).

3.3.15 Wavelet entropy (WE)

Wavelet entropy is used to measure the level of disorder as well as to compute the energy levels in the various frequency bands of the ECG signals (Rosso et al. 2001).

3.3.16 Correlation dimension (D2)

Correlation dimension calculates self-similarity in the ECG signals (Renyi 1961). The correlation integral C(r) is calculated first, and then the gap between N pairs of data points are measured (Jahmunah et al. 2019a, b).

3.4 Feature selection

Feature selection determines the best features and inputs them to the classification algorithm, to increase the speed of the CAD system. In the current work, the t test is used to select highly significant features. The t-distribution is defined as a continuous probability distribution for calculating population mean when sample size is small and the variance of the population is unknown. The t distribution is similar to the normal distribution. It is bell-shaped and symmetrical about the mean (Student Biometrika 1908). Features with a p-value lower than threshold are considered to be significant (Acharya et al. 2013). Here, the significant level corresponds to the probability of rejecting the null hypothesis, given that the condition is true. Figure 3 presents the 45 nonlinear parameters that were extracted from the ECG signals of MI patients and normal subjects using lead II.

Fig. 3
figure 3

a and b indicate 45 non-linear parameters extracted from MI and normal ECG signals using lead II

3.5 Classification

Classification of data is broadly grouped into two types: parametric and nonparametric classifiers. The parametric type classifies the data based upon the statistical distribution of the class, whereas nonparametric classifiers rely upon conditions of the unknown density function. In this work, K-Nearest Neighbor and Decision Tree are implemented, and they are categorized as nonparametric classifiers.

3.5.1 K-Nearest Neighbor (KNN)

KNN is a nonparametric classification method. KNN classifies the test sample by estimating the distance between the training and testing set. The class of the test sample is decided based on the nearest samples present in the training set. The distance is estimated using Euclidean distance (Acharya et al. 2013).

3.5.2 Decision Tree (DT)

DT is a graph in which a branching technique is used to decide possible outcomes. The decision tree splits the complex decisions into simpler decisions in order to extract the rules for the recognition of the class of data (Peng et al. 1996). The output of the decision tree is a binary structure. Here the input and outputs are deliberated as the root and terminal/leaf nodes respectively.

3.5.3 Support vector machine (SVM)

This is a supervised learning tool which simultaneously minimizes the empirical classification error and maximizes the geometric margin. SVM classifiers have two types of data: separable and non-separable data. For non-separable data, kernels such as radial basis aid in the classification process (Liu et al. 2013).

3.5.4 Probabilistic Neural Network (PNN)

PNN is a supervised learning algorithm. It comprises an input layer, representing the feature vector. This input layer is totally interconnected to the concealed layer, wherein these layers connect to the output representing the choices in which the input data can be classified (Acharya et al. 2019).

The three classifiers are trained and tested using ten-fold cross-validation strategy.

4 Results

20,622 beats were segmented in total, from 52 normal and 148 MI subjects. The two second segmentation was done in order to find the R-peak. Performance of the classifier was estimated based on the ranked features and was assessed by calculating the average accuracy, Positive Predictive Value (PPV), sensitivity, and specificity (Acharya et al. 2011). Table 2 provides a summary of the diagnostic performance for detection of MI versus normal using recurrence time, HOS, entropy, bispectrum, DFA, LLE, Hurst exponent, fractal dimension, permutation entropy, MMSE, Tsallis entropy, wavelet entropy, sample entropy, and approximate entropy features extracted from ECG signals with a duration of two seconds. A feature is statistically significant if p < 0.05; the t value indicates ranking of features (Hagiwara et al. 2018; Bishop 2006) If the t-value is higher, it represents features that are more significant. Hence, there is an inverse relationship between t-value and p-value.

Table 2 Range (Mean ± standard deviation) of features ranked using the t test

Table 3 shows the best performance of KNN, DT, SVM, and PNN classifiers used in our study. The highest accuracy, sensitivity, and specificity values of 97.96%, 98.89%, 93.81% were achieved respectively, with the SVM classifier.

Table 3 Best results of KNN, DT, SVM, PNN classifiers

5 Discussion

In this work, a nonlinear feature extraction method was investigated for the detection of normal versus MI from lead II ECG signals. This technique was used because it detects intrinsic complexity existing in the time series (Hurst 1956). Table 1 is a comparison of the results obtained from different CAD systems using a similar database.

From Table 1, it is apparent that various methods were proposed to develop CAD systems. The nonlinear analysis and time–frequency domain approaches were commonly employed (Hariharan et al. 2012). Hence, CAD systems along with a feature extraction technique yielded enhanced diagnostic accuracy as compared to single-type feature extraction techniques (Hagiwara et al. 2018). Bhaskar (2015), Dohare et al. (2018), Kora (2017), Padhy and Dandapat (2017), Sadhukhan et al. (2018), Bharadwaj et al. (2018), Han and Shi (2019), Seenivasagam and Chitra (2016) achieved lower classification accuracies as compared to our study. Although Acharya et al. (2016a, b), Kumar et al. (2017), Sharma et al. (2018), Lin et al. (2020) achieved higher classification accuracies, the methods they had proposed are computationally intensive as compared to the Pan-Thompkins algorithm, which is computationally more efficient. Although Liu et al. (2018a, b), Zhang et al. (2019), Tripathy et al. (2019), Alghamdi et al. (2020), Han and Shi (2020), Fu et al. (2020), Ramesh et al. (2020), Huang et al. (2020) achieved relatively higher classification accuracies than our study, these authors explored deep learning techniques, which require a lot of time to train the model as compared to our technique. Also, these authors have used small data sizes to validate their models; hence robustness is not guaranteed. Deep learning models should be validated with a larger data. Ribeiro et al. (2020) had employed a deep neural network with larger data, but still obtained a lower accuracy than our study. Acharya et al. (2017a, b, c, d, e) also achieved higher classification accuracies, but the authors investigated a different classification from our study. They did a 3-class classification and 4-class classification study, respectively. Venu et al. (2019), Haddadi et al. (2019) had employed deep learning methods but still achieved lower accuracies than our study. Hence, our method is technically sound as we have achieved a relatively high classification accuracy with the usage of a less computationally intensive algorithm. Therefore, a faster diagnosis of MI is possible.

It should be noted that recurrence time yielded more statistically significant features. The means for normal class features are greater than for the MI class. Figures 4, 5, 6 indicate recurrence, bispectrum and cumulant plots, respectively. These plots are different for normal versus MI classes. Figure 4 shows recurrence plots for normal and MI. In this, the recurrence parameter indicates the degree of feature repetition in the ECG signals. In the plot, blue dots indicate recurrence at a specific time interval. Figure 5 represents bispectrum and contour plots. The cumulant and contour plots of normal and MI signals are presented in Fig. 6. It is evident that the recurrence plots are distinct in the normal and MI classes. Also, the patterns in the bispectrum and cumulant plots are unique and show good separation between the two classes. Hence, the non-linear features used in our study are highly discriminatory. There are some benefits and limitations of our study, following.

Fig. 4
figure 4

Recurrence plots for a normal and b MI

Fig. 5
figure 5

Bispectrum plots for a normal and b MI

Fig. 6
figure 6

Cumulant plots for a normal and b MI

5.1 Benefits

  1. 1.

    The recommended system enables rapid diagnosis of MI.

  2. 2.

    The system has been validated by ten-fold cross-validation; hence it is reliable.

  3. 3.

    The system could be used to find anomalies associated with MI in real-time analysis.

  4. 4.

    The top few features exhibit a high degree of separation and hence, can be used to develop the index (Pham et al. 2020a, b)

5.2 Limitations

  1. 1.

    Only a small data size can be used for this technique.

  2. 2.

    The manual extraction and selection of features can be a laborious task.

A CAD system is advantageous due to its versatility, rapidness, reliability, and the fact that it can be used to find anomalies associated with MI in real-time analysis.

5.3 Challenges in myocardial infarction prediction

The features of ECG, including its peak deflections, time domain amplitude, and duration, provide information regarding myocardial characteristics. The time domain features are not able to provide exact discrimination between normal and MI beats (Martis et al. 2014). The wavelet domain can be used to distinguish two dissimilar ECG signals with the same magnitude due to an increase in time resolution and a compromise in the frequency resolution. The challenge lies in selecting an optimal wavelet basis function.

Assuming that noise and ECG signals are seen in separate frequency components, linear models can be used. However when ECG signals and noise overlap the same frequency spectrum, random processes cannot be described using linear models (Chua et al. 2010). Nonlinear methods have some limitations including: (i) these techniques do not follow both principles of superposition and homogeneity, (ii) they are computationally rigorous, (iii) linear shift invariance is not valid for a nonlinear system, and (iv) reflection and symmetry properties are not followed.

6 Future work

The amplitude peaks provide information concerning cardiac characteristics. However, minute alterations in peak deflection morphology and position cannot be identified clearly by visual inspection. In signal processing terms, the time domain features are not able to provide discriminative information for normal versus abnormal beats (Lih et al. 2020; Clifford et al. 2006). Herein, we have listed different non-linear features used by different authors for testing (Kannathal et al. 2006). The linear method provides satisfactory classification accuracy. Hence, for future work, testing should be done on noise-free data using nonlinear methods, as they can be implemented even under noisy conditions (Ansari et al. 2017; Acharya et al. 2017a, b, c, d, e). Additionally, more data should be added to test our recommended model to improve performance.

6.1 ECG in mobile healthcare and telecare

Apart from modifications done for ECG algorithmic analysis, there is additional scope for mobile healthcare technology, wherein ECG signals are recorded with mobile devices (Constantinescu and Jinman 2012). Patients are connected to Holter-like devices for ECG signal recording. Any emergency in patient health can be readily reported to the critical care unit. Adeli and Sankari (2011) invented a cost-effective mobile medical device for the purpose of real-time monitoring of cardiac health. A future challenge is to develop an efficient remote monitoring device to rapidly provide information about patient health and suitable treatments, using a decision support system (DSS) (Tamura 2012). There is a requirement for DSS in cardiac telecare, and a necessity for an ECG monitoring unit via wearable electrodes. This can help to capture data via a web-based unit, and can be employed for instantaneous screening of ECG signals by doctors. The system should be cost-effective, low in power consumption, and should be affordable to the patient (Venkatesan et al. 2018; Pandey et al. 2012) Fig. 7 presents the ECG recognition system in a clinical setting.

Fig. 7
figure 7

Proposed ECG recognition system in a clinical setting

In this system, mobile devices and sensors are connected wirelessly through cloud computing devices. Without processing ECG data, signals are sent to mobile devices from different sensing devices. As the data is not processed and is generated from different devices with continuous monitoring, it will require more space. To store large volumes of data, cloud storage space is utilized. The unknown data is sent to the developed model at the cloud for diagnosis. The diagnostic results can be sent to healthcare centers and physicians (Acharya et al. 2018a, b).

The advent of cloud computing has enabled host software packs to analyze ECG data, including Software-as-a-Service (SaaS), Platform-as-a-Service (PaaS), and Infrastructure-as-a-Service (IaaS). The SaaS layer is used for organizing custom-designed analysis of current and historic ECG data. The PaaS layers supervise the execution of software into three major units: (i) Workflow Engine, (ii) Container scaling manager, and (iii) Aneka. The IaaS layers are self-service models for monitoring, accessing, and managing remote datacenter infrastructures, such as compute, storage, and networking services (LeCun et al. 2015).

Deep learning is the part of machine learning methods in which hidden layers of neurons are used to construct inherent features. For big datasets, deep learning methods can be used as it performs better than machine classification and classic analysis methods. The word “deep” is obtained from various hidden layers in an artificial neural network (ANN) (Fukushima and Miyake 1982). The ANN structure comprises the input, hidden, and output layers. Connection link is used to connect every nerve cell of one layer to every nerve cell of another layer. These computational nerve cells are composed of dendrites (input), axon (output), nucleus (activation function), node (soma), and synapses (weights) (Goodfellow et al. 2016). Here, the input signals are dendrites, weight models are synapses, and the activation function is the nucleus in the biological neuron. The ANN structure adversely affects the performance of classification due to susceptibility to translation and shift deviation (LeCun and Bengio 1995). To overcome this drawback, a Convolutional Neural Network (CNN) can be used. The CNN ensures shift invariance and translation. CNN is a feedforward network which consists of pooling, convolution, and fully connected layers (Hinton and Salakhutdinov 2006; Lih et al. 2020; Murat et al. 2020).

Other deep learning techniques include the autoencoder, Recurrent Neural Network (RNN), and deep generative models, which are used to evaluate physiological signals. For the autoencoder, the input dimension is the same as the output, and it is an unsupervised neural network. The autoencoder has three layers: input, output, and hidden. For the autoencoder, encoding and decoding are two important steps (Hinton et al. 2006; Hopfield 1987).

The Deep Generative model comprises the Restricted Boltzmann Machine (RBM) and Deep Belief Network (DBN). The RBM consists of two layers: (i) visible and (ii) hidden layers. The DBN is the probabilistic model with various hidden layers. In RBM, the first layer is trained to reconstruct the input (Hinton et al. 2006).

The RNN is a recurrent network which follows a recursive approach. The Long Short-Term Memory (LSTM) network, which has the capability to learn long term dependencies, is a common type of RNN. The LSTM consists of three gates to incorporate memory block; they are: input, output, and forget gate. These gates assist in adding and removal of information from the network, based on cell state (Hopfield 1987).

For future work, we intend to employ a deep learning model and use a larger dataset to train our model. We hope to integrate this developed model to the cloud system such that information about patient health from the acquired ECG signals could be sent to the clinicians to aid them in their diagnostic and treatment decisions.

7 Conclusion

MI is an irreversible damage to the myocardium due to coronary artery blockage. The expansion of MI can be rapid if it is not treated expediently. If left untreated, further damage can occur to myocardial function and the structure of left ventricle. The recommended approach to distinguish between normal and MI signals involves a non-invasive tool. In this work, nonlinear parameters were extracted from lead II ECG signals. The performance of each classifier was measured using accuracy, sensitivity, and specificity. The highest accuracy of 97.96% was achieved with the SVM classifier using nonlinear features with a ten-fold cross-validation strategy. We have also proposed unique recurrence and HOS plots for normal and MI ECG classes to identify the two classes qualitatively. The proposed system outperforms other recently developed techniques, and has the potential to be readily deployed in hospitals and clinics, even in remote areas. CAD systems provide rapid and accurate results, and can be implemented for real-time diagnosis of MI.