CaPulse: Robust Pulse Extraction & Anomaly Detection
- CaPulse is a set of frameworks that extract physiologically and causally significant pulses from noisy data using deep learning and signal processing techniques.
- It uses robust artifact removal, bandpass filtering, and spectral peak detection to achieve smartphone PPG heart rate estimation with a mean error as low as 1.0 bpm.
- A complementary variant leverages a structural causal model with periodic normalizing flows and multi-period attention to significantly boost anomaly detection accuracy in time series.
CaPulse refers to a set of algorithmic and deep learning frameworks developed for (i) accurate, artifact-resistant pulse (heart rate) estimation from photoplethysmographic (PPG) signals (notably from video or wearable sensors) and (ii) causality-driven unsupervised anomaly detection in multivariate time series. While the term appears in several contexts, most notably in smartphone-based PPG heart-rate tracking and in modern causal anomaly detection, all share a focus on extracting physiologically or causally significant “pulses” from noisy data and achieving superior interpretability and accuracy.
1. CaPulse for Smartphone PPG Heart Rate Extraction
The earliest documented CaPulse scheme addresses robust estimation of beats-per-minute (BPM) from PPG signals acquired via smartphone cameras, emphasizing strong artifact rejection, accurate temporal/frequency processing, and alignment with clinical ECG (Chatterjee et al., 2020). The workflow encompasses:
- Frame Acquisition and Touch Artifact Elimination: The user places a fingertip over the rear camera under LED illumination; video frames are acquired at a constant rate (e.g., Hz), with a pixel central ROI analyzed.
- The raw PPG per frame is , where is the red-channel intensity.
- Touch artifacts (abrupt changes , for 8-bit intensity) are detected and excised via filtering, then linearly interpolated or median-filtered for continuity.
- Signal Conditioning: A second-order Butterworth IIR bandpass filter for $0.75$–$3.5$ Hz (45–210 bpm), prototype
with coefficients 0 1 2 3 for 4 Hz.
- Spectral Analysis: A Hann window 5 is applied before frequency-domain analysis to suppress spectral leakage.
- BPM Estimation: Time-domain peak detection (local maxima above 6 thresholding) and frequency-domain (FFT, heart-rate band localization, and median aggregation) routes are both implemented, with pseudocode provided for reproducibility.
- Performance: On a 20-subject evaluation, mean absolute error is 1.3 bpm (σ=1.8 bpm) for time-domain, 1.0 bpm (σ=1.5 bpm) for frequency-domain, substantially outperforming existing open-source PPG algorithms in both error magnitude and clinical correlation (7 to ECG, outlier rate 8) (Chatterjee et al., 2020).
2. Multi-Modal Fusion and Deep CaPulse Architectures
Later CaPulse frameworks address the challenges of motion artifact (notably in PPG signals recorded on wearables during free-living activities) by fusing PPG and inertial signals using deep networks, enabling improved robustness and explainability (Kasnesis et al., 2022).
- Architecture:
- Input: One-channel PPG, three-axis accelerometer, segmented in fixed windows (e.g., 4×256 samples).
- Temporal feature extraction: Three stacked dilated 1D-convolutional blocks per modality, yielding per-modality 9 “action embeddings.”
- Multi-Head Cross-Attention (MHCA): PPG embeddings serve as queries, accelerometer as keys and values (4 heads, 16-dim/head). Outputs are fused via a learnable linear layer.
- Regression head: Layer normalization and two-layer MLP regresses fused features to scalar heart-rate per window.
- Mathematical Formulation:
0
where 1, 2, 3 embed PPG and accelerometer features as described.
- Training Regimen: Minimization of MAE, Adam optimizer (lr=4), batch size 256, cross-validation with Leave-One-Session-Out. Optional post-processing clips per-window predictions deviating >10% from the running average.
- Results: On PPG-DaLiA, MAE = 4.44 bpm (no post), 4.03 bpm (with post); representing 7.6% improvement over best previous CNN; model size ∼130 k vs. DeepPPG’s 8.5 M parameters per ensemble. Arm-motion-driven evaluation on IEEE_Test yields comparable performance to larger models (Kasnesis et al., 2022).
3. Causal Anomaly Detection in Time Series: CaPulse
A distinct, causality-driven CaPulse framework for anomaly detection in multivariate time series is introduced in (Xia et al., 6 Aug 2025). Unlike pulse extraction, here “pulse” refers to the underlying “causal rhythm” of the system, formulated via a structural causal model (SCM) and learned through density modeling and periodic factorization.
- Structural Causal Model (SCM):
5
with - 6: exogenous (noise) - 7: latent causal factors (generating anomalies) - 8: observed time series (9) - 0: anomaly labels
Structural equations:
1
with independence 2 and mutually independent 3 (independent causal mechanisms).
- Periodic Normalizing Flows (PeNF):
Instead of fixed transformations, PeNF layers utilize a period checkerboard mask and invertible coupling conditioned on causal factors, enabling the flow to be aware of both global and local periodicity:
4
with negative log-likelihood loss over standard normal base 5.
- Periodic Mask Mechanism (PC-Mask):
Masks alternate along feature axes in blocks of size 6, estimated as the dominant period in the signal (via FFT).
7
Partitioned inputs receive different flow transformations to capture periodic structure.
- Periodical Learners (PaCM + MpCF):
- PaCM: Identifies top-8 local frequencies, reshapes subsequences, mines period-specific latent factors via small MLPs; collects amplitude weights.
- MpCF: Merges period-specific factors using self-attention across 9 periods, yielding a fused “omni” causal representation.
To satisfy causal independence, parallel augmentation (Gaussian perturbation in the high-frequency spectrum) is performed, enforcing invariance and mutual independence through cosine-similarity (0) and orthogonality (1) regularizations.
Total loss:
2
where 3 control the weighting.
- End-to-End Pipeline: Steps include period detection, mask construction, intervention/augmentation, multi-period causal extraction and fusion, density estimation via PeNF, and composite objective minimization.
4. Theoretical Foundations and Interpretability
The CaPulse anomaly framework establishes theoretical guarantees for causal disentanglement and identifiability: enforcing invariance under high-frequency (exogenous noise) perturbation induces the latent codes to capture the underlying stable, generative factors of anomaly occurrence. Orthogonality of the latent causal dimensions encourages their statistical independence, in line with the independent causal mechanisms principle.
Interpretability is direct: post-hoc tools (e.g., SHAP), attention score maps, and the amplitude or attention weights 4, 5 reveal which latent factors or periods most contribute to detected anomalies. In pulse estimation architectures, explainability is provided via visualization of attention maps and correlation to known motion artifacts.
5. Experimental Evaluation and Empirical Outcomes
PPG Heart Rate Extraction:
CaPulse achieves MAE = 1.0–1.3 bpm (σ = 1.5–1.8 bpm) on resting fingertip smartphone video (Chatterjee et al., 2020), outperforming open-source alternatives (MAE = 3–5 bpm, 6). In deep fusion settings, MAE = 4–5 bpm (lab/field PPG+IMU), matching or exceeding much larger networks (Kasnesis et al., 2022).
Causal Anomaly Detection:
CaPulse delivers substantially improved AUROC (+3% to +17%) on seven real-world anomalous multivariate time series, outperforming DeepSVDD, DeepSAD, DROCC, GANF, AnomalyTransformer, TimesNet, and others. Ablation studies confirm that global period masking, causal intervention, mutual independence, and multi-period attention all contribute measurably; e.g., removing causal intervention reduces AUROC by 1.8–7.0% (Xia et al., 6 Aug 2025).
Efficiency is strong: O(7) per batch for FFT-based steps, linear in network depth and hidden dimensions, with WADI-scale datasets trainable in 8 s per 9k samples/epoch on modern GPU.
6. Impact and Significance
CaPulse unifies artifact-robust PPG pulse extraction and state-of-the-art causal anomaly detection in time series via explicit integration of signal processing, deep learning, and causal modeling principles. Its interpretable multi-scale architectures, strong empirical error bounds, principled augmentation and regularization, and competitive computational efficiency establish it as a reference for both clinicians (PPG BPM) and system analysts (anomaly detection). A plausible implication is that the architectural and algorithmic motifs deployed in CaPulse may provide generalizable patterns for causal and periodicity-aware modeling across wider domains of structured time series.
7. Related Methods and Distinctions
While classical PPG-based heart rate estimation relies on bandpass filtering and peak detection, CaPulse adds robust artifact filtering and frequency-domain regularization, resulting in increased clinical correlation. In deep anomaly detection, CaPulse’s causal disentanglement and explicit periodic fusion distinguish it from purely correlation-based or principal-axes methods, facilitating improved interpretability and resilience to data imbalance and label scarcity.
Summary comparisons across the principal CaPulse variants:
| Domain | Input Modalities | Core Algorithmic Element | Reported Performance |
|---|---|---|---|
| Smartphone PPG BPM | Video-PPG | Artifact removal + Butterworth + Hann-FFT | MAE=1.0–1.3 bpm, 0 (Chatterjee et al., 2020) |
| Wearable HR (Deep) | PPG + 3-axis Accel | TCN + MHCA fusion | MAE=4.0–4.4 bpm (Kasnesis et al., 2022) |
| Time Series Anomaly | Multivariate X | SCM + PaCM/MpCF + PeNF+PC-Mask | AUROC +3–17% vs SOTA (Xia et al., 6 Aug 2025) |
Each instantiation operationalizes the extraction or detection of physiologically or causally meaningful “pulses” via principled filtering, normalization, fusion, and causality-based density estimation.