{'fraction_non_alphanumeric': 0.03808213564382519, 'fraction_numerical': 0.022831718525890582, 'mean_word_length': 4.737991266375546, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Self-supervised Representation Learning Framework for Remote Physiological Measurement Using Spatiotemporal Augmentation Loss

Recent advances in supervised deep learning methods are enabling remote measurements of photoplethysmography-based physiological signals using facial videos. The performance of these supervised methods, however, are dependent on the availability of large labelled data. Contrastive learning as a self-supervised method has recently achieved state-of-the-art performances in learning representative data features by maximising mutual information between different augmented views. However, existing data augmentation techniques for contrastive learning are not designed to learn physiological signals from videos and often fail when there are complicated noise and subtle and periodic colour or shape variations between video frames. To address these problems, we present a novel self-supervised spatiotemporal learning framework for remote physiological signal representation learning, where there is a lack of labelled training data. Firstly, we propose a landmark-based spatial augmentation that splits the face into several informative parts based on the Shafer dichromatic reflection model to characterise subtle skin colour fluctuations. We also formulate a sparsity-based temporal augmentation exploiting Nyquist-Shannon sampling theorem to effectively capture periodic temporal changes by modelling physiological signal features. Furthermore, we introduce a constrained spatiotemporal loss which generates pseudo-labels for augmented video clips. It is used to regulate the training process and handle complicated noise. We evaluated our framework on 3 public datasets and demonstrated superior performances than other self-supervised methods and achieved competitive accuracy compared to the state-of-the-art supervised methods.


Introduction
Physiological signals are critical indicators for human cardiovascular activities such as heart rate (HR), respiration frequency (RF), heart rate variability (HRV) and blood pressure (BP) (Xu, Yu, and Wang 2021). These signals are commonly used to monitor the wellness of patients (Avram et al. 2019). Traditionally, the Electrocardiography (ECG) and Photoplethysmography (PPG) are used to measure physiological signals, and both of them rely on the availability of cuffbased equipment which requires direct contact to human skin. This constrains the application of monitoring and estimation process in an unobtrusive and concomitant way with ubiquitous devices (e.g., smartphone cameras, webcams) (McDuff et al. 2015). In recent years, non-contact videobased remote physiological measurement (RPM) has been of great interest. Remote photoplethysmography (rPPG), using facial videos, has been introduced to overcome the limitation of conventional contact-based measurement approaches. In rPPG, signals are measured based on colour fluctuations on human skin, which are caused by the variations of blood volume during cardiac cycle (De Haan and Jeanne 2013).
Several recent studies using supervised deep learning methods Qiu et al. 2019;Niu et al. 2020b;Lee, Chen, and Lee 2020;Li et al. 2018) have shown promising results to remotely estimate physiological signals. They, however, remain problematic because of their dependency on the availability of large-scale labelled training data. The annotation of large-scale data is costly, slow and requires medical equipment. Researchers have employed various approaches to help solve these challenges including transferring knowledge across different domains and fine-tuning those knowledge with a relatively smaller amount of labelled image data. For example, Niu et al. (2020a) used a model that was pre-trained using large labelled natural images (i.e., ImageNet) and fine-tuned this knowledge using rPPG facial videos. Another approach is to create synthetic physiological signals to increase the number of training videos (Niu et al. 2018a;Condrea, Ivan, and Leordeanu 2020). However, such approach is limited by the domain shift between original and synthetic data. An alternative approach is to use self-supervised learning (SSL) to learn and extract image features from unlabelled data. Many recent SSL methods commonly applied the concept of contrastive learning and have achieved state-of-the-art (SOTA) performances in unsupervised image/video representation learning (Ahn et al. 2020;Oord, Li, and Vinyals 2018;Han, Xie, and Zisserman 2019;Qian et al. 2020;Ahn, Feng, and Kim 2021). In these approaches, videos are transformed using standard data augmentation techniques such as frame cropping, resizing, colour jittering and frame re-ordering to produce different views. Invariant video features are then learnt by maximising mutual information between different views in a contrastive manner. These standard augmentation techniques, however, are mainly limited to learn features for action recognition tasks, where large variations among the human anatomy can be modelled, and they are not designed to capture the subtle colour fluctuations on human skin. Many of RPM studies also transformed the video frames (3D) into 2D spatiotemporal map for subsequent 2D convolutional neural networks (CNNs) training (Niu et al. 2020a;Qiu et al. 2019;Lee, Chen, and Lee 2020). However, this transformation potentially neglect nature information contained in original inputs .
In this paper, we present a new Self-supervised Learning Framework for Remote Physiological Measurement (SLF-RPM). We propose a landmark-based spatial augmentation using Shafer's dichromatic reflection model (Wang et al. 2017) to effectively capture the colour fluctuations on human faces. We also propose a sparsity-based temporal augmentation that characterise periodic colour variations using Nyquist-Shannon sampling theorem (Nyquist 1928) to exploit rPPG signal features. We further formulate a new loss function using the pseudo-labels derived from our augmentations. It regulates the training process of contrastive learning and handles complicated noise. We evaluated our framework by comparing with other SOTA supervised and SSL approaches using 3 public datasets and conducted ablation studies to demonstrate the effectiveness of our SLF-RPM framework.
2 Related Work

Remote Physiological Measurement
The application of analysing rPPG from camera-captured videos was first proposed by Verkruysse et al. (2008). In early work, many studies have manually designed handcrafted signal features to characterise the rPPG signals. For example, Poh et al. (2010b;2010a) used independent component analysis (ICA) with RGB colour sequences to estimate HR signals. Similarly, some methods used chrominance features reflected from the human skin (Wang, Stuijk, and De Haan 2014;Wang et al. 2016). Although these hand-crafted features have shown promising performance, they are required to manually select region of interest (ROI), detect and process skin-pixels signals. This is challenging or even quixotic to be implemented in practical settings. In recent years, deep learning methods based on CNNs (Tulyakov et al. 2016;Hsu, Ambikapathi, and Chen 2017;Niu et al. 2018a) have been developed to overcome such limitations and they have been shown to effectively capture minor colour variations and extract rPPG signals. For example, Niu et al. (2020a) proposed RhythmNet to transform each video clip into a 2D feature map and fed it into a CNN to estimate rPPG signals.  proposed an end-toend CNN model, i.e, rPPGNet to reconstruct rPPG signals from highly-compressed videos. Lee et al. (2020) applied the concept of meta-learning using 2D CNN coupled with bidirectional long short-term memory to learn spatiotemporal features and enable faster inference adaption. Moreover, Lu et al.(2021) proposed Dual-GAN to model rPPG and noise signals to improve model robustness. The performance of these methods, however, were dependent on the labelled training data. Few unsupervised work were introduced (Condrea, Ivan, and Leordeanu 2020;Bobbia et al. 2019) and showed limited performances.

Self-Supervised Video Representations Learning
In recent years, self-supervised video representations learning methods have achieved promising results on action recognition task Zisserman 2019, 2020a;Jing and Tian 2018). For instance, Misra et al.(2016) learnt video representations by classifying shuffled video clips. Similarly, Jenni et al.(2020) generated a set of temporal transformations and constructed a 3D CNN to recognise them. The essential concept with these approaches is to use data augmentations to learn invariant features along spatial and temporal axes. These approaches primarily dealt with object interactions, optical flows, synchronised audios and object tracking. They, however, were not designed to capture the subtle facial colour changes for estimating rPPG signals.

Data Augmentation
Spatial augmentations 1 are commonly used in both supervised and SSL to cover a wider and diverse data distribution, and they have shown to be effective in extracting discriminative image features (Shorten and Khoshgoftaar 2019;Han, Xie, and Zisserman 2020b;Chen et al. 2020b). However, existing RPM studies Qiu et al. 2019;Spetlik et al. 2018;Niu et al. 2018b;Chen and McDuff 2018) did not apply spatial augmentations to frames directly, and the most close one is proposed by Niu et al. (2020b) which horizontally and vertically flip the processed spatiotemporal map (a representation to compact the 3D video into 2D). Motion statistics are essential in representing video information and play a key factor on the success of action recognition (Wang et al. 2019). These video dynamics are closely related with temporal information where each action class has a common pattern that can be observed in subsequent frames (Jenni, Meishvili, and Favaro 2020). For instance, many studies (Brattoli et al. 2017;Fernando et al. 2017;Lee et al. 2017;Xu et al. 2019;Kim, Cho, and Kweon 2019) proposed to use image frame re-ordering or optical flows to augment temporal data. These augmentation techniques were, however, not designed to estimate physiological signals in facial videos.

RPM Representation Learning Framework
The overview of our SLF-RPM is illustrated in Fig. 1 and detailed algorithm in appendix A. Suppose we have randomly sampled N raw videos from the dataset. We first apply our sparsity-based temporal and landmark-based spatial augmentations to generate 2N samples in total. Two augmented clips c 1 i , c 2 i originated from the same video v i are then fed into the video encoder to obtain corresponding video features h 1 i , h 2 i . Both of them are then mapped by the projection head into the space z 1 i , z 2 i where contrastive Figure 1: Overview of our SLF-RPM. Raw videos are transformed by the sparsity-based temporal augmentation and landmarkbased spatial augmentation to generate different views which are then used in our contrastive learning. Simultaneously, pseudolabels derived from our augmentations are used to constrain the learning process. Positive samples are denoted by the same subscripts and different superscripts e.g., basic block 2 512 × 2 × 2 2 global average pool Table 1: Video encoder of SLF-RPM: 3D ResNet-18. Each convolutional layer is followed by a batch normalisation layer and a ReLU layer. The spatiotemporal down-sampling is only applied to conv 3 , conv 4 and conv 5 with stride of 2. C, D, H and W denote channels, frames, height and width.
loss ) is applied to maximise mutual information. These two feature vectors are regarded as positive samples and rest of 2(N − 1) samples within the same mini-batch are considered as negative samples. We then generated pseudo-labels based on applied augmentations of the video v i and used two classifiers (i.e., single fully-connected (FC) layer) trained on h 1 i , h 2 i to identify the transformation {s 1 , r 1 } and {s 2 , r 2 } (see Sec. 3.6).

Video Encoder and Projection Head
We adopted 3D ResNet architecture (Hara, Kataoka, and Satoh 2018) as the video encoder which is shown in Table 1. The 3D architecture allows to learn spatial and temporal information at the same time. Each input was converted into a flatten feature vector h and then fed into the projection head, which is a multi-layer perceptron (MLP) in our experiment, to obtain the final encoded feature vector (i.e., z in Eq. 5). The projection head is removed during the evaluation process, and the feature vector h from the video encoder is used directly as RPM representations to make final predictions.

Preliminary Background: Skin Reflection Model
According to Shafer's dichromatic reflection model (DRM) (Wang et al. 2017), light source has a constant spectral composition with varying intensities and therefore the variation of skin reflections over the time are measured based on body motions (specular variations) and pulseinduced subtle colour changes (diffuse reflection) where only diffuse reflection contains rPPG-related information.
Using DRM, we can then define the skin reflection model for the image sequence along the time by where C k (t) is the k-th skin pixel of RGB values; I(t) denotes the light intensity level from the light source which is regulated by specular reflection v s (t) and diffuse reflection v d (t); v n (t) is the noise from camera sensor; t is the time step. We can further decompose v s (t) and v d (t) by v s (t) = u s · (s 0 + s(t)) (2) Figure 2: Illustration of landmark-based spatial augmentation. Based on detected facial landmarks, we define 7 ROI areas where u s is the unit colour vector of the light spectrum, s 0 and s(t) are the stationary and varying parts of specular reflections, i.e., s(t) captures motions.
where u d denotes the unit colour vector of the skin pixel; d 0 refers to the stationary reflection strength; u p refers to the relative signal strengths in RGB channels; p(t) refers to the rPPG signal. Given the defined notation above, we can rewrite the Eq. 1 using Eq. 2 and 3 by where our aim is to calculate p(t) from C k (t).

Landmark-Based Spatial Augmentation
We defined two criteria for our landmark-based spatial augmentation: 1) the relationship among colour channels of each pixel needs to be considered so that any pixel value changes (e.g., colour jitter) are not allowed; and 2) the underlying colour variations among different views are similar. From Eq. 4, the rPPG information contained in videos can be maximised by forcing u d to dominate the equation, and hence the diffuse reflection v d (t) can be approximated by skin pixel value C k (t). As such, we selected and cropped each frame into several facial parts according to face landmark locations (Bulat and Tzimiropoulos 2017) as shown in Fig 2. The selection of ROIs considers two factors: 1) the movements of eyes and mouth are more rapid than other parts of face which put more weights on the specular reflection v s (t) (Li et al. 2014); and 2) facial parts in the same video with similar skin colour C k (t) should contain similar signals p(t). Theoretically, removal of non-facial areas filters noise from the background which reduces the weight of v n (t) in Eq. 4. Informative selected ROIs ensure the dominance of diffusion reflections v d (t) and different ROI sequences from the same facial video contain similar rPPG signals which are used as positive samples (i.e., (z i , z j ) in Eq. 5) in our contrastive learning. In this paper, we define 7 ROIs including the whole face, forehead, left top cheek, right top cheek, left bottom cheek, right bottom cheek and chin. Figure 3: Illustration of signal sparsity. This is an example of 1-second length signal with sampling rate of 256.
The blue line represents original signal (i.e., stride of 1), the green dots represent data points of stride of 10, and the red dots represent data points of stride of 20. Note: red points overlap with green points, i.e., green points also appear at red point positions.

Sparsity-Based Temporal Augmentation
The main idea of sparsity-based temporal augmentation is motivated by the physical property of signals as shown in Fig. 3, i.e., Nyquist-Shannon sampling theorem (Nyquist 1928) such that a discrete sequence of samples can reconstruct corresponding continuous-time signal if the bandlimit B of the signal is less than the sample rate f s , i.e., B < 1 2 f s . In our case, the Frames Per Second (FPS) can be treated as sampling rate, and as long as the FPS is bigger than the Nyquist rate (i.e., 2 times of rPPG signal bandlimit), rPPG signal can be extracted from the video clip. As such, we can use different strides to augment each video along the time-axis, and the larger the stride is the lower the FPS will be.

Spatiotemporal Loss with Pseudo-labels
Specific constraints such as inductive bias during model training can help extract representative features. It effectively regulates and generalise the domain information (Argyriou, Evgeniou, and Pontil 2007). As such, we introduce a spatiotemporal loss that regulates the training process of contrastive learning and handles complicated noise. It first generates pseudo-labels for augmented video clips and creates two additional auxiliary classification tasks to predict the pseudo-labels. The pseudo-labels for each of video clip are defined based on the corresponding data augmentations. Suppose that we have a list of ROIs {R 1 , ..., R m , ..., R M } and a list of strides {S 1 , ..., S n , ..., S N }. Then, the video clip augmented by R m and S n will be labelled as (m, n) which are used as the ground truths of auxiliary classification tasks. According to previous work ), the mutual information among different views are maximised by where (i, j) is a pair of positive samples, 1 k =i ∈ {0, 1} is an indicator function which equals to 1 iff k = i (i.e., not the feature vector itself) and τ is the temperature hyperparameter. Additionally, we generalise this learning by in- where y a is the predicted ROIs,ŷ a is the target ROIs and C M is the number of classes, and where y b is the predicted strides,ŷ b is the target strides and C N is the number of classes. Our spatiotemporal loss is the sum of all losses as follows: We show the effectiveness of proposed loss function in Sec.5.3.

Experiment Setup
Datasets. We evaluated our RPM framework on HR estimation task by three widely used public datasets : MAHNOB-HCI (Soleymani et al. 2012), VIPL-HR-V2  and UBFC-rPPG (Bobbia et al. 2019) (See appendix B). All videos were re-sampled into 30 FPS and frames were resized into 64×64, and the length of each clip was constrained into 5 seconds. Metrics. The model performance on HR estimation (downstream task of RPM) was measured by comparing metrics of standard deviation (SD), the mean absolute error (MAE), the root mean square error (RMSE) and the Pearson's correlation coefficient (R). During the evaluation process, we adopt subject-exclusive test (Niu et al. 2020a), i.e., subjects in the training set will not appear in the testing set for fair comparisons. Linear Classification. To evaluate the quality of extracted rPPG representations, we followed the common linear classification protocol He et al. 2020) which freezes the weights of self-supervised video encoder layers and trains a subsequent FC layer on the global average pooling features of the video encoder. This evaluation is also used in our ablation studies. Transfer Learning. We firstly pre-trained SLF-RPM without labels, and then fine-tuned the weights of video encoder layers and a linear classifier with labels. We compared our method with 3D ResNet-18 pre-trained using Kinetics-700 (Smaira et al. 2020) and VIPL-HR-V2 (i.e., largest among three datasets) for supervised pre-training. Augmentation Details. Each video was first augmented into two clips using the stride number randomly sampled from the list {1, 2, 3, 4, 5} 2 , and each augmented clip was constrained to have length of 30-frame. Therefore, the longest clip (i.e., stride of 5) contained 5-second information, while the shortest clip (i.e., stride of 1) had 1-second information.
Frames of each clip were then cropped based on a specific ROI by randomly selecting one from 7 pre-defined facial areas as described in Sec. 3.4. We used Adam optimiser (Kingma and Ba 2015) with default settings to update the model weights. Settings of hyperparameters can be found in appendix C.

Linear Classification Evaluation
The results of linear classification experiment are shown in Table 2. We re-implemented three SOTA video SSL methods including DPC (Han, Xie, and Zisserman 2019), MemDPC (Han, Xie, and Zisserman 2020a) and SeCo (Yao et al. 2020). Our method had the best accuracies relative to other SSL methods on all datasets. SeCo was the closest to our method achieving MAE of 7.03 on MAHNOB-HCI, 13.32 on VIPL-HR-V2 and 9.83 on UBFC-rPPG. We attribute this difference to our augmentation schemes that effectively captured subtle colour fluctuations on facial skin, whereas other SSL methods are limited to learn only from apparent motions of the objects.
Performance comparisons to the supervised methods are also shown in Table 2. Our method on MAHNOB-HCI had a better performance (MAE of 3.60) with a large margin than the Supervised Baseline (MAE of 7.34) and had superior accuracy than previous SOTA Deephys (Chen and Mc-Duff 2018) (MAE of 4.57) and rPPGNet  (MAE of 4.03). Comparing with the best performing supervised approach Meta-rPPG (Lee, Chen, and Lee 2020) (MAE of 3.01) which used unlabelled testing samples to conduct transductive meta-learning, our method showed a competitive result and achieved higher SD of 4.58 and R of 0.92, suggesting that our method had more consistent predictions and stronger linear correlation between ground truth and predictions. We suggest that our distinctive performance on MAHNOB-HCI over supervised methods is subject to the limitations of the dataset where: 1. number of participants in MAHNOB-HCI is limited (i.e., 27 subjects in total); 2. videos are highly compressed, losing subtle details that human eyes cannot see. This was also reported from other similar work . Nevertheless, our method implicitly modelled compression-corrupted information patterns and learned robust rPPG signals in a self-supervised manner.
Our SLF-RPM on UBFC-rPPG achieved MAE of 8.39. Supervised methods on UBFC-rPPG had better performances than other SSL methods.This is mainly attributed to less noise on UBFC-rPPG (uncompressed video data), which improved overall supervised learning outcomes. Nevertheless, SLF-RPM reduced the performance gap with Supervised Baseline (MAE of 8.08) to MAE of 0.31.
The performances of all the methods on VIPL-HR-V2 were reduced in comparison to other two datasets. This is because VIPL-HR-V2 has more complex video conditions. Nonetheless, our method (MAE of 12.56) successfully closed the performance gap with the best supervised approach RePSS Team 1

Transfer Learning
We evaluated the transferable ability of rPPG features extracted by SLF-RPM. The results of the transfer learning are shown in Table 3. Our results indicate that the SLF-RPM improved the estimation of HR when it was used to pretrain CNNs for subsequent supervised fine-tuning. When the available dataset is limited, SLF-RPM can be used as the self-pre-training strategy (i.e., pre-train and fine-tune on the same dataset). This enabled faster adaption for rPPG feature extraction such that MAE was reduced to 11.59 on VIPL-HR-V2 dataset. Moreover, it was most effective when SLF-RPM was applied to pre-train using the largest VIPL-HR-V2 dataset. The performance of Supervised Baseline was improved from MAE of 7.34 to 6.23 on MAHNOB-HCI and from MAE of 8.08 to 7.35 on UBFC-rPPG dataset.We suggest that our self-supervised pre-training acted as an initialisation point for effective supervised fine-tuning, which improved the feature representation of rPPG signals. In contrast, model pre-trained on Kinetics-700 benchmark, commonly used in action recognition task, degraded HR estimation performance (MAE of 8.98 on MAHNOB-HCI, 12.28 on VIPL-HR-V2 and 9.77 on UBFC-rPPG) compared with the baseline model due to the hard domain shift between tasks. Moreover, we evaluated the model pretrained with labels using VIPL-HR-V2 and achieved MAE of 8.06 on MAHNOB-HCI and 8.32 on UBFC-rPPG. This demonstrates that our self-supervised pre-training strategy was better at characterising the RPM features than that of supervised pre-training methods.

Ablation Studies Landmark-based Spatial Augmentation
We compared our landmark-based spatial augmentation with 5 other common data augmentation techniques. We applied these techniques to the whole face area (i.e., R 1 of the pre-defined ROI list) and used stride of 1 to avoid temporal augmentation effects. The descriptions of R 1 − R 7 are in Sec. 3.4. As shown in Table 4, our landmark-based spatial augmentation had the best MAE score of 5.12. Our results show that the whole face ROI (R 1 ) was effective in model training, which improved MAE from 7.98 to 5.12. Among the standard augmentation techniques, Random Crop and Resize had the best result with MAE of 6.74. Random Grayscale had the worst performance with MAE of 10.66. The combination of all 5 techniques (standard paradigm in simCLR ), in fact, reduced the performance giving MAE of 9.54. One possible reason is that although appearance transformations prevent the model from using colour histogram shortcut  to distinguish different views, signal-related information contained in colour channels can be also distorted. Another reason could be that geometric transformations cannot guarantee augmented inputs are valuable. They may introduce signal noise by including non-facial areas (Li et al. 2014). Overall, our landmark-based spatial augmentation outperformed standard spatial augmentation techniques by a large margin for the task of HR estimation.

Sparsity-based Temporal Augmentation
We evaluated the effectiveness of our sparsity-based temporal augmentation compared to different standard temporal   Table 4: Ablation on spatial augmentation. We compared different spatial augmentations and evaluated the impact of each ROI. The best result is in bold. No temporal augmentation is applied.
augmentation techniques, and use whole face R 0 to avoid spatial augmentation effects. As shown in the bottom part of Table 5, our sparsity-based temporal augmentation follows the Nyquist-Shannon sampling theorem and showed the larger sparsity ranges had under-sampling issue that negatively affect the learning outcome since sparsity range {1,2,3,4,5,6} had worse MAE of 5.92 than the best performing range {1,2,3,4,5} with MAE of 5.28. However, we also noted that we need some enough sparsity (e.g., {1,2,3,4,5}) to have stronger data transformation compared with smaller range {1,2,3,4} achieving MAE of 6.21. Nevertheless, the proposed sparsity-based temporal augmentation generally outperformed other augmentation techniques. Among these four standard temporal augmentations, Random Temporal Interval had the best result with MAE of 5.74 and we attribute this to its ability to characterise the periodic cycle of blood volume changes on facial skin. Periodic had the worst MAE score of 7.31 due to the distorted rPPG signals.
labels enabled better characterisation of complicated ROIs and subtle temporal changes (i.e., noise).

Different Contrastive Learning Strategy
As the first contrastive learning work for RPM, we investigated the performance of different SSL strategies including CPC (Oord, Li, and Vinyals 2018), MoCo (He et al. 2020), CPC + MoCo and simCLR ) which achieved SOTA results on image classification tasks. We extended their ideas into video applications, i.e., transforming from 2D data into 3D data. To make our experiments consistent, data augmentations were limited to spatial augmentations using the same combination adopted in simCLR. From Table 7, simCLR obtained best result (MAE of 9.54), whereas CPC only achieved MAE of 13.49.

Conclusion
We present a SSL framework for RPM by introducing novel landmark-based spatial augmentation, sparsity-based temporal augmentation and spatiotemporal loss. Our results showed that the SLF-RPM significantly outperformed other SSL methods and achieved a competitive accuracy compared to other supervised methods on HR estimation task. The superior transfer ability of learnt RPM representations Contrastive Learning Strategy HR(bpm) MAE CPC (Oord, Li, and Vinyals 2018) 13.49 CPC + MoCo 13.05 MoCo (He et al. 2020) 11.73 simCLR  9.54 Table 7: Ablation on contrastive learning strategy. We compared with SOTA contrastive learning strategies for the HR estimation task. The best result is in bold.
using SLF-RPM demonstrates that it can be used as an effective pre-training strategy for many facial video analysis tasks. The limitations of this work is shown in appendix D

A SLF-RPM Algorithm
We demonstrates the overall algorithm for SLF-RPM in Alg. 1.

B Dataset Descriptions
MAHNOB-HCI Dataset contains 27 subjects, including 12 males and 15 females. Each video was recorded in 780×580 resolution with frame per second (FPS) of 61. Following the previous settings (Li et al. 2014), we used RGB videos recorded in emotion elicitation experiment and selected continuous sequence of frames in the range from 306 to 2135 (around 30 seconds), which resulted in 527 videos. The ground truth HRs were calculated from ECG signals in the channel EXG2. UBFC-rPPG Dataset contains 42 uncompressed videos of 30 FPS from 42 subjects. Ground truth HRs are provided for each of videos. Since this dataset has limited number of videos, we augmented each video by using a sliding window of 150 frames without any frame overlap, i.e., 60 seconds video was split into 12 clips with the length of 5 seconds each. We obtained 523 videos after the augmentation.
VIPL-HR-V2 Dataset is a recently released large-scale HR estimation benchmark which contains 2,500 RGB videos of 500 subjects recorded in 960 × 720 resolution with FPS of 30 in average. This dataset is more challenging as it introduces more complicated scenarios including various head movements, different illumination conditions and wide range of HR values (Niu et al. 2018b). Ground truth HRs and FPS are provided for each video.

C Model Parameters
Self-Supervised Training. For MAHNOB-HCI dataset, the hyper-parameter τ was 1, output dimension of MLP with 2048, learning rate of 1e-4, batch size of 128, and epoch number with 150. For UBFC-rPPG, the hyper-parameter τ was set to 0.1, output dimension of MLP with 2048, learning rate of 1e-4, batch size of 128, and epoch number with 50. For VIPL-HR-V2 dataset, the hyper-parameter τ was 1, output dimension of MLP with 512, learning rate of 1e-5, batch size of 128, and epoch number with 200. We empirically derived the best performing τ for each dataset.
Linear Classification Evaluation. We aligned the training process with self-supervised settings by sampling 75frame clips with the stride of 2 from 150-frame videos. The for k ← 1, ..., N do // 1st spatiotemporal augmentation to get augmented c 1 k . learning rate was set to 5e-3, and the epoch number was set to 50 for MAHNOB-HCI as well as UBFC-rPPG and 100 for VIPL-HR-V2. Transfer Learning. For MAHNOB-HCI dataset, the epoch number was 100, the batch size was 64 and the learning rate was 1e-4. For UBFC-rPPG, the epoch number was 200, the batch size was 64 and the learning rate was 5e-3. For VIPL-HR-V2, the epoch number was 100, the batch size was 64 and the learning rate was 5e-5. Similarly, videos were down-sampled with stride of 2 such that 75-frame clips were fed into the model.

D Limitations
There are several limitations in this work. First of all, the selection of ROIs in our spatial augmentation is based on prior knowledge, which may implicitly ignore underlying patterns of human skin we have not noticed. For example, people have different sensitiveness to the sunlight such that areas in the face exhibit different signal quality for each individual (Rouast et al. 2016;Chong and Werth 2019) and extra noise might be introduced if uniform ROI shapes are applied. Based on that, it is more reasonable to build an algorithm to automate this process and thus the selection of ROIs becomes intelligent and specific to each of the face. Moreover, as suggested in AutoAugmentation (Cubuk et al. 2018), instead of randomly sampling form pre-defined augmentation list, we can build a search space with sub-policies which could decide the most suitable augmentations for current video clip such that rPPG signal information are maximised. Furthermore, to control the effect of data augmentations, extra hyper-parameters can be added to re-weight the importance of applied transformations such that rPPG signal features can be learnt smoothly.
Another limitation is that we did not study the effect of skin tone on RPM and this can be an issue when transferring among datasets which contain different racial majority. To solve this problem, a larger dataset with balanced ratio of ethics should be built.
According to previous self-supervised method , the batch size is normally large (e.g., 4096) to provide more negative samples. However, due to the limitation of our dataset size, we can only use batch size of 128. We believe the performance of SLF-RPM can be further enhanced if more negative samples are available. Similarly, because of the limited resource of GPU, we did not experiment the effect of frame size and clip length. In this work, we sacrificed bigger frame and longer clip to make batch size as large as possible which can be fed into a single GPU.
Although our method is effective on improving baseline supervised model, the performance on improving SOTA supervised methods were not experimented. This actually can be done by applying SLF-RPM to initialise their backbone parameters.
Lastly, since our experiments were conducted in the laboratory environment, the effectiveness of our method in the clinic usage is unknown. Our next plan is cooperating with the hospital and evaluating our model in a more realistic situation.