In this paper, R wave peak interval independent atrial fibrillation detection algorithm is proposed based on the analysis of the synchronization feature of the electrocardiogram signal by a deep neural network. Firstly, the synchronization feature of each heartbeat of the electrocardiogram signal is constructed by a Recurrence Complex Network. Then, a convolution neural network is used to detect atrial fibrillation by analyzing the eigenvalues of the Recurrence Complex Network. Finally, a voting algorithm is developed to improve the performance of the beat-wise atrial fibrillation detection. The MIT-BIH atrial fibrillation database is used to evaluate the performance of the proposed method. Experimental results show that the sensitivity, specificity, and accuracy of the algorithm can achieve 94.28%, 94.91%, and 94.59%, respectively. Remarkably, the proposed method was more effective than the traditional algorithms to the problem of individual variation in the atrial fibrillation detection.
Atrial fibrillation (AF) is the most common type of cardiac arrhythmia in clinical setting, affecting about 1–2% of the general population [
Electrocardiogram (ECG) is commonly used as a diagnostic tool for AF detection, and considerable research has been conducted on ECG. These works are either based on RR interval (RRI, i.e., the interval between two adjacent QRS complex waves) variability or abnormal atrial activity (AA) (AlGhatri [
In view of the atrial activity, during AF, the P-wave is replaced by fibrillatory waves. Thus, a natural way to detect AF is to check the absence of P-waves. Previous algorithms were proposed to address this issue [
Recently, signal processing techniques have been employed to extract AA features from ECG waves for AF detection. Stridh
Magnitude-squared coherence, a frequency domain measure of the linear phase relation between two signals, has been shown to be a reliable discriminator of AF [
The objective of this paper is to improve the performance of the AF detection algorithm by combining the Recurrence Complex Network (RCN) with convolution neural network (CNN). As one of the deep learning algorithms [
The real data (surface ECGs) used in this method were provided by the MIT-BIH AF database (AFDB) [
For each data recording, a seven-order Butterworth bandpass filter is applied with poles at 0.5 Hz and 49 Hz to reduce baseline wander (BW) and noise. Then, the onset of the QRS wave is detected by finding the local maximums of the convolution between the ECG recording and a set of predefined QRS models. At each QRS onset point, the QRS wave is canceled based on the most matched model. The remaining signals are departed into segments; each of which is approximately the AA segment of a heartbeat. All the segments are interpolated into 128 bit data samples with the Fourier transform interpolation. Next, an AF detection algorithm is developed based on such samples. The main ECG preprocessing steps are illustrated in Figure
ECG data preprocessing.
Denoising of ECG signal
Removal of QRS wave
Interpolation of the AA segment
The ECG data is a nonstationary time series [
The recurrence matrix is obtained by the phase space reconstruction method. Generally, there are two kinds of phase space construction methods: the time delay method and the derivative reconstruction method [
The most common method for choosing the time delay parameter
The entropy
Then, the mutual information between
In recalling the definitions of the random variables
The problem of determining the embedding dimension
Consider again the ECG data
Having chosen appropriate parameters for the phase space, the dynamic character of the original data can be represented by the following
Traditionally, the recurrence matrix is binarilized, and some numerical features are extracted through the manual method. Then, the input samples can be classified with algorithms such as fuzzy c-means (FCM). However, it is difficult to manually define the appropriate features for the ECG data. To solve this problem, we propose to extract features from the recurrence matrix automatically by using the convolution neural network (CNN). Firstly, we calculate the eigenvalues of the recurrence matrix, and then, they are sent into the CNN. The CNN extracts the features and classifies the data. The eigenvalues of each data sample form a 92-byte feature vector.
The convolutional neural network (CNN) addresses the feature learning problem through the calculation of multiple levels of data representations by the operation involved in the multiple layers of the CNN. Except for the first layer and the top layer, the main part of the CNN is composed of alternating layers of convolution and pooling.
As illustrated in Figure
Illustration of a convolution layer and the subsequent pooling layer.
The weight vectors of the convolutional layer,
Each convolutional layer is followed by a pooling layer, as shown in Figure
The CNN used for AF detection has six layers (as illustrated in Figure
Structure diagram of the CNN.
The number of feature maps in each convolutional layer and the pooling parameters are chosen experimentally in Section
The input ECG data is preprocessed and segmented into 128-bit samples, where each sample corresponds to the atrial activity (AA) signal of one heartbeat. Then, the recurrence matrix is calculated. The eigenvalues of the recurrence matrix, which form a 92-byte feature vector, are sent to a CNN. The details of the CNN are introduced in the following.
C1 layer: The C1 layer is a convolution layer. It consists of six feature maps with a vector of 1
S2 layer: The S2 layer is a pooling layer. The obtained feature from C1 is sampled according to the principle of local image characteristics. The sampling is achieved by using a pooling function to several units in a region of a size determined by the pooling size parameter. After the experiment, the size is set as 2. Therefore, the size of the obtained feature map in this layer is 40 (80/2=40). The further feature extraction will cause it to be invariant to small variations in location. The resolution of the obtained feature map is reduced, but most of the information is retained.
C3 layer: The C3 layer is similar to that of C1. The size of the obtained feature map is 28 (40-13+1=28). As mentioned above, the pooling layer increases the receptive field of neurons. Therefore, a better feature structure is acquired for the depth structure.
S4 layer: This layer is the same as the S2 layer. The size of the feature maps is 14 (28/2=14).
Output layer: The output layer is fully connected to S4 layer. The number of S4 neurons is 12
Although the beat-wise AF detection algorithm is important in exploring the underlying feature of AF, its classification accuracy is relatively low. To improve algorithm performance, the majority voting methodology was adopted. Before AF detection, the ECG data is segmented into beat-wise data samples. Each adjacent
All programs and graphs were created in Matlab (R2015b version 8.6.0.267246, Mathworks). The 23 recordings in the database were divided into two groups. The first group contains 15 recordings, and the second group contains 8 recordings. The recordings of the two groups were obtained from different subjects. From the first group, 120,000 NSR (Normal sinus rhythm) heartbeat AA data samples and 120,000 AF samples, respectively, were obtained with the preprocessing method detailed in Section
There are two parameters of the reconstructed phase space that need to be determined: the delay time and the embedding dimension. Figure
Selection of the delay time.
Selection of the embedding dimension.
In order to select the best parameters for the CNN, the performance of the CNN is evaluated using different parameters.
As an initiation, the number of feature maps in the C1 layer and C2 layer is set as 6 and 12, respectively, according to ref. [
Classification rates of CNN under different lengths of the convolution kernel.
length of convolution kernel | 5 | 9 | 13 | 17 |
---|---|---|---|---|
training set | 75.68% | 77.17% | 82.37% | 78.3% |
testing set | 74.39% | 73.5% | 80.77% | 71.2% |
Classification rates of CNN under different number of feature maps.
| ||||||||
---|---|---|---|---|---|---|---|---|
| 3 | 6 | 9 | 12 | ||||
train | test | train | test | train | test | train | test | |
3 | 74.28% | 77.29% | 76.95% | 75.29% | 80.13% | 74.94% | 76.87% | 79.75% |
6 | 73.23% | 76.96% | 82.19% | 77.42% | 82.45% | 74.95% | 73.92% | 59.95% |
9 | 71.71% | 74.74% | 78.08% | 79.89% | 80.91% | 75.65% | 82.59% | 79.65% |
12 | 74.66% | 71.1% | 82.37% | 80.77% | 79.94% | 71.11% | 82.2% | 76.31% |
To illustrate the effectiveness of the CNN, the CNN is compared with other popular classification methods. Three measurements are used to evaluate the methods: accuracy (AC), sensitivity (SE), and specificity (SP). The inputs of all three classifiers are the low level features obtained by the method detailed in Section
Comparison of CNN with typical classification methods.
method | AC | SE | SP |
---|---|---|---|
SVM | 61.34% | 56.25% | 66.37% |
KNN | 70.95% | 88.97% | 52.93% |
CNN | 80.77% | 89.18% | 72.37% |
Most of the rate-independent AF detection algorithms are unable to solve the problem of individual variation. According to our investigation, only the Magnitude-squared coherence (MSC) algorithm [
Comparison with traditional rate-independent AF detection algorithms.
methods | AC | SE | SP |
---|---|---|---|
MSC | 66.31% | 71.54% | 61.09% |
RCN | 60.03% | 66.16% | 53.91% |
BWAD | 80.77% | 89.18% | 72.37% |
It can be seen that the proposed BWAD algorithm outperforms the traditional algorithms. Traditional algorithms perform poorly in beat-wise rate-independent AF detection because they rely on manually obtained features. In contrast, the BWAD algorithm effectively solves this problem by using CNN to extract high-level features for classification.
The performance of the proposed algorithm can be improved by majority voting, in which the outputs of
Results of majority voting under different parameters.
| AC | SE | SP |
---|---|---|---|
13 | 92.92% | 94.81% | 90.99% |
15 | 92.97% | 96.06% | 89.87% |
17 | 94.09% | 94.30% | 93.88% |
19 | 94.12% | 95.72% | 92.52% |
21 | 94.59% | 94.28% | 94.91% |
The configuration of the computer used for the program is an Intel Pentium Dual-Core with a processor speed of 2.2GHz and a memory size of 3.18GB. For the proposed algorithm, training the CNN is a time-consuming process. However, the training process can be carried out off-line. The training process (i.e., the whole data preprocessing process and the CNN training process (10 times)) requires approximately 9.65 hours for the 24,000 samples. Table
Comparison of the time spent in each process.
Remove QRS wave and noise reduction | The interpolation process | RCN extracting feature process | Testing |
---|---|---|---|
0.11 seconds | 0.00023 seconds | 0.0075 seconds | 0.00092 seconds |
As for the testing process, it was determined that the process of removing the QRS wave and reducing the noise was the most time-consuming process. After several experiments, the time spent in each process for one sample was obtained, and it was revealed that the testing process is about 0.1186 seconds for a sample. Therefore, this method can be used in real-time signal processing.
In this paper, a novel rate-independent AF detection algorithm that combines RCN and CNN based on AA features is presented. Firstly, the recurrence matrix is calculated with RCN, and the eigenvalues of the matrix are extracted to characterize atrial activity. Then, CNN is employed, which leverages the multilayer structures and presents an increasingly abstract representation of the input. These signals are distinguished through the optimization of the network so as to extract high-level features and classify the input sample. Finally, majority voting is utilized to improve algorithm performance.
In the experiments, the training set and testing set are constructed with a special arrangement so that the data samples of each set are obtained from different subjects. The proposed algorithm achieves an accuracy of 94.59%, which is comparable to popular RRI-based methods. Moreover, the proposed rate-independent algorithm is applicable to patients with rate-controlled drugs or pacemakers. Furthermore, the developed method solves the problem of individual variation. Therefore, it is evident that the proposed method can detect AF with superior performance.
The data used to support the findings of this study are available from the corresponding author upon request.
The authors declare that they have no conflicts of interest.
This work is supported by National Natural Science Foundation of China (61473112), Foundation for Distinguished Young Scholars of Hebei Province (F2016201186), Natural Science Foundation of Hebei Province (F2015201112), and Science and Technology Research Project for Universities and Colleges in Hebei Province (ZD2015067).