Inspiration

Basic vital signs shouldn't depend on what you can afford.

A pulse oximeter, a blood pressure cuff, a heart monitor: these are the first things any clinician reaches for, and millions of people don't have them. Many live far from a clinic, can't afford the visit or the equipment, or put off checking their health because of the cost. Yet almost all of them already carry a device with a camera: a phone, a laptop or a tablet.

Telehealth was supposed to close that gap, and it has made care easier to reach. But a video call still can't take a pulse. The doctor sees a face on a screen and has to ask, "How do you feel?" instead of reading the numbers that matter.

So we asked: what if the camera you already own could be the first instrument? Every heartbeat changes the colour of your skin slightly. Every breath moves your chest. A camera can see both. If we could read those signals honestly, with no extra hardware, no subscription and no data sent to anyone, then anyone with a camera could check their vitals at home, track how they change, and bring real numbers to a telehealth appointment.

That became Cuore, Italian for "heart": vital signs from the camera you already have, free, private, and running on your own device. Its home on the web is heartware.health.

We were also clear about what a camera can't do yet. Cuore doesn't measure blood pressure or replace medical-grade equipment. It's a first step that puts basic, honest measurements within reach of people who have none today.

What it does

Cuore reads three vital signs from an ordinary webcam, with nothing touching the body:

  • Heart rate: from the tiny colour changes that blood flow causes in facial skin (remote photoplethysmography, rPPG)
  • Breathing rate: from the rise and fall of the chest and shoulders
  • Blink rate: from the geometry of the eyelids

It then learns your own baseline for each one and shows how you compare with it. We call this composure. It is deliberately not a "stress score": resting heart rate, breathing pace and blink rate vary a lot from person to person, so Cuore compares you with you.

Cuore is honest about uncertainty. Every number is shown as reliable, provisional (dimmed, marked ≈, never averaged) or unavailable (blank, with the reason). We'd rather show no number than a wrong one.

What you get:

  • Live view: session-average and live heart rate, signal quality, composure and what it's based on, a live breathing wave, and a one-minute guided breathing exercise
  • Session report: six headline metrics, trend charts (provisional seconds drawn dotted, gaps left as gaps), data availability, plain-language findings, and a downloadable PDF, CSV or PNG, generated entirely in the browser
  • Phone mode: run Cuore on your laptop, pair your phone with an 8-character code, and measure with the phone's front camera over your home Wi-Fi
  • A 45-second quick read (experimental): it tells you exactly what can and can't be measured in that time

Privacy by design: the camera, the analysis and every reading stay on your own computer. No accounts, no cloud, no analytics. Video frames are processed in memory and never stored.

Cuore is a hackathon prototype for awareness, not a medical device.

How we built it

A small Python/Flask server runs the measurement pipeline on your own computer. The browser opens the camera, stamps each frame with its capture time, and streams it to the server at 127.0.0.1. The page polls once a second for results. The pipeline runs per frame:

1. Find the face. MediaPipe Face Landmarker places 478 landmarks on the face in every frame. They locate the skin, the eyes and the area below the chin.

2. Heart rate (rPPG). A neural rPPG model (FacePhys, via the open-source open-rppg library) recovers the blood-volume pulse from the face over a sliding 10-second window, updated every second. It also returns a signal quality index (SQI) from 0 (noise) to 1 (clean). A reading counts as reliable only when:

SQI > 0.22

Anything at or below that is shown as provisional and never enters averages or baselines.

The first 10 seconds of every session are calibration. Live BPM appears straight away, but the session-average BPM only uses reliable readings whose frames were captured after the first 10 seconds (timed on the server from the session's first frame, so network delay can't blur the boundary).

For comparison we also implemented the classical POS algorithm (Wang et al., 2017), available with --hr colour. In each sliding 1.6 s window we divide each colour channel by its temporal mean (Rₙ, Gₙ, Bₙ) and project onto two axes, then combine them with an adaptive weight:

S₁ = Gₙ − Bₙ
S₂ = −2Rₙ + Gₙ + Bₙ

h  = S₁ + α · S₂        where  α = σ(S₁) / σ(S₂)

We then bandpass to 0.7–3.5 Hz (42–210 BPM) and take the strongest frequency of a Hann-windowed FFT:

f*  = the frequency between 0.7 and 3.5 Hz where |X(f)|² is largest
HR  = 60 × f*  BPM

3. Breathing. Breathing moves the chest far more than the head. We run dense optical flow (Farnebäck) on the region below the chin and track its vertical motion, falling back to head motion if the shoulders aren't visible. Over a 30-second window we bandpass to 0.1–0.5 Hz (6–30 breaths/min) and pick the dominant frequency. A rate is shown only if that peak stands out from the noise:

SNR (dB) = 10 × log₁₀(peak power ÷ rest power)  ≥  −3 dB

4. Blinks. For each eye we compute the eye aspect ratio from six landmarks (d = distance between two points):

EAR = ( d(p₂, p₆) + d(p₃, p₅) ) ÷ ( 2 × d(p₁, p₄) )

A blink is a dip below 75% of that person's own open-eye level lasting 2–15 frames, so the threshold adapts to each face. Rates are counted over 60 seconds and marked provisional until a full minute is in.

5. Personal baselines. Each measurement learns its own baseline independently, so a weak heart signal never blocks breathing or blinks. A baseline is ready only once 60 s have passed since that measurement's first valid reading and at least 30 s of valid readings were collected. Elapsed time alone never counts.

6. Composure. Once two or more baselines are ready, Cuore compares you with them (₀ = your baseline):

Heart rate     HR  > 1.15 × HR₀
Breathing      RR  > 1.25 × RR₀
Blinks         BR  < 0.60 × BR₀   (and at least 3 per minute lower)

Composure reads elevated when blinks drop that far, or when any two of these happen together. With only one measurement to compare, it says "insufficient data" instead of guessing.

7. The interface and report. Hand-written HTML, CSS and JavaScript with no framework, in an "instrument" design language. The session report's PDF is generated directly in the browser by our own small PDF writer (vector text and charts, no libraries), so nothing leaves the machine.

8. Phone mode and security. server.py --lan serves HTTPS on the home network with a self-signed certificate, because phones only allow the camera on secure pages. Every device must pair with a one-time 8-character code, which is rate-limited. Paired devices get an HttpOnly, Secure, SameSite=Strict session token. Other protections: a strict Content-Security-Policy, host-header checks against DNS rebinding, and CSRF protection on every state-changing request.

9. The website. heartware.health is a static site generated from the same source and hosted on GitHub Pages, on a domain from GoDaddy Registry.

We also kept the original desktop app (an OpenCV dashboard on the main branch). It shares the same measurement code and can read a person in a video-call tile through screen capture.

Challenges we ran into

  • A tiny signal. The pulse is a skin-colour change of a fraction of a percent, competing with lighting drift and head motion. In our first real session the heart signal quality was only 0.13, because of a bright window behind the user. Instead of hiding that, we made "provisional" a first-class state: dimmed, marked ≈, never animated, never averaged.
  • Honest composure. Our first version could say "calm" based on a single measurement. We rebuilt baselines so each signal is learned and judged independently, and composure needs at least two before it says anything.
  • Webcam timing. Frames arrive unevenly and can arrive out of order once they travel over a network. We stamp each frame with its browser capture time, map it onto one server clock, and drop late frames, so the signal processing sees a clean timeline.
  • Phones and secure contexts. Browsers only open the camera on HTTPS pages or on localhost. Reaching a server on a laptop from a phone needed opt-in HTTPS, a pairing flow and rate limiting, without weakening the default local-only design.
  • Privacy vs hosting. Our sponsor hosting couldn't run real-time ML models, and running them in the cloud would have sent faces to a data centre. We kept measurement on the user's own machine and hosted only the static website.
  • Dependency conflicts. MediaPipe, OpenCV and JAX are particular about Python and package versions, so we pinned every dependency to the versions we tested.

Accomplishments that we're proud of

  • A complete pipeline from raw video to heart rate, breathing, blinks, personal baselines and composure, running live in the browser
  • Honest uncertainty: every value is labelled reliable, provisional or unavailable, and nothing is ever shown as more certain than it is
  • A downloadable session report (PDF, CSV, PNG) built entirely in the browser, with no libraries and no uploads
  • Phone mode with secure pairing, so a phone's camera can be used while video stays on your own network
  • A privacy-first design: no cloud, no accounts, no analytics, frames never stored
  • A live product website at heartware.health
  • 50 automated tests, covering baselines, composure, the 0.22 quality boundary, the 10-second calibration rule and phone-mode security

What we learned

  • How rPPG works, and how classical methods like POS compare with neural models
  • That showing no number is better than showing a wrong one, so signal-quality gating matters as much as the estimator
  • That "different from your own baseline" is a more honest and more useful idea than a universal stress score
  • That camera-based vitals can be less accurate on darker skin tones, where the colour signal is weaker, and that this has to be stated openly
  • That privacy is easiest to keep when it's an architectural decision, not a policy

What's next for Cuore

  • Measurement on the phone itself: run the whole pipeline in the phone's browser, so a phone is all anyone needs: no laptop, and video never leaves the device
  • Sharing with a clinician: let users bring their session report into a telehealth visit, on their terms
  • Research toward blood pressure: camera-based blood pressure estimation is an open research problem; we'd only add it once it can be validated against a medical cuff
  • Heart rate variability (HRV): detect individual beats and compute RMSSD from consecutive inter-beat intervals, a more sensitive marker of how the body is responding than average heart rate
  • Validation: test against a fingertip pulse oximeter across skin tones, lighting and motion, and publish the results
  • Baselines that persist between sessions, stored locally
  • A smoother video-call mode with automatic face-tile detection and built-in consent prompts

Built With. flask · python · javascript · html5 · css3 · mediapipe · opencv · numpy · scipy · open-rppg · jax · github-pages · porkbun

Try it out https://heartware.health https://heartware.health/run.html https://github.com/LeoSLayer1-Arif/cuore/tree/web-ui https://github.com/LeoSLayer1-Arif/cuore

Built With

Share this project:

Updates

Submission history