Bidirectional Recurrent Nets for ECG Signal Compression


  • Eman AL-Saidi Computer Science Department, King Saud University, Riyadh, Saudi Arabia
  • Khalil El Hindi Computer Science Department, King Saud University, Riyadh, Saudi Arabia



Electrocardiogram (ECG) is a commonly used tool in biological diagnosis of heart diseases. ECG allows the representation of electrical signals which cause heart muscles to contract and relax. Recently, accurate deep learning methods have been developed to overcome manual diagnosis in terms of time and effort. However, most of current automatic medical diagnosis use long electrocardiogram (ECG) signals to inspect different types of heart arrhythmia. Therefore, ECG signal files tend to require large storage to store and may cause significant overhead when exchanged over a computer network. This raises the need to come up with effective compression methods for ECG signals. In this work, the authors investigate using BERT (Bidirectional Encoder Representations from Transformers) model, which is a bidirectional neural network that was originally designed for natural language. The authors evaluate the model with respect to its compression ratio and information preservation, and measure information preservation in terms of the of the accuracy of a convolutional neural network in classifying the decompressed signal. The results show that the method can achieve up to 83% saving in storage. Also, the classification accuracy of the decompressed signals is around 92.41%. Furthermore, the method enables the user to balance the compression ratio and the required accuracy of the CNN classifiers.


BERT model; Convolutional neural networks (CNN); Data compression; Deep learning; ECG diagnosis


[1] WHO, 2021. Cardiovascular diseases (CVDs).

[2] Aspuru, J., Ochoa-Brust, A., Félix, R., et al., 2019. Segmentation of the ECG signal by means of a linear regression algorithm. Sensors. 19(4), 775.

[3] Eren, H., Webster, J.G., 2018. Telemedicine and Electronic Medicine. CRC Press.

[4] Goyal, M., Tatwawadi, K., Chandak, S., et al., 2018. Deepzip: Lossless data compression using recurrent neural networks. arXiv Prepr. arXiv1811.08162.

[5] Yildirim, O., San Tan, R., Acharya, U.R., 2018. An efficient compression of ECG signals using deep convolutional autoencoders. Cognitive Systems Research. 52, 198-211.

[6] Dasan, E., Panneerselvam, I., 2021. A novel dimensionality reduction approach for ECG signal via convolutional denoising autoencoder with LSTM. Biomedical Signal Processing & Control. 63, 102225.

[7] Zheng, L., Wang, Z., Liang, J., et al., 2021. Effective compression and classification of ECG arrhythmia by singular value decomposition. Biomedical Engineering Advances. 2, 100013.

[8] Rebollo-Neira, L., 2019. Effective high compression of ECG signals at low level distortion. Scientific Reports. 9(1), 1-12.

[9] Zhang, B., Zhao, J., Chen, X., et al., 2017. ECG data compression using a neural network model based on multi-objective optimization. PLoS One. 12(10), e0182500.

[10] Polania, L.F., Plaza, R.I., 2018. Compressed sensing ECG using restricted Boltzmann machines. Biomedical Signal Processing & Control. 45, 237-245.

[11] Abo-Zahhad, M., Ahmed, S.M., Zakaria, A., 2012. An efficient technique for compressing ECG signals using QRS detection, estimation, and 2D DWT coefficients thresholding. Modelling & Simulation in Engineering.

[12] Qian, J., Tiwari, P., Gochhayat, S.P., et al., 2020. A Noble Double-Dictionary-Based ECG Compression Technique for IoTH. IEEE Internet of Things Journal. 7(10), 10160-10170. DOI:

[13] Rajankar, S.O., Talbar, S.N., 2019. An electrocardiogram signal compression techniques: a comprehensive review. Analog Integrated Circuits & Signal Processing. 98(1), 59-74.

[14] Sahoo, G.K., Ari, S., Patra, S.K., 2015. Performance evaluation of ECG compression techniques. 2015 IEEE International Conference on Electrical, Computer and Communication Technologies (ICECCT). pp. 1-5.

[15] Elgendi, M., Mohamed, A., Ward, R., 2017. Efficient ECG compression and QRS detection for e-health applications. Scientific Reports. 7(1), 1-16.

[16] Padhy, S., Sharma, L.N., Dandapat, S., 2016. Multilead ECG data compression using SVD in multiresolution domain. Biomedical Signal Processing & Control. 23, 10-18.

[17] Jha, C.K., Kolekar, M.H., 2017. ECG data compression algorithm for tele-monitoring of cardiac patients. International Journal of Telemedicine & Clinical Practices. 2(1), 31-41.

[18] Chowdhury, M.H., Cheung, R.C.C., 2019. Reconfigurable architecture for multi-lead ecg signal compression with high-frequency noise reduction. Scientific Reports. 9(1), 1-12.

[19] Kumar, V., Saxena, S.C., Giri, V.K., et al., 2005. Improved modified AZTEC technique for ECG data compression: Effect of length of parabolic filter on reconstructed signal. Computers & Electrical Engineering. 31(4-5), 334-344.

[20] Ahmeda, S.M., Abo-Zahhad, M., 2001. A new hybrid algorithm for ECG signal compression based on the wavelet transformation of the linearly predicted error. Medical Engineering & Physics. 23(2), 117-126.

[21] Chen, J., Itoh, S., 1998. A wavelet transform-based ECG compression method guaranteeing desired signal quality. IEEE Transactions on Biomedical Engineering. 45(12), 1414-1419.

[22] Tun, H.M., Moe, W.K., Naing, Z.M., 2017. Analysis on ECG data compression using wavelet transform technique. International Journal of Psychological and Brain Sciences. 2(6), 127-140.

[23] Wu, T.C., Hung, K.C., Liu, J.H., et al., 2013. Wavelet-based ECG data compression optimization with genetic algorithm.

[24] Jha, C.K., Kolekar, M.H., 2021. Tunable Q-wavelet based ECG data compression with validation using cardiac arrhythmia patterns. Biomedical Signal Processing & Control. 66, 102464.

[25] Mukhopadhyay, S.K., Ahmad, M.O., Swamy, M.N.S., 2018. An ECG compression algorithm with guaranteed reconstruction quality based on optimum truncation of singular values and ASCII character encoding. Biomedical Signal Processing & Control. 44, 288- 306.

[26] Jha, C.K., Kolekar, M.H., 2021. Empirical mode decomposition and wavelet transform based ECG data compression scheme. IRBM. 42(1), 65-72.

[27] Kolekar, M.H., Jha, C.K., Kumar, P., 2021. ECG Data Compression Using Modified Run Length Encoding of Wavelet Coefficients for Holter Monitoring. IRBM.

[28] Shinde, A.A., Kanjalkar, P., 2011. The comparison of different transform based methods for ECG data compression. 2011 International Conference on Signal Processing, Communication, Computing and Networking Technologies. pp. 332-335. DOI:

[29] Vaswani, A., Shazeer, N., Parmar, N., et al., 2017. Attention is all you need. International Conference on Neural Information Processing Systems. 30.


How to Cite

AL-Saidi, E., & Hindi, K. E. (2022). Bidirectional Recurrent Nets for ECG Signal Compression. Journal of Computer Science Research, 4(4), 15–25.


Article Type