Remote Photoplethysmography · rPPG

Your heartbeat,
read by a webcam.

Every pulse pushes blood into your face and shifts its color too faintly to see — but not too faintly to measure. PulseCam recovers your heart rate from an ordinary camera. No contact, no wearable. Runs locally on a laptop.

How it works

From pixels to a pulse

The same signal-processing chain used to clean up a physical PPG sensor — only the input is a camera array instead of a photodiode.

01

Track the face

Detect the face each frame and lock a region of interest onto the forehead so we sample skin, not background.

02

Average the color

Collapse the forehead to one number per frame — the mean green channel, where the blood-volume signal is strongest.

03

Filter the noise

Detrend out lighting drift, then a Butterworth bandpass keeps only 0.75–3.5 Hz — the 45–210 BPM heart-rate band.

04

Find the rhythm

An FFT reports the dominant frequency of the cleaned wave. Multiply by 60 — that's your beats per minute.

⏱️ The frame rate is measured from real capture timestamps, not the webcam's claimed FPS — without this the reading drifts 10–20% off.
Two engines

Signal processing vs. deep learning

A classical DSP baseline you can fully explain, and a PhysNet 3D-CNN trained on real data — run live, side by side, so the AI has to prove itself against a trusted number.

PropertyDSP baselinePhysNet (AI)
MethodBandpass + FFT3D-CNN → pulse waveform
Still & well-litExcellentExcellent
Motion / talkingBreaks downRobust
Uneven lightingNoisyRobust
Needs training dataNoYes — UBFC-rPPG
Fully explainableYesBlack box
🧠 PhysNet (~0.77M params) takes a short clip of face frames and outputs a pulse waveform directly, learning to ignore motion the hand-written filter can't. Trained with a negative-Pearson loss on the UBFC-rPPG dataset (face video + ground-truth oximeter pulse).
Try it

Run it on your machine

Everything runs locally — your camera feed never leaves your laptop.

# 1. setup
git clone https://github.com/bshihab/rppg-poc
cd rppg-poc
python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

# 2. DSP baseline — works immediately, no training
.venv/bin/python heart_rate.py

# 3. AI: download UBFC-rPPG into data/UBFC-rPPG, then train
.venv/bin/python -m rppg.train --data data/UBFC-rPPG

# 4. live AI vs DSP, side by side
.venv/bin/python -m rppg.live_ai
Python PyTorch · PhysNet OpenCV SciPy DSP UBFC-rPPG Runs on Apple Silicon (MPS)