A CNN-Based Local-Global Self-Attention via Averaged Window Embeddings for Hierarchical ECG Analysis
Abstract
The high global mortality from cardiovascular diseases underscores the need for efficient diagnostic tools such as electrocardiograms (ECGs). Recent deep learning advances have greatly improved ECG analysis by capturing complex and informative patterns from the signals. CNNs remain the dominant architecture for this task, while transformers—despite their success in other domains—have yet to become the leading approach in ECG analysis. A key limitation is their difficulty in capturing local morphological features essential for accurate interpretation. In this regard, we propose a novel Local-Global Attention ECG model (LGA-ECG), which integrates convolutional inductive biases with global self-attention mechanisms. Our approach extracts queries by averaging embeddings obtained from overlapping convolutional windows, enabling fine-grained morphological analysis, while simultaneously modeling global context through attention to keys and values derived from the entire sequence. Experiments conducted on the CODE-15 dataset demonstrate that LGA-ECG outperforms state-of-the-art models and ablation studies validate the effectiveness of the local-global attention strategy. By capturing the hierarchical temporal dependencies and morphological patterns in ECG signals, this new design showcases its potential for clinical deployment with robust automated ECG classification PyTorch Implementation: https://github.com/pedroroblesduten/LGA-ECG .
Cite
Text
Buzelin et al. "A CNN-Based Local-Global Self-Attention via Averaged Window Embeddings for Hierarchical ECG Analysis." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025. doi:10.1007/978-3-032-06066-2_17Markdown
[Buzelin et al. "A CNN-Based Local-Global Self-Attention via Averaged Window Embeddings for Hierarchical ECG Analysis." European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, 2025.](https://mlanthology.org/ecmlpkdd/2025/buzelin2025ecmlpkdd-cnnbased/) doi:10.1007/978-3-032-06066-2_17BibTeX
@inproceedings{buzelin2025ecmlpkdd-cnnbased,
title = {{A CNN-Based Local-Global Self-Attention via Averaged Window Embeddings for Hierarchical ECG Analysis}},
author = {Buzelin, Arthur and Dutenhefner, Pedro and Rezende, Turi and Porfírio, Luisa G. and Bento, Pedro and Aquino, Yan and Fernandes, Jose and Santana, Caio and Miana, Gabriela and Pappa, Gisele L. and Ribeiro, Antônio L. P. and Jr., Wagner Meira},
booktitle = {European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases},
year = {2025},
pages = {283-299},
doi = {10.1007/978-3-032-06066-2_17},
url = {https://mlanthology.org/ecmlpkdd/2025/buzelin2025ecmlpkdd-cnnbased/}
}