Cyborg Collective

Your pulse and your expression, read by a camera

No headband: the camera in front of you, read in this browser. Nothing from it leaves this page.

Each heartbeat pushes blood into the skin of the face and changes its colour by a fraction of a percent: too little to see, enough for a camera to measure. This page follows the forehead and the cheeks, measures that change and counts it as a pulse. From the same picture it reads the expression on the face and how often the eyes close. Every number here is an estimate, and each one says how it was made.

Read

Sit facing the camera in even light and keep fairly still. A first number appears, in grey, after about six seconds. It turns solid, and is called steady, once the same rhythm has held for eight seconds more.

The camera is off.
Nothing is read until you start it.

The camera is off.

The picture is read on this device. No picture and no number is sent anywhere or kept: the page is allowed to talk to no other site (the rule is the first thing in its source), and it sends nothing to this one. Closing the page ends it.

Pulse estimated

– beats a minute not reading
Signal quality –
Window filled –
The pulse wave the number is counted from, against seconds. It has no unit: it is a mix of the skin's colour channels, filtered to the range a heart can beat in.

Beat-to-beat variation (rough): – ms RMSSD · – ms SDNN shown only while the pulse is clean

Signal quality is how clearly one rhythm stands out of the noise over the last twelve seconds. Under 25 % no number is shown. Above it the number is grey: a reading still being made. It turns solid and is called steady only when the same rhythm has stood out, above 55 % and within 4 beats a minute of itself, for eight seconds running. A face that moves can throw up a rhythm by chance for a moment; it does not keep one.

Expression a rule, not a trained model

Now: –

  • neutral–
  • happy–
  • sad–
  • angry–
  • surprised–
  • fearful–
  • disgusted–

This is what is often called emotion recognition. What it reads is the expression on the face: raised mouth corners, lowered brows, an open jaw. It does not know what the person feels.

Eyes estimated

–eye opening
0blinks
–closure, of 100

An eye's opening is its height over its width, and it counts as closed under 0.21. Blinks are counted from the start. Closure is the share of the last four seconds spent closed: one sign of drowsiness, not a measure of tiredness.

Arousal experimental

– of 100 not reading

How far the pulse has moved from your own first 20 seconds of steady readings: a faster heart and less variation raise it. It compares you with yourself a moment ago, from numbers that are themselves estimates.

How each number is made

Everything runs in the page. Each step is a plain file that can be opened and read.

StepWhat happensFile
Where the face isA face model places 478 points on the face in each picture, and gives 52 numbers for its shape (how far the mouth corners are raised, the jaw open, and so on).landmarks.js
Skin colourThe mean red, green and blue of the forehead and both cheeks, forehead counted double, once per picture. Pixels that are nearly black or blown out are left out.face.js
Pulse wavePOS (plane orthogonal to skin; Wang, den Brinker, Stuijk and de Haan, 2017): the three colour traces are mixed so that movement and changes of light mostly cancel and the pulse stays.rppg.js
Heart rateThe wave is brought to 30 samples a second, its drift removed, and filtered to 0.7–4 Hz (42 to 240 beats a minute) without shifting it in time. The strongest rhythm in its spectrum is the heart rate.dsp.js
Signal qualityThe power at that rhythm and its first overtone, against the rest of the band, in decibels, mapped to 0–100 %.dsp.js
SteadyA reading is called steady when, for eight seconds running, every reading had a quality above 55 % and all of them named the same rate, within 4 beats a minute. A quality score alone is fooled by colour that wanders; a rhythm that holds is not.steady.js
Beat-to-beat variationPeaks of the wave are taken as beats; RMSSD and SDNN are computed from the times between them, with implausible gaps left out. Shown only while the pulse is steady.dsp.js
ExpressionHand-written rules turn the 52 shape numbers into seven scores, and a softmax turns the scores into shares that sum to 100 %.expression.js
EyesEach eye's height over its width, from six of the points. Closed-then-open is a blink.eyes.js
ArousalHeart rate above, and RMSSD below, the median of the first 20 seconds of steady readings.arousal.js

That an ordinary webcam can read a pulse was shown by Poh, McDuff and Picard at the MIT Media Lab (Optics Express, 2010). The method used here is a later one, POS (Wang et al., IEEE Transactions on Biomedical Engineering, 2017). The face model is Google's MediaPipe Face Landmarker, kept beside this page with its licence (vendor/mediapipe) so that nothing is fetched from another site.

What this page does not do