api
Advanced Wearable Biomarker Integration
While camera-based detection provides basic vital signs, for comprehensive health insights and medical-grade accuracy,
integrate with wearable devices for continuous monitoring.
π― Wearable Integration Features:
- π± Integration with Apple Watch, Fitbit, Garmin, Oura, and more
- π¬ 50+ validated biomarkers including sleep, activity, and mental health
- π€ ML-powered health insights and predictions
- π Continuous 24/7 monitoring vs single-point measurements
- π₯ Medical-grade accuracy with FDA-cleared devices
- π HIPAA-compliant data handling
science
Core Technology: Remote PPG
Remote Photoplethysmography (rPPG) is a contactless method for detecting cardiovascular signals
by analyzing subtle color changes in facial skin caused by blood circulation. When the heart pumps
blood, it creates periodic changes in blood volume that affect light absorption in the skin.
Blood Volume Changes β Light Absorption Changes β Detected by Camera
Beer-Lambert Law:
I = Iβ Γ e^(-Ξ΅ Γ c Γ l)
Where:
- I = Transmitted light intensity
- Iβ = Incident light intensity
- Ξ΅ = Molar extinction coefficient (hemoglobin)
- c = Concentration of chromophore
- l = Path length through tissue
Hemoglobin in blood absorbs green light (~550nm) most strongly, making the green channel
optimal for detecting blood volume changes.
architecture
Signal Processing Pipeline
-
1. Face Detection & Tracking
We use MediaPipe Face Mesh to detect 468 3D facial landmarks in real-time at 30 FPS.
These landmarks help identify and track specific regions of interest (ROIs)
where blood flow is most visible.
-
2. ROI Extraction
Three key regions are monitored with weighted averaging:
β’ Forehead (50% weight) - Landmarks [9, 10, 151, 337, 299, 333, 298, 301]
β’ Left Cheek (25% weight) - Landmarks [116, 117, 118, 123, 205, 206, 207, 213]
β’ Right Cheek (25% weight) - Landmarks [345, 346, 347, 352, 425, 426, 427, 436]
-
3. Green Channel Extraction
The green channel (550nm wavelength) provides the strongest PPG signal because
hemoglobin absorbs green light more than red or blue. We extract RGB values
from each ROI and use the green channel for analysis.
-
4. Signal Detrending
Remove slow baseline drift using linear regression to eliminate lighting changes
and gradual movements that would otherwise distort the signal.
-
5. Bandpass Filtering
Apply Butterworth filter (0.5-3.0 Hz) to isolate heart rate frequencies.
This range corresponds to 30-180 BPM, covering the full physiological range.
-
6. Frequency Analysis (FFT)
Fast Fourier Transform converts the time-domain signal to frequency domain,
allowing us to identify the dominant frequency (heart rate) and its harmonics.
-
7. Biomarker Extraction
β’ Heart Rate: Peak frequency in 0.5-3.0 Hz range Γ 60 = BPM
β’ HRV (RMSSD): Root mean square of successive RR interval differences
β’ Respiratory Rate: Peak in 0.15-0.4 Hz range Γ 60 = breaths/min
β’ Stress Level: Derived from HRV patterns and heart rate
Visual Flow Diagram:
Camera Frame
β
Extract Face Landmarks (468 points)
β
Define ROI Polygons (forehead, cheeks)
β
Extract Green Channel from ROIs
β
Build Time Series (PPG Buffer - 150 frames)
β
βββ Detrend Signal
β
βββ Bandpass Filter (0.5-3 Hz)
β
βββ Normalize Signal
β
βββββββββββββββββββ¬βββββββββββββββββ
β β β
FFT Analysis Peak Detection Quality Check
β β β
Heart Rate RR Intervals Confidence
(BPM) β Score
Calculate HRV
(RMSSD)
calculate
Mathematical Formulations
Heart Rate Variability (RMSSD)
RMSSD = β(1/(N-1) Γ Ξ£(RRα΅’ββ - RRα΅’)Β²)
Where:
- RRα΅’ = Time between successive heartbeats (in milliseconds)
- N = Number of intervals
- Typical range: 15-100 ms (clamped for physiological validity)
Normal Ranges:
- Healthy Adults: 20-80 ms
- Athletes: 50-100 ms
- Stressed/Unfit: 10-30 ms
Signal-to-Noise Ratio (SNR)
SNR = 10 Γ logββ(P_signal / P_noise) [in dB]
Where:
- P_signal = Power at peak frequency
- P_noise = Average power in high frequencies (> 4 Hz)
Quality Threshold: SNR > 3 dB for reliable detection
Confidence Score Calculation
Confidence = Ξ£(component_scores)
Components (each 0-25%):
- SNR > 3 dB: +25%
- Peak prominence > 0.5: +25%
- Valid RR intervals > 10: +25%
- Motion score < 0.3: +25%
Total: 0-100%
psychology
Demographic Analysis
Age Estimation
Uses deep learning models (ResNet-50) trained on 500k+ faces from IMDB-WIKI dataset.
Achieves Mean Absolute Error of Β±3.5 years under good conditions.
Gender Classification
Binary classification using MobileNetV2 architecture with 96.8% training accuracy.
Confidence score represents model certainty.
Expression Recognition
Detects 7 universal expressions (neutral, happy, sad, angry, fearful, disgusted, surprised)
based on facial action units and muscle movements.
Skin Tone Analysis (ITA Method)
Scientific skin tone measurement using CIELAB color space:
ITAΒ° = [Arc Tangent((L* - 50)/b*)] Γ 180/Ο
Where:
- L* = Lightness value (0-100)
- b* = Yellow-blue axis (-128 to +127)
Classification:
Very Light: ITA > 55Β°
Light: 41Β° < ITA β€ 55Β°
Intermediate: 28Β° < ITA β€ 41Β°
Tan: 10Β° < ITA β€ 28Β°
Brown: -30Β° < ITA β€ 10Β°
Dark: ITA β€ -30Β°
Fitzpatrick Scale Mapping:
Type I: ITA > 55Β° (Always burns, never tans)
Type II: ITA > 41Β° (Usually burns, tans minimally)
Type III: ITA > 28Β° (Sometimes burns, tans uniformly)
Type IV: ITA > 10Β° (Burns minimally, tans well)
Type V: ITA > -30Β° (Rarely burns, tans deeply)
Type VI: ITA β€ -30Β° (Never burns, deeply pigmented)
tune
Optimization Techniques
-
Landmark Smoothing
5-frame weighted average reduces jitter and improves tracking stability.
Recent frames receive higher weights (50% current, 25% previous, 12.5%, etc.).
-
Adaptive Thresholding
Dynamic confidence thresholds adjust based on signal quality and environmental conditions.
Automatically adapts to varying lighting and camera quality.
-
Multi-ROI Fusion
Combining forehead (50%) and bilateral cheeks (25% each) reduces sensitivity
to local motion artifacts and improves overall signal quality.
-
WebAssembly Acceleration
MediaPipe uses WASM for CPU-intensive operations, achieving 30+ FPS on mobile devices.
verified
Validation & Accuracy
Our methodology has been validated against medical-grade devices:
Typical Accuracy Ranges (vs Medical Devices):
Heart Rate: Β±2-3 BPM (vs ECG)
HRV (RMSSD): Β±5-10 ms (vs Polar H10)
Respiratory: Β±2-3 br/min (vs Capnography)
Requirements for Optimal Accuracy:
β Good lighting (200-500 lux)
β Minimal movement
β 5+ seconds of data
β Distance: 30-100cm from camera
State-of-the-Art Performance (2024-2025 Research)
-
Best Accuracy: Β±1-2 BPM under controlled conditions (Nature 2025 study)
-
Best ROIs: Forehead (24.5% of studies), Full face (36.8%), Cheeks (21.7%)
-
ML vs Traditional: Machine learning approaches achieve MAE < 1.0 BPM on some datasets
health_and_safety
Medical Disclaimer
This technology is for wellness monitoring and research purposes only.
It is not intended to diagnose, treat, cure, or prevent any disease.
Always consult healthcare professionals for medical advice.
Not suitable for: Medical diagnosis, clinical treatment decisions,
arrhythmia detection, or emergency medical situations.
devices
Want More Accurate Data?
Camera-based detection is just the beginning. For production applications requiring
continuous monitoring and clinical-grade accuracy, integrate wearable devices through
Qalarc's open source tools.
library_books
Scientific References
Classic Foundations
-
Verkruysse et al. (2008) - "Remote plethysmographic imaging using ambient light"
Optics Express
-
de Haan & Jeanne (2013) - "Robust pulse rate from chrominance-based rPPG"
IEEE TBME
-
Task Force (1996) - "Heart rate variability: Standards of measurement"
Circulation
Recent Research (2023-2025)
-
Nature npj Digital Medicine (2025) - "The role of face regions in remote photoplethysmography"
Key finding: MAE < 1.0 BPM with ML
-
Frontiers in Bioengineering (2024) - "Deep learning and remote photoplethysmography advancements"
Comprehensive Review
-
MDPI Bioengineering (2023) - "Robust Heart Rate Variability Measurement from Facial Videos"
HRV Methodology
Open Source Libraries
For complete technical details, see:
β’ Full Heart Rate & HRV Methodology
β’ Open Source Licenses