Heart Rate Detection Trigger
Table of Contents
Overview
Labvanced heart rate measurement is a physiological tracking system that uses standard webcams to estimate heart rate remotely—no specialized hardware required.
This event listener triggers on heart rate detection updates. Upon selecting this trigger, the BPM, a timestamp and confidence score can be measured.
Note: All processing occurs client-side, ensuring GDPR compliance and guaranteeing that no facial data is ever transmitted or stored externally.

Recording Heart Rate Data
Upon selecting the trigger and giving the action a name, a dialog box will appear prompting you to set up the relevant events for recording data for heart rate detection:

As a result of auto-creating this event, the following action will be created (as shown in the picture below). The variable name heartRate_Heart Rate Detection is assigned and the trigger-specific value of [BPM,T,C] Array is indicated as the values to be recorded during data collection.
From here, the variable name can be further edited via the Variables panel, and the trigger values can also be reassigned to be different values. See below for more options via the Value-select Menu.

Preview of Heart Rate Data Collected in Labvanced
Below is an example of data recorded as a result of having the above event active in your task in Labvanced:

Enabling / Activating Heart Rate Detection
In order for the heart rate detection trigger to function, the relevant settings must be activated and enabled under both the Task Controls and Settings, as explained below.
Study Settings - Enable Heart Rate Detection
In the Settings tab, navigate to Physiology → Heart Rate Detection and check the checkbox in order to activate heart rate measurements in your study.
Note: As remote heart rate detection (rPPG) works by calculating weighted averages over time and therefore can take 10 or more seconds to initialize, there is a setting under the Settings tab called Initialize RPPG on Study Start that by activating helps ensure the rPPG measurements are ready before your main task starts (except where you have enabled RPPG in your first task). Furthermote, there is an additional setting called Wait for heartrate confidence that when enabled, the study will wait until the heart rate detection reaches the specified confidence level before proceeding. The study will also be paused if the heart rate confidence falls below the specified threshold during the experiment. This is useful for ensuring that the heart rate data is reliable.
Task Settings - Enable Heart Rate Detection
Under the Task Controls section in the Task Editor, navigate to the Physiological Signals tab and click the checkbox in order for heart rate detection to be active in the particular task.
Upon activating the heart rate detection by clicking the checkbox, a dialog box will appear prompting you to indicate whether an event for recording heart rate detection data values should be created, along with what frame should the recording occur on:

Trigger-specific Values for Heart Rate Detection
Upon selecting the Heart Rate Detection Trigger, the following options are available in the Value-Select Menu.

| Value | Description |
|---|---|
BPM | Numeric value indicating the measured heart rate as beats per minute (BPM). |
Camera Capture Time (T) | The adjusted timestamp value based on when the image snapshot (ie the camera capture) occurred which is required in order to perform heart rate detection calculations. Note: While the Trigger Timestamp is a value of when the trigger initiated, it takes a few milliseconds for the algorithm to then capture the image frame locally and then process the related heart rate score. Thus, the Camera Capture Time T value is a more accurate timestamp to use. |
Confidence (0) | A value from 0 to 1 indicating the confidence of the measured heart rate value. |
[BPM, T, C] | An array holding the values for heart rate (BPM - beats per minute), the camera capture time (T), and the confidence interval of the measurement (C). Refer to the image preview in the data recording section above for a sense of the data collected with this trigger-specific value selected. |
Trigger Timestamp (Unixtime) | The trigger timestamp in UNIXTIME. Note: Refer to the Camera Capture T value as this is a more accurate value for when the emotion detection occurred, as explained above. |
Trigger Time (From Frame Onset) | Time (in milliseconds) that the trigger occurred from the frame onset / start. |
Practical Examples Featuring the Heart Rate Detection Trigger
In this demo, remote heart rate detection is activated. The relevant values (BMP, timestamp, and confidence intervals of the measurement) will be displayed in real-time.