INTRODUCTION
The involuntary exchange of electrodes during electrocardiogram (ECG) testing is one of the most frequent technical errors in primary care health centers[1], producing erroneous diagnoses in up to 24 % of cases[2][3], some of which are severe medical conditions, such as acute ST-segment elevation myocardial infarction (STEMI), with an incidence of 11 %[3]. These exchanges occur more frequently with real-time biomedical devices, such as those intended for use in primary care health centers in remote areas using telemedicine, with reports of reversals in up to 50 % of cases caused mainly by medical personnel not specialized in cardiology[2].
Early electrode exchange detection algorithms used alterations in the P- QRS -T wave morphology of the electrocardiogram signal[4], signal reconstruction, and correlation[5][6] with low accuracy for specific detections. The following methods are based on the use of Machine Learning: Decision Trees[4][7][8][9][10], Artificial Neural Networks[6][11][12], Support Vector Machines[7][9][13], and amplitude thresholding[14], techniques of variable accuracy in terms of sensitivity and specificity, which, although they can reach high values, have the drawback of requiring high processing power and a high waiting time[15][16], which complicates their implementation in real-time embedded devices. Subsequently, Jekova[17] developed a method based on Pearson correlation coefficients distributed in an ordered manner in correlation matrices, achieving Se= 87 % - 97.8 % and Sp = 91 %, an improvement in the accuracy and processing of electrode detection algorithms.
The current research team intends to implement a method of automatic detection of electrode exchange in biomedical devices in real time, as part of the Think Health project, based on an edge computing model. This project, in turn, is part of the Biomedical Engineering at the “Universidad Nacional de San Agustín de Arequipa”[18][19][20][21][22] [23]. However, the current detection method is computationally expensive[24].
Some methods that correlate or quantify the morphological similarity between biological signals are the Bray- Curtis similarity (mBC) and signed correlation coefficient (SCC), with fewer operations during processing compared with the traditional Pearson correlation[25]. The study of [26] represented ECG precordial signals as a displacement of precordial V1, so it can be deduced that the precordial signs differ little. With this in mind, it is possible to compare this difference using error parameters. These error estimators, such as the mean squared error (MSE) or root mean square difference (PRD), have been widely used as performance parameters to determine filter quality[27], validate preprocessing techniques[28], and evaluators of ECG signal acquisition[29]; however, they may have potential in this detection algorithm.
This paper proposes a new precordial electrode exchange detection method based on error estimators (MSE and PRD) and improves the algorithm based on correlation coefficients using signal correlation methods with lower computational complexity (Bray Curtis, Pearson Correlation, Modified Pearson Correlation, and Signed Correlation). This research determines the most suitable electrode exchange detection algorithm for implementation in embedded biomedical systems, such as the Think Health project.
Databases
The databases used in this article are PTB (Physikalisch Technische Bundesanstalt)[30][31], with 549 conventional 12-lead and 3-lead Frank records from 290 subjects; the extended version of PTB: PTB XL, with 21837 clinical ECG records belonging to 18885 patients[32]; Georgia 12-Lead ECG Challenge Database (G12EC) from Emory University, Atlanta,[33] with 10344 records representing a demographic group from the southeastern United States; and the database created by Chapman University and Shaoxing People's Hospital (CUSPH),[34] with records from 10646 patients; whose main characteristics are summarized in Table 1.
Table 1 Databases used.
| Dataset | Records | Duration | Leads | Sampling |
|---|---|---|---|---|
| PTB | 549 | 32-120 s | I, II, II, aVR, aVL, aVF, V1-V6 | 1000 Hz |
| PTB-XL | 21837 | 10s | I, II, II, aVR, aVL, aVF, V1-V6 | 500 Hz |
| G12EC | 10344 | 10s | I, II, II, aVR, aVL, aVF, V1-V6 | 500 Hz |
| CUSPH | 10 646 | 10s | I, II, II, aVR, aVL, aVF, V1-V6 | 500 Hz |
These databases were chosen because they are the only databases with 12-lead digital signals. The pathological signals present in some recordings make them ideal for testing detection algorithms, whereas databases such as PTB and PTB-XL have unmodified signals with different types of noise and artifacts and a realistic distribution of data quality in clinical practice and in the face of changes in environmental conditions or various imperfections in the input data[32].
MATERIALS AND METHODS
Precordial electrode exchange detection
The precordial electrode detection algorithm is based on the correlation between nearby precordial leads with a more significant similarity between the signals of adjacent electrodes[17]. The coefficients in a correlation matrix give the maximum correlation (with value 1) on the diagonal for a signal with itself and a descending numerical sequence of the other correlation coefficients, as shown in Figure 1.

Figure 1 Correlation coefficient matrix. Blue squares: Coefficients of maximum value (1) in signals correlated with themselves (am,m). Light blue squares: The coefficients are ordered in descending order. Gray boxes: Comparison of adjacent correlation coefficients.
This article proposes new matrix based on the calculation of error coefficients by measuring the difference between adjacent leads. This may allow the creation of a matrix of error coefficients with characteristics opposite to those of the correlation matrix presented in Figure 1, having on the diagonal the comparison of a signal with itself, with difference 0, and an ascending numerical sequence as the other precordial leads are compared, as shown in Figure 2.

Figure 2 Matrix based on error estimators. Blue boxes: Coefficients of minimum value (0), error of signal with itself. Light blue boxes: Coefficients ordered in ascending order. Gray boxes: Comparison of adjacent correlation coefficients.
To find the minimum number of coefficients needed to detect a specific electrode exchange, Frequent Exchange Coordinates (FECs) were established. These FECs can detect specific electrode exchanges without using the full correlation matrix or error matrix, thus minimizing the number of correlation or error estimation coefficients used during testing.
The FECs are determined through the change in the comparisons of a standard correlation matrix or error matrix and can be represented in a 6x5 matrix, as shown in Figure 3; this matrix is obtained from the comparisons between the coefficients in Figures 1 and 2. In Figure 3, r(XY) represents the comparison (higher or lower) of the correlation or error coefficients between V(X, Y) and V(X, Y+1). The coordinates found are presented in the results with a value of 1 if there is a reverse of the comparison between the pairs of coefficients and 0 if there is no change in contrast in most cases.
Electrode exchange detection algorithm
Based on the behavior of the precordial signals described above, the algorithm summarized in Figure 4.
The algorithm begins by preprocessing the signal in its input records using a 1Hz - 30Hz FIR filter. The FIR filter designed in MATLAB uses the syntax b = fir1(n,[Wn1 Wn2]). This method uses a least squares approximation to calculate the filter coefficients and then smooths the signal using a window. This filter creates a row vector b containing the Hamming window filter coefficients of order n. Then, vector [Wn1 Wn2] contains two elements containing the pass-band edge frequencies, which, in turn, respond to the Nyquist frequency, half the sampling frequency.
The choice of the 1-30 Hz band was based on the work done by Jekova[17], who obtained good performance when preprocessing the signal for precordial signal correlation algorithms. In addition, preliminary tests showed that the noise in the signals and artifacts present in the evaluated databases evaluated were attenuated with this range of filters.
Likewise, another future objective of this work is to implement this algorithm in embedded systems for which the finite impulse digital filter (FIR) is an ideal candidate in this type of systems, presenting implementation advantages over other types of digital filters, such as the IIR infinite impulse response filter for real-time ECG signal processing applications, as described by Bui and Byun[35].
For the evaluation of this specific algorithm, 2 s of the 10 available samples in each record were taken for the PTB-XL, G12EC, and CUSPH databases, which have a sampling frequency of 500 Hz, and only 1 s in the PTB database with a sampling frequency of 1000 Hz, with the objective of having an equal number of samples to evaluate in each record; likewise, the full wave signal around the R peak was considered for this analysis. In the future, the application of this algorithm in an embedded system could take action at the time of starting to use the 12-lead ECG or continuously, remembering that this will only be an emergency system in case of a possible error in the placement of electrodes, and the filters applied here will not influence the signal recorded for diagnosis by health personnel.
Then, the verification of the frequent exchange coordinates (FECs) was performed in 2 approaches: correlation coefficients and error parameters, to determine the type of comparison with the best results.
In this test, the effectiveness of using the difference between the precordial lead signals was determined using error parameters, such as the mean square error (MSE) presented in Equation 1 and, the percent root mean square error (PRD), presented, in Equation 2:
Mean Squared Error (MSE)
Percent Root Mean Square Difference (PRD)
These methods are compared to the conventional Pearson correlation presented in Equation 3:
To improve the signal correlation method in terms of computational cost, a modified Pearson correlation method, (Equation 4) was used. Gembris et al. reported that this formula reduces the redundancy produced by pairwise correlations[36]. At the same time, the performance of other signal similarity assessment methods will be tested, such as the Bray-Curtis similarity coefficient (Equation 5) and the signed correlation coefficient (Equation 6) mentioned by Lian, Muessig, and Lang, because of their low computational requirements and sensitivity to amplitude difference[25]:
Modified Pearson Correlation
Bray-Curtis similarity coefficient (mBC)
Correlation coefficient with sign (SCC)
To further reduce the computational complexity and based on the symmetric property of the Pearson Correlation coefficient (corr(x,y) = corr(y,x)[36], reducing the number of coefficients from N^2=36 elements to N(N-1)/2=15, which corresponds to the upper triangle above the main diagonal part of the correlation matrix (Figure 5).
The above-mentioned calculations for verifying frequent exchange coordinates were performed by simulating electrode exchanges in a training group. Finally, these FECs were tested in test groups (The determination of the training and test groups will be mentioned later).
Electrode exchange simulations
Simulations of precordial electrode exchange were performed to determine the frequent exchange points and to verify the sensitivity and specificity of the algorithm for detecting these simulated changes.
The simulation was performed by changing the data matrices of each lead in Matlab R2020a program. The electrode exchange simulation was performed assuming that the database records had no previous electrode exchanges.
Exchanges can be classified into hops; when the exchange is between 2 adjacent electrodes, it is a one-hop exchange; if the distance between the exchanged electrodes is two, it is a two-hop exchange, and for a distance of 3, it is a 3 hop exchange. In these cases, 12 simulated exchange shapes were obtained.
The precordial electrode exchange simulation results are presented in Table 2.
Validation of the proposed method in databases
The validation of the algorithms using each error and correlation method was performed using the block diagram presented in Figure 6.
Validation was performed using the k-fold cross-validation technique (Figure 7); the records of each database were randomly separated into eight groups of an equal number of data. In the first cycle, group 1 took the role of the test set, and the rest of the training set. Specific exchange points for 1, 2, and 3 hop electrode exchanges will be determined throughout training and tested in the test group. In the next cycle, group 2 is the test set, and the other records are the training set. The k-fold cross-validation method assumes that the test set iterates with the 8 groups created.
As mentioned above, to validate the method with K fold cross validation, 8 groups are separated from the total number of records in each database and placed in the Records column of Table 3, this table in turn presents the size of each group and the dynamic training and test sets. As can be seen, the number of records was less than the total number of records in the database because the total group size evaluated was required to be a multiple of k = 8.
Table 3 Group sizes for k-fold cross validation.
| Dataset | Records | k | Group size | Training set | Test set |
|---|---|---|---|---|---|
| PTB | 549 | 8 | 68 | 476 | 68 |
| PTB-XL | 21832 | 8 | 2729 | 19103 | 2729 |
| G12EC | 10344 | 8 | 1293 | 9051 | 1293 |
| CUSPH | 10640 | 8 | 1330 | 9310 | 1330 |
| PTB | 549 | 8 | 68 | 476 | 68 |
This process is performed iteratively to obtain the mean values of Sensitivity (Equation 7) and Specificity (Equation 8) for each database. These performance metrics were obtained from the confusion matrix shown in Figure 8.
Where:
TP is the number of positive exchanges correctly classified as positive by the model.
TN is the number of negative exchanges correctly classified as negative by the model.
FN is the number of positive exchanges incorrectly classified as negative.
FP is the number of negative exchanges incorrectly classified as positive.
where TP = true positive, TN = true negative, FN = false negative, and FP = false positive.
The FECs obtained during training in a more extensive database (PTB XL) were used to ensure that coordinates were valid in any database. Finally, these FECs from the more extensive database were tested on the other databases.
Determination of processing time
Additional tests were performed to determine processing time for each method (Table 4). The cputime function available in matlab was used in sets of N samples taken at random in each database (N=250, N=500, N=1000, N= 2000, N=3000, N=4000, N=5000). This function determines the time required by the central processing unit (CPU) to process program instructions. All formative and direct experiments were performed using Matlab R2020a software on a PC with a Windows 10 operating system, 2.4-GHz Intel Core i5 processor, and 4.096-GHz RAM.
RESULTS AND DISCUSSION
Sensitivities and specificity of the algorithm
The methodology described above was used to obtain the average sensitivity and specificity of each database. The Frequent Exchange Coordinates algorithm was tested using correlation (p, mp, mBC, SCC) and error parameters (MSE and PRD). The average Se and Sp values are listed in Table 5. As can be seen, on average, the correlation methods were slightly more accurate in diagnosing electrode exchanges, with the Pearson and modified Pearson correlations being more accurate.
Table 5 Average Se and Sp values of the algorithm with own FECs.
| Database | PTB | PTB XL | G12EC | CUSPH | Mean | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | Se (%) | Sp (%) | Se (%) | Sp (%) | Se (%) | Sp (%) | Se (%) | Sp (%) | Se (%) | Sp (%) |
| MSE | 96.29 % | 97.52 % | 99.96 % | 98.26 % | 98.23 % | 99.93 % | 99.96 % | 98.91 % | 98.61 % | 98.66 % |
| PRD | 96.26 % | 97.57 % | 99.95 % | 98.96 % | 94.62 % | 99.74 % | 93.89 % | 99.62 % | 96.18 % | 98.97 % |
| p | 99.52 % | 99.60 % | 98.99 % | 99.01 % | 98.93 % | 98.41 % | 99.29 % | 98.89 % | 99.18 % | 98.98 % |
| mp | 99.52 % | 96.72 % | 99.00 % | 98.96 % | 98.93 % | 98.37 % | 99.29 % | 98.88 % | 99.19 % | 98.23 % |
| mBC | 93.13 % | 95.94 % | 97.93 % | 99.99 % | 97.00 % | 97.49 % | 98.67 % | 99.98 % | 96.68 % | 98.35 % |
| SCC | 75.09 % | 96.76 % | 90.99 % | 94.81 % | 92.25 % | 96.29 % | 97.28 % | 96.81 % | 88.90 % | 96.17 % |
Table 6 shows the Frequent Exchange Coordinates (FEC) obtained from the training database of the more extensive database (PTB-XL). This table displays the highest percentage of exchange in the coordinates of the FEC columns (with exchange) and the percentage of exchange in coordinates that usually remain unchanged in the FEC (without exchange). For example, in the simulated exchange between V1 and V2, the coordinates r31 and r41 change in 99.23 % and 99.89 % of cases, respectively. For the same simulation, V1 and V2, the coordinates r42 and r53 were unchanged in 99.82 % and 99.94 % of the cases, respectively. Using the proposed algorithm, these FECs (r31 r41 r42 r53) can be coded as 1 if there is an exchange and 0 if there is no exchange. The proposed coding scheme is presented in Table 6.
Table 6 Average Se and Sp in the PTB-XL database.
| Swap | FEC (With exchange) | FEC (Without exchange) | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| N | Leads | Coord. | % | Coord. | % | Coord. | % | Coord. | % | Coord. | % |
| 1 | V1-V2 | r31 | 99.23 | r41 | 99.89 | - | - | r42 | 99.82 | r53 | 99.94 |
| 2 | V2-V3 | r42 | 99.7 | r52 | 99.47 | - | - | r41 | 99.94 | r53 | 99.98 |
| 3 | V3-V4 | r53 | 99.78 | r63 | 99.41 | - | - | r52 | 99.97 | r64 | 99.96 |
| 4 | V4-V5 | r34 | 99.43 | r64 | 99.63 | - | - | r35 | 99.99 | r23 | 99.99 |
| 5 | V5-V6 | r35 | 98.12 | r45 | 97.7 | - | - | r34 | 99.98 | - | - |
| 6 | V1-V3 | r41 | 99.73 | r42 | 98.89 | - | - | r53 | 99.98 | - | - |
| 7 | V2-V4 | r63 | 99.46 | r52 | 99.63 | - | - | r14 | 99.99 | r51 | 99.98 |
| 8 | V3-V5 | r64 | 99.41 | r63 | 99.34 | r35 | 98.57 | r12 | 99.99 | - | - |
| 9 | V4-V6 | r34 | 99.43 | r35 | 99.43 | - | - | r23 | 99.99 | - | - |
| 10 | V1-V4 | r51 | 99.92 | r12 | 99.73 | r53 | 99.73 | r31 | 99.99 | - | - |
| 11 | V2-V5 | r23 | 99.74 | r62 | 99.82 | r64 | 99.64 | r15 | 99.99 | r52 | 99.99 |
| 12 | V3-V6 | r25 | 99.6 | r64 | 99.44 | r23 | 98.94 | r12 | 99.99 | r63 | 99.99 |
As can be seen, it is only necessary to verify the code of the FEC specific to detect electrode exchange. That is, obtaining correlation or error coefficients to find the FECs and determine whether an exchange occurred at those points significantly minimizes computational cost. The frequent exchange coordinates listed in Table 7 were tested in the PTB, G12EC, and CUSPH databases.
Table 7 Frequent Exchange Coordinates codes for each hop.
| N | Swap | FEC | Code |
|---|---|---|---|
| 1 | V1-V2 | r31 r41 r42 r53 | 1100 |
| 2 | V2-V3 | r41 r42 r52 r53 | 110 |
| 3 | V3-V4 | r52 r53 r63 r64 | 110 |
| 4 | V4-V5 | r23 r34 r35 r64 | 101 |
| 5 | V5-V6 | r34 r35 r45 | 11 |
| 6 | V1-V3 | r41 r42 r53 | 110 |
| 7 | V2-V4 | r14 r51 r52 r63 | 11 |
| 8 | V3-V5 | r12 r35 r63 r64 | 111 |
| 9 | V4-V6 | r23 r34 r35 | 11 |
| 10 | V1-V4 | r12 r51 r53 r64 | 1110 |
| 11 | V2-V5 | r15 r23 r52 r62 r64 | 1011 |
| 12 | V3-V6 | r12 r23 r25 r63 r64 | 1101 |
The Sensitivities and Specificities of each exchange were then averaged and presented in Table 8.
Table 8 Average Se and Sp values in the test databases.
| Set | Training set | Test set 1 | Test set 2 | Test set 3 | Mean | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Database | PTB XL | PTB | G12EC | CUSPH | ||||||
| Method | Se(%) | Sp(%) | Se(%) | Sp(%) | Se(%) | Sp(%) | Se(%) | Sp(%) | Se(%) | Sp(%) |
| MSE | 99.96 % | 98.26 % | 97.22 % | 99.69 % | 99.67 % | 99.87 % | 99.77 % | 99.68 % | 99.16 % | 99.38 % |
| PRD | 99.95 % | 98.96 % | 93.23 % | 99.61 % | 94.45 % | 99.45 % | 93.89 % | 99.86 % | 95.38 % | 99.47 % |
| p | 98.99 % | 99.01 % | 99.11 % | 99.66 % | 97.96 % | 99.56 % | 97.68 % | 99.74 % | 98.44 % | 99.49 % |
| mp | 99.01 % | 98.96 % | 99.11 % | 99.66 % | 97.95 % | 99.56 % | 97.74 % | 99.74 % | 98.45 % | 99.48 % |
| mBC | 97.93 % | 99.99 % | 92.05 % | 99.45 % | 97.12 % | 99.94 % | 94.45 % | 99.86 % | 95.39 % | 99.81 % |
| SCC | 90.99 % | 94.81 % | 60.69 % | 98.78 % | 83.36 % | 98.76 % | 84.96 % | 99.01 % | 80.00 % | 97.84 % |
Sensitivity is excellent, with values above 95 % and specificity greater than 99 %. However, the correlation by SCC is somewhat lower.
Determination of algorithm processing time
Table 9 presents the average processing time of the frequent exchange coordinate algorithm for each method (MSE, PRD, p, mp, mp, mBC, SCC) on a set of N samples (N=250, N=500, N=1000, N=2000, N=3000, N=4000, N=5000) taken at random in each database. The processing time was determined using the CPU time function (cputime).
Table 9 Processing time for each method and test database.
| Database | N | TMSE(us) | TPRD(us) | Tp(us) | Tmp(us) | TmBC(us) | TSCC(us) |
|---|---|---|---|---|---|---|---|
| PTB | 250 | 0.12 | 0.14 | 0.24 | 0.22 | 0.25 | 56.76 |
| 500 | 66.44 | 85.74 | 145.95 | 160.53 | 79.67 | 65.56 | |
| 1000 | 77.08 | 106.84 | 177.22 | 250.47 | 107.03 | 84.06 | |
| 2000 | 108.11 | 167.86 | 264.23 | 436.56 | 169.69 | 122.7 | |
| 3000 | 161.65 | 241.82 | 331.53 | 653.49 | 250.25 | 171.18 | |
| 4000 | 191.82 | 305.48 | 401.93 | 838.4 | 316.09 | 212.12 | |
| 5000 | 226.93 | 371.71 | 480.14 | 1062.56 | 381.75 | 249.56 | |
| G12EC | 250 | 0.04 | 0.06 | 0.1 | 0.33 | 0.06 | 38.76 |
| 500 | 42.13 | 60.18 | 99.63 | 134.3 | 58.36 | 47.2 | |
| 1000 | 48.66 | 72.59 | 115.38 | 217.33 | 70.91 | 54.75 | |
| 2000 | 55.92 | 86.58 | 129.84 | 398.19 | 85.71 | 63.31 | |
| 3000 | 70.27 | 114.22 | 164.34 | 601.81 | 114.1 | 81.53 | |
| 4000 | 86.24 | 143.24 | 197.9 | 783.24 | 143.41 | 99.52 | |
| 5000 | 106.93 | 185.64 | 236.25 | 992.74 | 185.66 | 122.43 | |
| CUSPH | 250 | 0.02 | 0.03 | 0.05 | 0.1 | 0.03 | 64.3 |
| 500 | 45.16 | 62.54 | 101.91 | 139.75 | 63.01 | 49.61 | |
| 1000 | 58.73 | 89.92 | 131.59 | 225.5 | 88.66 | 66.73 | |
| 2000 | 88.77 | 145 | 200.39 | 400.96 | 147.04 | 103.26 | |
| 3000 | 139.08 | 233.47 | 280.31 | 656.81 | 245.93 | 153.69 | |
| 4000 | 175.75 | 297.91 | 355.53 | 852.62 | 314.32 | 194.85 | |
| 5000 | 221.48 | 379.4 | 444.28 | 1058.54 | 396 | 245.16 |
The MSE and SCC methods had the shortest processing times in all databases, with an average of 61.49us (MSE) and 68.51us (SCC) for N = 1000. In contrast, the Pearson and modified Pearson correlation methods had average processing times of 231.10 and 141.39 US for K = 1000. Comparing the MSE processing method with the Pearson evaluation method for all values of N, the average processing time with the MSE method represented 44.99 % of the processing time with the Pearson evaluation.
Discussion
The detection of electrode exchange using the error estimators presented an average accuracy of Se= 99.16 % and Sp=99.38 % for the MSE, compared to the correlation methods whose maximum was Se= 98.45 % and Sp=99.48 % = for mρ. This accuracy is comparable to the previous correlation method [17], with Se=. 93.8%-99.8% and Sp = 98.9 %, as well as methods based on Machine Learning: Decision Trees [4][8][9][10]: Se = 17.9 % - 99.3 % Sp= 86.6 % - 100 %, Neural Networks [6][11][12]: Se = 44.5 % - 99.9 % Sp= 99 %, SVM [9][13]: Se = 56.5 % - 93.7 % Sp = 86.6 % - 99.9 % and Amplitude Thresholds [14]: Se = 20 % - 90 % and Sp = 99.8 %.
Average processing times of 61.49µs for MSE (N=1000) and 89.78µs for PRD were obtained, thus achieving a reduction of up to 73.39 % compared with the conventional Pearson correlation method with 231.10µs [17]. These results allow us to deduce that this detection method can also be applied to the analysis of peripheral electrodes. Although the shortest processing times correspond to SCC and MSE, SCC is not highly accurate and is not recommended for use in this algorithm. On the other hand, MSE has a shorter processing time and adequate accuracy, with SE = 99.16 % and SP = 99.38 %, making it ideal for use in the Frequent Exchange Coordinate algorithm.
The use of coefficient reduction for pairwise comparisons performed by Gembris et al. [36] is validated and recommended, finding that only N(N-1)/2=15 correlation or error coefficients need to be obtained compared to the 36 coefficients described in the work of Jekova [17] to detect electrode inversions effectively. However, it method is not applicable when using the PRD error estimator because it excludes symmetric coefficients. In turn, the developed algorithms are effective for both standard and pathological or noisy signals; this is demonstrated when used in databases with these characteristics, such as G12EC, which has high accuracy values ranging from 94.45% to 99.67 % using the error estimators.
CONCLUSIONS
This article presents a novel method for automatically detecting precordial electrode exchange by replacing correlation coefficients with error estimators. This strategy significantly improves the algorithm execution time and dramatically reduces the amount of data processing, thereby reducing the computational cost while achieving test accuracy comparable to correlation-based algorithms. The experimental results demonstrated that the most efficient method in terms of execution time, memory, and accuracy was the MSE method, with an average processing time of 61.49µs for the MSE (N=1000), which is a reduction of 56. 51% compared to the conventional Pearson correlation method; in terms of accuracy, this method obtained Se= 99. 16% and Sp=99.38 comparable to high computational cost methods such as those based on Machine Learning previously mentioned and with results superior to correlation methods [17] with Se=. 93.8%-99.8% and Sp= 98.9%.
Algorithms based on correlation and error estimators, such as Bray-Curtis, modified Pearson, MSE, and PRD, are accurate methods for electrode exchange detection with high sensitivity and specificity. Among these, MSE has the shortest processing time, making it ideal for use in the Frequent Exchange Coordinates (FEC) algorithm. In turn, FEC coordinates increase the specificity of the algorithm, which is an advantage for algorithms intended for use in embedded systems because it reduces the percentage of false alarms. In other words, the use of the MSE-based FEC algorithm is an accurate and easy method to implement in any embedded system because it, is only necessary to find the coefficients of the codes presented in Table 7. However, it should be considered that it is possible that some diseases may alter electrical signals and therefore the correlation or difference between these signals. However, although this topic is beyond the scope of this research, it can be further explored in future work.
For all these reasons, MSE was determined to be the most suitable method for implementation in the Think Health Project biomedical kit.









nueva página del texto (beta)









