Numerical Estimation of Ejection Fraction from 12-lead ECG

,


Introduction
Ejection fraction (EF) is a valuable measurement for assessing the heart's function and its muscle health.EF shows the percentage of blood volume that is pumped out of the ventricles with each contraction and reveals such diverse myocardial diseases as ischemia, congenital heart diseases, conduction disorders, infectious diseases, and granulomatous diseases.The cardiac cycle consists of two phases during each heartbeat: ventricular contraction, called systole, and its relaxation phase, called diastole.The amount of blood in the heart at the end of systole is called end-systolic volume (ESV), and the blood volume at the end of diastole is end-diastolic volume (EDV).EF percent (%) can be determined by using the following equation: EF (%)=(EDV-ESV)/EDV*100 (1) Normal range of this volumetric fraction is 50-75%.Lower EF leads to heart muscle damage and systolic congestive heart failure, and higher values may indicate a heart condition like hypertrophic cardiomyopathy.
Echocardiography (echo), radionuclide ventriculography, cardiovascular magnetic resonance (CMR), cardiac catheterization, and computerized tomography (CT) scanning of the heart are five methods commonly employed for EF estimation.Among these methods, echocardiography is non-invasive and mostly used because of its short-time and bedside properties, along with its ability to create two-and three-dimensional images, which provide useful information about shape, size, and other volumetric information of the heart.However, these methods have some weak points caused by the geometric assumption during the operation, which is substituted with a data slice for the entire ventricle in m-mode echo types in order to estimate the 3-D information from a limited set of 2-Ddata.This, in turn, requires precision to determine the borderline of ventricles to ensure accurate cavity detection.Thus, echo cardiographic images have been repeatedly reported as misleading in diagnosing patients with aortic regurgitation [1], dilated and remodeled ventricles [2], and wallmotion abnormalities [3].
Radionuclide ventriculography is a useful nuclear cardiac imaging technique.It employs SPECT or PET for measuring the EF radionuclide angiography and gated myocardial perfusion imaging.It requires common planar imaging and anterior and posterior oblique projection of left and right ventricle separation, and is prone to background removal errors and less accuracy in calculating EF.
Cardiovascular magnetic resonance estimates the EF factor by employing manual, semi-automated, or automated methods of MRI [4].It is often calculated using the Simpson disk summation method, which treats the ventricles as a stack of disks.This method's biggest limitation is its prolate ellipse assumption of ventricle volume, which does not properly assess any ventricles [5].
The computed tomography technique, like cardiovascular magnetic resonance, is a Simpson-based method.However, CT exposes the patient to ionizing radiation and requires iodinated contrast material.This method also results in poor-quality images in patients with cardiac arrhythmias or ectopic beats [6].
The heart consists of two types of cells.The cardiomyocyte cell type constitutes the ventricles and atria, and the cardiac pacemaker cell type creates electrical impulses to control the heart's rhythm of contraction and beating.The electrical activities caused by these cells depolarize and repolarize the heart's muscular activity.During the depolarization phase, electrical cells generate an impulse to separate ions such as sodium, potassium, and calcium, which in turn causes electrical charging on both sides of the membrane and systolic contraction of the heart's muscle fiber.In the repolarization phase, those ions return to their regular states.This relaxation phase of the heart muscles is diastolic [7].
Such bioelectrical activity within these cells causes a current in tissues around the cells called volume current, which can make a difference in readings between the electrodes attached to the body.By attaching these electrodes to the torso, the electrical potential difference generated by the heart's tissues as a function of time is called ECG.In a normal ECG signal, six peaks are labeled P, Q, R, S, T, and U.The P peak results from depolarization of the atria.The P-R interval is the time between depolarization of the atria and the ventricles.The QRS complex demonstrates depolarization or contraction, and the T wave displays the repolarization or relaxation of the ventricles.The U wave usually results from a rest potential [8].
The shape and amplitude of these ECG segments make up a typical measurement of the heart's functional work.Any distortion in the heart's mechanical work leads to changes in amplitude and direction of the ECG's peaks [9].
The mechanical and electrical model of the heart, which incorporates the mechanical actions and changes in electrical activity of heart cells by summing up dipoles of bioelectrical activity of those cells during heart repolarization and depolarization, shows that subtle alteration in surface ECG can lead to ventricular fibrillation [10][11][12][13][14][15][16].
There were also various works on mechanical and electrical model of heart that they reported connectivity between heart's volume and electrical activities [17,18].Further developments indicated linear relationship between electrical systole, mechanical systole and also the length of ECG cycles [19].
In this paper, regarding the relationships between the electrical activities from the surface encompassing the volume conductor [20][21][22][23][24] (with the heart at its center) and the ventricles' contraction and relaxation in systolic and diastolic phases, we propose an ECG-based EF estimation method.In doing so, we use volumetric information fed into the 12-lead ECG.This is a standard ECG recording method [25] that spreads out equally on the body surface and measures the heart's electrical activity in three orthogonal directions: right and left, superior and inferior, and anterior and posterior (Figure 1).Such spatial information of the heart's electrical activity is obtained by assuming that the heart is located at the center of an infinite, homogeneous volume conductor [26].
The surfaces under these 12-lead ECG signals in systolic and diastolic phases were estimated using numerical integration like the trapezoidal method, Simpson's rule, and Boole's [27] rule formulas.
We also used the eigenvectors information of the data under ECG cycles to estimate the area and volume of the data.Those values for the QRS segment of the ECG, representing ventricle contraction, and the S-T interval, demonstrating ventricle relaxation, were then used, respectively, as EDV and ESV values in the EF equation calculation.

Data Set
The proposed methodology was applied on ECG recorded signals at Shahid Faghihi Hospital, a subsidiary of Shiraz University of Medical Sciences, using a 12-lead system with 25mm/s and 10 mm/mv.The subjects included in this database were found to have had no significant arrhythmias.They consisted of 21 men ages 32 to 56, and 29 women ages25 to 57.For each subject, the EDV, ESV, and EF factor were estimated by a cardiologist using the patient's echocardiogram.

Methodology
In this section, the proposed method for estimating EF using the ECG segments is introduced.Figure 2 shows the overall procedure step by step, and the following subsections describe each step in detail.

Data Preprocessing
The data were derived from 12-lead surface ECG by Cardiax v3.35 with10mm/mV and 25mm/sand 235 estimated sampling rate.As the proposed procedure was based on estimating the area and volume of the ECG graph, the signal needed to be adequately cleaned from the baseline wandering noise.Therefore, first the two cascaded low-pass filters were applied to the signal to remove the baseline wandering noise.To more precisely remove this noise in each cardiac cycle, the P-R segment (Figure 3) was found and set as the base axis of the signal for baseline wandering removal, which was done by shifting the cardiac cycle toward the P-R segment.To find the P-R segment, first heart rate of ECG cycles was computed from the signal using a simple frequency estimation method based on spectral peak location estimation [28].The R peaks of the signal were found by using peak detection maximum search [29], and then we searched a time interval between 0.15 second and 0.8second before R peaks to find a steady line indicating the P-R segment.Then the ECG baseline signal was corrected according to the P-R segment amplitude.

Detecting QRS and T Wave
The QRS complex is a segment of ECG, which includes three deflections of normal ECG baseline due to simultaneous depolarization of the right and left ventricles.Its normal duration varies between 0.06 and 0.10 second [30] (Figure 3).Since our method was based on the area computation procedure, and the shape of the wave is substantial in this method's results, it was very important that the movement from the baseline for both QRS and T wave pointed accurately.Therefore, we applied a procedure that worked for each ECG cycle based on deviation from the steady line before each wave.
As can be seen in Figure 3, R is the highest peak in a heartbeat cycle, while the T wave is a wide one coming after a relatively long (about 80 ms), steady ECG signal occurring after QRS.To find the QRS segment, first a peak detection maximum search [29] was applied to find R peaks.Having detected these peaks, we could then find the P-R segment of the signal, which has the same amplitude as the steady line before the P-R interval with some tolerances.To find that segment, we tried to detect a time interval with minimum 0.05 second duration and amplitude near the samples following the first deviation of ECG baseline.After finding P-R segments, the first deviation was spotted in this line and recorded as the starting point of the QRS complex segment.The end of the S wave was derived by locating the S-T interval, which was the first sample, by returning to baseline at minimum 0.7 second duration.Depolarization Simpson's rule [31] to estimate the integrals of function f is another variation of the Newton-Cotes formula, which uses the quadratic polynomials.This rule is derived from integrating the third-order Lagrange interpolating polynomial [23] into the function at three equally spaced points.Using the value's function of the three points (a, b, c), its formula is as follows: Boole's rule [2] is also a Newton-Cotes formula, which approximates an integral using the values of ƒ at five equally spaced points (a, b, c, d, and e) as follows: Estimating Ejection Fraction EF factor, as mentioned in the introductory section, could be estimated using Equation 1.In this paper, the region under the QRS segment in the ECG signal was used to represent EDV, and the region under the T wave as that of ESV.The areas of those regions were calculated using trapezoidal, Simpson's and Boole's integration rules, and also eigenvector information employed in estimating the volume and area.The results were then used to compute the EF factor.As the area of the region under the QRS segment used as EDV and those ones for T wave employed as ESV in Equation 1.

Results
Baseline wandering and other noises were removed from the ECG data for all 50 patients using a smoothing algorithm (Figure 4).After that, by employing the previously mentioned peak locating method, the mean frequencies were approximated for each derived signal, which were almost 235 Hz.Next, the signal was filtered with a cascaded second-order, zero-phase, low-pass filter with normalized frequency range between 1 and 30.Almost 10 to 15 first straight line samples of the signal were assigned as the baseline samples, R peaks were located  of the ventricles (the lower chambers of the heart) after a contraction or heartbeat is responsible for the T wave (Figure 3).The T-wave segments were then detected in the same way as the last deviation from the steady line after the QRS segment was found.Then, the samples were searched to determine which ones returned to that line in order to spot the end of the T-wave segment.Figure 4 shows the overall algorithm to detect the QRS and T wave of ECG.

Surface under ECG Planes
The spatial information of heart electrical activity, which was provided with the 12-lead ECG method in three orthogonal planes of the heart, was used to estimate the surface under QRS and ST segments, which indicated in Figure 3 as QRS interval and S-T segment respectively (Figure 3).As we know from 12-lead ECG, each lead's data represents a particular orientation in space: Bipolar limb leads (frontal plane) include I, II and II leads; augmented unipolar limb leads (frontal plane) consist of aVR, aVL, and aVF leads; and Unipolar (+) chest leads (horizontal plane) include leads V1 to V6 [25].
Looking at Figure 1, by choosing appropriate leads for each of the sagittal, frontal and transverse planes, the volume information of the ECG signal can be estimated [12][13][14][15][16][17][18][19][20][21][22][23][24][25][26][27][28][29].In order to consider such information in estimating the EF factor [10], which is based on changing the electrical activity due to the change in volume of the heart in the contraction/relaxation step from which the vector cardiogram is derived [13], 12-lead ECG was transformed to three orthogonal axes (XYZ) using I, aVF, and -V2 leads [14].Then, QRS and ST segment area information can be computed by employing numerical integral rules to calculate the EF factor from those leads.Ischemia, injury and fraction heart diseases are three major risk factors for heart failure.Ischemia occurs when the heart's muscles  by applying a peak detection algorithm based on maximum searching.Time duration of the P-R segment was almost 0.06 second, and the P-R interval lasted from 0.12 to 0.20 second .Thus, we sought a window with 40 samples, before the detected R peaks, for a steady line with the length of 10-15 samples and with amplitude near baseline samples to locate the P-R segment in the data.
Afterward, the amplitude of baseline samples was updated to these new samples, and the first downward deviation toward this line was found.This sample was spotted as the beginning of the QRS wave.To locate the end of QRS, the length of searching windows was changed to 25 samples (0.1 second) to find a line with at least five samples and with amplitude near the baseline amplitude.The first deflection of the S-T segment served as the starting point of the T wave.
After finding those points, the searching window was set to a 200-samples (0.8 second) length, and the first five samples of data with amplitude close to the baseline within the window was signaled as the T wave's end. Figure 6 shows atypical example of found QRS and T-wave segments.The procedure was repeated for each cardiac cycle and channel of data, and then the multi-segment trapezoidal method, Simpson's and Boole's rules were used to estimate the area under QRS and T-wave segments.
For each patient, the absolute value of the area segments, which was obtained by the numerical integration method under QRS as EDV and Twave as the ESV factor, was averaged over all the cardiac and 12lead ECG signals.Then, the EF factor was calculated from these values according to Equation 1.The methods were applied on four groups of leads: V1, V2, V3 and V4 (anterior plane), leads III, II and aVF (inferior plane), leads I and AVL plus V5 and V6 (left lateral plane), and leads V2, I, and aVF as XYZ directions.
Table 1 represents the average of computed areas under each QRS and Twave using Trapezoidal, Simpson's, Boole's methods, and the values of EF factors, which were reported by cardiologists from echocardiograms for all five group leads.To study the trend of estimated values for each of the EF factors for patients, the results were depicted in Figure 7a-7f for each group.
The scatter plot of resulted EF for all ECG leads using Boole's methods and real EF values represented at Figure 8.By setting the marginal error depicted with green color, for normal EF between 50 and 75, the estimated EF values, which lied out of this margin, marked.As we can see, there were 6 subjects outer the normal margin.

Results Evaluation
In order to evaluate the results the similarity factor for obtained EFs and the reported values for all five groups and three area estimation methods were evaluated by calculating their Wilcoxon Signed-Ranks test [32], Canberra distance [21], Paired samples t-test, and Root Mean Square Error (RMSE).The Wilcoxon test is a nonparametric test of the null hypothesis to evaluate the difference between two populations with independent samples when the distribution of data is unknown or not certainly normal.In which its null hypothesis "the medians of the two samples are identical" is accepted by when w-value is lower than critical value of W from Wilcoxon table.As we know from statistical literature, the median of data is the one, which do not, affected by outlier and skewed data so by considering this test we can find fair view from the goodness of our work.We applied two-tailed Wilcoxon test with significant level .01 for 50 subjects.T-test for two independent means the magnitude of data.In order to find a threshold for RMSE values regarding the normal range for EF value, which is between 50 and 75, we find a maximum distance between real EF value and 50 and 75 of all subjects.We employed the maximum distance vector for calculating a threshold for acceptable RMSE value and 13.31is obtained, so for the EF's of leads upper this value the resulted would be rejected.
Canberra distance is one of the distance measuring tools for paired samples.It is obtained by absolute difference between the variables of the two groups, which divided by the sum of the absolute variable values prior to summing.This method is directly related to absolute of difference between samples, so we use it to consider the overall distance between estimated and real EF values.The threshold for Canberra distance regarding maximum distance vector is 4.96 in which for the calculated distance bigger than this value the result is not acceptable.
All these validation methods applied on mentioned groups of leads and the results of which were reported in Table 2.

Discussion and Conclusion
In this paper, we proposed a numerical methodology of estimating the area under the QRS and T-wave segments of 12-lead ECG in normal subjects to calculate the EF formula by setting the areas under QRS to represent EDV values and the ones under the Twave to indicate ESV values.In order to estimate those areas, we employed three of the usual numerical integrating methods: Boole's, Simpson's, and trapezoidal.The methods were applied on five groups of signal leads: V1, V2, V3 and V4 for the anterior plane, leads III, II and aVF for the inferior plane, leads I and AVL plus V5 and V6 for the left lateral plane.
Each of these groups of leads represents the heart from a different point of view.They show the pathological effects of ischemia-injuryfraction as part of the ECG.In addition, we employed the signals of leads V2, I, and aVF as XYZ orthogonal directions to investigate the relation between the electrical information and EF fraction values at various ECG planes.To analyze the correlation between the resulting values and the values reported by cardiologists, their RMSE, PPMC, and t-test, and Wilcoxon values were derived.
Using those three previously mentioned area-estimation methods, there is a significantly close proximity between the ratio of the area under QRS wave and T-wave segments and EF values (Figure 7A-7F).Moreover, between those ECG groups, the electrical activity in XYZ direction using leads II, aVF, and V2 showed more similarity with the EF value compared to the others (Figure 7E).The results also indicated that the mean of all ECG leads provides appropriate EF value (Figure 7A); however, from Tables 1 and 2 there is no significant difference between the outcomes for those different area-estimation methods.
From Table 2 the null hypothesis of Wilcoxon Signed-Ranks has not been rejected except for leads group 5, which means that there is significant dependency between median values for both estimated and true EF values.In addition to the Wilcoxon, which showed the difference between data regarding median value, T-test results compare the samples considering their mean values.The null hypothesis of mean equality of the sample groups has been rejected under represented significant level for group leads 2, 3, and 4, which means that the distribution of group leads 1 and 5 are very similar.RMSE results represent the magnitude of differences.Considering the RMSE in Table 2, the Boole's rule yielded relatively better results in comparison to the Simpson and Trapezoidal methods.In addition, using and mentioned threshold 13.31 the reported EF for group leads 4 is a statistical measurement to compare the mean of two populations of data in the case of two samples that are independent.The null hypothesis is mean equality of the population of difference scores across the two measurements.In this paper, we use this test to examine the mean difference for real EF value and resulted ones.
The RMSE methods calculated the sample standard deviation of data point by summing up the difference between them.This measurement provides good estimation of accuracy of results just by considering  is not acceptable which means there were not lied in acceptable normal range of EF. the Canberra values of observed and expected results in Table 2 showed for all groups except 4 is significantly lower than obtained threshold like for reported for RMSE.
Considering these evaluation methods the proposed procedure to estimate EF is not suitable for group leads 4 and 5, however regarding Wilcoxon and t-test measurements the results for group lead 5 could follow the trend and distribution of real data on the other hand by incorporating all leads of ECG signals best resulted could be achieved.
The fourth row of Table 2 depicted the P-values of EF that are respectively which is almost P<001 for mentioned integration methods.Therefore, the results confirmed the hypothesis of significant relation between EF and the ratio of heart power in systolic and diastolic phases.

Figure 1 :
Figure 1: Projections of the lead vectors of the 12-lead ECG system in three orthogonal planes assuming that the volume conductor is spherical homogeneous and the cardiac source centrally located.

Figure 2 :
Figure 2: The overall signal processing methodology to EF estimation.

Figure 4 :
Figure 4: The overall signal processing methodology to EF estimation.

Figure 5 :
Figure 5: The lead directional of heart, the leads, which represent the change of ischemia/injury/infraction, and the it's related ECG segment representative.

Figure 6 :
Figure 6: Typical example of 12-lead ECG and theirs detected QRS (: red segments) and T-wave (: green segments) using the algorithm.

Figure 7 :
Figure 7: The mean EF values estimation of all ECG leads for 50 subjects by employing trapezoidal, Simpson, and Boole's method and true value reported by cardiologist.A: all leads B:leads V1-V4, C:II,III,aVF, D:I,aVL,V5-V6, E:II,aVF,V2, F: The Boole's results of all groups.

Figure 8 :
Figure 8: The mean EF values estimation of all ECG leads for 50 subjects by employing Boole's method and true value reported by cardiologist.