A Robust Beat-to-Beat Artifact Detection Algorithm for Pulse Wave

With the rise of the concept of smart cities and healthcare, artiﬁcial intelligence helps people pay increasing attention to the health of themselves. People can wear a variety of wearable devices to monitor their physiological conditions. The pulse wave is a kind of physiological signal which is widely applied in the physiological monitoring system. However, the pulse wave is susceptible to artifacts, which prevents its popularization. In this work, we propose a novel beat-to-beat artifact detection algorithm, which performs pulse wave segmentation based on wavelet transform and then detects artifacts beat by beat based on the decision list. We veriﬁed our method on data acquired from diﬀerent databases and compared with experts’ annotations. The segmentation algorithm achieved an accuracy of 96.13%. When it is applied to detect main peaks, the performance achieved an accuracy of 99.11%. After the previous segmentation algorithm, the artifact detection algorithm can detect beat-to-beat pulse waves and artifacts with an accuracy of 98.11%. The result indicated that the proposed method is robust for pulse waves of diﬀerent patterns and could eﬀectively detect the artifact without the complex algorithm. In summary, our proposed algorithm is capable of annotating pulse waves of various patterns and determining pulse wave quality. Since our method is developed and evaluated on the transmission-mode PPG data, it is more suitable for the devices and applications inside the hospitals instead of reﬂectance-mode PPG.


Introduction
Smart cities aim to provide citizens with quality life and services, and smart healthcare is its essential part. Pulse wave contains vital physiological information about the cardiovascular system, which is now commonly applied in smart healthcare (measuring blood oxygen, heart rate, and blood pressure). e acquisition of the above physiological parameters depends on two fiducial points (main peak and onset). However, the pulse wave, especially the photoplethysmographic (PPG) signal, is weak and susceptible to artifacts. Because the spectrum and duration of the artifact are difficult to estimate, artifacts are hard to eliminate with traditional filters, which affects the subsequent analysis. To get artifact-free data, a robust pulse wave preprocessing algorithm is needed.
In general, artifacts include technical, environmental, and biological artifacts [1]. Many artifact reduction methods introduce multichannel signals (such as the accelerometer and multiwavelength PPG) to assist artifact analysis [2,3], which hinders the prevalence of the wearable devices. Moreover, complex algorithms require huge computations, like adaptive filtering [4] and machine learning algorithms [5]. Moreover, artifact reduction methods can distort normal signals while correcting disturbed signals. erefore, recent studies usually divided the signal into fixed-time segments and then discarded the disturbed segments as a whole after artifact detection [6], resulting in useful signals also filtered out along with artifacts. erefore, if artifacts are detected beat by beat, the normal pulse waves can be preserved as much as possible. For this purpose, we propose a beat-to-beat artifact detection algorithm for pulse wave.
Accurate detection of the onset, usually accompanied by peak detection, is essential for the periodic segmentation of the pulse wave. In reference [1], adaptive threshold and moving average filter are used to recognize the main peak. Han and Kim [7] apply a downward zero-crossing method to detect the main peak. Paradkar and Chowdhury [8] combine singular value decomposition and wavelet transform to detect the fiducial points. However, these methods are not robust enough for the diversity and variability of pulse waveforms.
In this paper, we propose a robust fiducial point detection algorithm based on wavelet transform and a beat-tobeat artifact detection method based on the decision list, which is verified on different public databases.

Materials and Methods
As Figure 1 shows, we first eliminate sensor-off and clipping waveforms and then perform noise suppression based on discrete wavelet transform (DWT). On this basis, a beat-tobeat segmentation method (onset detection) is proposed. Finally, we use the artifact detection algorithm for the segmented pulse wave to determine whether it is normal or not.
In this study, the artifact in the PPG signal is divided into two categories, as shown in Figure 2. e first kind, namely, the sensor-off/clipping waveforms, results from the sensor slipping off. e high-amplitude pulse suddenly appears in the PPG waveform. Besides, the clipping waveform occurs when the high-amplitude pulse exceeds the range of the analog-digital converter. e second kind results from the slide of the sensor caused by strenuous human movement.
ere appear the distortion of the PPG waveform and the loss of the fiducial points.

Database.
ree public databases, Multiparameter Intelligent Monitoring in Intensive Care (MIMIC), Complex System Laboratory (CSL), and CapnoBase database, were used to verify the performance of the algorithm [9][10][11]. Table 1 shows the databases used to validate different algorithms. To prepare databases for artifact detection, we invited two doctors familiar with this field to annotate data manually. e annotation rules of the artifact were defined as (1) there is no physiological explanation for the change in signal morphology and (2) characteristic points cannot be identified clearly. e following describes the specific usage of the three databases used to validate the fiducial point and artifact detection algorithm.
Database for the fiducial point detection: we downloaded 10 minutes of data for each subject, for a total of 50 subjects, from the MIMIC database for the onset detection. Besides, we also adopted the ABP signal for verifying the robustness of the algorithm, just like the literature [12,13]. Similarly, two 60-minute ABP records from the Complex Systems Laboratory (CSL) database were downloaded for verifying the main peak detection algorithm. PPG signals from 33 subjects in the CapnoBase database were used to verify the main peak detection algorithm.
Database for artifact detection: since PPG signals are more susceptible to artifacts than ABP signals, we took oneminute PPG data containing artifacts for each subject, for a total of 27 subjects, from the MIMIC database. Besides, ABP signals in the CSL database contain fewer artifacts. erefore, we took four 1-minute ABP signal segments for verifying the artifact detection algorithm.
Local Dataset: ten young subjects, wearing the PPG sensor (Fingertip Pulse Oximeter BM2000A, Berry), are required to sit still in the chairs for 30 seconds and walk around for 30 seconds to get a clean PPG signal and disrupted signal, respectively.

Detection of Onset and Main Peak.
e noise suppression and onset detection pipelines are presented in Figure 3. eir specific parameter settings are shown in Figure 3(a). Since CSL and CapnoBase databases have been preprocessed, we only need to process the data from the MIMIC database. Since the sample rate of the MIMIC is 125 Hz and the main components of the pulse wave occur in the range of 0.5-15 Hz [14], a sevenlayer DWT is performed based on Daubechies (Db) 8 wavelet.
en, the first-layer approximation subband (corresponding to low-frequency noise) and sixth to seventh detail subbands (corresponding to high-frequency noise) are discarded by zeroing their decomposition coefficients. en, the clean signal is obtained by the reconstruction of the decomposition. As shown in Figure 4, the noise suppression algorithm eliminates baseline drift and retains the fiducial points.
After noise suppression, we detect the onset and main peak by stationary wavelet transform (SWT). e basic idea and parameter settings of this method are shown in Figure 3(b). e first stage divides the clean signal into segments and applies SWT with second-order spline wavelets, which has an excellent detection effect on singularity points. In the second to fourth stages, we define the region where the onset exists by peaks of each subband. erefore, an adaptive threshold is calculated, which is 0.2 (empirical parameter) of the maximum value of the current subband in the current segment. en, the local maximum is regarded as a peak in every subband above this threshold. Towering peaks in the third and fifth detail subbands define the region containing the onset (see Figure 5). However, sometimes this region does not include the onset. erefore, we extend this region by a certain length, which is 0.5 (empirical parameter) of the average distance between the peak position of the fifth subband and the peak position of the sixth subband. Finally, we determine the location of the minimum in the expanded region as the onset and then identify the main peak by finding the maximum between two successive detected onsets.

Beat-to-Beat Artifact Detection Based on Decision List.
e artifact detection algorithm is a classifier that distinguishes artifacts from reliable pulse waves. We propose the decision list method, which consists of nine decision rules defined by the pulse wave characteristic parameters. If the corresponding rule is not satisfied, it indicates that the pulse wave is disturbed. Before fiducial points detection and artifact detection, we add a block to detect sensor-off and clipping waveform. e template matching method 2 Mathematical Problems in Engineering (template length set to 10 samples here) identifies the signal segments with invariant amplitude. e basic idea of this method is that each rule can determine whether the current signal is an artifact. e result determined by the current rule cannot be changed by the next rule. As Figure 6 illustrates, rules 1-2 intend to detect jitters or drifts of the signal due to serious noises. e allowable range for pulse wave rise time and pulse wave duration (PWD) is 0.08-0.49 s [15] and 0.27-2.4 s [16], respectively (rules 304). Moreover, the ratio of systolic and diastolic phase duration is set to 4 (rule 5) according to the experiment. Furthermore, rules 6-9 are based on the Gaussian fitting method we propose. e amplitude normalization is applied for the singlebeat pulse wave x(n), as shown in the following equation: e pulse waveform consists of two peaks (main peak and dicrotic peak) [17,18]. Two Gaussian functions are used to fit the different components of the single-beat pulse wave, and their expressions are as follows: where n � 1, 2, . . ., N, N denotes the length of the singlebeat pulse wave, H, C, and W denote height, central location, and width of Gaussian function, and x denotes the wandering caused by the noise. g 1 (n) and g 2 (n) indicate the main wave and the dicrotic wave. In this paper, after the periodic segmentation, the single-beat signal length is resampled to 1000. Afterward, the upper and lower bounds of the seven fitted parameters (H1, C1, W1, H2 (4). Seven parameters are obtained by solving the J based on nonlinear least squares. Rules 6-9 use four parameters (H1, C1, H2, and C2). According to the relative position of C2 and the end of the pulse wave, as well as the relative position of C1 and C2, the pulse wave is recognized as three patterns. e relative position of C1 and C2 above 35 or the ratio of H2 to H1 above 0.8 is considered abnormal. Figure 7 shows the result of Gaussian functions fitting. If the time difference between the detected point and the reference point is within a predefined acceptable interval (AI), the fiducial point detected by our algorithm is regarded as TP. We set the AI to 1.25 samples for peak detection and two samples for onset detection.

Assessment
For the artifact detection algorithm, a normal pulse wave is regarded as TP. If continuous artifacts completely cover the original pulse waves, the onset detection algorithm cannot accurately segment the pulse wave and merge them into one artifact. erefore, the TN number of disturbed signals in such a case can only be estimated by dividing the artifact duration by the average period of two adjacent normal pulse waves.

Fiducial Point Detection.
e MIMIC database contains five types of pulse waveforms, as shown in Figure 8. e identical subject can be counted in different kinds according to various types. e results of onset detection are listed in Table 2.
e evaluation results show that the proposed method achieved SE ranging from 95.46% to 98.78% and PP ranging from 95.89% to 98.92% for five types of pulse waveforms. e results of the main peak detection are summarized in Table 3. Our method is evaluated on a total number of 22,201 peaks from CapnoBase and a total number of 13,115 from CSL. For a fair comparison, we choose the methods based on the CSL database. As Table 4 shows, our approach has a better performance than others.

Artifact Detection.
e performance of beat-to-beat artifact detection was calculated for each database (Table 5). We analyzed 1,460 normal pulse waves and 965 disturbed pulses from the MIMIC database. On the CSL database, a total of 889 normal pulse waves and 144 disturbed pulse waves were analyzed. e algorithm is applied to 523 normal pulse waves and 408 disturbed pulse waves from the local dataset. Figure 9 is an example of beat-to-beat artifact detection.

Discussion
e results of peak detection indicate that our method can detect the peaks well although the CapnoBase database and the CSL database both contained artifacts. Since each single-beat pulse wave corresponds to one main peak, the accurate detection of main peaks means the reliable periodic segmentation of the pulse wave. In a word, our method is robust under time-varying pulse wave amplitude, pulse waves of different patterns, and various artifacts and noise.

Begin
True True  True  True  True  True  True  True   False   False  False  False  False  False   False   1  2  3  4  5  6 Figure 8: Five types of pulse waveforms: (a) one peak, (b) two peaks (main peak and dicrotic peak), (c) three peaks (main peak, tidal peak, and dicrotic peak), (d) the notch is lower than the onset, and (e) an inflection point appears around the main peak. 6 Mathematical Problems in Engineering e pulse wave varies in the waveform, making it challenging to calculate the characteristic parameters relying on identifying the dicrotic wave. To solve the above problem, we use two Gaussian functions to fit the main wave and the dicrotic wave of the pulse wave. Besides, our proposed Gaussian fitting method can quantify the changes of two kinds of waves as they propagate in the arteries, which provides another idea for pulse wave analysis. is method estimates the position, height, and width of the dicrotic wave instead of accurate extraction. Gaussian function fitting, combined with characteristic parameters, ensures that pulse waves of different patterns could be analyzed to detect artifacts. Table 2 presents the onset detection performance of different waveform patterns. e algorithm performance degradation is not due to itself but due to increase in incorrect annotations as waveforms become more complex. Some onsets annotations of the database are not the minimum locations between two peaks. For example, some onsets from the '039' patient are marked on the dicrotic wave.
Although powerful hardware [20] and sophisticated signal processing technique [21,22] can help us convert disturbed signals into original signals, these methods are computationally expensive, and more importantly, they do not take into account the effect of the algorithm on the clean signal. Although some researchers aim to extract heart rate from the disturbed signal without detecting fiducial points and achieve promising results [23], the fiducial point is an important reference. Our method firstly performs periodic segmentation by detecting fiducial points. e longer segmented heart period indicates that the current segment may be an artifact. Subsequent clipping waveform detection and further artifact detection are effective in determining artifacts. In this way, the clean segmented signal is retained as much as possible.
e main limitation of this paper is that the direct performance comparison with other studies is restricted due to the confidentiality of databases and reproducibility of methods. Besides, disease influence on pulse waveform is not taken into account. Besides, the dataset that is used to develop and evaluate our method consists of transmissionmode PPG data, which prevented its application in the device based on the reflectance-mode PPG sensor. So, it is more suitable for the applications in the hospital.

Conclusions
In this paper, we propose a novel beat-to-beat artifact detection method, which can analyze different kinds of pulse waves to detect artifacts. Our proposed method can be applied to annotate the fiducial points for its robustness. Besides, it can get more effective data segments by eliminating beat-to-beat disturbed signals, improving the calculation of subsequent physiological parameters. Our method is easy to be applied in various mobile devices, which is conducive to promoting smart healthcare and the construction of smart cities.

Data Availability
e processed data required to reproduce these findings cannot be shared at this time as the data also form part of an ongoing study.