IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 1 Automated Detection of Atrial Fibrillation Based on Time-Frequency Analysis of Seismocardiograms Tero Hurnanen, Eero Lehtonen, Mojtaba Jafari Tadi, Tom Kuusela, Tuomas Kiviniemi, Antti Saraste, Tuija Vasankari, Juhani Airaksinen, Tero Koivisto, Mikko Pa¨nka¨a¨la¨ Abstract—In this paper, a novel method to detect atrial fibrilla- tion from a seismocardiogram (SCG) is presented. The proposed method is based on linear classification of the spectral entropy and a heart rate variability index computed from the SCG. The performance of the developed algorithm is demonstrated on data gathered from 13 patients in clinical setting. After motion artefact removal, in total 119 minutes of AFib data and 126 minutes of sinus rhythm data were considered for automated atrial fibrillation detection. No other arrhythmias were considered in this study. The proposed algorithm requires no direct heartbeat peak detection from the SCG data, which makes it tolerant against interpersonal variations in the SCG morphology, and noise. Furthermore, the proposed method relies solely on SCG and needs no complementary electrocardiography (ECG) to be functional. For the considered data, the detection method performs well even on relatively low quality SCG signals. Using a majority voting scheme which takes 5 randomly selected segments from a signal and classifies these segments using the proposed algorithm, we obtained an average true positive rate of 99.9% and an average true negative rate of 96.4% for detecting atrial fibrillation in leave-one-out cross-validation. The presented work facilitates adoption of MEMS-based heart monitoring devices for arrhythmia detection. Index Terms—Seismocardiography, MEMS, accelerometer, atrial fibrillation I. INTRODUCTION ATRIAL fibrillation (AFib) is a very common cardiacanomaly, present in approximately two percent of all people, i.e. in approximately 140 million people globally [1]. During AFib, the atria fail to contract in a coordinated manner, instead vibrating approximately 400 to 600 times per minute. In this case, contraction of the ventricles is irregular and excessively infrequent, for example 120 to 180 times per minute. AFib poses a major diagnostic challenge, as symptoms may be sporadic and absent during medical examinations. Identifying scarcely occurring silent AFib thus requires long- term continuous monitoring, e.g. months or years at a time [2]. Today, the heart’s activity can be investigated and measured by several methods, of which the most common are electrocar- diography (ECG), ultrasound cardiography (or echocardiogra- T. Hurnanen, E. Lehtonen, M. Jafari Tadi, T. Koivisto and M. Pa¨nka¨a¨la¨ are with Technology Research Center, University of Turku, Finland. M. Jafari Tadi is also with the Department of cardiology and cardiovascular medicine, Faculty of Medicine, University of Turku, Finland. T. Kuusela is with Department of Physics and Astronomy, University of Turku, Turku, Finland. T. Kiviniemi, A. Saraste, T. Vasankari and J. Airaksinen are with Heart Center, Turku University Hospital, Turku, Finland. This work was supported by Finnish funding agency for innovation (TEKES) under grant 40254/12, by the Academy of Finland under grant 277383, and by the University of Turku Graduate School. phy), phonocardiography and photoplethysmography. One al- ternative to the above mentioned techniques is mechanocardio- graphy (MCG), where the idea is to assess the condition of the heart [3] by measuring the mechanical activity (cardiac muscle motion) of the heart. MCG has multiple names in the literature, for example, ballistocardiography (BCG) and seismocardiog- raphy (SCG) [4]–[6]. Although ECG is currently the dominant technique, using microelectromechanical sensors (MEMS) for heart telemonitoring has recently become a popular research topic, e.g [7]–[9]. Miniaturized low-power, three-axis, high- resolution and low-noise accelerometers enable inexpensive access to mechanical cardiac monitoring via many existing devices such as different smart devices (e.g. smart watches and phones) [10], [11], as well as via dedicated hardware attached for example with chest straps or even indirectly from beds, chairs or similar set ups [12]–[15]. As the ECG currently is the gold standard for diagnosing arrhythmias, a lot of research efforts have been targeted in the development of EPMs (ECG Patch Monitors) [16]. Main challenges with EPMs are that a reliable analysis requires good electrode-to-patient contact and that the electrode distance should be large enough to provide sufficient amplitude of the biosignal [7] — a typical distance between electrodes is in the order of 5-10 cm [7], [8]. Similar minimum size requirements are present in insertable ECG sensors, such as Medtronic’s Reveal LINQ ICM, whose length is approxi- mately 4.5 cm. Furthermore, the electrode interface required by ECG must be provided with additional hardware to existing smart devices which slows down the penetration to consumer market. In contrast, there are over two billion smart phone users which already have MCG-ready device in their pocket. Of course it would also be possible to integrate a MEMS- based AFib detector into a single package (System in Package, SiP) measuring few millimeters and attach it with a skin- friendly adhesive to patient’s chest [8], [9], [17]. That kind of cheap, noninvasive (and possibly disposable) device capable to frequent monitoring of the cardiac activity in an unnoticeable manner would be a preferred choice for massive screening purposes of silent AFib. The third alternative is to enhance the performance of EPMs with concurrent MCG. Since all EPMs already include an accelerometer for motion artefact removal/compensation the price to be paid for this extra analysis remains almost negligible. The first step toward the implementation of the above men- tioned MCG applications is to evaluate the feasibility of seis- mocardiography for AFib detection. To this end, we propose an algorithm based on computing the spectral entropy [18] and IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 2 a heart rate variability index of the measured SCG signal. This automated classification procedure is based on the temporal randomness in the SCG signal rather than finding individual heart beats. This approach relaxes the requirements for the acquired signal quality and therefore results in more reliable detection results. A flowchart of the presented automated AFib detection algorithm is shown in Fig.1. This paper is based upon earlier publications [19], [20], in which we represented a proof of concept and preliminary results for the automatic detection of atrial fibrillation in seismocardiograms. These methods are refined and explained in detail in this manuscript, and a statistical analysis is in- cluded. This paper is organized as follows. We review the most significant publications related to this work in Subsection I-A. In Section II the experimental study protocol used in this work and the used data collection system are described. Section III describes the signal processing methods used in this work. Section IV concentrates on the evaluation of the developed classification method with related experimental statistics. Sec- tion V discusses the potential impact of this study and future directions in this research, and Section VI concludes the paper. Noise-removal filter: FFT-based brick wall filter, bandpass 1-45 Hz. Motion artefacts removal filter: sliding window (500 ms) RMS filter, threshold-based artefact removal. Subtraction of the estimated respiration component given by median filter (window size 125 ms). Rectify, multiply with Hamming window and compute PSD for bandwidth of 2-8 Hz. Divide signal into nonoverlapping segments of 12.5 s. Estimate durations of cardiac cycles: divide signal into overlapping segments of 2.5 s (overlap 1.5 s) and compute cross- correlation. Find the location of the first side peak with threshold opearation. Remove noise floor with threshold operation and compute spectral entropy for normalized data. Spectral entropyHRV index Preprocessing Estimate HRV: Compute the median of absolute differences between beat intervals. Linear least squares classifier. Computation of spectral entropy and HRV index for each segment. Fig. 1. A flowchart of the proposed automated AFib detection algorithm, as described in more detail in Sections III and IV. A. Literature Review Up to now, a number of techniques have been pro- posed for an automatic detection of AFib. For example, methods based upon Wavelet transform [21], Kolmogorov entropy [22], sample entropy [23], time-frequency analysis of heart rate variability [24], [25], Shannon entropy [26], [27], approximate entropy [25], sequential hypothesis test- ing [28], threshold-crossing intervals [29], auto-correlation function [29], spectrum analysis [29] and algorithms based on neural-networks [30], pattern recognition [31], and machine learning techniques [32]. However, most of these techniques are developed for the ECG signal and there are only a few studies focusing on the detection of AFib from the mechanical signals. In 2011, Bru¨ser et al. investigated the feasibility of AFib detection in BCG signal using support vector machine (SVM) classifiers and latter in 2013 reported results achieved for analysis of ballistocardiogram signals using machine learn- ing techniques [33], [34]. Accordingly, the best algorithm, random forest, achieved a sensitivity (or true positive rate) and specificity (or true negative rate) of 93.8% and 98.2%, respectively. This result was achieved by analyzing 856 epochs (each 30 s) of BCG signal recorded from 10 patients. A recent study reported a pitch-tracking technique for cycle length analysis of BCG signals in AFib and normal sinus rhythm modes [35]. However, as no quantitative results were reported, it is difficult to estimate the accuracy of the method in AFib detection. II. DATA ACQUISITION A. Study Protocol The clinical study was performed in the Heart Center, Turku University Hospital, Finland, by using the measurement system described in Subsection II-B. The research protocol was approved by the Ethical Committee of the Hospital District of the South-Western Finland. This study included 13 patients with AFib who were medically treated or to whom a cardioversion was anticipated. Of these 13 patients, 12 were male and one was female. Other demographics of the patients were as follows (min-max, mean, standard deviation): age (38- 71, 60.7, 9.1 years), height (165-193, 180.4, 8.8 cm), mass (77-123, 92.2, 11.8 kg), BMI (23.5-45.2, 28.6, 5.4 kg/m2). Patients were enrolled from the outpatient clinic, from those referred for cardioversion and from the ward. The main criteria for inclusion were: • Age at least 18 years old • History of AFib requiring medical therapy or cardiover- sion • Patient is willing to comply with specified evaluations • Patient or legally authorized representative has been in- formed of the nature of the study, agrees to its provi- sions and has been provided written informed consent, approved by the appropriate review board. The main exclusion criteria for this study were: • Ages under 18 years old • Any significant medical condition, which in the inves- tigators opinion may interfere with the patients optimal participation in the study IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 3 0 1 2 3 4 5 −10 0 10 AFib Time (s) Ac ce le ra tio n (m g n ) −5 0 5 0 0.5 1 Time (s)A ut oc or re la tio n of S CG 0 1 2 3 4 5 −100 0 100 Time (s) EC G 0 1 2 3 4 5 −10 0 10 sinus rhythm Time (s) Ac ce le ra tio n (m g n ) −5 0 5 0 0.5 1 Time (s)A ut oc or re la tio n of S CG 0 1 2 3 4 5 −100 0 100 Time (s) EC G Fig. 2. Five seconds of SCG data measured from the same patient. Left panels: AFib. Right panels: sinus rhythm (after successful cardioversion). Bandpass filtered SCG signal is plotted in upper panels (gn is earth’s gravity) and corresponding ECG signal in middle panels. Autocorrelations of the SCG signals are plotted in lower panels to demonstrate the change in the regularity of the heart rhythm. Two sets of SCG data were collected from each patient in supine position. The first data set was acquired during AFib and the second in sinus rhythm after successful cardioversion. The measurement took approximately 30 minutes per patient. B. Data Collection The custom-made data collection system used in this study consisted of a seismocardiograph, electrocardiograph and a data acquisition board for storing synchronized SCG and ECG data on a memory card. SCG was obtained using a three-axis, low-power, micro electromechanical accelerometer (MMA8451Q from Freescale Semiconductor), with 14 bits of resolution and the size of 3 mm × 3 mm × 1 mm. MMA- sensor was carefully selected because it is low-power, small size, has enough output bits and reasonable noise floor. There are MCG studies conducted with more accurate accelerometers e.g. [36], [37], but using superior sensors was avoided in this study to maintain the compatibility of the presented AFib detection method with the current and near future smart phones. The sensor was attached to the body of sternum using double-sided tape without hair removal in the chest area. ECG was recorded for reference purposes only. The ECG electrodes were mounted on the anterior lateral regions to the abdomen on the left and the right hypochondriac leading to one-lead setup. Data acquisition was hosted by Freescale FRDM-KL25Z board, which sampled both data at a sampling frequency (FS) of 800 Hz and stored the collected data on a memory card. Data processing was performed offline after transferring the binary data from the memory card to the computer [38]. A typical sample of the SCG signal recorded from a patient within this study with the above described data collection system is shown in Fig. 2. The data on the left panel of Fig. 2 is recorded during AFib, while the data on the right panel is from the same patient during sinus rhythm after succesful cardioversion. The corresponding ECG signals are also plotted for reference. Autocorrelation curves computed from the plotted SCG samples (5 s) demonstrate the change in the periodicity of heart rate between the sinus rhythm and AFib. III. SIGNAL PROCESSING METHODS In the following a relatively simple and computationally light algorithm for the detection of AFib from SCG signal is presented. The motivation for this work is to investigate methods which allow for automatic detection of AFib episodes solely from SCG, while being as tolerant against interpersonal variations in the SCG morphology and noise as possible. A. Preprocessing of the SCG signal The first preprocessing step is to apply a noise-removing filter on the acquired SCG signal. To this end we use an FFT based brick-wall filter with the bandpass frequency range of [1 Hz, 45 Hz]. It should be noted that while the heart rate can be lower than 60 bpm, the majority of heart-related SCG spectrum is still above 1 Hz. Subsequently, motion artefacts are removed from the signal by applying a sliding window (500 ms) root mean square (RMS) filter and then determining the median value of the filtered signal. Parts of the signal exceeding twice this median value are considered to be motion artefacts and are discarded. The remaining, artefactless signal IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 4 is divided into non-overlapping segments of 10000 samples — which equals 12.5 seconds. The selection criterion for this experimentally determined segment size was that it yielded sufficient accuracy in the subsequent steps of the algorithm. Shorter segments would reduce the accuracy of detection algorithm, while longer segments would reduce the number of segments. Fig. 3 demonstrates the performance of the motion artifact detection algorithm on a noisy SCG signal. The upper panel of Fig. 3 shows the energy envelope of the signal and the median value based noise removal threshold is drawn with a dashed line. In the lower panel of Fig. 3, the motion artefacts in the original (bandpass filtered) SCG signal are detected, and hence can be omitted from further analysis. In this example, the algorithm finds eleven motion artefact-free signal segments, marked with numbers and dashed vertical lines. In the following we denote the resulting motion artefact- Time (s) 0 20 40 60 80 100 120 140 160 SC G S ig na l (m g n ) -20 0 20 1 2 3 4 5 6 7 8 9 10 11 Time (s) 0 20 40 60 80 100 120 140 160 Si gn al e nv el op e (n or ma liz ed ) 0 5 10 15 Detection Threshold Fig. 3. Detection of motion artefacts from mechanical signals using the RMS filter. Upper panel: the RMS-filtered signal and the threshold for the motion artefact detection. The signal is normalized so that the threshold value is 1. Bottom panel: motion artefacts are detected and highlighted in light gray. Signal segments which are determined to be artefact-free, are numbered and marked with dashed vertical lines. free SCG signal segments by s(t). These segments are used for the computation of the spectral entropy and the heart rate variability index. B. Spectral entropy Our hypothesis is that by analyzing the randomness of the preprocessed SCG signal it is possible to determine if it corresponds to sinus rhythm or AFib. A specific way to measure the randomness of a signal segment is to compute its spectral entropy [18] using FFT analysis and power spectral density (PSD). To compute the spectral entropy of a cardiac signal segment, the following steps are applied. The first step is to remove the respiration component. Let us assume that the considered signal segments s(t) consist of three additive components as s(t) = sh(t) + sb(t) + n(t), (1) where sh(t) is the acceleration signal segment of interest caused by the heart motion, sb(t) corresponds to the respi- ration component, and n(t) includes all the other residual ac- celeration signals and noise after removal of motion artefacts. The above described preprocessing steps significantly reduce the power of the third component n(t). Thus it can be assumed to be small in comparison to sh(t) and sb(t) in the following. The effect of breathing component sb(t) was reduced by subtracting an estimate of the breathing from the signal segment s(t). The estimated breathing signal was obtained by applying a median filter to s(t) with a window length of 100 samples — which equals 0.125 seconds with the considered sampling frequency of 800 Hz. This window size was found to be a good compromise for this filter. It is short enough to capture sb(t), but long enough to effectively filter out the cardiac-related part sh(t), thus resulting into good estimate of breathing component. The final approximated cardiac acceleration signal segment is then given by sˆh(t) = s(t)−Median100(s(t)). (2) The second step is to rectify sˆh(t) and consider only its positive values. The resulting signal segment is denoted by sˆh,rect.(t), where sˆh,rect.(t) = { sˆh(t), if sˆh(t) ≥ 0, 0, otherwise. This rectification step is adopted from [39], where it is ex- plained to restore the missing periodicity information, which is beneficial when trying to distinguish AFib from sinus rhythm on the basis of the peridiocity of the signal. The third step is to compute the PSD for the signal segment using FFT. Prior to taking the FFT, the signal was multiplied with the Hamming window in order to reduce the edge effects of the FFT and smoothen the spectrum. Finally the FFT was squared to get an approximation of the PSD. Let us denote this approximation of the power spectral density of sˆh(t) by p(f), where f is limited to the interval [2 Hz, 8 Hz]. Fig. 4 presents samples of the bandwidth limited power spectral density curves p(f) for the sinus rhythm and AFib. It can be observed that the power spectrum of the sinus rhythm signal is divided between a smaller number of frequencies in comparison to the AFib signal, which has a more wide-band signal structure, as can be expected from the random nature of AFib. Before computing the spectral entropies, an extra threshold operation given by pˆ(f) = { 0, if p(f) < Θ, p(f), otherwise, is applied in order to remove the noise floor from the PSD. The sufficient threshold value Θ depends mainly on the amount of noise in the sensor, and was once again determined experimen- tally in this work. It was found out that Θ = max(p(f))/6 is a good choice with the available data. Next pˆ(f) is normalized sum up to 1 by setting pˆnorm(f) = pˆ(f)/ ∑ f pˆ(f). IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 5 This normalization is done in order to compute the spectral entropy, as it essentially considers the frequency spectrum as a probability distribution. The spectral entropy S of pˆnorm(f) is then computed as S = − ∑ f pˆnorm(f) log(pˆnorm(f)). (3) The computed spectral entropy S is higher for a SCG signal segment containing AFib than for sample containing sinus rhythm only. The computed spectral entropies for the AFib signal segment and a sinus rhythm signal segment of example of Fig. 4 are approximately 5.65 and 2.33, respectively, where natural logarithm is used in (3). In Section IV we describe how the discrimination between AFib and sinus rhythm can be automated by using the computed spectral entropy values. 0 2 4 6 8 10 12 0 0.02 0.04 0.06 0.08 0.1 0.12 Frequency (Hz) Po w er (n orm ali ze d) Power spectral density 0 2 4 6 8 10 12 0 0.02 0.04 0.06 0.08 0.1 0.12 Frequency (Hz) Po w er (n orm ali ze d) Power spectral density Fig. 4. Power spectral density curves obtained by using the method described in the text part. Upper panel: power spectral density of an SCG signal corresponding to sinus rhythm. Lower panel: power spectral density of an SCG signal corresponding to AFib. The power spectral densities have been normalized so that the summed PSD between 2 Hz and 8 Hz equals 1. The spectral entropies for these PSD curves are 2.78 and 5.74, for the sinus rhythm and the AFib, respectively. C. Heart rate variability In addition to spectral entropy, the variations between consecutive interbeat time intervals, defined as the heart rate variability (HRV) [40] is used as a second indicator of the randomness of the cardiac signal in this study. The HRV is considered to be a key indicator of the cardiovascular condition of an individual [40], [41]. To compute the amount of HRV in a given 12.5 s segment of SCG signal, the durations of the individual cardiac cycles in this signal must first be estimated. Due to the signal quality we are unable to detect individual heart beats from the signal. Autocorrelation based methods have been proposed to find heart rate in ultrasound signal [42] and in ballistocardiography signal [43]. Correlation based methods are beneficial, as no explicit peak detection algorithms are needed, and hence the methods tolerate noise and interpersonal variations in the sig- nal morphology. In this work the following cross-correlation based method is applied to get this estimation. 1) Determining the cardiac cycle duration: To begin with, the acquired 12.5 s segment of SCG signal is divided into smaller subsegments with the duration of 2.5 seconds. The subsegment size is chosen so that each subsegment should contain at least two heartbeats. This assumption is true as long as the instantaneous heart rate is at least 48 beats per minute. The segmentation is performed so that consecutive subsegments overlap by 1.5 seconds. Therefore, each 12.5 s segment s(t) consists of eleven 2.5 s subsegments, which are all unique but should share at least one heart beat with the neighboring subsegment. Let us consider a 2.5 second subsegment u(t) ⊂ s(t). If u(t) contains exactly two heartbeats, then the time interval between these heartbeats (or duration of the single cardiac cycle) can be accurately estimated by computing the period of u(t). To achieve this, the first 1.5 seconds of u(t) — denoted by u1.5(t) in the following — is cross-correlated with u(t). This yields R(u(t), i) = ∑ j u(j)u1.5(j + i), (4) where j is a discrete variable denoting the time indices, and only positive indices j + i up to the number of samples in u1.5(j) are taken into account. The duration of the corresponding cardiac cycle can now be estimated by locating the first side peak of R(i). Formally, this is performed by computing the index of the first side peak ifirst peak = arg|i|>i0 max(R(u(t), i), (5) where i0 is a threshold, which is chosen to be i0 = 1/3Fs. The justification for this choice is that io corresponds to a period of at least 1/3 seconds in the signal, which is sufficient threshold for heart rates below 180 bpm. Now the corresponding estimated cardiac cycle duration is obtained as d = ifirst peak/Fs. (6) Although the atria contract fast at rate of 400 to 600 beat per minute in AF, the AV node allows only occasional impulses to pass through. Therefore, the ventricular rate registered by SCG during AFib is typically from 160 to 180 beats per minute [44]. IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 6 Time (s) 1 2 3 4 5 6 7 8 Es tim at ed c yc le d ur at io n d i 0.5 1 1.5 AFib Time (s) 1 2 3 4 5 6 7 8 |d i +1 - d i | 0 0.1 0.2 0.3 0.4 0.5 0.6 Time (s) 1 2 3 4 5 6 7 8 Es tim at ed c yc le d ur at io n d i 0.5 1 1.5 Sinus rhythm Time (s) 1 2 3 4 5 6 7 8 |d i +1 - d i | 0 0.1 0.2 0.3 0.4 0.5 0.6 Fig. 5. HRV determination. Left side panels correspond to a signal acquired during AFib, and the right side panels to signal acquired during sinus rhythm. The estimated cardiac cycle durations di are presented in the upper panels, and their absolute differences in the bottom panels. Median of the absolute change, which is the used as the estimate for the HRV value, is plotted with dashed line. The calculated HRV values are 0.30 and 0.03 for AFib and sinus rhythm, respectively. However, the considered 2.5 second subsegment may con- tain more than two heartbeats. In that case, the resulting cross- correlation can contain strong side peaks which correspond to shifts by other than the desired cardiac cycle. In such situation we may either detect wrong cardiac cycle or two consecutive cardiac cycles as one cycle. The first one is not harmful, but the latter can be considered as an outlier that will be dealt with by using median function, as explained in the following. 2) Estimating the heart rate variability: Let U be a set of above-defined subsegments ui(t) from a given SCG signal segment, where i = 1, . . . n. Each ui(t) is associated with the corresponding estimated duration of the cardiac cycle di. In this paper, the estimated heart rate variability (HRV) is given by the median of absolute differences in subsequent cycle durations: HRV = Median({|di+1 − di| : i = 2, 3, . . . , n}). (7) This HRV index measures the amount of change in the durations between subsequent cardiac cycles. The median function is used here to protect this index against outliers and incorrectly determined cardiac cycle durations. For the clas- sification described in the following Section, the logarithmic HRV is considered HRVlog = log(1 + HRV). (8) The justification for using the logarithmic HRV is that the dynamic range of HRV is large in this study, and therefore the logarithmic HRV makes visualization easier and also results in a minor improvement in the classification. Examples of obtained HRV curves, and their absolute differences and median values, are presented in Fig. 5. Spectral entropy 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 N um be r o f s am pl es 0 5 10 15 20 25 30 35 40 Sinus AFib HRVlog 0 1 2 3 4 5 6 7 8 N um be r o f s am pl es 0 5 10 15 20 25 30 35 40 45 Sinus AFib Fig. 6. Detection of atrial fibrillation using a single variable. Bars on the left side of the boundary are classified as segments which contain sinus rhythm and points on the right side the boundary are classified as segments which contain atrial fibrillation. Top panel: classification using the spectral entropy. The classification boundary obtained from a linear least-squares classifier equals SE = 4.6. Bottom panel: classification using the logarithmic HRV, where the linear boundary equals HRVlog = 4.0. IV. AUTOMATED DETECTION OF ATRIAL FIBRILLATION USING SPECTRAL ENTROPY AND HRV In the following we use the spectral entropy and the HRV index to determine whether a given SCG signal has been recorded during atrial fibrillation or not. For this, all the data acquired from the 13 patients was preprocessed according to steps defined in Section III to obtain cardiac signal segments s(t). After applying the spectral entropy and HRV estimation algorithms to each signal segment, the histograms shown in Fig. 6 are obtained. In Fig. 7 the results of both analyses are combined so that the y-axis shows the location of the assessed sample with respect to spectral entropy and x-axis with respect to the logarithmic HRV. Both of presented figures also contain linear decision boundaries to separate the clouds of points to belonging to sinus rhythm and atrial fibrillation to demonstrate that visually the linear classifier works very well. IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 7 HRVlog 1 2 3 4 5 6 Sp ec tra l e nt ro py 2 3 4 5 6 7 Sinus rhythmAtrial fibrillation Fig. 7. Detection of atrial fibrillation using both the spectral entropy and the logarithmic HRV. For visualization purposes we have restricted the number of points in this scatter plot to 200. The classification boundary obtained from a linear least-squares classifier equals SE = −1.1HRVlog + 8.8; a segment corresponding to a point above this boundary is classified as atrial fibrillation, whereas a segment corresponding to a point below this boundary is classified to contain no atrial fibrillation. A. Linear least-squares classifier with majority voting A linear least-squares classifier — using only spectral entropy, only logarithmic HRV, or both — was trained using a training set of 12 patients’ data, and tested using a data from the remaining patient. The test was performed for both AFibPos signal and AFibNeg signal recorded from that patient. The classification procedure was performed multiple times, each time considering the data from a different patient as a test set, and the data from the rest of the patients as the training set. For a given patient, the classification was performed 1000 times, and the average classification performance was recorded as presented in Table I. This leave-one-out cross-validation was applied to reduce the effect of low amount of data. In the first trial, only one signal segment from a random temporal location for each case — AFibPos and AFibNeg — per patient was designated to the test set, and that signal segment was then classified with the trained linear classifier. Hence this test required 12.5 seconds of data per patient. To improve the classification performance, in the subsequent trials an uneven number m = 3 or m = 5 of segments — were randomly selected from the same patient, all segments either AFibPos or AFibNeg — and the these signal segments were classified using the trained classifier, and the final result was determined using the majority rule. In other words, this set of m segments was classified as AFibPos if more than m/2 of the segments were classified by the linear classifier as AFibPos, while otherwise the set was classified as AFibNeg. The performance of the classifier was assessed by computing its true positive and true negative rates. By true positive we mean classification of an AFibPos signal as atrial fibrilla- tion, and by true negative the classification of an AFibNeg signal as sinus rhythm. False positives and false negatives are defined accordingly as falsely classified atrial fibrillation SE vote size 1 3 5 patient TPR TNR TPR TNR TPR TNR 1 0.823 0.801 0.909 0.908 0.947 0.964 2 0.954 0.955 0.998 0.997 1.000 0.999 3 0.850 0.797 0.933 0.870 0.962 0.932 4 0.970 0.780 0.999 0.868 1.000 0.922 5 0.818 0.893 0.909 0.971 0.965 0.988 6 0.963 0.401 0.999 0.375 1.000 0.331 7 0.959 0.917 0.992 0.979 1.000 0.993 8 0.810 0.915 0.895 0.967 0.950 0.984 9 0.827 0.952 0.901 0.987 0.964 0.995 10 0.886 0.964 0.972 0.998 0.987 1.000 11 0.813 0.802 0.915 0.902 0.970 0.937 12 1.000 0.612 1.000 0.685 1.000 0.728 13 0.885 1.000 0.954 1.000 0.985 1.000 mean 0.889 0.830 0.952 0.885 0.979 0.906 std 0.071 0.167 0.043 0.176 0.020 0.188 HRV vote size 1 3 5 patient TPR TNR TPR TNR TPR TNR 1 1.000 0.828 1.000 0.906 1.000 0.953 2 0.979 0.986 1.000 1.000 1.000 1.000 3 0.974 0.867 0.998 0.960 1.000 0.981 4 1.000 0.750 1.000 0.818 1.000 0.863 5 1.000 0.673 1.000 0.778 1.000 0.811 6 1.000 0.769 1.000 0.835 1.000 0.907 7 0.987 0.976 1.000 0.998 1.000 0.999 8 0.981 0.797 0.997 0.901 1.000 0.931 9 1.000 0.966 1.000 0.997 1.000 0.999 10 0.960 1.000 0.996 1.000 0.999 1.000 11 0.815 1.000 0.909 1.000 0.964 1.000 12 1.000 0.961 1.000 0.992 1.000 0.998 13 1.000 1.000 1.000 1.000 1.000 1.000 mean 0.977 0.890 0.992 0.937 0.997 0.957 std 0.050 0.115 0.025 0.081 0.010 0.062 SE+HRV vote size 1 3 5 patient TPR TNR TPR TNR TPR TNR 1 1.000 0.815 1.000 0.917 1.000 0.949 2 0.979 0.983 0.998 1.000 1.000 1.000 3 1.000 0.834 1.000 0.944 1.000 0.981 4 1.000 0.756 1.000 0.829 1.000 0.902 5 0.985 0.738 1.000 0.877 1.000 0.910 6 0.959 0.741 0.997 0.839 0.998 0.895 7 1.000 0.947 1.000 0.991 1.000 1.000 8 1.000 0.824 1.000 0.905 1.000 0.950 9 0.967 0.971 0.992 0.999 1.000 1.000 10 0.982 1.000 0.999 1.000 1.000 1.000 11 0.869 0.984 0.957 0.999 0.990 1.000 12 1.000 0.800 1.000 0.904 1.000 0.951 13 1.000 1.000 1.000 1.000 1.000 1.000 mean 0.980 0.876 0.996 0.939 0.999 0.964 std 0.036 0.106 0.012 0.064 0.003 0.041 TABLE I AVERAGE CLASSIFICATION PERFORMANCES USING LEAVE-ONE-OUT CROSS-VALIDATION. EACH VALUE IS AVERAGED OVER 1000 RANDOM TRIALS WITH THE CORRESPONDING PATIENT’S DATA AS THE TEST SET. TOP: PERFORMANCE USING ONLY SPECTRAL ENTROPY. MIDDLE: PERFORMANCE USING ONLY HRV. BOTTOM: PERFORMANCE USING BOTH SPECTRAL ENTROPY AND HRV. IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 8 and sinus rhythm, respectively. As expected, the true positive rate (TPR) and the true negative rate (TNR) of the detection were improved by taking more segments into account. Table I summarizes the results of different classification methods. In the table, each row represents results of one patient being used as the test group. The classifier is trained with the remaining 12 patients. All three choices of variables for the detection of atrial fibrillation perform well for the considered data. When the number of segments is increased, the true positive rate and the true negative rate of the classification improves, and for five segments, both of them are above 0.95 when using only HRV, or when using both spectral entropy and HRV. With the considered data, using only spectral entropy for the classification seems to perform slightly worse as compared to using only HRV or both HRV and spectral entropy. V. DISCUSSION It is practically significant to develop the automated detec- tion of atrial fibrillation from an SCG signal obtained using a MEMS accelerometer, as this facilitates the development of miniaturized smart sensors for screening of atrial fibrillation from masses. This is an important task, as atrial fibrillation is a common cardiac anomaly that appers to cause of up to 25 percent of all strokes. Therefore an inexpensive and unobtrusive way to constantly monitor the rhythm of the heart for scarcely occurring silent atrial fibrillation would be useful from both personal health’s and economics’ perspective. For example, patients with unexplained syncope could benefit from such a long-term monitoring in order to find an explanation for the symptoms. This work shares some similarities with [34], but there are also many differences. These two studies are briefly compared in the following. The apparent similarity between these two studies is that both try to detect AFib noninvasively with me- chanical sensors instead of conventional ECG approach. Also, the measurement scenario is the same: patients are measured before and after cardioversion. Furthermore, the amount of patients and the mean length of the individual recordings are the same order of magnitude. In [34] the recordings were performed with bed-mounted sensor (BCG), whereas in this study the sensor was attached directly to chest (SCG). That is, the former method is contactless the latter is not. Both approaches have their pros and cons. For example, the bed- mounted sensor allows recordings lasting the whole nighttime and powering the measurement equipment is easy. Instead, the wireless chest-mounted sensor (e.g. patch or smartphone) needs to be battery-powered, but can also take measurements during daytime when the person is staying still. There are also significant differences in the computational approaches between these studies. Specifically, [34] focuses on comparing the performance of seven popular machine learning algorithms (with automatically selected 17 general features) in detecting AFib. The results are classified into three categories: normal, AFib and motion artifact. Instead, the focus of the presented work is to show that the used spectral entropy and HRV measures contain sufficient information to classify between SCG signals corresponding to AFib and sinus rhythm after noise artefacts have been removed. In the light of the results, these methods have comparable detection performance, but as they are based on different features, it is possible that an appropriate combination of the methods could yield even higher detection rates of atrial fibrillation. Currently, ECG is the state-of-the-art method for moni- toring heart function, and the Holter monitor can be used to determine arrhythmias in longer measurements. However, wearable ECG devices require a good electrical contact, which in practice entails attaching adhesive electrodes firmly onto the skin, from which body hair and the surface layer have been removed. Electrical contact is further enhanced by means of a special gel between the electrode and the skin. Electrodes attached in this manner may irritate the skin and for this reason, ECG-based techniques are infeasible for very long- term monitoring; typically, Holter monitors are used up to a period of two weeks [16]. The ECG devices equipped with electrodes to be touched with fingers do not suffer from such problems but are only good for occasional short term check ups and are therefore inferior as compared to Holter monitors when trying to catch silent AFib. Besides miniaturized heart monitoring patches, the pre- sented algorithms can also be implemented in a smart phone. Here the idea would be to measure the rhythm of the heart for example once per day by lying in a supine position with the smart phone placed on the chest. A straightforward advantage in comparison to ECG is that no additional devices are required; the internal sensors of the smart phone are sufficient for such measurements. Another possible use for (MEMS) accelerometer -based atrial fibrillation detection would be to use the proposed algorithm with bed sensors, where the data would be acquired while the patient is sleeping as suggested by e.g. [13]. VI. CONCLUSION In this paper a novel method for detecting atrial fibrillation from an SCG signal measured by using a MEMS accelerome- ter was presented. For automated detection of atrial fibrillation a linear least-squares classifier was used with spectral entropy and heart rate variability measure as input variables. The proposed method tolerates well interpersonal variations in the signal morphology and also noise, as it does not require accurate beat detection from the SCG signal. The obtained results are promising and warrant further investigation into this topic. It should be noted that in this work the focus was on classification between atrial fibrillation and sinus rhythm; the effect of other arrhythmias to the quality of the classification was left for future work. REFERENCES [1] J. S. Healey, S. J. Connolly, M. R. Gold, C. W. Israel, I. C. Van Gelder, A. Capucci, C. Lau, E. Fain, S. Yang, C. Bailleul, C. A. Morillo, M. Carlson, E. Themeles, E. S. Kaufman, and S. H. Hohnloser, “Sub- clinical atrial fibrillation and the risk of stroke,” New England Journal of Medicine, vol. 366, no. 2, pp. 120–129, 2012, pMID: 22236222. IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 9 [2] E. I. Charitos, U. Stierle, P. D. Ziegler, M. Baldewig, D. R. Robinson, H.-H. Sievers, and T. Hanke, “A comprehensive evaluation of rhythm monitoring strategies for the detection of atrial fibrillation recurrence: Insights from 647 continuously monitored patients and implications for monitoring after therapeutic interventions,” Circulation, vol. 126, no. 7, pp. 806–814, 2012. [3] I. Starr, A. J. Rawson, H. A. Schroeder, and N. R. Joseph, “Studies on the estimation of cardiac output in man, and of abnormalities in cardiac function,” American Heart Journal, vol. 18, no. 4, pp. 506 –, 1939. [4] J. W. Gordon, “Certain molar movements of the human body produced by the circulation of the blood,” Journal of Anatomy and Physiology, vol. 11, pp. 533–536, 1877. [5] B. S. Bozhenko, “Seismocardiography– a new method in the study of functional conditions of the heart,” Terapevticheskii Arkhiv, vol. 33, pp. 55–64, 1961. [6] O. Inan, P.-F. Migeotte, K.-S. Park, M. Etemadi, K. Tavakolian, R. Casanella, J. Zanetti, J. Tank, I. Funtova, G. Prisk, and M. Di Rienzo, “Ballistocardiography and seismocardiography: A review of recent ad- vances,” Biomedical and Health Informatics, IEEE Journal of, vol. 19, no. 4, pp. 1414–1427, July 2015. [7] Y. Chuo, M. Marzencki, B. Hung, C. Jaggernauth, K. Tavakolian, P. Lin, and B. Kaminska, “Mechanically flexible wireless multisensor platform for human physical activity and vitals monitoring,” IEEE transactions on biomedical circuits and systems, vol. 4, no. 5, pp. 281–294, 2010. [8] M. Etemadi, O. T. Inan, J. A. Heller, S. Hersek, L. Klein, and S. Roy, “A wearable patch to enable long-term monitoring of environmental, activity and hemodynamics variables,” IEEE transactions on biomedical circuits and systems, vol. 10, no. 2, pp. 280–288, 2016. [9] P. Castiglioni, A. Faini, G. Parati, and M. Di Rienzo, “Wearable seismocardiography,” in 2007 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE, 2007, pp. 3954–3957. [10] J. A. Heathers, “Smartphone-enabled pulse rate variability: An alter- native methodology for the collection of heart rate variability in psy- chophysiological research,” International Journal of Psychophysiology, vol. 89, no. 3, pp. 297 – 304, November 2013, psychophysiology in Australasia conference. [11] J. Hernandez, D. McDuff, and R. Picard, “Bioinsights: Extracting personal data from still wearable motion sensors,” in Wearable and Implantable Body Sensor Networks (BSN), 2015 IEEE 12th International Conference on, June 2015, pp. 1–6. [12] W. Jia, Y. Li, Y. Bai, Z.-H. Mao, M. Sun, and Q. Zhao, “Estimation of heart rate from a chest-worn inertial measurement unit,” in Bioelectron- ics and Bioinformatics (ISBB), 2015 International Symposium on, Oct 2015, pp. 148–151. [13] C. Bru¨ser, K. Stadlthanner, S. de Waele, and S. Leonhardt, “Adaptive beat-to-beat heart rate estimation in ballistocardiograms,” Information Technology in Biomedicine, IEEE Transactions on, vol. 15, no. 5, pp. 778–786, Sept 2011. [14] O. Postolache, P. Girao, G. Postolache, and M. Pereira, “Vital signs monitoring system based on emfi sensors and wavelet analysis,” in Instrumentation and Measurement Technology Conference Proceedings, 2007. IMTC 2007. IEEE, May 2007, pp. 1–4. [15] J. Ramos-Castro, J. Moreno, H. Miranda-Vidal, M. Garcia-Gonzalez, M. Fernandez-Chimeno, G. Rodas, and L. Capdevila, “Heart rate variability analysis using a seismocardiogram signal,” in Engineering in Medicine and Biology Society (EMBC), 2012 Annual International Conference of the IEEE, Aug 2012, pp. 5642–5645. [16] J. A. Walsh, E. J. Topol, and S. R. Steinhubl, “Novel wireless devices for cardiac monitoring,” Circulation, vol. 130, no. 7, pp. 573–581, 2014. [Online]. Available: http://circ.ahajournals.org/content/130/7/573.short [17] S. CI., “Bioelectronics: The way to discover the world of arrhythmias?” Hellenic journal of cardiology, vol. 55, no. 3, pp. 267–8, 2014. [18] I. A. Rezek and S. J. Roberts, “Stochastic complexity measures for physiological signal analysis,” IEEE Transactions on Biomedical Engi- neering, vol. 45, no. 9, pp. 1186–1191, Sept 1998. [19] “European Congress on e-Cardiology and e-Health October 2014, Se- lected Abstracts,” European Journal of Preventive Cardiology, vol. 21, no. 2 suppl, pp. 38–44, 2014. [20] T. Koivisto, M. Pa¨nka¨a¨la¨, T. Hurnanen, T. Vasankari, T. Kiviniemi, A. Saraste, and J. Airaksinen, “Automatic detection of atrial fibrillation using mems accelerometer,” in Computes in cardiology 2015, 42nd annual conferene, vol. 42, September 2015, pp. 829–832. [21] J. Slocum, A. Sahakian, and S. Swiryn, “Diagnosis of atrial fibrilla- tion from surface electrocardiograms based on computer-detected atrial activity,” Journal of Electrocardiology, vol. 25, no. 1, pp. 1 – 8, 1992. [22] K. Tateno and L. Glass, “Automatic detection of atrial fibrillation using the coefficient of variation and density histograms of rr and δrr intervals,” Medical and Biological Engineering and Computing, vol. 39, no. 6, pp. 664–671. [23] D. E. Lake and J. R. Moorman, “Accurate estimation of entropy in very short physiological time series: the problem of atrial fibrillation detection in implanted ventricular devices,” American Journal of Physiology - Heart and Circulatory Physiology, vol. 300, no. 1, pp. H319–H325, 2011. [Online]. Available: http://ajpheart.physiology.org/content/300/1/H319 [24] D. Andresen and T. Brggemann, “Heart rate variability preceding onset of atrial fibrillation,” Journal of cardiovascular electrophysiology, vol. 9, no. 8 Suppl, p. S269, August 1998. [Online]. Available: http://europepmc.org/abstract/MED/9727672 [25] C. W. Hogue, P. P. Domitrovich, P. K. Stein, G. D. Despotis, L. Re, R. B. Schuessler, R. E. Kleiger, and J. N. Rottman, “Rr interval dynamics before atrial fibrillation in patients after coronary artery bypass graft surgery,” Circulation, vol. 98, no. 5, pp. 429–434, 1998. [26] D. D. McManus, J. Lee, O. Maitas, N. Esa, R. Pidikiti, A. Carlucci, J. Harrington, E. Mick, and K. H. Chon, “A novel application for the detection of an irregular pulse using an iphone 4s in patients with atrial fibrillation,” Heart Rhythm, vol. 10, no. 3, pp. 315 – 319, 2013. [27] J. Lee, B. Reyes, D. McManus, O. Mathias, and K. Chon, “Atrial fibrillation detection using an iphone 4s,” Biomedical Engineering, IEEE Transactions on, vol. 60, no. 1, pp. 203–206, Jan 2013. [28] N. V. Thakor, Y. S. Zhu, and K. Y. Pan, “Ventricular tachycardia and fibrillation detection by a sequential hypothesis testing algorithm,” IEEE Transactions on Biomedical Engineering, vol. 37, no. 9, pp. 837–843, Sept 1990. [29] R. H. Clayton, A. Murray, and R. W. F. Campbell, “Comparison of four techniques for recognition of ventricular fibrillation from the surface ecg,” Medical and Biological Engineering and Computing, vol. 31, no. 2, pp. 111–117. [Online]. Available: http://dx.doi.org/10.1007/BF02446668 [30] T. F. Yang, B. Devine, and P. W. Macfarlane, “Artificial neural net- works for the diagnosis of atrial fibrillation,” Medical and Biological Engineering and Computing, vol. 32, no. 6, pp. 615–619. [31] K. Sternickel, “Automatic pattern recognition in ECG time series,” Computer Methods and Programs in Biomedicine, vol. 68, no. 2, pp. 109 – 115, 2002. [32] M. G. Tsipouras and D. I. Fotiadis, “Automatic arrhythmia detection based on time and timefrequency analysis of heart rate variability,” Computer Methods and Programs in Biomedicine, vol. 74, no. 2, pp. 95 – 108, 2004. [33] C. Bru¨ser, M. D. H. Zink, S. Winter, P. Schauerte, and S. Leonhardt, “A feasibility study on the automatic detection of atrial fibrillation using an unobtrusive bed-mounted sensor,” in Computing in Cardiology, 2011, Sept 2011, pp. 13–16. [34] C. Bru¨ser, J. Diesel, M. D. H. Zink, S. Winter, P. Schauerte, and S. Leonhardt, “Automatic detection of atrial fibrillation in cardiac vibration signals,” IEEE Journal of Biomedical and Health Informatics, vol. 17, no. 1, pp. 162–171, Jan 2013. [35] M. D. H. Zink, C. Bru¨ser, P. Winnersbach, A. Napp, S. Leonhardt, N. Marx, P. Schauerte, and K. Mischke, “Heartbeat cycle length de- tection by a ballistocardiographic sensor in atrial fibrillation and sinus rhythm,” BioMed Research International, vol. 2015, no. 840356, pp. 1–10, Feb 2015. [36] M. A. Garcia-Gonzalez, A. Argelags-Palau, M. Fernndez-Chimeno, and J. Ramos-Castro, “A comparison of heartbeat detectors for the seismocardiogram,” in Computing in Cardiology 2013, Sept 2013, pp. 461–464. [37] A. D. Wiens, M. Etemadi, S. Roy, L. Klein, and O. T. Inan, “Toward continuous, noninvasive assessment of ventricular function and hemo- dynamics: Wearable ballistocardiography,” IEEE journal of biomedical and health informatics, vol. 19, no. 4, pp. 1435–1442, 2015. [38] M. J. Tadi, T. Koivisto, M. Pankaala, and A. Paasio, “Accelerometer- based method for extracting respiratory and cardiac gating information for dual gating during nuclear medicine imaging,” International Journal of Biomedical Imaging, vol. 2014, no. 690124, pp. 1–11, 2014. [39] R. Peters, E. James, and M. Russell, “Amplitude Modulation Effects in Cardiac Signals,” 2010. [Online]. Available: http://arxiv.org/abs/1011.1880 [40] Electrophysiology, Task Force of the European Society of Cardiology the North American Society of Pacing, “Heart rate variability: Standards of measurement, physiological interpretation, and clinical use,” Circulation, vol. 93, no. 5, pp. 1043–1065, 1996. [41] M. Tadi, E. Lehtonen, T. Koivisto, M. Pankaala, A. Paasio, and M. Teras, “Seismocardiography: Toward heart rate variability (hrv) estimation,” in IEEE JOURNAL OF BIOMEDICAL AND HEALTH INFORMATICS , APRIL 2016 10 Medical Measurements and Applications (MeMeA), 2015 IEEE Interna- tional Symposium on, May 2015, pp. 261–266. [42] J. Jezewski, D. Roj, J. Wrobel, and K. Horoba, “A novel technique for fetal heart rate estimation from doppler ultrasound signal,” BioMedical Engineering OnLine, vol. 10, no. 1, p. 92, 2011. [43] C. Bru¨ser, S. Winter, and S. Leonhardt, “Robust inter-beat interval estimation in cardiac vibration signals,” Physiological Measurement, vol. 34, no. 2, p. 123, 2013. [44] ECG Holter,Guide to Electrocardiographic Interpretation. Springer US, 2008.