# 3D Convolutional Neural Networks for Remote Pulse Rate Measurement and Mapping from Facial Video
## 3 Materials and Methods
### Synthetic Data Generation
#### 3.2.1 Modeling iPPG Waveforms  
We approximated the pulse waveform measured over skin in video streams with curve models fitted to data. To this end, 62 clear PPG waves were extracted from the UBFC-RPPG dataset [20] (a typical excerpt is presented in Figure 4a).  
Curves generated from periodic and non-periodic models were then fitted to data (Figure 3). Models used to approximate PPG waveforms are presented in Table 1. Goodness of fit was evaluated using the fit standard error, also know as the root mean square error (RMSE):  
\[RMSE\ =\ \sqrt{MSE}=\sqrt{\frac{\sum_{i=1}^{n}\left(y_{i}-\hat{y_{i}}\right)^{2 }}{n-m}}. \tag{1}\]  
\(y\) is a PPG pulse wave extracted from the UBFC-RPPG dataset, and \(\hat{y}\) is its corresponding fitted-to-data approximation. \(n\) corresponds to the number of samples in \(y\), and \(m\) is the number of fitted coefficients in the model (\(n-m\) is the residual degrees of freedom).  
An RMSE value by pulse wave and by methods (here, a method refers to a model with a given \(n\) value, such as the polynomial model with \(n=5\), for example) was computed. Statistics (mean and standard deviation) are presented in Figure 4b. They show that the Fourier series and sum of sines models are the most relevant models. As expected, the RMSE decreases (goodness of fit increases) as we increase the number of terms (\(n\)) and therefore the number of coefficients. These models  
Figure 4: Fitting results. (**a**) Typical excerpt of a camera pulse wave extracted from the UBFC-RPPG dataset. Solid orange line: raw photoplethysmography (PPG) pulse wave. Dotted black line: fitted signal. (**b**) Results of the curve-fitting procedure (periodic and non-periodic models were tested). The RMSE is computed for each of the 62 pulse waves and its corresponding fitted-to-data approximation. The statistics for each tested method (each histogram bin) indicates that Fourier series and sum of sines are the most relevant models. (**c**) Each method (e.g., Fourier series with \(n=1\)) contains 62 sets of \(a_{i}\) and \(b_{i}\) coefficients (one set of coefficients per PPG wave). We thus choose to respectively average the coefficients to produce a unique set of \(a_{i}\) and \(b_{i}\) coefficients for each method. Fourier series for \(n=2\) correspond to the method that gives the lowest RMSE.  
Figure 3: Fitting real iPPG signals to determine the best pulse wave model. Different models are tested. Fourier series were chosen because they present the lowest root mean square error (RMSE, see Figure 4 for details). They also have the advantage of fitting periodic signals.  
present a particular advantage: they fit periodic functions and can therefore be used to generate periodic functions.  
Each method (e.g., Fourier series with \(n=1\)) currently includes 62 sets of \(a_{i}\) and \(b_{i}\) coefficients (one set of coefficients per PPG wave). We averaged the corresponding coefficients to get a unique model per method. As stated in the previous paragraph, only Fourier series and sum of sines models were considered. We computed once more the RMSE between the 2 \(\times\) 8 average models and the 62 pulse waves extracted from the UBFC-RPPG dataset. Related results are presented in Figure 4c. Independently of the model, \(n=2\) is the best choice (lowest RMSE). Overall, Fourier series for \(n=2\) is the method that gives the lowest RMSE. Because the two models are pretty similar (see equations in Table 1), the error difference between them for \(n=2\) is slight (average model RMSE for Fourier series: 0.12; average model RMSE for sum of sines model: 0.13). We can also observe that the RMSE increases as we increase \(n\), probably because of overfitting that restricts generalization.