# A Robust Random Forest-Based Approach for Heart Rate Monitoring Using Photoplethysmography Signal Contaminated by Intense Motion Artifacts

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

- The proposed hybrid MA removal method can not only improve the denoising performance, but also hold a low computational complexity by random forest-based binary decision algorithm, which combines two MA removal algorithms. Compared with the correlation coefficient-based binary decision algorithm that can only detect the linear relationship [13,14], the proposed binary decision algorithm can detect not only the linear relationship by using the correlation coefficient as one feature, but also the nonlinear relationship by using many other effective features, ensuring an accurate decision result and thus improving the denoising performance considerably with a low computational complexity.
- The spectral peak tracking problem is formulated into a pattern classification task, and the random forest-based algorithm can locate the spectral peak corresponding to HR with a better generalization and robustness. Most existing heuristic tracking algorithms set rules artificially and adjust the parameters arbitrarily, resulting in a poor robustness on a more challenging dataset. In contrast, the random forest-based algorithm can set more formalized rules and can adjust the parameters by an intelligent classifier, achieving a better robustness and generalization. Hence, the proposed spectral peak tracking algorithm can be more suitable for wearable devices.

## 2. Stage 1: Motion Artifacts Removal

#### 2.1. Second-Order Volterra Adaptive Noise Cancellation

#### 2.2. Random Forest-Based Binary Decision

#### 2.2.1. Random Forest-Based Classifier Training

- Time domain: the energy of the denoised PPG signal $\widehat{\mathit{s}}$ would be selected as a feature;
- Frequency domain: (1) Firstly for the spectrum (calculated by periodogram) of the clean PPG signal, it contains few frequency components (a significant fundamental peak and several harmonic peaks). However, the spectrum of corrupted PPG signal is very messy. Therefore, the number of significant peaks is selected as a feature, where significant peak means that the amplitude of the peak is larger than a threshold ${\delta}_{1}$ of the maximum amplitude (${\delta}_{1}=30\%$ in our experiments). (2) Then, the mean and kurtosis of the frequency spectrum of $\widehat{\mathit{s}}$ are selected as the features. (3) Furthermore, the correlation coefficients between the spectrum of $\widehat{\mathit{s}}$ and the raw PPG signal and the correlation coefficients between the spectrum of $\widehat{\mathit{s}}$ and the acceleration signal are used as features. For example, for a clean PPG signal, the value of the correlation coefficients is very small, but for a corrupted signal, the value is large.
- Wavelet domain: Using wavelet transform, the denoised PPG signal $\widehat{\mathit{s}}$ can be decomposed into a number of sub-band signals. (1) The energy of each of these sub-band signals is selected as a feature. (2) Then, the mean and standard deviation of these sub-band signals are selected as features. Specifically, the signal is decomposed into the fifth level using the mother wavelet of the Daubechies wavelet of order four (db4).

#### 2.2.2. Binary Decision Using the Trained Classifier

#### 2.3. Singular Spectrum Analysis

- The periodogram is first used to get the spectrum of acceleration signals $\mathit{a}$. In the spectrum, we determine the dominant frequencies with an amplitude larger than a threshold ${\delta}_{2}$ (${\delta}_{2}=50\%$ in our experiments) of the maximum amplitude. Denote by ${L}_{acc}$ the set of location indexes of selected dominant frequencies in the spectrum.
- For each time series, if its dominant frequency has location indexes in ${L}_{acc}$, it would be regarded as the time series associated with MA [28]. Finally, the cleansed PPG signal ${\widehat{\mathit{s}}}_{recon}$ can be obtained by summing the remained time series without the series corresponding to MA.

## 3. Stage 2: Random Forest-Based Spectral Peak Tracking

- ${L}_{prev}$ is the frequency location index of HR estimated in the previous time window.
- ${L}_{Range1}=[{L}_{prev}-{\Delta}_{s},\cdots ,{L}_{prev}+{\Delta}_{s}]$, where ${L}_{Range1}$ is the range of fundamental frequency of HR, and ${\Delta}_{s}$ is a small positive integer (${\Delta}_{s}=2$ in our experiments).
- ${L}_{Range2}=[2({L}_{prev}-{\Delta}_{s}-1)+1,\cdots ,2({L}_{prev}+{\Delta}_{s}-1)+1]$, where ${L}_{Range2}$ is the range of first-order harmonic frequency of HR, and ${\Delta}_{s}$ is a small positive integer.
- ${L}_{i}^{0}(i=1,2)$ represents the frequency location indexes of two dominant peaks in ${L}_{Range1}$, and ${L}_{i}^{1}(i=1,2)$ is from ${L}_{Range2}$. In this stage, dominant peak denotes the spectral peak that has the dominant frequencies with an amplitude larger than a threshold ${\delta}_{2}$ (mentioned in the part of the introduction of SSA) of the maximum amplitude.
- $Loc$ denotes the finally selected frequency location index of the spectral peak of HR at this stage.

#### 3.1. Random Forest-Based Spectral Peak Tracking

#### 3.1.1. Random Forest-Based Classifier Training

- Extract the number of dominant spectral peaks in the time window of ${L}_{Range1}$ and ${L}_{Range2}$, respectively. The reason is that for Class 1, the signal is relatively clean; thus, the number is less. However, for Class 3, the signal is relatively not clean; thus, the number is larger.
- Extract the energy of $\mathit{a}$, since signal $\mathit{a}$ can indirectly reflect the state of the signal.
- Extract the correlation coefficient between ${\widehat{\mathit{s}}}_{recon}$ and $\mathit{a}$ and the correlation coefficient between the spectrum of ${\widehat{\mathit{s}}}_{recon}$ and the spectrum of $\mathit{a}$. The smaller the correlation coefficient, the more clean the signal, then it is more likely to be Class 1.
- Extract the mean value, skewness and kurtosis of ${\widehat{\mathit{s}}}_{recon}$. These statistical properties can capture the characteristics of the signal, such as the concentration trend of the signal.
- Extract a feature indicating the presence or absence of the peak-pair $({L}_{i}^{0},{L}_{j}^{1})$. If exists, the value of the feature is marked as Number 1, which indicates that Class 1 has a greater chance; if not, it is marked as Number 0, meaning that Class 2 and Class 3 have greater possibility.

#### 3.1.2. Spectral Peak Tracking Using the Trained Classifier

## 4. Datasets and Performance Metrics

#### 4.1. Datasets

#### 4.2. Metrics

## 5. Experimental Results

#### 5.1. Experimental Setting

#### 5.2. Results and Discussions

## 6. Conclusions

## Acknowledgments

## Author Contributions

## Conflicts of Interest

## References

- Nakajima, K.; Tamura, T.; Miike, H. Monitoring of heart and respiratory rates by photoplethysmography using a digital filtering technique. Med. Eng. Phys.
**1996**, 18, 365–372. [Google Scholar] [CrossRef] - Kamal, A.A.R.; Harness, J.B.; Irving, G.; Mearns, A.J. Skin photoplethysmography-a review. Comput. Methods Prog. Biomed.
**1989**, 28, 257–269. [Google Scholar] [CrossRef] - Yousefi, R.; Nourani, M.; Ostadabbas, S.; Panahi, I. A motion-tolerant adaptive algorithm for wearable photoplethysmographic biosensors. IEEE J. Biomed. Health Inform.
**2014**, 18, 670–681. [Google Scholar] [CrossRef] [PubMed] - Sarkar, S.; Bhoi, A.K.; Savita, G. Fingertip pulse wave (PPG signal) analysis and heart rate detection. Int. J. Emerg. Technol. Adv. Eng.
**2012**, 2, 404–408. [Google Scholar] - Karmakar, C.; Khandoker, A.; Penzel, T.; Schöbel, C.; Palaniswami, M. Detection of respiratory arousals using photoplethysmography (PPG) signal in sleep apnea patients. IEEE J. Biomed. Health Inform.
**2014**, 18, 1065–1073. [Google Scholar] [CrossRef] [PubMed] - Kim, B.S.; Yoo, S.K. Motion artifact reduction in photoplethysmography using independent component analysis. IEEE Trans. Biomed. Eng.
**2006**, 53, 566–568. [Google Scholar] [CrossRef] [PubMed] - Krishnan, R.; Natarajan, B.; Warren, S. Two-stage approach for detection and reduction of motion artifacts in photoplethysmographic data. IEEE Trans. Biomed. Eng.
**2010**, 57, 1867–1876. [Google Scholar] [CrossRef] [PubMed] - Ram, M.R.; Madhav, K.V.; Krishna, E.H.; Komalla, N.R.; Reddy, K.A. A novel approach for motion artifact reduction in PPG signals based on AS-LMS adaptive filter. IEEE Trans. Instrum. Meas.
**2012**, 61, 1445–1457. [Google Scholar] [CrossRef] - Han, H.; Kim, J. Artifacts in wearable photoplethysmographs during daily life motions and their reduction with least mean square based active noise cancellation method. Comput. Biol. Med.
**2012**, 42, 387–393. [Google Scholar] [CrossRef] [PubMed] - Sun, X.; Yang, P.; Li, Y.; Gao, Z.; Zhang, Y.T. Robust heart beat detection from photoplethysmography interlaced with motion artifacts based on empirical mode decomposition. In Proceedings of the 2012 IEEE-EMBS International Conference on Biomedical and Health Informatics, Hong Kong, China, 5–7 January 2012; pp. 775–778.
- Peng, F.; Zhang, Z.; Gou, X.; Liu, H.; Wang, W. Motion artifact removal from photoplethysmographic signals by combining temporally constrained independent component analysis and adaptive filter. Biomed. Eng. Online
**2014**, 13, 50. [Google Scholar] [CrossRef] [PubMed] - Khan, E.; Al Hossain, F.; Uddin, S.Z.; Alam, S.K.; Hasan, M.K. A robust heart rate monitoring scheme using photoplethysmographic signals corrupted by intense motion artifacts. IEEE Trans. Biomed. Eng.
**2016**, 63, 550–562. [Google Scholar] [CrossRef] [PubMed] - Zhang, Y.; Liu, B.; Zhang, Z. Combining ensemble empirical mode decomposition with spectrum subtraction technique for heart rate monitoring using wrist-type photoplethysmography. Biomed. Signal Process. Control
**2015**, 21, 119–125. [Google Scholar] [CrossRef] - Ye, Y.; Cheng, Y.; He, W.; Hou, M.; Zhang, Z. Combining Nonlinear Adaptive Filtering and Signal Decomposition for Motion Artifact Removal in Wearable Photoplethysmography. IEEE Sens. J.
**2016**, 16, 7133–7141. [Google Scholar] [CrossRef] - Zhang, Z.; Pi, Z.; Liu, B. TROIKA: A general framework for heart rate monitoring using wrist-type photoplethysmographic signals during intensive physical exercise. IEEE Trans. Biomed. Eng.
**2015**, 62, 522–531. [Google Scholar] [CrossRef] [PubMed] - Mullan, P.; Kanzler, C.M.; Lorch, B.; Schroeder, L.; Winkler, L.; Laich, L.; Eskofier, B.M. Unobtrusive heart rate estimation during physical exercise using photoplethysmographic and acceleration data. In Proceedings of the 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 25–29 August 2015; pp. 6114–6117.
- Lin, Z.; Zhang, J.; Chen, Y.; Zhang, Q. Heart rate estimation using wrist-acquired photoplethysmography under different types of daily life motion artifact. In Proceedings of the 2015 IEEE International Conference on Communications (ICC), London, UK, 8–12 June 2015; pp. 489–494.
- Murthy, N.K.L.; Madhusudana, P.C.; Suresha, P.; Periyasamy, V.; Ghosh, P.K. Multiple spectral peak tracking for heart rate monitoring from photoplethysmography signal during intensive physical exercise. IEEE Signal Process. Lett.
**2015**, 22, 2391–2395. [Google Scholar] [CrossRef] - Zhu, S.; Tan, K.; Zhang, X.; Liu, Z.; Liu, B. MICROST: A mixed approach for heart rate monitoring during intensive physical exercise using wrist-type PPG Signals. In Proceedings of the 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 25–29 August 2015; pp. 2347–2350.
- Sun, B.; Zhang, Z. Photoplethysmography-based heart rate monitoring using asymmetric least squares spectrum subtraction and Bayesian decision theory. IEEE Sens. J.
**2015**, 15, 7161–7168. [Google Scholar] [CrossRef] - Vautard, R.; Yiou, P.; Ghil, M. Singular-spectrum analysis: A toolkit for short, noisy chaotic signals. Phys. D Nonlinear Phenom.
**1992**, 58, 95–126. [Google Scholar] [CrossRef] - Hassani, H. Singular spectrum analysis: Methodology and comparison. J. Data Sci.
**2007**, 5, 239–257. [Google Scholar] - Paulo, S.D. Adaptive Filtering: Algorithms and Practical Implementation; The International Series in Engineering and Computer Science; Springer: New York, NY, USA, 2008. [Google Scholar]
- Breiman, L. Random forests. Mach. Learn.
**2001**, 45, 5–32. [Google Scholar] [CrossRef] - Cohen, A.; Kovacevic, J. Wavelets: The mathematical background. Proc. IEEE
**1996**, 84, 514–522. [Google Scholar] [CrossRef] - Hlawatsch, F.; Boudreaux-Bartels, G.F. Linear and quadratic time-frequency signal representations. IEEE Signal Process. Mag.
**1992**, 9, 21–67. [Google Scholar] [CrossRef] - Rukhin, A.L. Analysis of time series structure SSA and Related techniques. Technometrics
**2002**, 44, 290. [Google Scholar] [CrossRef] - Fukushima, H.; Kawanaka, H.; Bhuiyan, M.S.; Oguri, K. Estimating heart rate using wrist-type photoplethysmography and acceleration sensor while running. In Proceedings of the 2012 Annual International Conference of the IEEE Engineering in Medicine and Biology Society, San Diego, CA, USA, 8 August–1 September 2012; pp. 2901–2904.
- Asada, H.H.; Jiang, H.H.; Gibbs, P. Active noise cancellation using MEMS accelerometers for motion-tolerant wearable bio-sensors. In Proceedings of the 26th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, San Francisco, CA, USA, 1–5 September 2004; Volume 1, pp. 2157–2160.
- Zhang, Z. Photoplethysmography-based heart rate monitoring in physical activities via joint sparse spectrum reconstruction. IEEE Trans. Biomed. Eng.
**2015**, 62, 1902–1910. [Google Scholar] [CrossRef] [PubMed] - Salehizadeh, S.; Dao, D.; Bolkhovsky, J.; Cho, C.; Mendelson, Y.; Chon, K.H. A novel time-varying spectral filtering algorithm for reconstruction of motion artifact corrupted heart rate signals during intense physical activities using a wearable photoplethysmogram sensor. Sensors
**2016**, 16, 10. [Google Scholar] [CrossRef] [PubMed] - Tadj, L.; Ouali, M.S.; Yacout, S.; Ait-Kadi, D. Replacement Models with Minimal Repair; Springer: New York, NY, USA, 2011. [Google Scholar]

**Figure 2.**Two examples showing the process of removing MA. In (

**a**,

**b**), the waveform in the above layer is in the time domain, and the below layer is the corresponding spectrum. The red cycle in the spectrum represents the spectral peak corresponding to HR, which is obtained by simultaneous ECG. In (

**a**), the MA in the denoised signal are determined as $Strong$, and it shows that a more accurate HR estimation can be obtained by further exploiting singular spectrum analysis (SSA). In example (

**b**), the decision result is $NotStrong$, indicating that SSA should not be used to avoid increasing unnecessary workload. (

**b**) shows that the spectral peak of HR still can become dominant by the first MA-removal algorithm without the use of SSA.

**Figure 4.**The bar graph of HR estimation results for the approaches listed in Table 1 (the proposed HR estimation approach, TROIKA [15], JOSS [30], SpaMA [31], SPECTRAP [20], CC [13] and CNAFSD [14]) in terms of average AAEs on the first 12 recording, the remaining 10 challenging recordings and all 22 recordings.

**Figure 5.**The Bland–Altman plot of the estimates of our proposed approach on the 22 datasets. The limit of agreement (LOA) was [−7.18, 6.46] BPM (standard deviation σ = 3.48 (BPM).

**Figure 6.**Scatter plot on the 22 datasets between the ground truth and the estimates of our proposed approach. The fitted line was $y=0.9954x-0.2215$; the ${R}^{2}$ value was 0.9859; the Pearson correlation correlation was 0.9929.

**Figure 7.**Estimation results on recordings of Subject 21 of 22 recordings. The HR traces of our proposed approach were plotted, and this was compared to the ground truth, which was recorded simultaneously from ECG.

**Table 1.**The HR estimation results in terms of AAE on the 22 PPG datasets. Average absolute error (AAE).

Subject | Proposed | TROIKA [15] | JOSS [30] | SpaMA [31] | SPECTRAP [20] | CC [13] | CNAFSD [14] |
---|---|---|---|---|---|---|---|

Sub.1 | 1.61 | 2.87 | 1.33 | 1.23 | 1.18 | 2.06 | 1.66 |

Sub.2 | 1.39 | 2.75 | 1.75 | 1.59 | 2.42 | 3.59 | 1.56 |

Sub.3 | 0.73 | 1.91 | 1.47 | 0.57 | 0.86 | 0.92 | 0.65 |

Sub.4 | 1.48 | 2.25 | 1.48 | 0.44 | 1.38 | 1.54 | 1.48 |

Sub.5 | 0.77 | 1.69 | 0.69 | 0.47 | 0.92 | 0.97 | 0.77 |

Sub.6 | 1.34 | 3.16 | 1.32 | 0.61 | 1.37 | 1.64 | 1.12 |

Sub.7 | 0.59 | 1.72 | 0.71 | 0.54 | 1.53 | 2.25 | 0.72 |

Sub.8 | 0.63 | 1.83 | 0.56 | 0.40 | 0.64 | 0.63 | 0.91 |

Sub.9 | 0.57 | 1.58 | 0.49 | 0.40 | 0.60 | 0.62 | 0.42 |

Sub.10 | 3.50 | 4.00 | 3.81 | 2.63 | 3.65 | 4.62 | 2.35 |

Sub.11 | 1.07 | 1.96 | 0.78 | 0.64 | 0.92 | 1.30 | 1.45 |

Sub.12 | 1.04 | 3.33 | 1.04 | 1.20 | 1.25 | 1.80 | 0.78 |

Sub.13 | 5.24 | 6.63 | 8.07 | 3.41 | 4.891 | - | 7.71 |

Sub.14 | 1.12 | 1.94 | 1.61 | 7.29 | 1.58 | - | 1.62 |

Sub.15 | 1.31 | 1.35 | 3.10 | 2.73 | 1.83 | - | 3.10 |

Sub.16 | 6.81 | 7.82 | 7.00 | 3.18 | 3.05 | - | 7.00 |

Sub.17 | 1.76 | 2.46 | 2.99 | 3.01 | 1.62 | - | 2.99 |

Sub.18 | 1.26 | 1.73 | 1.67 | 4.46 | 1.24 | - | 1.67 |

Sub.19 | 1.62 | 3.33 | 2.80 | 3.58 | 2.04 | - | 2.45 |

Sub.20 | 0.91 | 3.41 | 1.88 | 1.94 | 2.49 | - | 1.81 |

Sub.21 | 0.92 | 2.68 | 0.92 | 2.56 | 1.16 | - | 0.92 |

Sub.22 | 0.64 | 0.51 | 0.49 | 3.12 | 0.66 | - | 0.49 |

Ave12 (mean ± SD) | 1.23 ± 0.80 | 2.42 ± 0.78 | 1.28 ± 0.90 | 0.89 ± 0.60 | 1.50 ± 0.86 | 1.83 ± 1.21 | 1.16 ± 0.55 |

Ave 10 (mean ± SD) | 2.16 ± 2.10 | 3.19 ± 2.32 | 3.05 ± 2.52 | 3.53 ± 1.48 | 2.13 ± 1.21 | - | 2.98 ± 2.45 |

Ave 22 (mean ± SD) | 1.65 ± 1.56 | 2.78 ± 1.67 | 2.09 ± 1.99 | 2.09 ± 1.73 | 1.69 ± 1.06 | - | 1.98 ± 1.90 |

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license ( http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Ye, Y.; He, W.; Cheng, Y.; Huang, W.; Zhang, Z.
A Robust Random Forest-Based Approach for Heart Rate Monitoring Using Photoplethysmography Signal Contaminated by Intense Motion Artifacts. *Sensors* **2017**, *17*, 385.
https://doi.org/10.3390/s17020385

**AMA Style**

Ye Y, He W, Cheng Y, Huang W, Zhang Z.
A Robust Random Forest-Based Approach for Heart Rate Monitoring Using Photoplethysmography Signal Contaminated by Intense Motion Artifacts. *Sensors*. 2017; 17(2):385.
https://doi.org/10.3390/s17020385

**Chicago/Turabian Style**

Ye, Yalan, Wenwen He, Yunfei Cheng, Wenxia Huang, and Zhilin Zhang.
2017. "A Robust Random Forest-Based Approach for Heart Rate Monitoring Using Photoplethysmography Signal Contaminated by Intense Motion Artifacts" *Sensors* 17, no. 2: 385.
https://doi.org/10.3390/s17020385