CondFlow-ECG: Conditional Rectified Flow for Morphology-Aware ECG Denoising
Abstract
Electrocardiography (ECG) is central to cardiac monitoring because it captures rhythm, beat timing, and clinically meaningful waveform morphology. In practical acquisition settings, ECG recordings are often corrupted by baseline drift, muscle activity, electrode motion, and powerline interference, which can obscure local morphology and degrade R-peak detection and heart-rate estimation. We propose CondFlow-ECG, a conditional rectified-flow framework for morphology-aware ECG denoising. Rather than treating denoising only as direct waveform regression, which can oversmooth sharp waveform transitions, CondFlow-ECG formulates restoration as conditional transport and learns a velocity field that moves intermediate ECG states toward the clean signal conditioned on the corrupted ECG. This transport-based formulation is implemented with multiscale one-dimensional convolutional encoding, Fourier time conditioning, a temporal attention bottleneck, and skip-connected decoding. We evaluate CondFlow-ECG on MIT-BIH Arrhythmia recordings corrupted with baseline wander, muscle artifact, and electrode motion artifact from the MIT-BIH Noise Stress Test Database, together with synthetic powerline interference and mixed-noise settings across multiple input SNR levels. On a fixed 4000-window evaluation set, CondFlow-ECG outperforms U-Net and Transformer baselines, reducing RMSE to 0.106, improving Pearson correlation to 0.991, increasing R-peak F1 to 0.962, and achieving a 14.1 dB average SNR improvement, supporting the value of conditional flow-based restoration for morphology-preserving ECG denoising.