A simple realtime algorithm for automatic external defibrillator

A simple realtime algorithm for automatic external defibrillator

Biomedical Signal Processing and Control 51 (2019) 277–284 Contents lists available at ScienceDirect Biomedical Signal Processing and Control journa...

2MB Sizes 1 Downloads 202 Views

Biomedical Signal Processing and Control 51 (2019) 277–284

Contents lists available at ScienceDirect

Biomedical Signal Processing and Control journal homepage: www.elsevier.com/locate/bspc

A simple realtime algorithm for automatic external defibrillator Somaye Abedini Khadar, Narges Tabatabaey-Mashadi, Gheshlaghi Mojtaba Daliri ∗ Dept. of Electrical Engineering, Imam Reza International University, Mashhad, Iran

a r t i c l e

i n f o

Article history: Received 27 February 2018 Received in revised form 24 January 2019 Accepted 26 February 2019 Keywords: Automatic external defibrillators Ventricular fibrillation Ventricular tachycardia Adaptive threshold Support vector machine Hierarchical Real time Python Embedded system Raspberry pi

a b s t r a c t Automatic External Defibrillator is a device that automatically diagnoses the heart rhythm which requires an electric shock. In general the signal processing unit of an AED aims to immediately identify the occurrence of ventricular fibrillation and ventricular tachycardia in a patient’s electrocardiograph signal. In this research, a quick and high-precision method is presented that identifies peaks and heart rate arrhythmias of the cardiac signals that do not include QRS complex. Initially, asystole and presence of extra noise are recognized in a preprocessing step. Furthermore, two support vector machine classifiers have been used in a hierarchical way to separate Ventricular Fibrillation, Ventricular Tachycardia and normal signals. As a result, a real-time algorithm is developed that matches American Heart Association standard with an accuracy of 98.6%. Finally the Raspberry pi board is used as a hardware platform to embed the proposed algorithm into an AED system. The results show that the implemented system can detect shock-required rhythms in 0.56 s; and the method may be used in an actual signal processing unit of an AED. © 2019 Elsevier Ltd. All rights reserved.

1. Introduction Any disturbance in the circulatory and/or respiratory system, will endanger the human’s life. Heart, as the main member of the body’s circulatory system, is responsible for pumping blood throughout the body, as well as on the pathway of the lung circulation system. The blood purification into the lungs is also controlled by the respiratory system. Inappropriate functioning or the occurrence of any disorder in this system can cause death. Maintaining the lives of patients with heart diseases is highly dependent on time. With the growing rate of cardiac diseases and their high death rates, paying attention to special cares for people who are at risk of heart attacks is very important. Cardiovascular disease remains the leading cause of death in the world [1]; they are responsible for 10% of the total death as reported in the beginning of the twenties century while it is predicted to be 35–65% by the year 2025 [2]. The Ventricular Fibrillation (VF) and Ventricular Tachycardia (VT) are dangerous arrhythmia that require prompt treatment. Therefore, cardiovascular and respiratory equipment is of particular importance given that they are involved in urgent emergency rescue activities. Electrical cardioversion or an electrical shock is

∗ Corresponding author. E-mail addresses: [email protected] (S.A. Khadar), [email protected] (N. Tabatabaey-Mashadi), [email protected] (G. Mojtaba Daliri). https://doi.org/10.1016/j.bspc.2019.02.030 1746-8094/© 2019 Elsevier Ltd. All rights reserved.

the first treatment to these disorganized heart activities [3]. Since heart attacks usually occur suddenly and the patient may be in any distance from health care centers, an automated defibrillator system that can monitor and properly react to abnormal heart signals, can be a solution to save several lives. Considering the importance of the time of treatment, it is of desire to develop systems that help patients in applying the right treatment at the right time based on their heart abnormal signal. Therefore, the goal is to produce a portable physiological signal monitoring system that can analyze the patient’s vital signal in real time and apply appropriate prompt treatment if necessary. Automatic External Defibrillator (AED) research investigate an embedded system that can promptly and accurately respond to patient needs. In general, the AED signal processor unit is intended to design an algorithm that can accurately detect ventricular fibrillation by receiving a real time ECG signal and subsequently issuing a command signal to apply the shock. Under the American Heart Association (AHA) regulations, heart rhythms are classified into two general groups. The first group refers to rhythms that require shock; this category includes ventricular arrhythmias, such as VF and also VT [4]. Second group covers arrhythmias that do not require shock; i.e. normal sinus rhythm, tachycardia, supraventricular, bradycardia, atrial fibrillation, and fistula and asystole. This research develops an embedded system that can distinguish shock require signals (i.e. VT and VF) from normal ECGs with a standard

278

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284

precision in a practical time. Additionally the presented work can distinguish VT from VF for advanced cardiovascular care. 2. Challenging issues in designing an AED In a cardiac arrhythmia monitoring system, the proper functioning of an algorithm is crucial. Ignorance of an arrhythmia, false negative (missing the diagnosis) will foreclose the possibility of patient’s recovery and its false positive (incorrect diagnosis to apply the shock) may result in the aberrant deviation of therapeutic steps [5]. Inappropriate shocks or failure to shock will have an irrecoverable effect on the patient’s life. Consequently, sensitivity and specificity are both important factors in an AED apparatus. According to American Heart Association (AHA), the sensitivity and specificity threshold regulations in AEDs should be greater than 90% and 95% respectively [4]. The golden time for shock delivery is within 5 min (in hospitals less than 3 min)1 ; survival rates decrease approximately 7%–10% with every minute of defibrillation delay; survival rate of 90% achieved when defibrillation delivered in the first minute. According to this AHA report, the AED rhythm analysis requires 5–15 seconds depending on the brand. It is worth mentioning that in an AED system the main time should be reserved for the AED shock unit which requires charging and desirably when the signal processing time in AED analyzing unit decreases, the safety margin for resuscitation can increase. Consequently, main challenges in AEDs are the overall processing and applying time in addition to the precise sensitivity as well as specificity of arrhythmia recognition. 3. Background Chebyshev polynomial was one of the first tools that obtained the features of the electrocardiography signals [6]. Later, Hermitian polynomials were used for signal analysis [7].Then, ROC chart was considered for the separation of cardiac signals [8,9]. One of the methods for extracting features from such signals is based on the wavelet transform. By making use of this transform, another group of features were presented that generally responded better than previous approaches [10–12]. Additionally various classification methods were used for categorization of such heart rhythm. For example Levenberg-Mrquardt algorithm [13] and feed forward neural networks [14]. The published article by Padmavati et al. recently published a paper in the field of cardiac signals which compared SVM against neural network methods in recognizing the atrial fibrillation [15]; the research proved that SVM with Gaussian Kernel produces better results. Considering feature extraction, ECG wavelet features obtained good classification results when used with artificial neural networks [16,17]. Building upon these findings, an efficient algorithm is presented in [18]. Literature studies show that various algorithms have been used for detecting the shock-required heart signals. The TCI2 algorithm, introduced in [20], first finds the maximum value of the ECG signal in one-second intervals and then sets the threshold value to 20% of this maximum value. Using the threshold value obtained, a string of zero and one is produced. In this way, if the signal is greater than the threshold, one pulse and otherwise zero will be produced. Then the time interval between two consecutive passages of the heart signal is calculated from the threshold value. This is done for a few consecutive periods, and from these intervals the average value of TCI is calculated and signals are sorted according to this value.

The paper presented in reference [18] used Discrete Cosine Transform and Daubechies wavelet 17 (db17). The extraction of features in this level requires many calculations. Considering classification, the research used four SVMs with parallel Gaussian kernel. In spite of the long processing time because of the mass calculations, still the algorithm did not return acceptable results; Sensitivity = 91.7%, Specificity = 87.3%, Accuracy = 89.1%. In a more recent research Alonso-Atienza et al. compared four heart signal processing methods applied to 4-second patches to detect ventricular fibrillation [19]. These methods include: TCI, ACF3 , spectrum4 , VF filter5 . According to their results, TCI obtained the best sensitivity with 93% and ACF obtained the worst sensitivity rate by 38%. A recent attempt presented in [21] emphasizes that out-ofhospital cardiac arrest signals may differ from Holter records in public ECG databases and justifies the point by reporting 2% higher recognition rates in public databases over out-of-hospital data. Moreover Figuera et al. [21] claim that the complexity of classifying shock required arrhythmia in out-of-hospital data is double, since it requires twice features compared to other databases when optimal features were mined amongst 30 features from 4 s ECG signals. While their final few number of features is noticeable, their overall signal acquisition and process is more complicated and time-consuming compared to our work. 4. Database The benchmark dataset used in this study is the MIT-BIH Arrhythmia Database [22]. This database contains 48 half-hour Arrhythmia excerpts of two-channel ECG ambulatory records from 47 subjects studied between 1975 and 1979. Twenty-three of these records were randomly chosen from a set of 4000 24-hour recordings collected from inpatients (about 60%) and outpatients (about 40%); the rest were selected from the same set but to include less common clinically significant arrhythmias. The data sampling rate is 360 Hz. The database contain 3 arrhythmia categories as NSRDB,6 VFDB7 and CUDB.8 Consequently the length of each ECG input signal to the classifier is considered 3 s. This results a database with 8449 data (3 s signals). In details, the database contains 2882 V F signals, 1085 V T signals and 4482 normal signal. For a general round number, this study used 7000 signals out of 8449 which contained 3800 V T and VF signals. 5. Identification of extra noise and asystole Preprocessing the signal before feature extraction can result in less complex diagnoses; furthermore, valuable features may be extracted from the preprocessed signal which leads to the increase of the system efficiency and better diagnosis [23]. To do so, it is necessary to eliminate or at least reduce the existing noise in ECG. Noise sources in an ECG signal are caused by the environmental effects, the processes related to the data registration including muscles’ noise and/or deviation of the baseline and fluctuations of city power. The preprocessing filter function used in this study is presented in [24]. The steps are as follows: i Eliminate the average value of the ECG signal to remove DC

3 4 1

Circulation. 2000;102(suppl I):I-60 –I-76.© 2000 American Heart Association, Part 4: The Automated External Defibrillator, Key Link in the Chain of Survival, at: Inc.http://circ.ahajournals.org/content/102/suppl 1/I-60#sec-1. 2 Threshold Crossing Intervals.

5 6 7 8

Apoaks in the autocorrelation function. Signal spectrum shaps. Signal content outside the meanfrequency. Normal sinus rate data base. Ventricular fibrillation data base. Creighton University Ventricular Tachycardia Database.

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284

279

Fig. 1. An Initial signal (top) compared to the output signal resulted from applying the mentioned filter set.

ii Apply a 5-degree intermediate filter to remove high-frequency noise (city noise) iii Apply a high pass filter with a cut-off frequency of 1 Hz to eliminate the noise caused by the background deviation. iv Apply a low pass gas balloon filter with a 30 Hz disconnect frequency in order to remove higher frequency noise Fig. 1 shows an example of a heart signal before and after applying this set of filters Given that ECG registration by Gacek was used in this article [7], the signal amplitude of the heart is between 0.05 to 0.1 V in normal mode and much less than that in asystole mode. Therefore after de-noising, if the maximum average of amplitudes was less than 0.05 V the algorithm recognize an asystole. For identification of extra noise, slew rate is used. If the maximum of slew rate absolute value becomes more than 400, the system announces the existence of extra noise [25]. Validate Slewrate is calculated from formula (1): Slewrate =

ecgt − ecgt−1 xt − xt−1

(1)

Where ecg t is the amount of signal at the moment xt and ecg t−1 is the amount of signal at a moment xt−1 . 6. Identification of R peaks Heart rate variability (HR) is an important factor in diagnosing heart diseases. Normal heart rate is due to an increase and decrease cycle in blood pressure which is appeared to form a voltage peak with a relatively flat area in ECG. Generally to analyze ECG signals and to determine the heartbeat, a peak detector is essential. Distinct peaks are disappeared in the ventricular fibrillation and instead an unorganized noisy signal appears in ECG. The peak detector interprets this noisy signal as a series of fast beats with random distances. Therefore, an adaptive filter has been employed to identify the extreme points on the basis of maximum amounts crossing a threshold. It should be noted that, a window with 150 samples (0.4 s) is used for peak detection. Since the normal heart signal frequency is between 60–100 Hertz, maximums usually occur in each 0.5 s and so a window with 150 samples was chosen. However the number of peaks in the fibrillation and tachycardia are more than this, therefore, after finding the first peak, the algorithm looks for the next

peak within a range starting at 0.4×"the recent detected peak value". Subsequently, each peak is obtained by considering a 0.4 coefficient of the previous peak. Using this method, almost all peaks of a signal are detected. One of the advantages of this algorithm is its adaptive threshold which provides the possibility to follow the fast changes in the signal and hardly looses R peaks. Figs. 2–4 respectively represent an example of the R peaks detected in normal, VT and VF signals. Several complex signals were randomly examined and since they full filled objectives of this research, it can be concluded that this R-peak identification method is reliable enough to match the other steps of this study. HR = Absolute(60/R-R)

(2)

7. Feature extraction To recognize the type of signal, first the signal features should be extracted. The characteristics should create patterns that can differentiate between various types of signals. In intelligent classification systems, not presenting the suitable input to the network, can cause an inappropriate response and/or an increase in learning time and computational complexity. Usually two set of feature domains are considered for a temporal signal, i.e. frequency and time. Based on that, various set of features are extracted and later tested in this research. 7.1. Time domain features In general, doctors diagnose based on the time domain information and morphology extracted from electrocardiography signal. Therefore, such features, all extracted from a short time period of the cardiac signal, are considered in this study as well. The total number of time domain features are 12 and are listed in Table1. 7.2. Wavelet features Because of the unstable nature of a cardiac signal [27], timeFrequency domain is a richer domain for feature representation. Given that the wavelet coefficients can describe the time-frequency domain features of signals, wavelet is a good choice for extracting the characteristic of ECG signals. The objective of wavelet analysis is separating the structures with different time scales. Selection of a suitable wavelet and a right scale is very crucial for this signal

280

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284

Fig. 2. Maximum and minimum points in the normal signal automatically detected using the proposed method.

Fig. 3. Maximum and minimum points in the VT signal automatically detected using the proposed method.

Fig. 4. Maximum and minimum points in the VF signal automatically detected using the proposed method. By determining the time distance between two consecutive peaks, the heart rate is available from [26].

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284 Table 1 list of time features.

281

Table 2 Results of the 3-fold Cross Validation of the proposed algorithm.

No.

Features

Description

Parameter

Fold3

Fold2

Fold1

Average

1 2 3 4 5 6 7 8 9 10 11 12

MAX(PEAK) MIN(PEAK) MEAN(MIN) MEAN(MAX) SIZE(MAX) SIZE(MIN) VAR(MAX) VAR(MIN) VAR(INDMAXIM) VAR(INDMINIM) HR R-R

Maximum value of the Peaks Minimum value of the of Peaks Average of Minimums Average of Maximums Number of Maximums Number of Minimums Variance of Maximums Variance of Minimums Variance of Maximum Positions in the Signal Variance of Minimum Positions in the Signal Heart Rate Distance between two R peaks

Error Sensitivity Specificity

0.01796 95.3% 99.6%

0.0942 84.6% 88%

0.0102 94% 99.6%

0.040786 91.3% 95.73%

analysis. The lower levels of wavelet analysis (D1,D2) contain the information of low frequency with the range zero to 50 Hz. Ignoring the coefficients at these scales causes loss of a set of information. Similarly, the coefficients of middle levels of wavelet analysis (D3,D4) include the overlapping information [28]. Among the different wavelet bases, Haar wavelet set is the shortest and simplest which is appropriate for short time signal analysis [29]. Therefore, Haar wavelet was selected as mother wavelet in this study [29,30] whit scale four. Instead of using the total wavelet coefficients as the feature vector that would increase the computational complexity, some other representative features of the wavelet coefficients are used. Consequently the feature vector contains variance, average, standard deviation, mode, median, maximum and minimum of the wavelet transform coefficients at each level. Detail wavelet coefficients D1 to D4 and the general coefficients A4 are used in the feature vector. Hence, the number of wavelet features are added up to 35. 7.3. All features By combining the two set of describe features, a new input feature vector is produced that contains all features. This feature vector has 47 elements formed as shown in Eq. (3). Featurevector = [TimedomainfeaturesWaveletfeatures]

(3)

8. Classification method Following appropriate ECG feature extraction, it is necessary to use a suitable classifier to identify the intended arrhythmias. SVM classifiers not only increase the amount of system’s identification precision, but also does not have the parametric complexities of the other classifiers including the number of middle layers, speed of convergence and etc. as in neural networks. To increase the precision of classification, and to first categorized the shock needed signals, two SVM classifiers are used hierarchically. These two separate 3 classes of data; first classifier separates normal signals from abnormal. Then if signal is not normal, it gets down to the second SVM that identifies the ventricular fibrillation from tachycardia. SVM had shown good results in ECG classification [31,32], therefore similar to such research this study also used an RBF kernel for its SVMs. Considering artificial intelligent networks for classification, usually about 60%–70% of the data are used as the training set. The remaining unseen data are used as the test set to compare trainednetwork response against the actual data classes (their tags). Additionally, it is important that the specified ratio of the data categories be commensurate with volume of the randomly selected data in the test and train sets; this will avoid biased learning of the system. To use SVM for real data, at first the amount of all feature elements are normalized to the range of [-1, 1]; hence largeness or

Fig. 5. The classifier scheme proposed to diagnose arrhythmias.

smallness of a feature value does not influence the learning of the machine.9 Due to the importance of testing the system for various data, and in order to prevent reporting biased learning results, the 3-fold Cross Validation method is used. Finally, 4500 signals considered for training the first SVM classifier and 2500 signals for its testing phase. The second SVM, that classifies VT from VF signals, was trained with 2800 signals and further tested on 1000 signals in each cross validation fold. The results are shown in Table 2. The averaged 3-fold recognition results fully conform to AHA standards. Fig. 5 illustrates how the classifier works. 9. Reduction of feature dimension & optimized feature selection The high dimension of the input space can complicate the identification issue and reduce the recognition speed. Therefore the authors applied the following procedure to find the minimum number of optimum features. In this method the number of features are decreased by one in several steps (at most eliminating none and at least retaining one feature element); then in each iteration Gaussian Genetic Algorithm (GA) is applied as an optimization method to find the best features among the 47 that matches the number of feature elements considered in that iteration. The fitness function of the GA is related to the error of the SVM classifier on the training data that should be minimized. Subsequently, the solution is recognized by the highest recognition rate with minimum number of features when comparing optimum classification rates amongst various steps. The best recognition rate obtained using 25 elements, having 0.2% error for the first SVM; and 42 feature elements having 3.3% error for the second SVM. This low error rate indicates a good selection of features especially in the first SVM that recognizes shock-required signals from others. The final selected features are presented in Table 3. Thus comparing Table 3 to Table 2, four timedomain features are ignored though scrutinizing the nature of those features it can be concluded that they are somehow embedded in

9 Using Support Vector Machines Effectively: https://neerajkumar.org/writings/ svm/.

282

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284

Table 3 Final selected features.

Table 6 Algorithm’s performance using different set of features.

Number

Feature

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Maximum value of the Peaks Minimum value of the Peaks Average of Maximums Average of Minimums Number of Maximums Variance of Maximums Variance of Minimum Positions in the Signal Heart Rate Mean(D4) Mean(D2) Mean(D1) Max(A4) Max(D4) Max(D2) Max(D1) Min(A4) Min(D4) Min(D1) PSTD(A4) PSTD(D4) PSTD(D3) PSTD(D2) PSTD(D1) Range(A4) Range(D4)

Table 4 Algorithm’s performance without using GA. Parameter

First SVM

Second SVM

Training Error Training Time (in Seconds) Train Sensitivity Train Specificity Test Error Test Sensitivity Test Specificity

0.0310 1.13 99.2% 94.6% 0.038 98.6% 93.9%

0.0520 0.63 93.6% 95.35% 0.06 92.9% 94.47%

Parameter

First SVM

Second SVM

Training Error Training Time (in Seconds) Train Sensitivity Train Specificity Test Error Test Sensitivity Test Specificity

0.002 1.086 99.6% 100% 0.003 96.0% 98.55%

0.033 0.7 93.99% 98.5% 0.039 92.79% 98.1%

Table 5 Algorithm’s performance when using GA.

the features of the time-frequency domain and they were probably redundant. 10. Results Various comparisons have been conducted to study the developed algorithm’s performance. Table 4 shows the classification and time results obtained using all 47 features; Table 5 represents results of classifying the features that are considered most effective by GA method. Comparing the results of these two tables it is concluded that although the GA does not consume much time, but it significantly reduces the error rates by choosing the right features. In another comparison, various set of features (i.e. wavelet, time, and both feature sets) were given to the classifiers and the results are reported in Table 6. This table presents how each set of features impact the recognition. Obviously Table 6 results reports that the wavelet features alone outperforms other sets both in terms of time and error rate. This

Parameter

Time-domain Features

Wavelet Features

All Features

Training Error Training Time (in Seconds) Testing Error Testing Time (in Seconds)

0.079 1.74 0.09 0.3

0.006 1.72 0.008 0.31

0.032 2.45 0.04 0.45

Fig. 6. Raspberry Pi 2 B [33].

choice of features obtained 0.6% error which is ideal in distinguishing ventricular fibrillation from tachycardia signals. Thus, the precision rate of algorithm is reported 99.2%. The testing time for the classification of a new input signal is only 0.45 s which clearly indicates the real-time capability of the algorithm. 11. Hardware implementation of the proposed algorithm To implement the algorithm into an AED processor, there is a need for a hardware platform that supports future developments of the device in the same strength and reliability. Therefore the Raspberry Pi B which is the most popular computer board is used to implement the algorithm. This board is a small computer that has processing and memory capabilities far beyond the microcontroller boards. The Pi Raspberry family are slates that use a high-power ARM processor core (700 MHz) with an optimized system. Having an operating system, this board has the ability to run a wide range of software. This important feature allows the user to take advantage of the size of a small computer with acceptable processing power for Lightweight apps. Fig. 6 represents the hardware platform that is used in this research. Raspberry Pi has two types of programming languages that Pi supports by default. These two languages are Scratch and Peyton. Other than defaults, languages like Shell script, C, Java, PHP and BASIC may also be used for programming in Pi. Scratch programming is very similar to the Lego game, and there’s no need to write a program line. Python is an interpreter language in which line-by-line commands are read and executed, with high-level commands and data structures, made for proper programming [3]. Python is a free, open, and extensible programming language. Python-written codes can be added to other sources of this language code; and libraries and codes written in other programming languages can be used along Python codes. Having a variety of data types and Python dynamics reduces the amount of coding and saves development time compared to languages like C ++, C, and even Java. So in this project, the Python 3.4 programming language is used to implement the algorithm and to communicate with the hardware. In in addition to the usual Numpy and Scipy libraries, the Sklearn and Pywavelet libraries are used to implement the SVM algorithm and to extract wavelet transform coefficients. The predict function is used to test data considering trained SVMs and the

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284

283

Fig. 7. output of the Raspberry Pi applying the proposed algorithm on several sample signals.

dwt function is used to perform wavelet transform. Output results on several sample signals are shown in Fig. 7. As it is interpreted from Fig. 7, the training phase is also run on the board; note that if an AED is only used to detect needs for electric shocks inputting an ECG signal of a patient, then there is no need for the training phase to be implemented into AED board considering the computational cost. In other words, the training may be done using another computer and the trained system then would be transferred to the AED board. However this capability of training the AED on its own board indicates the system future development which may be updated and further trained on more specific real data matching the users. 12. Conclusion The simple practical algorithm presented in this research identified VF and VT from three-second ECG signals which shows improvement in the duration time of input signal (by one second) and complex process presented in [21]. The advantage of the presented algorithm here is its simple adaptive method for peak detection, asystole and noise identification. The algorithm fulfills AHA standard. Accuracy, simplicity and real-time applicability were major considerations in the development of the algorithm. As a result it is concluded that the wavelet features contain the most effective features of the ECG signals for defibrillators. Realtime process capability suggests the application of this algorithm for a commercial AED healthcare device. The ability of this study to classify VF from VT advances the method over presented algorithm in [21]. Another remarkable attempt of this research is its hardware implementation. Most of the past projects only considered the signal processing software algorithm neglecting the possibility of implementation into an AED. Meanwhile the few research on data filtration processes that granted the implementation stage, still used a computer or a simple microcontroller that did not have the ability to extend and update the hardware. In other words, unlike the presented research, previous hardware implementations

used boards that are specifically designed for specific applications. In addition, hard-core projects often focused on well-known past processes while this research developed its own algorithm. The Raspberry Pi boards give the expansion capability of the hardware in future resulting a robust hardware responding in a short time. One of the important issues in determining the suitability of the algorithm is the time it takes to execute the algorithm. By reducing the processing time and eliminating the training stage (which was run in MATLAB), the trained SVM classifier weights were extracted and transferred to the Raspberry Pi hardware. The actual AED device only requires to apply the test phase of classification based on the trained weights. Thus, by ignoring the training phase, the timing performance of the implemented system was as a real AED device. The response time of today’s AED systems is usually more than 10 s and often lasts from 12 to 19.5 s [4]. Testing time for an unseen signal measured on the hardware slightly depends on the board’s version. In the implementation presented in this research the Raspberry Pi version B was used which satisfied the regulations. Time required to detect the signal is about 0.56 s. Considering the input data time-slots which are three seconds, it is concluded that the execution time of the algorithm outperforms current commercial systems.

References [1] Bernard Gersh, The Epidemic of Cardiovascular Disease in the Developing World: Global Implications, 2012, A606-A606. [2] H. Sharifi, Nurcing tutorial articles: Heart and cardiovascular risk factors and their prevention [in Persian],URL, 2019 www.cardiacnursing.ir/Docs/article RiskFactor.html. [3] Michael Eifling, Mehdi Razavi, Ali Massumi, The evaluation and management of electrical storm, Tex. Heart Inst. J. 38.2 (2011) 111–121. [4] Richard E. Kerber, Lance B. Becker, Joseph D. Bourland, Richard O. Cummins, Alfred P. Hallstrom, Mary B. Michos, Graham Nichol, et al., Automatic external defibrillators for public access defibrillation: recommendations for specifying and reporting arrhythmia analysis algorithm performance, incorporating new waveforms, and enhancing safety: a statement for health professionals from the American Heart Association Task Force on Automatic External

284

[5]

[6]

[7]

[8]

[9]

[10]

[11]

[12]

[13] [14]

[15]

[16]

[17]

[18]

[19]

S.A. Khadar et al. / Biomedical Signal Processing and Control 51 (2019) 277–284 Defibrillation, Subcommittee on AED Safety and Efficacy, Circulation 95 (6) (1997) 1677–1682. K. Shojaei, R. Amyrftahy, F. capper, Rytmy¬Hay Identification And Diagnosis Of Acute Atrial-Ventricular Pursuant To Section-full ECG, Based On Standard Database MIT / BIH, Faculty of Electrical Engineering Islamic Azad University of Majlesi, 2009. L.G. Herrera-Bendezu, B.G. Denys, Feature identification of ECG waveforms via orthonormal functions, in: Computers in Cardiology 1990, Proceedings, 1990, pp. 641–644, September. M. Lagerholm, C. Peterson, G. Braccini, L. Edenbrandt, L. Sornmo, Clustering ECG complexes using Hermite functions and self-organizing maps, IEEE Trans. Biomed. Eng. 47 (7) (2000) 838–848. A. Amann, R. Tratnig, K. Unterkofler, A new ventricular fibrillation detection algorithm for automated external defibrillators, Comput. Cardiol. (2005) 559–562, 2005, September. ˜ F. Alonso-Atienza, J.L. Rojo-Álvarez, A. Rosado-Munoz, J. Vinagre, A. García-Alberola, G. Camps-Valls, Feature selection using support vector machines and bootstrap methods for ventricular fibrillation detection, Expert Syst. Appl. 39 (2) (2012) 1956–1967. D. Cvetkovic, E.D. Übeyli, I. Cosic, Wavelet transform feature extraction from human PPG, ECG, and EEG signal responses to ELF PEMF exposures: a pilot study, Digit. Signal Process. 18 (5) (2008) 861–874. K.I. Minami, H. Nakajima, T. Toyoshima, Real-time discrimination of ventricular tachyarrhythmia with Fourier-transform neural network, IEEE Trans. Biomed. Eng. 46 (2) (1999) 179–185. O.T. Inan, L. Giovangrandi, G.T. Kovacs, Robust neural-network-based classification of premature ventricular contractions using wavelet transform and timing interval features, IEEE Trans. Biomed. Eng. 53 (12) (2006) 2507–2515. E.D. Übeyli, Combining recurrent neural networks with eigenvector methods for classification of ECG beats, Digit. Signal Process. 19 (2) (2009) 320–329. A.De Gaetano, S. Panunzi, F. Rinaldi, A. Risi, M. Sciandrone, A patient adaptable ECG beat classifier based on neural networks, Appl. Math. Comput. 213 (1) (2009) 243–249. K. Padmavathi, K.S. Ramakrishna, Classification of ECG signal during atrial fibrillation using autoregressive modeling, Procedia Comput. Sci. 46 (2015) 53–59. P. De Chazal, R.B. Reilly, B.G. Celler, Using wavelet coefficients for the classification of the electrocardiogram. In engineering in medicine and biology society, 2000, Proceedings of the 22nd Annual International Conference of the IEEE 1 (2000) 64–67, IEEE. Z. Dokur, T. Olmez, E. Yazgan, Comparison of discrete wavelet and Fourier transforms for ECG beat classification, Electron. Lett. 35 (18) (1999) 1502–1504. Ali Bahadorinia, Ali Dolatabadi, Ahmad Hajipour, A hybridized artificial neural network and optimization algorithms for the diagnosis of cardiac arrhythmias, Adv. Comput. Sci. 3 (4) (2014) 51–58. Felipe Alonso-Atienza, et al., Feature selection using support vector machines and bootstrap methods for ventricular fibrillation detection, Expert Syst. Appl. 39.2 (2012) 1956–1967.

¨ [20] Nitish V. Thakor, Y.-S. Zhu, K.-Y. Pan, Ventricular tachycardia and fibrillation detection by a sequential hypothesis testing algorithm, IEEE Trans. Biomed. Eng. 37.9 (1990) 837–843. [21] Carlos Figuera, Unai Irusta, Eduardo Morgado, Elisabete Aramendi, Unai Ayala, Lars Wik, Jo Kramer-Johansen, Trygve Eftestøl, Felipe Alonso-Atienza, Machine learning techniques for the detection of shockable rhythms in automated external defibrillators, PLoS One 11 (7) (2016), e0159654. [22] A. Gacek, W. Pedrycz, A genetic segmentation of ECG signals, IEEE Trans. Biomed. Eng. 50 (10) (2013) 1203–1208. [23] A.L. Goldberger, L.A.N. Amaral, L. Glass, J.M. Hausdorff, Ivanov PCh, R.G. Mark, J.E. Mietus, G.B. Moody, C.-K. Peng, H.E. Stanley, PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals, Circulation 101 (23) (2000) e215–e220 [Circulation Electronic Pages (June 13) http://circ.ahajournals.org/content/101/23/e215. full]. [24] A. Amann, R. Tratnig, K. Unterkofler, Reliability of old and new ventricular fibrillation detection algorithms for automated external defibrillators, Biomed. Eng. Online 4 (1) (2005) 60. [25] Erfan Naghsh, Mohammadreza Yazdchi, Detecting ventricular fibrillation in real time by the used of image forming based on signals and time delayed, Majlesi J. Multimedia Processing 2 (4) (2013). [26] I. Jekova, V. Krasteva, Real time detection of ventricular fibrillation and tachycardia, Physiol. Meas. 25 (5) (2019) 1167–2004. [27] Yu Hen Hu, Surekha Palreddy, Willis J. Tompkins, A patient-adaptable ECG beat classifier using a mixture of experts approach, IEEE Trans. Biomed. Eng. 44 (9) (1997) 891–900. [28] P.R. Chitrapu, D.J. Waldo, Time-Frequency analysis and linear prediction of cardiac late potentials In Time-Frequency and Time-Scale Analysis, in: Proceedings of the IEEE-SP International Symposium, 1992, pp. 227–230. [29] S.Z. Mahmoodabadi, A. Ahmadian, M.D. Abolhasani, M. Eslami, J.H. Bidgoli, ECG feature extraction based on multiresolution wavelet transform, in: IEEE Engineering in Medicine and Biology 27th Annual Conference, 2005, pp. 3902–3905. [30] S.M. Szilagyi, Z. Benyo, L. Szilagyi, L. David, Adaptive wavelet-transform-based ECG waveforms detection,” engineering in medicine and biology society, Proceedings of the 25th Annual International Conference of the IEEE 3 (2003) 2412–2415, 2003, September. [31] A. Kandaswamy, C.S. Kumar, R.P. Ramanathan, S. Jayaraman, N. Malmurugan, Neural classification of lung sounds using wavelet coefficients, Comput. Biol. Med. 34 (6) (2004) 523–553. [32] Karthik Ravichandran, David Chiasson, Kunle Oyedele, Classification of Electrocardiogram Anomalies, avialable at, 2013 http://cs229.stanford.edu/ projects2013.html. [33] Y. Alwan, Z. Cvetkovic, M. Curtis, Classification of human ventricular arrhythmia in high dimensional representation spaces, arXiv preprint arXiv 1312 (5354) (2013).