Embedded Biomedical AI · End-to-End Case Study

Sense the pulse.
Classify cognitive load.

A traceable engineering pipeline connecting an earlobe PPG analog front end, STM32F411 real-time processing, IBI/HRV feature generation, and CNN–Transformer evaluation.

5-foldStored code-archive evaluation
0.9988Mean ROC-AUC
0.9775Mean F1
STM32F411Acquisition and DSP MCU

01 · System

From sensor to decision

Every boundary that converts an analog pulse into a digital feature is documented. Circuit, firmware, Python pipeline, and stored results link directly to repository evidence.

Overall system architecture from PPG sensor through STM32 and HRV features to CNN Transformer
PPG analog front end → STM32 peak detection → UART IBI stream → HRV features → cognitive-load classifier
Hardware

Earlobe PPG

The analog amplification/filtering path and STM32 ADC connection are supported by circuit and system-architecture evidence.

Firmware

Real-time peak detection

Moving average, IIR band-pass, adaptive thresholding, and a derivative FSM produce peak and IBI events for UART transmission.

ML

Time/frequency HRV

Windowed features are standardized; CNN local patterns and Transformer long-range relationships support High/Low classification.

02 · Signal Pipeline

Inspectable processing stages

The firmware path from ADC samples to heartbeat intervals is separated from the data path that turns those intervals into model-ready HRV tensors.

STM32 PPG signal-processing pipeline
STM32 firmware signal path
Time and frequency HRV feature formulas
HRV definitions in the Python pipeline
PPG analog front-end circuitPPG sensor and STM32 hardware overviewGeneric N-back task interface without participant data

03 · Model

CNN + Transformer

The CNN compresses local patterns in HRV features; patch embedding and self-attention model dependencies across windows. All headline metrics on this page are calculated from the stored CSV.

CNN Transformer cognitive-load classification architecture
Repository model architecture

04 · Evidence

Results with boundaries

The code archive's five-fold outputs and the paper summary use different evaluation conditions and are therefore reported separately.

AUC accuracy and F1 across five folds
Five-fold archive summary
High Low holdout confusion matrix
Stored holdout confusion matrix

Source audit · Aggregate only

Additional reviewed aggregate evidence

Only group- and fold-level results from the supplied research archive are public. Raw participant PPG, identifiable subject screens, and individual N-back captures remain withheld.

Aggregate RMSSD SDNN HF and LF HF distributions by performance group
Group-level HRV distributions
Aggregate mean HRV feature heat map by performance group
Group-level mean HRV features
Aggregate real versus synthetic HRV feature distribution comparison
Real-versus-synthetic distribution audit
Synthetic low-performance subgroup HRV time and frequency features
Synthetic subgroup feature profile
Aggregate model training accuracy and loss history
Training accuracy and loss
Aggregate K-fold low and high performance confusion matrix
K-fold aggregate confusion matrix
EvidenceROC-AUCAccuracyF1Interpretation
Code archive, five-fold mean0.99880.98140.9775Arithmetic mean of the five stored fold rows
Paper summary0.850.82Separately reported paper conditions; not directly compared