Baseline Wander as a Limiting Factor in Heart Vector Space Modeling: Improving Neural ODE and PINN Predictions via Learned Decomposition

Richárd Tuhári and Gergő Bognár
Department of Numerical Analysis, Eötvös Loránd University


Abstract

Electrocardiographic (ECG) signals can be represented as continuous trajectories in a heart vector space, providing a natural framework for modeling cardiac electrophysiology with Neural Ordinary Differential Equations (Neural ODEs) and Physics-Informed Neural Networks (PINNs). However, baseline wandering introduces low-frequency drift into these trajectories, distorting their geometry and significantly degrading model performance. This drift alters the underlying dynamical structure, violating smoothness assumptions and impairing the enforcement of physiological constraints in PINNs, which leads to reduced prediction accuracy and numerical instability. To address this issue, we treat baseline wander as a separable latent component of the trajectory in heart vector space. We train neural networks to predict the baseline directly from observed ECG signals, enabling decomposition into baseline and physiologically relevant components prior to dynamical modeling. The corrected trajectories are then used as inputs for Neural ODE and PINN frameworks. Experiments on ECG datasets with both synthetic and real baseline drift demonstrate that this preprocessing step substantially improves downstream performance. We observe more stable Neural ODE integration, reduced reconstruction error, and improved long-term trajectory prediction. In the PINN setting, baseline-corrected signals lead to better adherence to physiological constraints, indicating a closer alignment with true cardiac dynamics. Importantly, while the Neural ODE and PINN models themselves remain computationally intensive, the baseline prediction module can be implemented as a simple, lightweight neural network, making it suitable for real-time preprocessing. This enables efficient deployment in wearable and continuous monitoring systems, where it can enhance signal quality before more complex modeling. Overall, our results show that explicit baseline modeling is critical for reliable continuous-time ECG analysis, and that even simple neural approaches can significantly improve both model robustness and practical applicability.