PULSE LAB / SpO₂ EXPERIMENT 01
Archived first attempt, superseded before publication. Current neural model report.
A trained model.
Accuracy remains limited.
Actual training run · 5 October 2026 · Hoffman camera RGB dataset · participant-held-out evaluation.
What was trained
Two candidates were fitted: a regularized regression on three log RGB pulse-amplitude ratios, and a compact residual temporal convolutional network with an RGB waveform encoder and an SpO₂ head. The constant baseline predicts the median training label. The ratio model had the lowest overall error and is used by the website; the CNN is retained as a research candidate.
Ratio regression improves pooled MAE by only 0.37 points (5.5%) over the constant baseline. This is a modest improvement. No confidence or clinical-validation claim follows from it.
Errors on unseen participants
Lower is better. All errors are SpO₂ percentage points; 95% versus 90% differs by 5 points.
| Model | MAE | RMSE | Signed bias | Mean participant MAE |
|---|---|---|---|---|
| RGB ratio regression · initial candidate | 6.38 | 7.81 | -0.20 | 6.39 |
| Residual temporal CNN · candidate | 7.39 | 9.81 | +2.11 | 7.36 |
| Training-median baseline | 6.75 | 8.13 | +1.17 | 6.82 |
The model family was chosen after comparing these same folds. Selection is exploratory; an untouched external cohort is still required. Metrics describe individual source-data windows, before the website’s additional provisional signal gates and averaging.
Performance across oxygen ranges
| Reference SpO₂ | Windows | Ratio MAE | Ratio bias |
|---|---|---|---|
| 70 to <80% | 346 | 11.50 | +11.50 |
| 80 to <90% | 618 | 3.72 | +2.23 |
| 90 to 100% | 944 | 6.24 | -6.07 |
Positive bias means overestimation. The model tends toward the middle of the training range and performs poorly near its extremes.
Every participant held out once
| Test participant | Windows | Ratio MAE | CNN MAE | Constant MAE |
|---|---|---|---|---|
| 100001 | 318 | 7.56 | 14.82 | 7.75 |
| 100002 | 371 | 7.50 | 7.73 | 6.34 |
| 100003 | 352 | 5.59 | 4.87 | 6.59 |
| 100004 | 336 | 4.75 | 5.48 | 5.33 |
| 100005 | 284 | 6.20 | 5.20 | 7.26 |
| 100006 | 247 | 6.72 | 6.08 | 7.63 |
Training and evaluation protocol
- Use the public per-frame R, G and B means at nominal 30 Hz. Keep both hands from a participant in the same fold.
- Discard the first six seconds of every recording, then create six-second windows without overlap. Exclude windows with missing labels, any reference outside 70–100%, invalid RGB, unusable mean exposure, or essentially absent channel variation. No patient-specific calibration or label-guided timing adjustment is used.
- Use the mean of six corresponding 1 Hz readings from the dataset’s Masimo
SpO2 5reference. Alignment follows the repository’s simultaneous-start assumption; timing and averaging lag remain limitations. - Remove each RGB channel’s DC level and linear trend. Preserve relative pulse amplitudes:
100 × (RGB / channel mean − 1 − trend). Derive log AC/DC RMS ratios R/G, R/B and G/B. These visible-light camera channels are not a calibrated red/infrared pulse oximeter. - For each outer test participant, select CNN epochs using a different validation participant and the remaining four for fitting. Refit on all five non-test participants using that epoch count. Fit ratio scaling and regression only on those five. No outer test participant enters training, scaling or epoch selection.
- Refit deployment weights on all six participants. The CNN uses 34 epochs selected from the median inner-fold epoch count. Deployed ratio regression uses fixed ridge penalty 10. The final all-data fit has no separate test cohort.
What happens on the phone
The camera’s whole-frame RGB means are sampled separately from the existing BP region. Six-second contiguous segments are resampled using measured timestamps. SpO₂ uses all three channels and its own flash, clipping, timing, pulse-variation and training-ratio checks. Three accepted segments produce an experimental average. Rejected segments and gaps are not joined.
Inference runs in the browser. Scans stay in the current tab until exported; this change adds no upload endpoint. A clear waveform, a stable output or a narrow segment range does not establish accuracy. The displayed waveform and later-entered cuff values do not enter SpO₂ inference. BP and SpO₂ retain independent models and validation.
Software verification
Python and browser JavaScript agreed on all 6 exported parity cases. Maximum difference was 0.000000586 points for regression and 0.000001462 for the CNN. These cases test implementation equivalence and were part of the final fit; they are not held-out accuracy evidence.
Checks passed for missing models, flash off, invalid timing, clipped/flat/nonfinite RGB, frame gaps, out-of-domain ratios, real RGB replay, segment separation, contact resets and expiry. Existing simulated camera/BP flows also passed. Physical iPhone capture and browser rendering were not tested in this run.
Known limits
- Six participants, one Nexus 6P phone model; no independent iPhone or browser cohort.
- Pulse oximeter reference rather than arterial co-oximetry.
- Alignment uses nominal 30 Hz and shared recording start; sensor averaging/lag remain limitations.
- Raw frame means from whole-frame decoded video; browser exposure, white balance, processing and flash differ.
- No clinical threshold, hypoxemia triage, skin-tone subgroup, personalization or glucose validation.
- Adjacent nonoverlapping windows remain correlated; participant count is the effective generalization sample size.
- Live signal gates are provisional engineering rules, not clinical validation.
The present run does not implement a jointly trained BP/SpO₂/glucose encoder. The neural candidate is an initial RGB encoder plus SpO₂ head; the better-performing ratio model is the deployed baseline. Personalization remains future work requiring paired, later-session reference data.
Sources and reproducibility
Official Hoffman dataset · Hoffman et al., 2022 · MIT license and attribution
Paper: Smartphone camera oximetry in an induced hypoxemia study, npj Digital Medicine 5, 146. This run is a new baseline implementation; the paper’s reported metrics are not substituted for our measurements.
Dataset commit: c483ae8fe4cd32b0b9ce412d07299b05279fc58f · seed 20261005 · deployed model spo2-hoffman-ratio-20261005.