Atrial Fibrillation Detection Directly from Compressed ECG with the Prior of Measurement Matrix

: In the wearable health monitoring based on compressed sensing, atrial ﬁbrillation detection directly from the compressed ECG can effectively reduce the time cost of data processing rather than classiﬁcation after reconstruction. However, the existing methods for atrial ﬁbrillation detection from compressed ECG did not fully beneﬁt from the existing prior information, resulting in unsatisfactory classiﬁcation performance, especially in some applications that require high compression ratio (CR). In this paper, we propose a deep learning method to detect atrial ﬁbrillation directly from compressed ECG without reconstruction. Speciﬁcally, we design a deep network model for one-dimensional ECG signals, and the measurement matrix is used to initialize the ﬁrst layer of the model so that the proposed model can obtain more prior information which beneﬁts improving the classiﬁcation performance of atrial ﬁbrillation detection from compressed ECG. The experimental results on the MIT-BIH Atrial Fibrillation Database show that when the CR is 10%, the accuracy and F1 score of the proposed method reach 97.52% and 98.02%, respectively. Compared with the atrial ﬁbrillation detection from original ECG, the corresponding accuracy and F1 score are only reduced by 0.88% and 0.69%. Even at a high CR of 90%, the accuracy and F1 score are still only reduced by 6.77% and 5.31%, respectively. All of the experimental results demonstrate that the proposed method is superior to other existing methods for atrial ﬁbrillation detection from compressed ECG. Therefore, the proposed method is promising for atrial ﬁbrillation detection in wearable health monitoring based on compressed sensing.


Introduction
Atrial fibrillation (AF) is the most common type of persistent arrhythmia. It is closely related to the occurrence of thrombosis, stroke, and even death, posing an imminent threat to human health [1,2]. Therefore, real-time detection of atrial fibrillation and corresponding intervention is important to prevent the occurrence of related diseases. In recent years, wearable technology-based health monitoring has rapidly developed, and compressed sensing (CS) [3][4][5] is increasingly used in wearable health monitoring due to its low sampling rate and low power consumption [6]. Compressed sensing can collect physiological signals at a much lower sampling rate than Nyquist on wearable devices and accurately reconstruct the original signals at remote devices, thus greatly reducing the power consumption of wearable devices and extending their battery life [7].
Usually, the wearable health monitoring system based on compressed sensing will first accurately reconstruct the original ECG signals after the compressed ECG data are collected and transmitted to the remote devices, and then make a further diagnostic analysis based on the reconstructed ECG signal [8]. However, the time required for signal reconstruction is likely to affect the real-time performance of automatic diagnosis, especially when most of the compressed sensing reconstruction algorithms have high computational complexity [9]. In the automatic AF detection, to obtain a more accurate analysis result, it is usually necessary to analyze a length of ECG signal frame of 5 to tens of seconds, which will bring a certain processing delay [10]. If a lot of time is consumed during signal reconstruction, it is difficult to ensure the real-time performance of AF monitoring.
To solve the problem of real-time performance degradation caused by the signal reconstruction process in the wearable AF monitoring system based on compressed sensing, Da Poian et al. [11] proposed a matched filtering method to extract RR intervals directly from compressed ECG data, so that compressed ECG can be used directly for AF detection without reconstruction. However, the RR intervals extracted by Da Poian's method at a higher compression ratio is not accurate, resulting in unsatisfactory classification performance for AF detection. In addition, Zhang et al. [12] proposed a deep learning method, which directly inputs the collected compressed ECG into the neural network model, and then outputs the results of AF detection. In fact, if there is no other prior information, the compressed ECG contains much less information than the original ECG, so it is difficult to obtain satisfactory classification performance by only relying on the compressed ECG data.
In this paper, we propose a method to detect atrial fibrillation directly from compressed ECG signals, which makes full use of the existing prior information to improve the classification performance of AF detection. Specifically, we designed a deep neural network model for one-dimensional ECG signals, which directly inputs the compressed ECG signal to the model, and outputs the detection result of atrial fibrillation at the end of the model, thereby eliminating the process of ECG signal reconstruction. To fully benefit from the prior information contained in the measurement matrix, so as to improve the classification performance of atrial fibrillation detection, we designed the first layer of the deep network model as a fully connected layer and initialized the weights of this layer with the pseudo-inverse of the measurement matrix. The experimental results on the MIT-BIH Atrial Fibrillation Database show that our proposed method is superior to the existing algorithms for directly detecting atrial fibrillation from compressed ECG, and the initialization using the measurement matrix effectively improves the classification performance of AF detection from compressed ECG. In summary, the main contributions of this paper are as follows: • To address the real-time problem of atrial fibrillation detection based on compressed sensing, a deep learning method to detect atrial fibrillation directly from the compressed ECG is proposed without the need to reconstruct the ECG, thereby ensuring the real-time detection of atrial fibrillation in wearable health monitoring.

•
In order to fully benefit from the existing prior information, we designed the first layer of the deep network model as a fully connected layer, and then used the measurement matrix to initialize the weights of this layer, so that the model can learn the features related to atrial fibrillation more easily. As a result, the classification performance of the model can be effectively improved.

•
Experiments on the MIT-BIH Atrial Fibrillation Database show that the classification performance of the proposed method is superior to the existing methods for detecting atrial fibrillation from compressed ECG. Especially at higher compression ratios, it can effectively reduce the loss of classification performance caused by signal compression.
The remainder of this paper is organized as follows: Section 2 states problem description and motivation; Section 3 presents the proposed method; Section 4 describes datasets, experimental setup, evaluation metrics, and experimental results; conclusions are given in the last section.

Importance of Measurement Matrix in Compressed Sensing
Compressed sensing is a framework used for data sampling and compression. It performs sensing and compression at the same time. Compared with the traditional data sampling and compression methods, it costs much less energy [13]. Thus, it is being used more and more in the cases which require low-power data acquisition extending the battery life [14]. The basic mathematical model of compressed sensing can be expressed as where α ∈ R N×1 is the original signal, Φ ∈ R M×N (M N) is the measurement matrix, and s ∈ R M×1 is the compressed signal. The original signal is projected from the high-dimensional space to the low-dimensional space through the measurement matrix, so as to realize the compression of the original signal. Therefore, the measurement matrix is an important link between the compressed signal and the original signal. Compressed sensing reconstruction algorithms [15][16][17][18] can use the measurement matrix to accurately reconstruct the original signal from the compressed data. Thus, a lot of important information in the original signal can be obtained by using the measurement matrix. If there is only the compressed signal without knowing the measurement matrix, it is difficult to infer from the low-dimensional space back to the high-dimensional space. This is actually like wavelet-based compression and reconstruction: if there are only wavelet coefficients, but the wavelet basis is unknown, it is also difficult to reconstruct the original signal.
As shown in Figure 1, we take a normal ECG and atrial fibrillation ECG as examples. Figure 1a,b are a normal ECG segment and an atrial fibrillation ECG segment, respectively. In normal ECG, each heartbeat contains a P wave reflecting atrial activity and a QRS complex reflecting ventricular activity, and the R peak (marked by red circles in the figure) is the most prominent peak in each heartbeat. In AF ECG, the P wave disappears and is replaced by a continuous fibrillating wave, and the RR interval (interval between two adjacent R peaks) sequence is absolutely irregular. Usually, atrial fibrillation waves are difficult to extract due to their small amplitude and are easily disturbed by noise. Therefore, the RR interval sequence is more commonly used to automatically diagnose atrial fibrillation [19]. Figure 1c,d are the compressed data of (a) and (b), respectively, and the compression ratio corresponding to the measurement matrix is 60%. From the time domain waveform, the compressed data are not consistent with the dimension of the original ECG segment, and some waveform characteristics of the original ECG are not clearly shown in the compressed data. Thus, it is difficult to obtain some features of the original ECG only from the compressed ECG. Then, we multiplied the pseudo-inverse of the measurement matrix with the compressed data in Figure 1c,d to get the waveform in Figure 1e,f. This simple multiplication can be regarded as a crude reconstruction; of course, the signal is already seriously distorted relative to the original ECG. However, in fact, we can still see all the R peaks (red circles) in the original ECG from Figure 1e,f. This shows that, through a simple operation on the measurement matrix, we have actually recovered the positions of the R peaks in the original ECG. Therefore, it can fully benefit from the prior information of the measurement matrix and obtain the effective features of the original ECG to improve the classification performance of atrial fibrillation detection.

AF Detection Based on Compressed Sensing
The electrocardiogram is currently the most effective way to detect atrial fibrillation [20]. The main characteristic of atrial fibrillation on the electrocardiogram is that the P wave disappears and is replaced by continuous and irregular tremor waves. In addition, due to the absolute irregularity of the ventricular rate, the RR interval time series is absolutely irregular.
The most commonly used method for the automatic detection of atrial fibrillation is machine learning. These methods first extract the morphological and statistical features of the ECG, and then use these features as input to train a classifier to automatically identify whether the ECG contains atrial fibrillation. In recent years, due to the powerful feature extraction capabilities of deep neural networks, end-to-end AF detection methods based on deep learning have achieved better accuracy [21]. In the deep learning-based AF detection method, there is no need to extract the ECG features in advance, but directly input the original signal into the network model.
In a wearable health monitoring system based on compressed sensing, after the compressed ECG data are collected and transmitted to the remote devices, the original ECG signal is usually reconstructed first, and then the reconstructed signal is used for automatic diagnosis and analysis. The blue arrow in Figure 2 is the basic process of AF detection in a wearable health monitoring system based on compressed sensing. First, the compressed ECG signal needs to be collected on the wearable device using compressed sensing; then, the collected compressed data are transmitted to the remote device through a wireless connection; after receiving the compressed data, the remote device usually uses a compressed sensing reconstruction algorithm to reconstruct the ECG signals, and then uses the reconstructed ECG signals for automatic AF detection [22]. However, most of the compressed sensing reconstruction algorithms have high computational complexity. If the computing performance of remote devices is limited, such as smartphones or smartwatches, the reconstruction process will consume a lot of time. As a result, the real-time performance of AF detection is seriously affected. Since the original signal can be reconstructed from the compressed data with high precision, it means that the compressed data contain most of the information of the original signal. Therefore, it is possible to directly use the compressed data for AF detection without reconstruction, just as shown by the red arrow in Figure 2. Da Poian et al. [11] proposed a heartbeat detection method called compressed sensing matched filtering (CSMF) [23], which can directly detect the locations of the R peaks from compressed ECG data, thus obtaining the RR intervals. The same method is also used to detect systolic peak from compressed photoplethysmography [24]. Then, based on the RR intervals, a support vector machine (SVM) classifier is used to detect the presence of atrial fibrillation. Although their proposed method alleviates the adverse impact of signal reconstruction on real-time performance, the accuracy of AF detection is significantly lower than that of AF detection on the reconstructed signal at the same compression ratio. In addition, Zhang et al. [12] also eliminated the signal reconstruction process and proposed an end-to-end AF detection method for compressed ECG signals based on deep learning. They directly input the compressed ECG signal segments into the designed convolutional neural network model and output the result of AF detection at the end of the model. However, Zhang's method ignored the measurement matrix, which is an important link between the compressed signal and the original signal. Based on a large amount of data and the powerful learning ability of deep neural networks, Zhang's method has learned the mapping relationship between compressed ECG and AF labels to a certain extent. However, if the prior information of the measurement matrix is used to train the network model at the same time, then the network model may be easier to learn some important features about the original ECG, thereby improving the classification performance of the model. This paper aims at the problems of insufficient utilization of existing prior information and poor classification performance of AF detection in compressed ECG and makes full use of the available prior information to improve the classification performance of AF detection from compressed ECG.

Proposed Method
In order to solve the problem of AF detection of compressed ECG, a deep neural network model for one-dimensional ECG signals is proposed based on deep learning.

Loss Function
AF detection is to automatically identify whether there is atrial fibrillation in the ECG segment, which is actually a binary classification problem in machine learning. Therefore, we use binary cross-entropy loss for AF detection, which is defined as follows: where i is the index of the ECG segment, there are a total of K ECG segments, y i is the label of the i-th ECG segment, andŷ i is the probability of whether the input ECG segment has atrial fibrillation.

Model Architecture
In this paper, we design a one-dimensional neural network model using one-dimensional ECG signals for AF detection based on residual network [25] and grouped convolution [26]. The network model we proposed refers to ResNeXT [27] and is simplified and modified for our problem. The high-level architecture of the proposed model is shown in Figure 3a.  The model starts with a fully connected layer, followed by a one-dimensional convolutional layer with a kernel size of 3 and a filter number of 64, and four bottleneck blocks. The four bottleneck blocks are divided into four stages, and each bottleneck block is a stage. The width of the bottleneck block is 4d, where d starts from 1 and increases with each stage. Finally, a global pooling layer, a fully connected layer, and a sigmoid layer produce an output probability value, which is between 0 and 1. Figure 3b shows the specific structure and parameters of the bottleneck block. The bottleneck block contains three one-dimensional convolutional layers, and the middle convolutional layer is based on grouped convolution. The first and third layers are two one-dimensional convolutional layers. The detailed parameters of the four bottleneck blocks are shown in Table 1. Each convolutional layer is followed by a batch normalization. We use ReLU as the activation function. Since the bottleneck block uses a skip connection to directly pass the input of the bottleneck block to the end of the bottleneck block, the input of the bottleneck block is added to the output of the last layer and then activated by the activation function.

Initialization Using Measurement Matrix and Training
The first layer of the proposed model is a fully connected layer, and its weight matrix is represented by W. Its input dimension is M which is the length of the input compressed ECG segment, and its output dimension is set to N which is the length of the original ECG segment. Then, the dimension of its weight matrix W is N × M, which is also the dimension of the pseudo-inverse of the measurement matrix. We denote the entire neural network model as f (·), the input is the compressed ECG s, and the output is the label y; then, y = f (s). Then, we define the part of the model except the first layer as g(·), and the output of the model can be expressed as In order to make full use of the prior information of the known measurement matrix, we use Φ † , which represents the pseudo-inverse of measurement matrix to initialize the first layer of the model. Specifically, Φ † is assigned to the weight matrix of the first fully connected layer as the initial value, that is, W ini = Φ † , where W ini indicates the initial value of W. Thus, the output size of this layer is equal to the length of the original ECG segment. When the initial value of this layer remains constant, the output of the compressed ECG through this layer is equivalent to the matrix-vector multiplication described in Figure 1, which can be regarded as a very rough reconstruction of ECG segment. If so, a lot of potentially useful information will be lost.
Therefore, we only use Φ † to initialize the weight matrix W of the first layer, and W will be fine-tuned in the process of supervised training. In the process of training, the atrial fibrillation label is used to mine more potential information from the compressed ECG that can distinguish different types of ECG.
In the training, we use an Adam optimizer with mini-batch to train our network model, and the batch size is set to 256. The epoch is set to 100. Then, we set the learning rate of the model to lr = 0.001, and since we only fine-tune the first fully connected layer, the corresponding learning rate is set to 0.1*lr. The model is implemented based on Python 3.6 and a Pytorch framework [28] of version 1.4.0. The network model is trained on a computer equipped with a CPU of Intel i9-9700k (Intel Corporation Co., Ltd., Santa Clara, CA, USA), 32 GB RAM, and two GPUs of Nvidia RTX 2080Ti (Nvidia Corporation, Santa Clara, CA, USA).

MIT-BIH Atrial Fibrillation Database
The data set used in this paper is from the MIT-BIH atrial fibrillation database [29], which is currently the most widely used atrial fibrillation data set. The database contains 25 long-term ECG records of human subjects with atrial fibrillation (mainly paroxysmal). Among them, records 00735 and 03665 only have beat files and unaudited QRS wave annotation files. Therefore, only 23 ECG signals including two channels are used for recording.
The duration of each recording is about 10 hours and contains two channels of ECG signals. All ECG signals are sampled at a sampling rate of 250 Hz with a resolution of 12 bits and an accuracy of ±10 mV. The original analog recording was made using a dynamic electrocardiograph at Beth Israel Hospital in Boston, with a typical recording bandwidth of about 0.1 Hz to 40 Hz. There are four types of rhythm annotations in the dataset: "AFIB" (atrial fibrillation), "AFL" (atrial flutter), "J" (AV nodal rhythm), and "N" (used to represent all other rhythms).
According to the setting of most research work based on this data set, we divide these four types of rhythms into two categories, of which the three types of rhythms "AFL", "J", and "N" are merged into one category, namely "Non-AF", and "AFIB" is another category, namely "AF".

Experimental Setup
In the experiment, we divided the ECG signals in the MIT-BIH Atrial Fibrillation Database into segments with a duration of 10 s, and, since the sampling rate of the ECG signals was 250 Hz, the number of sampling points for an ECG segment was N = 2500. Then, the ECG segments are annotated according to the rhythm annotations in the data set. When the ECG segment contains AF beats, the ECG segment is labeled "AF"; otherwise, it is labeled "Non-AF". After these ECG segments are labeled, we randomly divide all ECG segments into 70% training set, 10% validation set, and 20% test set. We use the validation set to adjust the hyperparameters of the model and select the optimal model to test on the test set. Then, all the ECG segments are compressed by a measurement matrix. The compression ratio (CR) was defined as: We used sparse binary matrix [30] as the measurement matrix, and it was generated with dimension M × N, where M = {2250, 2000, ..., 500, 250}, N = 2500, and the corresponding compression ratios are 10%, 20%, ..., 80%, 90%. At the same compression rate, all ECG segments are compressed using the same measurement matrix. In the experimental results, except for the Gaussian random matrix [31] used in Section 4.4.3 to compare the effects of different measurement matrices on classification performance, the other experiments are all used sparse binary matrices as a measurement matrix, including the two methods compared.

Evaluation Metrics
In the experiments, we used accuracy (Acc), F1 score, sensitivity (Se), specificity (Sp), and Youden index (YI) to evaluate the classification performance of the proposed method. These evaluation metrics are expressed as follows: where TP, TN, FP, and FN indicate true positive, true negative, false positive, and false negative, respectively. In our experiment, we regarded the ECG segment labeled "AF" as positive, while the one labeled "Non-AF" was negative. After the proposed model is trained well, we obtain the values of TP, TN, FP, and FN based on the prediction results of the test set, and calculate the listed evaluation metrics as the experimental results.

Comparison of AF Detection from Compressed ECG and Reconstructed ECG, Respectively
In order to further demonstrate the advantage of detecting AF directly from compressed ECG, we compare the experimental results of the proposed method with that of AF detection from reconstructed ECG. In the experiment, we used the BSBL-BO algorithm [32,33] to reconstruct the ECG segments, which is an excellent algorithm for physiological signal reconstruction. Then, the reconstructed ECG segments were input into the proposed neural network model without the first fully connected layer. Table 2 shows the results of the experiment. As can be seen from Table 2, when the compression ratio is less than 70%, no matter whether the AF detection is from compressed ECG or reconstructed ECG, the classification performance is very close, and there is no very obvious difference. When the compression ratio is 80% and 90%, the classification performance of AF detection from compressed ECG is significantly better than that from reconstructed ECG. This is because the reconstruction algorithm can easily lose some potential useful information when the compression ratio is high, and our proposed method does not depend on the quality of signal reconstruction, but directly learns useful features from the compressed ECG. Therefore, the loss of information in the signal reconstruction process is avoided. In addition, in the last two rows of Table 2, we list the average CPU time required by the two methods to detect AF for each ECG segment, where AF detection from the reconstructed ECG includes two stages of reconstruction and classification, while AF detection from the compressed ECG only includes the time required for reconstruction. As can be seen from the results in the table, the time required for AF detection from compressed ECG does not change much at different compression ratios, while the time required for AF detection from reconstructed ECG decreases with the increase of compression ratio. Most of the time consumed by the AF detection from reconstructed ECG comes from the process of ECG reconstruction, while the time required for ECG classification is very little, which leads to a difference of two to three orders of magnitude in the average CPU time required by the two methods. In order to show it more intuitively, the average CPU time of the two methods with different compression ratios is represented by the curve graph shown in Figure 4, and the vertical axis of the CPU time in the figure is represented by a logarithm. It can be clearly seen from the figure that the CPU time of AF detection from compressed ECG is two to three orders of magnitude less than that of reconstructed ECG. In addition, the higher the compression ratio, the smaller the size of the measurement matrix, and the matrix operation during reconstruction will be simpler, resulting in less time for reconstruction. This is why the blue curve in Figure 4 decreases as the compression ratio increases. Of course, we only take the BSBL-BO algorithm as an example, and there are many compressed sensing reconstruction algorithms with a lower computational complexity that can greatly reduce the time required for the reconstruction process. However, it is difficult to guarantee the quality of signal reconstruction, especially at high compression ratios. For the definite signal reconstruction process, it is difficult to avoid the loss of potential useful information. Our proposed method dynamically adjusts the weights initialized with the measurement matrix according to the information of labels during the supervised training process. Thus, in order to avoid the loss of potentially useful information caused by the signal reconstruction process before the deep network training, it is a better choice to improve real-time performance by eliminating the reconstruction process.

Comparison of Different Methods for AF Detection from Compressed ECG
We compared the classification performance of the proposed method with the existing compressed ECG-based AF detection methods using the evaluation metrics listed in Section 4.2, and Table 3 shows the detailed experimental results. The table lists the comparison of the classification performance of the three methods for the compression ratio from 10% to 90%. In addition, CR = 0% represents the result of AF detection using the original ECG.
The experimental results of the methods proposed by Da Poian and Zhang are directly quoted from their articles. Our proposed method and Zhang's method are both end-to-end methods based on deep learning, which can directly classify the input ECG, whether it is compressed or not. In particular, our proposed method will remove the fully connected layer initialized with the measurement matrix in the model when classifying the original ECG. Since Da Poian's method extracted features from compressed ECG through specially designed matching filtering, her method cannot directly classify the original ECG, so this method did not have classification results for original ECG.
As can be seen from this table, when classifying the original signal (CR = 0%), Zhang's method and our proposed method have very similar classification performance from various evaluation metrics, and Zhang's method is slightly better. When classifying the compressed ECG, Zhang's method inputted the compressed ECG directly into the network model and ignored the measurement matrix, while our method added a fully connected layer initialized by the measurement matrix at the front of the network model. Therefore, our method could make full use of the information of compressed ECG and measurement matrix, which are both necessary in compressed sensing reconstruction. Table 3. Comparison of classification performance between the proposed method and existing methods for AF detection from compressed ECG. Sensitivity (Se) is the probability of no missed diagnosis, while specific (Sp) is the probability of no misdiagnosis. This table shows that the classification performance of the proposed method is superior than the other methods. Bold numbers represent the best results among the compared methods.

Metric
Method The results in Table 3 show that the proposed method is very close to Zhang's method in all the evaluation metrics when classifying the original ECG. However, in the classification of compressed ECG, the classification performance of the proposed method is better than that of Zhang's method at various compression ratios. Taking the F1 score as an example, the F1 scores of the proposed method are 98.02% and 93.40% at a compression rate of 10% and 90%, respectively, which are 0.69% and 5.31% lower than that of the original ECG. Correspondingly, the F1 scores of Zhang's method are 96.25% and 88.17% respectively, which is 2.18% and 10.26% lower than that of the original ECG. That is to say, when the measurement matrix was ignored, Zhang's method lost more classification performance than the proposed method at the same compression ratio. Since our proposed method makes full use of compressed ECG and measurement matrix, the classification performance loss caused by signal compression is much smaller.
For a more intuitive comparison, we take the accuracy rate and F1 score as examples, and use the curve graph shown in Figure 5 to compare the classification performance changes of three methods at different compression ratios. It can be seen from the figure that the classification performance of the proposed method is very close to that of Zhang's method when the ECG is not compressed in terms of accuracy or F1 score. However, after ECG compression, the classification performance of Zhang's method is much worse than that of the proposed method. Especially at a high compression ratio of 90%, the difference in classification performance between the two methods is more obvious. As for Da Poian's method, its classification performance is significantly worse. Regarding the results of Da Poian's method, we can see that it is far inferior to the other two deep learning methods in most evaluation metrics, especially at high compression ratios. In addition, it only performed better on the specificity. As we know, sensitivity is the probability of no missed diagnosis, while specific is the probability of no misdiagnosis. For AF detection, sensitivity is more important because once the patient misses the diagnosis, the patient may miss the optimal treatment time. Relatively speaking, specificity is not the most important because patients are often further checked after being misdiagnosed, so as to have the opportunity to correct the previous misdiagnosis.

Comparison of Different Measurement Matrices
To verify the effect of different measurement matrices on the classification performance of the proposed method, we compared the two most commonly used measurement matrices: sparse binary matrix (SBM) [30] and Gaussian random matrix (GRM) [31]. Table 4 shows the classification performance of the proposed method when using different measurement matrices to compress the ECG. The results of Zhang's [12] method on different measurement matrices are also listed in the table for comparison. It can be seen that, when using the same measurement matrix, the classification performance of the proposed method on most evaluation metrics is better than that of Zhang's method. In addition, at most compression ratios, whether it is the proposed method or Zhang's method, the classification performance of the sparse binary matrix is slightly better than that of the Gaussian random matrix. However, overall, there is no obvious difference in the classification performance based on these two measurement matrices at the same compression ratio.
Of course, how to choose a suitable measurement matrix does not all depend on the classification performance. When designing algorithms related to compressed sensing, high-speed sampled digital signals are usually used to implement signal compression through numerical simulation. However, in practical applications, it is not possible to sample digital signals at high speed and then compress them numerically. In order to take advantage of the low sampling rate of compressed sensing in practical applications, it is necessary to design a special analog-to-information converter (AIC) [34,35] through a hardware circuit according to the measurement matrix. Because the elements in the Gaussian random matrix are randomly generated floating-point numbers, it is difficult to implement the Gaussian random matrix through a hardware circuit. However, the sparse binary matrix is different. The elements in it are all 0 s and 1 s, which is easy to implement on a hardware circuit. Therefore, the sparse binary matrix is more suitable for practical applications. Table 4. Comparison of classification performance of AF detection from compressed ECG using different measurement matrices. This table shows that the classification performance of the proposed method is better than Zhang's method [12] when using the same measurement matrix. For the same method, there is no significant difference in classification performance using different measurement matrices. Bold numbers represent the best results among the compared methods.

Discussion
The experimental results in Table 2 show that the proposed method has a huge advantage in real-time performance compared to the method of classification after reconstruction. Therefore, for scenarios with real-time requirements, it is a better solution to detect atrial fibrillation directly from the compressed ECG. The experimental results in Table 3 show that the proposed method has better classification performance than the existing methods for atrial fibrillation detection from compressed ECG. Table 4 compares the classification performance of the proposed method when using different measurement matrices. From the experimental results, there is little difference between the sparse binary matrix and Gaussian random matrix, but, in practical applications, the sparse binary matrix is easier to implement.

Conclusions
In this paper, a deep learning method using a measurement matrix for initialization is proposed to improve the classification performance of atrial fibrillation detection from compressed ECG. Different from the existing method that simply used compressed ECG and corresponding labels for supervised training, our proposed method fuses the prior information of the measurement matrix into the deep network model, thus fully benefiting from the existing information (including compressed ECG and measurement matrix) to improve the classification performance of atrial fibrillation detection from compressed ECG.
Compared with the usual compressed ECG processing method (classification after reconstruction), the proposed method eliminates the signal reconstruction stage. Therefore, the time required to process the compressed ECG can be greatly reduced, thereby effectively improving the real-time performance of atrial fibrillation detection. In summary, for compressed sensing-based wearable health monitoring that requires real-time performance, direct atrial fibrillation detection from compressed ECG not only improves the real-time performance of atrial fibrillation detection but also helps to save the energy of the equipment with less computational complexity. Therefore, the proposed method has good application prospects in wearable health monitoring scenarios.

Conflicts of Interest:
The authors declare no conflict of interest.