The Rlign algorithm for enhanced electrocardiogram analysis through heart rate–corrected ECG alignment for explainable classification and clustering
European Heart Journal - Digital Health

Abstract
Electrocardiogram (ECG) recordings are fundamental for diagnosing cardiac conditions. Recent advances in automatic ECG analysis have been dominated by deep learning, particularly convolutional neural networks (CNNs). CNNs excel in processing high-dimensional signal data, where their ability to automatically extract complex features has enabled significant progress. However, while CNNs are powerful for biomedical signal analysis, their application to ECG data also carries disadvantages, such as the requirement for large annotated datasets and limited explainability. To address these challenges, we aim to reintroduce shallow learning methods, such as linear classifiers, by leveraging the cyclic nature of ECG signals.
We developed an adaptive transformation that restructures ECG signals into a fully structured format suitable for shallow learning algorithms. This method aligns R-peaks across all signals in a dataset and resamples the inter-QRS segments to match a predefined reference heart rate. The approach was systematically evaluated across tasks including classification, clustering, and explainability. Our transformation substantially improved the performance of shallow learning techniques. Compared with CNN approaches, shallow models trained on transformed ECGs achieved superior accuracy and interpretability in data-limited scenarios.
We demonstrate that shallow machine learning methods, when combined with our alignment-based transformation, can reach CNN level performance in ECG analysis, especially under conditions of limited training data. This approach offers clear advantages in classification, clustering, and explainability and provides an accessible alternative to deep learning. To facilitate adoption and further research, we release a publicly available framework for ECG signal alignment at
Contributors

Lucas Plagwitz
Author

Lucas Bickmann
Author

Michael Fujarski
Author

Alexander Brenner
Author

Warnes Gobalakrishnan
Author

Lars Eckardt
Author

Antonius Büscher
Author

Julian Varghese
Author
