Published

2026-04-01

Enhancing Contrastive Learning for Atrial Fibrillation Detection Using Clustering-Based Unlabeled ECG Selection

Mejora del aprendizaje contrastivo para la detección de fibrilación auricular mediante selección de ECGs no etiquetados con agrupamiento

Keywords:

deep learning, contrastive learning, clustering, cardiac arrhythmia, electrocardiograms, ECG, self-supervised learning (en)
aprendizaje profundo, aprendizaje contrastivo, clustering, arritmia cardiaca, electrocardiogramas, ECG, aprendizaje autosupervisado (es)

Downloads

Authors

Recent advances in deep learning have improved the automatic detection of cardiac arrhythmia from electrocardiogram (ECG) signals, supporting early diagnosis and treatment. However, most high-performing models require large amounts of labeled data, whose acquisition is costly and dependent on expert annotation. To improve data efficiency in low-label settings, this work proposes a clustering-based strategy for selecting informative unlabeled ECG signals prior to contrastive self-supervised pretraining. The selected signals are used to construct a more representative pre training set, followed by contrastive learning and supervised fine-tuning with a limited number of labeled examples. The proposed approach was evaluated on the Icentia11k dataset, using standard arrhythmia detection metrics, where it consistently outperformed baseline contrastive learning methods. In particular, an average improvement of 4.9 points in the F1-score and 0.4 points in the Area under the Curve (AUC) metric is achieved when only 5000 labeled ECG segments are available. These results demonstrate that targeted unlabeled data selection strengthens contrastive pre-training, leading to improved performance and robustness in data-constrained ECG analysis scenarios.

Los avances recientes en aprendizaje profundo han mejorado la deteccion automatica de arritmias cardiacas a partir de señales de electrocardiograma (ECG), facilitando el diagnostico temprano y el tratamiento oportuno. Sin embargo, la mayorıa de los modelos de alto desempeño requieren grandes volumenes de datos etiquetados, cuya obtencion es costosa y depende de expertos clınicos. Con el objetivo de mejorar la eficiencia en el uso de datos en escenarios con escasez de anotaciones, este trabajo propone una estrategia de seleccion de ECGs no etiquetados basada en agrupamiento previo al preentrenamiento contrastivo autosupervisado. Las señales seleccionadas se emplean para construir un conjunto de preentrenamiento mas representativo, seguido de aprendizaje contrastivo y ajuste supervisado con un numero limitado de ejemplos etiquetados. El metodo propuesto se evalua sobre el conjunto de datos Icentia11k mediante metricas estandar para la deteccion de arritmias, superando de manera consistente los enfoques base de aprendizaje contrastivo. En particular, se obtiene un incremento promedio de 4.9 puntos en la puntuacion F1 y 0.4 puntos en la metrica del area bajo la curva (AUC) utilizando solo 5000 señales etiquetadas. Estos resultados evidencian que la seleccion dirigida de datos no etiquetados fortalece el preentrenamiento contrastivo y mejora el desempeño y la robustez del modelo en escenarios con datos limitados.

References

[1] S. Nattel, “New ideas about atrial fibrillation 50 years on,” Nature, vol. 415, no. 6868, pp. 219–226, 2002.

[2] J. Schl"apfer and H. J. J. Wellens, “Computer-interpreted electrocardiograms,” J. Am. Coll. Cardiol., vol. 70, no. 9, pp. 1183–1192, 2017.

[3] O. Yildirim and P. Plawiak, “Arrhythmia detection using deep convolutional neural network with long duration ecg signals,” Comput. Biol. Med., vol. 102, pp. 411–420, 2018.

[4] A. Çınar and S. A. Tuncer, “Classification of normal sinus rhythm, abnormal arrhythmia and congestive heart failure ecg signals using lstm and hybrid cnn-svm deep neural networks,” Comput. Methods Biomech. Biomed. Eng., vol. 24, no. 2, pp. 203–214, 2021.

[5] B. M. Mathunjwa, Y.-T. Lin, C.-H. Lin, M. F. Abbod, and J.-S. Shieh, “Ecg arrhythmia classification by using a recurrence plot and convolutional neural network,” Biomed. Signal Process. Control, vol. 64, p. 102262, 2021, art. no. 102262.

[6] T. Wang, C. Lu, Y. Sun, M. Yang, C. Liu, and C. Ou, “Automatic ecg classification using continuous wavelet transform and convolutional neural network,” Entropy, vol. 23, no. 1, p. 119, 2021, art. no. 119.

[7] Y. Ansari, O. Mourad, K. Qaraqe, and E. Serpedin, “Deep learning for ecg arrhythmia detection and classification: An overview of progress for period 2017–2023,” Front. Physiol., vol. 14, p. 1246746, 2023, art. no. 1246746.

[8] Z. Wu and C. Guo, “Deep learning and electrocardiography: Systematic review of current techniques in cardiovascular disease diagnosis and management,” Biomed. Eng. Online, vol. 24, no. 1, p. 23, 2025, art. no. 23.

[9] G. Petmezas, L. Stefanopoulos, V. Kilintzis, A. Tzavelis, J. Rogers, A. K. Katsaggelos, and N. Maglaveras, “State-of-the-art deep learning methods on electrocardiogram data: Systematic review,” JMIR Med. Inform., vol. 10, no. 8, p. e38454, 2022, art. no. e38454.

[10] H.-T. Chiang, Y.-Y. Hsieh, S.-W. Fu, K.-H. Hung, Y. Tsao, and S.-Y. Chien, “Noise reduction in ecg signals using fully convolutional denoising autoencoders,” IEEE Access, vol. 7, pp. 60 806–60 813, 2019.

[11] A. J. Hajjar, “In-depth guide to self-supervised learning: Benefits and uses,” AIMultiple, 2022. [Online]. Available: https://research.aimultiple.com/self-supervised-learning/

[12] X. Liu, F. Zhang, Z. Hou, L. Mian, Z. Wang, J. Zhang, and J. Tang, “Self-supervised learning: Generative or contrastive,” IEEE Trans. Knowl. Data Eng., vol. 35, no. 1, pp. 857–876, 2023.

[13] C. Ding and C. Wu, “Self-supervised learning for biomedical signal processing: A systematic review on ecg and ppg signals,” medRxiv, 2024. [Online]. Available: https:/ www.medrxiv.org/content/10.1101/2024.09.30.24314588v1

[14] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, “A simple framework for contrastive learning of visual representations,” in Proc. 37th Int. Conf. Mach. Learn. (ICML), ser. Proc. Mach. Learn. Res., vol. 119, 2020, pp. 1597–1607. [Online]. Available: https://proceedings.mlr.press/v119/chen20j.html

[15] P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola, A. Maschinot, C. Liu, and D. Krishnan, “Supervised contrastive learning,” in Adv. Neural Inf. Process. Syst., vol. 33, 2020, pp. 18 661–18 673.

[16] X. Liu, L. Zhang, J. Song, Z. Wang, Y. Zhang, Y. Yu, J. Zhou, X. Wang, and W. Zhang, “Contrastive learning in medical imaging: A survey,” Med. Image Anal., vol. 81, p. 102684, 2022, art. no. 102684.

[17] C. Zou, A. M"uller, E. Martens, P. M"uller, D. R"uckert, A. Steger, M. Becker, and W. Utschick, “Self- supervised learning for atrial fibrillation detection with ecg using cnntransformer,” in 2023 IEEE Int. Conf. Bioinf. Biomed. (BIBM), 2023, pp. 807–812.

[18] T. Mehari and N. Strodthoff, “Self-supervised representation learning from 12-lead ecg data,” Comput. Biol. Med., vol. 141, p. 105114, 2022, art. no. 105114.

[19] M. M. Rahman, M. W. Rivolta, F. Badilini, and R. Sassi, “A systematic survey of data augmentation of ecg signals for ai applications,” Sensors, vol. 23, no. 11, p. 5237, 2023, art. no. 5237.

[20] H. Wu, Q. Hu, D. Wang, S. Zhu, and C. Yang, “Enhancing atrial fibrillation detection in ppg analysis with sparse labels through contrastive learning,” Comput. Methods Programs Biomed., vol. 264, p. 108698, 2025, art. no. 108698.

[21] C. Liu, Z. Wan, S. Cheng, M. Zhang, and R. Arcucci, “Etp: Learning transferable ecg representations via ecg-text pre-training,” in Proc. IEEE Int. Conf. Acoust., Speech Signal Process. (ICASSP), 2024, pp. 8230–8234.

[22] J. Li, C. Liu, S. Cheng, R. Arcucci, and S. Hong, “Frozen language model helps ecg zero-shot learning,” in Proc. Mach. Learn. Res., vol. 227. PMLR, 2024, pp. 402–415, med. Imag. Deep Learn. (MIDL). [Online]. Available: https://proceedings.mlr.press/v227/li24a.html

[23] K. Sanchez, C. Hinojosa, H. Arguello, D. Kouamé, O. Meyrignac, and A. Basarab, “Cx-dagan: Domain adaptation for pneumonia diagnosis on a small chest x-ray dataset,” IEEE Trans. Med. Imaging, vol. 41, no. 11, pp. 3278–3288, 2022.

[24] ——, “Cx-dagan: Domain adaptation for pneumonia diagnosis on a small chest x-ray dataset,” IEEE Trans. Med. Imaging, vol. 41, no. 11, pp. 3278–3288, 2022.

[25] A. Navarro Luna, K. A. Fonseca, and C. A. Fajardo, “A similarity constrained signal selection algorithm for contrastive learning in the detection of atrial fibrillation,” 2023, presented at LatinX in AI Comput. Vision Workshop, IEEE/CVF Int. Conf. Comput. Vis. (ICCV), 2023. [Online]. Available: https://www.latinxinai.org/iccv-2023

[26] A. Y. Hannun, P. Rajpurkar, M. Haghpanahi, G. H. Tison, C. Bourn, M. P. Turakhia, and A. Y. Ng, “Cardiologist-level arrhythmia detection and classification in ambulatory electrocardiograms using a deep neural network,” Nat. Med., vol. 25, no. 1, pp. 65–69, 2019.

[27] P. Paquet, D. Levesque, and P. Fecteau, “Systems and methods for ecg-based arrhythmia detection using deep learning,” U.S. Patent US11 304 660B2, Apr. 12, 2022. [Online]. Available: https://patents.google.com/patent/US11304660B2/en

[28] S. Tan, G. Androz, A. Chamseddine, P. Fecteau, A. Courville, Y. Bengio, and J. P. Cohen, “Icentia11k: An unsupervised representation learning dataset for arrhythmia subtype discovery,” 2019. [Online]. Available: https://arxiv.org/abs/1910.09570

[29] C. A. Fajardo, “Compressed deep learning models to detect cardiac arrhythmias,” GitHub repository, 2023. [Online]. Available: https://github.com/cafajaruis/

[30] P. Kumar and V. K. Sharma, “Cardiac signals based methods for recognizing heart disease: A review,” in 2021 3rd Int. Conf. Intell. Commun. Technol. Virtual Mobile Netw. (ICICV), 2021, pp. 1375–1377.

[31] C. A. Fajardo, A. S. Parra, T. Castellanos-Parada, and K. Roy, “Low-complexity deep learning models for accurate atrial fibrillation diagnosis,” in Proc. 26th Eur. Conf. Artif. Intell. (ECAI), 2023, starting AI Researchers’ Symp. (STAIRS). [Online]. Available: https://ecai2023.eu/conf-data/ecai2023/files/STAIRS/stairs2023_05.pdf

[32] Z. Jiang, Y. Zheng, H. Tan, B. Tang, and H. Zhou, “Variational deep embedding: A generative approach to clustering,” 2016. [Online]. Available: https://arxiv.org/abs/1611.05148

[33] J. Pereira and M. Silveira, “Unsupervised representation learning and anomaly detection in ecg sequences,” Int. J. Data Min. Bioinf., vol. 22, no. 4, pp. 389–407, 2019.

[34] C. Shorten and T. M. Khoshgoftaar, “A survey on image data augmentation for deep learning,” J. Big Data, vol. 6, no. 1, p. 60, 2019, art. no. 60.

[35] N. Diamant, E. Reinertsen, S. Song, A. Aguirre, C. M. Stultz, and P. Batra, “Patient contrastive learning: A performant, expressive, and practical approach to ecg modeling,” PLoS Comput. Biol., vol. 18, no. 2, p. e1009862, 2022, art. no. e1009862.

[36] Y. Zou, P. Wang, L. Du, X. Chen, Z. Li, J. Song, and Z. Fang, “A multi-level multiple contrastive learning method for single-lead electrocardiogram atrial fibrillation detection,” Bioengineering, vol. 12, no. 1, p. 44, 2025, art. no. 44.