Enhanced premature ventricular contraction pulse detection and classification using deep convolutional neural network

Access to accurate and precise monitoring systems for cardiac arrhythmia could contribute significantly to preventing damage and subsequent heart disorders. The present research concentrates on using photoplethysmography (PPG) and arterial blood pressure (ABP) with deep convolutional neural networks (CNN) for the classification and detection of fetal cardiac arrhythmia or premature ventricular contractions (PMVCs). The framework for the study entails (Icentia 11k) a public dataset of ECG signals consisting of different cardiac abnormalities. Following this, the weights obtained from the Icentia 11k dataset are transferred to the proposed CNN. Finally, fine-tuning was carried out to improve the accuracy of classification. Results obtained showcase the capacity of the proposed method to detect and classify PMVCs into three types: Normal, P1, and P2 with an accuracy of 99.9%, 99.8%, and 99.5%.


Introduction
Premature ventricular contractions (PMVCs) are the most common rhythmic irregularity of heart rate that occur due to the secondary ectopic pacemakers located in the ventricles.The said condition is evidenced in people and could be nonfatal in the absence of structural heart diseases.However, in the event of underlying structural heart diseases PMVCs become a prominent risk factor that triggers a stream of cardiac abnormalities [1][2][3][4].Recent research reported the correlation between the increased frequency of PMVCs and cardiac failure.Multiple frequent PMVCs can occur as bigeminy and trigeminy where every second and third beats are premature respectively.This can cause inefficiency in blood circulation and that may lead to temporary loss of consciousness [5][6][7].Notably, PMVCs are the most generic type of cardiac irregularity in patients with chronic kidney disease [8].
Several methods have been fashioned, investigated, and presented for the detection and classification of PMVC from ECG signals such as the Gaussian Process Classifiers (GPC), Support Vector Machines (SVM) [9], Fuzzy neural network (FNN) [10], Wavelet transform and timing interval features [11], Wavelet transform and discrete cosine transform [12], SVM and particle swarm optimization [13], Principal Component Analysis (PCA) and Feed Forward Artificial Neural Network (FFANN) [14] and Quadratic spline wavelet and FNN [15].Besides, to classify data, several stochastic and statistical features, including the Lyapunov exponent, skewness, kurtosis, fuzzy entropy, and spectral entropy, were extracted from signals, and select features have been identified by PCA.Results revealed that KNN outperformed all classifiers [22] with higher values.However, in the majority of aforementioned methods, chest electrodes were utilized for acquiring the ECG signal which may cause discomfort and limited freedom of movement to patients [16].In this regard, researchers explored an alternative method for ECG in the form of Photoplethysmography (PPG) based devices.These devices are cheap, user-friendly, and convenient for self-screening daily [17].The literature described studies on PMVCs detection and classification using PPG signals.
To discriminate between an irregular pulse-to-pulse interval (PPI) caused by an arrhythmic pulse and one caused by an artifact, the algorithm measures the PPI and pulse amplitude by a beat.This study verified that it is possible to detect irregular pulses utilizing the properties of pulse amplitude variations without incorrectly detecting body movement data [18].There is a compensatory pause following every premature ventricular beat, allowing the ventricle more time to fill.Therefore, an increase in stroke volume is connected to the following regular heartbeat.Thus the study demonstrates that the first indication that a patient has developed PMVC pulse is frequently a beat-to-beat variation in PPG amplitude [19].For the categorization and detection of ventricular premature beats (VPBs), the two traditional metrics turbulence onset and slope are evaluated in conjunction with turbulence shape in another study.With a linear classifier, a classification accuracy of Acc = 96.8% is achieved in this method.One of the paper's limitations is that the atrial premature beats were not taken into account for analysis [20].Another technique is based on six characteristics that define peak-topeak intervals and PPG pulse power.The characteristics are extracted using a sliding window approach and are normalized in relation to heart rate.The successful high classification results serve as a foundation for robust PMVC detection that is less intrusive than electrocardiography-based methods [21].In order to classify the data, a number of stochastic and statistical features, including the Lyapunov exponent, skewness, kurtosis, fuzzy entropy, and spectral entropy, were extracted from the signals.Selected features were then identified by PCA.The results revealed that KNN performs the best overall of all classifiers [22].The accurate detection of PPG onset points alone allows for the representation of the total PPG beat shape in terms of two simple statistical characteristics.In contrast to the regular beats, the estimated beat-to-beat difference between these two factors provides a discriminating distinction for the PVC beats [23].Another method is proposed to use photoplethysmographic (PPG) data from a smartwatch to detect premature atrial contraction (PAC) and premature ventricular contraction (PVC).For the MIMIC III dataset, the suggested technique offers a surprisingly high detection accuracy of 92% [24].
Yet, the studies were limited to a few features in the time and frequency domain and do not explicitly highlight the competence in detecting premature pulses.In the current research, automated detection and classification of PMVC from PPG and Arterial Blood Pressure (ABP) is therein proposed using a wavelet-based Convolutional Neural Network (CNN) algorithm.Wavelet transform aids in the detection of multiscale frequency information, while CNN extracts specific features of the signal and classifies them into specific categories.In this way, PPG and ABP signals elevate the robustness of the algorithm with good classification accuracy when compared to most previously published methods.The organization of the paper starts with Introduction, followed by Methodology, Results, Discussion, and Conclusion.

Waveforms
PPG is a non-invasive method for monitoring blood volume changes in cardiovascular systems that work by illuminating the tissue at a certain wavelength of light [17].Usually, PPG is acquired from a fingertip with a single sensor thus providing more comfort to the patient than in the case of attaching ECG electrodes.Whereas, the ABP is acquired by using a tonometer attached to the radial artery of the patient [25].The reduced ventricular filling during PMVC lessens the PPG and ABP pulse amplitude.Hence, the waveforms become very difficult to identify (P1) or show very small amplitude (P2) [26].These premature pulses P1 and P2 in PPG and ABP along with a reference ECG is depicted in Fig. 1.

Datasets
Pretraining of the deep neural network was carried out on Icentia 11k dataset.For the development of the Icentia 11k dataset, ECG signals of 11,000 patients from Ontario, Canada [27] were recorded using a CartioSTAT device.Following this, automatic beat detection was performed on the extracted signal, and each beat was analyzed by an Icentia technologist.The beat was then annotated into different categories of cardiac arrhythmias including Premature Arterial Contraction, PMVC, Normal Sinus rhythm, Arterial Fibrillation, and Arterial Flutteres.The PMVC pulses detected from the Icentia dataset were 44,835.
The proposed method was developed on a 1 h duration of PPG and ABP signals from the Physio net MIMIC database, sampled at 250 Hz [28]

Proposed framework
The proposed technique for PMVC detection and classification from PPG and ABP signals is shown in Fig. 2. Firstly, the signals were subjected to pre-processing to reduce artifacts.Following this, a Low-Rank Optimization algorithm was performed and the denoised signal was subjected to wavelet transform at different scales.The obtained result was processed through the convolutional neural network to detect the PMVC and classify them into Normal, P1, and P2 pulses.A detailed description of each of the steps is discussed below.

Motion artifact removal
Low-rank optimization algorithm allows modeling the same complexity of the PPG and ABP signals with smaller dimensions.This smaller dimension approximation of the original PPG and ABP signals is subject to the constraint that the smaller dimension has a lower rank.The rank constraint often imposes constraints on the deformities and outliers of the signal.This conceptualization can be mathematically proven by compacting full-dimensional data into a smaller dimensional subspace while retaining the same information.The motion artifact signals can be mathematically modeled as where Y is the PPG/ABP signal corrupted with the motion artifact (H) and the additive noise (n).Using Eq. ( 1), H and x are extracted from Y.This equation is known as an "ill-posed problem" and derives its name as the number of unknown parameters is greater than the number of known parameters.When x and H are separated, the x value provides the motion artifact-free signal.Whereas, in the case of a Single   Measurement Vector Model (SMV), Y is 1-D consisting of sensor data from either PPG or ABP.Importantly, the proposed network incorporates Lowrank approximation as a unique and innovative step in the detection workflow, owing to its compatibility and accuracy in processing signals that have been affected by motion artifacts.Equation (1) stands for the Fourier frequency domain and the low-rank approximation works exceptionally in this domain.The convolutive operation can be modeled as a multiplicative separation of variables, and it also causes a distinct separation between motion artifact and PPG/ABP signal frequencies formerly occupied in the outer higher frequency bands.Alternatively, the optimization reduces additive noise and convolutive motion artifacts.Both convolution and additive deterioration can be removed using the issue statement in Eq. ( 1).The low-rank algorithm turns this matrix into one with a significantly lower rank than the original by making the matrix have fewer independent rows but essentially the same information for a given Y.
Overall, using low-rank approximation results in a smaller subspace structure, which aids in regularizing and solving ill-posed problems by leveraging the amount of redundancy, which is in turn directly proportional to the rank.The number of observations in a low-rank matrix must be equal to or greater than the degree of freedom given by r (M + N − r), where M, N, and r denote the signal's rows, columns, and rank, respectively.The Augmented Lagrangian Method (ALM) has been utilized to tackle the motion artifact problem.It is a linear, ill-posed, inverse problem, and the low-rank matrix was employed for efficient optimization approaches.Singular Value Decomposition (SVD), a lowrank algorithm utilized in this paper, decomposes the signal into singular values, which decomposes the matrix into and the rank of X is equal to the number of non-singular values in the SVD.Where U, V represents the unitary square matrices of dimension [M × D, D × N] and ∑ represents the diagonal singular matrix of low rank which is equal to the number of non-singular values in the SVD.In the given event, the signal is both sparse and low rank, the matrix decomposition occurs as N atoms and all the atoms together form an atomic set A. where The above process represents an atomic set generation by concatenation of matrices.
(2) The SVD for the atomic set of sparse low-rank matrix A is given by From the atomic set A, the low-rank matrix is retrieved and used in a convex optimization for motion artifact removal as indicated by where ‖X‖ * is the nuclear norm of the matrix Independent Component Analysis (ICA) was deployed for motion artifact removal in case of noisy signals; however, it proved effective only in the case of small degradations.Similar to ICA, the low-rank approach also assumes that a motion artifact's high dimensional data can be modeled with much lower dimensional data without a motion artifact.The low-rank constrained optimization problem can be modeled as: where ‖‖ F represent the Frobenius norm and E represents the error or the motion artifact.The above low-rank minimization uses SVD as given by where (U, ∑, V) represents the SVD components and k , represents the regularization and penalty variables.The lowrank decomposition with matrix recovery differs from other motion artifact reduction methods by using only the rankone matrix.This proposed algorithm is applicable in case of any low-rank obtained from an iterative minimization step given as where representing the k+1 iteration atomic set is a sparse domain.The atomic set is iteratively updated to obtain the optimal solution and the recovered matrix after K + 1 itera- tions.‖‖ F represents the Frobenius norm.The low-rank matrix recovery is assisted with gradient priors to the preceding equation as where ∇‖Hx‖ is the more regularized gradient prior and be employed to further rectify the motion artifact output without compromising the fundamental and harmonic frequencies.(

Wavelet transform
The motion artifact corrected signal is as a secondary step, subjected to wavelet transform.This step contributes transformation of signals from the time domain to a combination of time and frequency domains [29].The Continuous Wavelet Transform (CWT) being applied to the signal is given by As seen in Eq. ( 11), the transformed signal is a function of two variables, translation (τ) and scale parameters (s) respectively.ψ(t) is the transforming function and is called the mother wavelet.Applying the CWT, in each window (per second) of PPG and ABP yields a tensor of wavelet coefficients as shown in Fig. 2. The scalogram thus obtained from the CWT helps to distinguish morphological and structural variation at each time point of the raw signal.

Convolutional neural network
Critically, CNN is being introduced as an innovative approach for the first time in an artificial neural network with a view of building a network with several deep layers.The local connections and shared weights make CNN stand apart from other deep-learning architectures.The architecture of deep CNN consists of several convolution layers and pooling layers.In convolution layers, a weight matrix or filter runs across the input signal or image such that all elements are converted at least once to get a convoluted output [30].ResNeXt is the deep CNN being used in the proposed method.ResNeXt network is an integration of ResNet [31] and Inception [32].A ResNeXt has repeated blocks of convolution layer with the same topology and it also introduces a new dimension called cardinality (C).Cardinality is an essential element along with width and depth.The ResNeXt used in this method has a Cardinality of C = 32.The structure of ResNeXt with C = 32 is portrayed in Fig. 3.
The output layer of ResNeXt consists of three neurons with a softmax activation that gives the probabilistic distribution of three classes namely Normal, P1, and P2.The architecture of the ResNeXt network utilized in the present study is illustrated in Fig. 4. Firstly, the ResNeXt network is pretrained using the Icentia 11k dataset to detect the PMVC pulses.Later, the network is finetuned using the pretrained weights obtained from the Icentia dataset for input MIMIC and test dataset from the hospital.

Fine-tuning of CNN
As a prior, transfer learning involves pretraining ResNeXt on the Icentia dataset, followed by fine-tuning ResNeXt on the MIMIC and hospital datasets.Pretraining provides a technique to identify ideal initial weights that enhance target task learning.Subsequently, the last stage involves fine-tuning, wherein a network begins with transferring all weights from a pretrained network to a currently used network.A common practice of fine-tuning is to replace the last fully connected layers with the number of classes available for the preferred application.However, this is applicable only when the distance between the source and the target is comparable to some degree.Otherwise, the effective way of fine-tuning starts from the last layer and incrementally includes layer by layer until the desired performance is attained.In the proposed work, the resNeXt network shown in Fig. 3 is adopted for fine-tuning.PPG being the change of intensity in blood volume occurred during each cardiac cycle is obtained from the patient's fingertip and any changes in the ECG rhythmic activity or minute changes will immediately be reflected on the PPG signal.This results in good fine-tuning accuracy using the pretrained weights from the icentia dataset.The finetuning of CNN was done on the MIMIC dataset labeled normal, P1, and P2 pulses.It is vital to perform downsampling and normalization before fine-tuning.The dataset was down-sampled to a frequency of 250-300 Hz to match

ROC analysis
The 18 test signals collected from the MIMIC dataset and 2 test signals obtained from the hospital were analyzed to obtain classification accuracy.Figure 5 compares the Receiver Operating Characteristics (ROC) curve for finetuned CNN in the case of Normal, P1, and P2 classes.During fine-tuning, the least performance was obtained when random weight was initialized to the CNN.However, finetuning the last two layers (FC1-FC2) provided better results when compared to random weight initialization.The performance was improved via fine-tuning of ResNext from block 1 to the FC2 layer for all classes.Figure 6 compares the ROC curve for Normal, P1, and P2 obtained from fine-tuned ResNext block 1 to FC2 layer.The network could classify a normal signal with an Area under the Curve (AUC) of 0.9821 and an AUC of 0.971 and 0.9565 or P1 and P2 signals, respectively.The classification accuracy of the P2 pulse was reduced owing to the prevalence of severe motion artifacts leading to misclassification with some smaller pulses.

Performance evaluation
The training progress and loss function of the best-finetuned models are shown in Fig. 7.The training accuracy goes up to 99% and the loss function is almost zero for ResNeXt when compared with ResNet and DensNet.The figure shows ResNet gives less performance when compared with densNet with a training accuracy of 92% and loss function of 0.5.The comparison of the F1 score of different pretraining objectives on the test datasets is given in Table 2.The pretraining objectives include heart rate classification, Arterial fibrillation, PMVC, and sinus rhythm.The transferred weights from the Icentia dataset corresponding to PMVC were given as initial weights to the MIMIC dataset.The F1 score of both normal and noisy signals along with average values are detailed in the table below.The MIMIC test dataset exhibited a good F1 score for PMVC events in comparison with other pre-training objectives.The average F1 score obtained for PMVC was 0.959 ± 0.52.ResNeXt showed an excellent F1 score of 0.934 ± 0.12 for noisy PMVC pulses as well.

Classification results
Table 3 compares F1 score on different CNN architectures, and it is obvious from the table that ResNeXt outperformed the findings when compared to ResNet and DenseNet.Table 4 illustrates the classification results using CNN alone with PPG and ABP signals and an accuracy of 93.8%, 92.3%, and 89.4% was obtained for Normal, P1, and P2 pulses respectively.While results from using wavelet-based CNN with PPG signal alone are detailed in Table 5.The performance of wavelet-based CNN with PPG signal reflected better classification than CNN with PPG and ABP signals; with an accuracy of 95.9%,93.4%,and 90.08% for Normal, P1, and P2 pulses respectively.In contrast to the above-stated approaches, the researched method of wavelet-based CNN using both PPG and ABP signals (Table 6) depicted the best results.The classification results outperformed the above two methods with an accuracy of 99.9%,99.8%,and 99.5% for Normal, P1, and P2 pulses respectively.Such a feat is a great indicator for the adoption of the proposed framework in the detection of PMVC signals.
The classification results are also validated with different matrices for the proposed method and state of art methods.Figure 8. shows the comparison of Feed Forward Artificial Neural Network (FNN) [21] and KNN [22] with the proposed network in terms of Mathews Correlation Coefficient (MCC) [33], Precision, and F1 score for Normal, P1, and P2 pulses.Results reveal that the proposed fine-tuned ResNeXt Network outperformed the other two techniques for all the matrices used for evaluation.

Discussion
The present research was carried out to develop the most precise and accurate method for the detection and classification of PMVC from simultaneous PPG and ABP signals.The use of wavelet transforms and CNN allowed the achievement of better performance than other machine learningbased methods [21], [22] discussed elsewhere.With wavelet transform, the multiscale frequency information could be obtained at each point of the given signal that relates to premature pulses.CNN thus aids the extraction of several features related to premature pulses and inappropriate classification.In the current method, estimation of wavelet transform on every 1 s duration of the signal was carried out, to avoid even minuscule loss of pulses.Furthermore, the incremental fine-tuning of CNN contributes to higher sensitivity on ResNext from block 1 to the FC2 layer for all classes with low false positive rates.
According to the study, the biggest issue is identifying PMVCs apart from artifacts because distorted PPG and ABP signals can be mistakenly allocated to a category of premature pulses.Previous studies used high-pass and lowpass FIR filters to pre-process the PPG signal [18,[21][22][23][24].The proposed method used an advanced signal processing algorithm based on low-rank optimization to eliminate the motion artifact.This algorithm showed adequate performance to find PMVCs in artifact-distorted data which in turn increases the robustness of the results.
Comparative analysis of the proposed method in terms of performance indicators was described on par with CNN alone with PPG & ABP signals, wavelet-based CNN with PPG signal alone, and also other available machine learning-based techniques [21,22] (Table 7).As defined by sensitivity and specificity, the morphological features-based ANN method [21] obtained values of 99.4/94.2,94.2/99.6, and 93.1/99.8;while, the proposed method obtained higher   99.8% for Normal, P1 and P2 pulses, respectively.Although the algorithm shows nearly perfect specificity and sensitivity as shown in Table 7, the study was also compared in terms of MCC, precision, and F1 score with state of art methods.The matrices used in the proposed network outperformed KNN [22] for all three classes.Also, the method showed better results than or the performance is at par with FNN [21].
In general, the normalization of heart rate will tend tedious when the classification performance of the PPG signal largely depends on the estimated normal heart rate [21].In addition, the pre-processing step could be considered timeconsuming and complicate the algorithm [21].Hereby, the proposed algorithm eliminates these two problems, although the time taken for training was relatively high it is ideally balanced with reduced testing time of mere seconds.
Despite, discussed and validated results certain considerations are essential in utilizing the proposed framework.The limitations of the proposed include manual labeling of Normal, P1, and P2 pulses by comparison of the ECG pulses.Furthermore, testing was not carried out with signals recorded during physical activities in real time.In the proposed study, the ECG signal beats are carefully examined from the start to determine the presence of the PVC beats solely.However, other kinds of arrhythmia, such as premature atrial contraction, atrial fibrillation, atrial flutter, irregular sinus rhythm, etc., may also have an impact on the PPG signal.Future research will examine the impact of these forms of arrhythmias, which were not taken into account in this study.

Conclusion
An automated detection and classification of PMVCs using PPG and ABP was proposed as a unique approach.Results indicated that the wavelet-based CNN provides good accuracy for premature pulse classification in comparison to other available methods.Herein, transfer learning was used to improve the accuracy of classification using ResNeXt.Initially, pretraining was carried out on a large ECG dataset called Icentia 11k, and later fine-tuning was performed on a smaller PPG dataset obtained from MIMIC and the hospital dataset.Since PPG estimates the blood volume changes that occurred during each cardiac cycle as sampled from the patient's fingertip, even minute changes in the ECG rhythmic activity will be reflected.Further, as both ABP and ECG are physiological measurements that reveal the heart's functionality, any anomaly in the heart can be well observed in the ABP waveform.Compared to previous studies that used basic filters, the low-rank optimization method used for eliminating motion artifacts increases the robustness of the algorithm.It is understood that the depth of the layers that have been finetuned and the number of parameters that have been taken into consideration both affect how long it takes to train a model.Results indicated that among all Models fine-tuned ResNeXt has taken minimum training time in addition to achieving an accuracy of 99.9%.Thereby, the proposed PMVC detector could be deployed in clinical applications when moderate physical activities are involved for rapid minute detection with greater accuracy.Innovative health monitoring devices that can be used to reduce the mortality rate due to PMVC can be compatible with the proposed method and its promising results.

Fig. 1
Fig. 1 Example of PMVC pulse types in PPG and ABP signals with reference ECG signal, where N indicates Normal pulse and P1 and P2 indicate PMVC pulses respectively

Fig. 2
Fig. 2 Block diagram of the proposed method.The process is divided into 5 steps: (1) the dataset was denoised using the low-rank optimization technique (2) the spectrogram of the signal is obtained using wavelet transform (3) the Icentia11K data set is used to pretrain a

Table 2
Comparison of F1 score of different pre-training objectives.For each method, the average macro F1 score and the standard deviation on the test set were reported Performance analysis of KNN, FNN, and proposed network with different performance parameters for Normal, P1, and P2 Pulses.MCC vs. Epochs for a normal b P1 Pulse c P2 Pulse.Precision vs. Epochs for d normal e P1 Pulse f P2 Pulse.F1 score vs. Epochs for g

Table 4
The Classification results obtained using CNN with PPG and ABP signals

Table 5
The Classification results obtained using wavelet-based CNN with PPG signal

Table 6
The Classification results obtained using wavelet-based CNN with PPG and ABP signals