  Accurate delineation of key waveforms in an ECG is a critical step in
extracting relevant features to support the diagnosis and treatment of heart
conditions. Although deep learning based methods using segmentation models to
locate P, QRS, and T waves have shown promising results, their ability to
handle arrhythmias has not been studied in any detail. In this paper we
investigate the effect of arrhythmias on delineation quality and develop
strategies to improve performance in such cases. We introduce a U-Net-like
segmentation model for ECG delineation with a particular focus on diverse
arrhythmias. This is followed by a post-processing algorithm which removes
noise and automatically determines the boundaries of P, QRS, and T waves. Our
model has been trained on a diverse dataset and evaluated against the LUDB and
QTDB datasets to show strong performance, with F1-scores exceeding 99% for QRS
and T waves, and over 97% for P waves in the LUDB dataset. Furthermore, we
assess various models across a wide array of arrhythmias and observe that
models with a strong performance on standard benchmarks may still perform
poorly on arrhythmias that are underrepresented in these benchmarks, such as
tachycardias. We propose solutions to address this discrepancy.
