Neural Network QRS Duration Estimator for EP Studies Enhanced by Foundation Model Morphological Context

Yan B Werneck1, Bernardo Martins Rocha2, Joventino de Oliveira Campos3, Rafael Sachetto Oliveira4, Matheus Aquino Marge2, Tiago Dutra Franco2, Thiago Goncalves Schroder e Souza5, THAIZ RUBERTI SCHMAL6, Lucas Arantes Berg3, Rodrigo Weber dos Santos3
1PPGMC-UFJF, 2Universidade Federal de Juiz de Fora, 3Federal University of Juiz de Fora, 4Univerisidade Federal de S�o Jo�o del-Rei, 5University Hospital of the UFJF, 6EBSERH University Hospital Juiz de Fora


Abstract

Electrophysiological characterization of patients undergoing programmed ventricular stimulation (EP studies) requires accurate QRS duration measurement across all beat types present in the recording, including sinusoidal and stimulus beats acquired at varying coupling intervals. Existing QRS detectors do not address this setting: stimulus beats exhibit morphologies such as paced rhythms, aberrant conduction, and bundle branch blocks that rule-based methods and general-purpose detectors were not designed for. Additionally, labeled data is scarce since expert annotation of EP recordings is time-consuming.

We propose a semi-supervised neural approach trained on 500 annotated beats from 8 non-ischemic dilated cardiomyopathy patients. A frozen HuBERT-ECG-small foundation model provides morphology-aware representations, compensating for annotation scarcity. The architecture treats Pan-Tompkins detection as a structural prior over beat location, which is then updated by morphological context extracted from the foundation model. Both prior and update are instantiated as soft temporal masks, combined through a convolution module into a final mask prediction whose sum yields QRS duration, providing interpretable intermediate representations. A semi-supervised continuity constraint on unannotated beats regularizes cross-patient generalization. On a held-out patient, unseen during training, the model achieves approximately 20 ms mean absolute error — consistent with inter-annotator clinical precision and considerable better than a baseline Pan-Tompkins rule based with learned threshold — despite high morphological variability across patients and beat types.