Content uploaded by Ahmed J. Obaid
Author content
All content in this area was uploaded by Ahmed J. Obaid on Dec 14, 2021
Content may be subject to copyright.
Full Terms & Conditions of access and use can be found at
https://www.tandfonline.com/action/journalInformation?journalCode=tdmc20
Journal of Discrete Mathematical Sciences and
Cryptography
ISSN: (Print) (Online) Journal homepage: https://www.tandfonline.com/loi/tdmc20
Smartphone-based ECG signals encryption for
transmission and analyzing via IoMTs
Azmi Shawkat Abdulbaqi, Ahmed J. Obaid & Maysaa Hameed Abdulameer
To cite this article: Azmi Shawkat Abdulbaqi, Ahmed J. Obaid & Maysaa Hameed
Abdulameer (2021): Smartphone-based ECG signals encryption for transmission and
analyzing via IoMTs, Journal of Discrete Mathematical Sciences and Cryptography, DOI:
10.1080/09720529.2021.1958996
To link to this article: https://doi.org/10.1080/09720529.2021.1958996
Published online: 22 Oct 2021.
Submit your article to this journal
View related articles
View Crossmark data
©
Smartphone-based ECG signals encryption for transmission and
analyzing via IoMTs
Azmi Shawkat Abdulbaqi *
College of Computer Science and Information Technology
University of Anbar
Ramadi
Iraq
Ahmed J. Obaid †
Department of Computer Science
Faculty of Computer Science and Mathematics
University of Kufa
Kufa
Iraq
Maysaa Hameed Abdulameer §
Informatics Institute for Postgraduate Studies
Iraqi Commission for Computers and Informations
Baghdad
Iraq
Abstract
Electrocardiography (ECG) has long been a common method of assessing and
diagnosing cardiovascular problems (CaDs). The heart’s electrical activity is visualized in
the form of a waveform and its analysis can turn out to provide valuable insights about the
functioning and normalcy of a healthy heart or detect a wide range of possible heart risks.
This article deals with the Internet of Medical Things (IoMT) based real time healthcare
monitoring system which diagnoses the ECG signals remotely and hence manifests essential
heart conditions. An electrocardiograph machine captures medical-grade patient heart
data. The outcome of the project includes detecting the heart rate, the various interval
and segment analysis of the signal, cardiac axis detection as well as prompting the various
possible conditions in case of anomalies in the heart activities. In such cases, the system can
send an automatic ECG report from the patient to the doctor safely by encrypting this report.
*E-mail: azmi_msc@uoanbar.edu.iq (Corresponding Author)
†E-mail: ahmedj.aljanaby@uokufa.edu.iq
§E-mail: burdenmay2018@gmail.com
Journal of Discrete Mathematical Sciences & Cr yptography
ISSN 0972-0529 (Print), ISSN 2169-0065 (Online)
DOI : 10.1080/09720529.2021.1958996
2 A. S. ABDULBAQI, A. J. OBAID AND M. H. ABDULAMEER
It can be further modified to generate a call in case of critical condition and provide urgent
medical assistance. During the ECG analysis, the article presented clearly results represented
by finding different values for different patients starting from QRS width 96, PR Interval
133, and P amplitude 2.81, and ending last patient test QRS width 93, PR Interval 112, and P
amplitude 1.57.
Subject Classification: Primary 60G35, Secondary 92C55.
Keywords: Electrocardiogram (ECG), Cardiovascular diseases (CaDs), Internet of Medical Things
(IoMTs), Left vintrecular hypertrophy (LVH), Right vintrecular hypertrophy (RVH).
1. Introduction
According to the World-Health-Organization (WHO), CaDs is the
world’s leading cause of mortality, with about 17.9 million fatalities each
year. Coronary heart disease, such as heart attack and cerebrovascular
illness, such as stroke, account for 80% of these fatalities. Middle aged
and elderly people are usually the prime targets [1]. Healthcare systems
and especially health monitoring and its related technologies is one of
the evergreen and most advancing applications. It is the need of the hour
to leverage the advances in the technology in the healthcare sector and
develop an efficient heart monitoring system [2]. The unavailability of
doctors or medical equipment as well the distance between the doctors
and the patients turn out to be major obstacles in up-scaling the quality
of medical services. In such situations the possibility of regular health
checkups is a challenge as well [3]. In order to combat such issues, we can
utilize the concept of IoMT and develop a portable ECG healthcare device.
The portable device can be made to be associated with a mobile app to
make the process user friendly as well as faster and more accessible. The
electrocardiogram is also known as ECG or EKG depicts the measure
of the electrical activity of the heart. The ECG consists of P, QRS and T
waves and various intervals which can be analyzed to leverage prime
requirements like the heart rate as well as the conditions and risks in the
functioning of the heart [4]. The amplitude (in millivolts) and the intervals
(in milliseconds), are essential values to classify the signal as being in the
normal range or not. Cardiac Arrhythmia shows a condition of abnormal
heart activity which is a threat to humans. For cardiac patients, the timely
detection of arrhythmia is very crucial. By examining any anomalies in
the ECG signals, clinicians can identify a multitude of cardiac disease
conditions [5].
Finally, the article organized as follows; Section 2, presented the
literature review. Section 3, elaborates on the method and materials.
ECG SIGNALS ENCRYPTION FOR TRANSMISSION 3
Section 4, introduced the Cryptography of AES. Results and Discussion
introduced in Section. Section 5 is a detailed description of the results
obtained and its discussion followed by Section 6, which summarizes the
study and provides the conclusion.
2. Literature Review
ECG strips are commonly used to record the ECG signals. They are
a kind of graph article that has grid-like boxes. The boxes are 1 mm2
in dimension. 25 mm/sec is usually the speed of the article. Hence
0.04 seconds is the time interval of each 1mm horizontal box. 10 mm is
equivalent to 1mV as per the standard calibration [6]. P, QRS, and T waves
and their amplitude, deflection, and their duration are measured using
this ECG strip and, ECG interpretation is done [7]. The vertical squares
in the graph are used to measure the amplitude in terms of the voltage of
the heartbeat. Based on the lead under consideration, the deflection will
vary [8]. Such ECG strips are manually analyzed to interpret information
about the heart rate, P, QRS, T waves, intervals, segments duration, wave
amplitude, deflection, and cardiac axis. The latest technology can be
effectively used to rule out the manual and tedious process of counting
and measuring the squares which is error-prone. It could be made more
time-efficient along with improved accuracy in results.
Several approaches have been adopted to apply the technological
advancements in the welfare of healthcare. In the article “ECG beat
classification based on PNN and wavelet transformation”, wavelet
transformation technique and Probabilistic Neural Network (PNN) has
been used for feature extraction [9]. The PNN classifier was used to
separate 6 kinds of ECG beats. The accuracy achieved was 99.65% another
such approach was adopted using Wavelet transform analysis technique
for QRS complex detection and Peak detection on MATLAB in the article,
“Analysis of Electrocardiogram using WT”. The accuracy obtained was
99.8% and various abnormalities and their features were compared as
well [10]. In “Acquisition, Filtering and analysis of Electrocardiogram
using MATLAB”, similar detection of QRS interval, amplitude and
other intervals was done using MATLAB Toolbox and a comparison of
the extracted features of QRS complex were compared with that of the
normal waves [11]. Wavelet transform and non - adaptive filter approach
was proved to be easier and convenient in the article “Study & analysis of
Electrocardiogram signal using MATLAB & LabVIEW as effective tools”.
The QRS complex, heart rate as well as various abnormalities were detected
4 A. S. ABDULBAQI, A. J. OBAID AND M. H. ABDULAMEER
using wavelet transform digital filter [12]. To make the monitoring more
convenient, GUI based approach was adopted in “Monitoring of Heart
rate and detection of PQRS based on GUI, MATLAB”. The system could
identify P, Q, R, S, T waves and the heart rate [13].
3. Method and Materials
The ECG data was procured from a portable electrocardiograph
machine, that captures medical-grade patient heart data. With a responsive
Fig. 1
(A) Complete project Flow, (B) Stage of ECG Signals Encryption; (C) Insider
Full Description of ECG Signal Encryption
ECG SIGNALS ENCRYPTION FOR TRANSMISSION 5
500 Hz refresh rate, the ECG capturing instrument is simultaneous,
smooth, and accurate. The specifications of the ECG machine used are:
(1) ARM® Cortex®-32-bit RISC core operating at a frequency of 48 MHz.
(2). High speed 1 MSPS (Million samples per second) accurate 12bit ADC
with high gain amplifiers. (3) BLE 4.0 with 1MB data buffer. (4) Low power
standby for long battery life. (5) Total time to take reading and analysis of
data is less than 20 seconds. (6) Data transfer with server uses AES-256
encryption and authentication is done using 4096-bit key pair. The entire
backend was developed in Python and the testing of the code was done on
the Ubuntu 20.04 LTS test server.
3.1 Filtering
Due to noise, the signal gets distorted and this makes the process of
feature extraction less accurate. Pre-processing involves removing noise
from the input ECG signal. This project involves making use of Butterworth
filters to reduce the noise. The filter is designed using the following[14].
3.2 Feature Extraction
For a proper disease diagnosis, it is essential that the clinically
important features of an ECG signal must be detected accurately. These
features are extracted using Python programming and the disease
Fig. 2
(a) ECG Signal # Rec 110 With/Without Noise, (b) ECG Signal after Noise
Removal (Signal Filtered)
6 A. S. ABDULBAQI, A. J. OBAID AND M. H. ABDULAMEER
is predicted according to the range of the values of features such as
amplitude, intervals and axis [15].
4. Cryptography of AES
4.1 AES Cipher-Decipher
The encryption block begins with the text files containing the original
ECG signals. The decipher block then uses the encrypted text files. Finally,
the identifying block utilizes the decrypted text files. The AES-256
standard is supported by the algorithm[19] [21].
4.2 BlocksforCipheringandDeciphering
The cipher block has two data interfaces: an input data array and an
output data array. Each calculation’s block size is 256 bits since both the
input and output data arrays are 16-bit arrays. The decode block is an
inverse of the cipher block, with the identical input and output arrays[20]
[22].
5. Results and Discussion
Table 1 indicates the diagnosis done by the model based on the
results obtained. The model takes into account all the conditions which
are set, and accordingly predicts the possible CaDs conditions accurately.
This provides a quick review of the patient’s health status to the doctor
and thus the diagnosis is accelerated.
The project flow phase includes sending the signals captured by
the instrument are sent to a mobile application. The received signals are
encrypted in the binary format and this data is sent to the server to run the
backend code through an API call. The code decrypts the signal, extracts
the readings of all leads and graphs of all these leads are plotted. These
signals are passed through some filters for performing denoising of the
signal. Clinically important features such as peaks, intervals, amplitudes
and axes are extracted from the filtered ECG signal data using signal
processing techniques. These features are significant in determining
various heart diseases, based on their values. 2D wavelet fusion is utilized
in this cryptosystem to solve the issue of ECG low-activity intervals. ECG
signals are subjected to a pre-processing phase. The ECG signals are first
divided into non-overlapping frames and reshaped to 2-D matrices in the
pre-processing stage. ECG signal is then subjected to a 2D DWT. Fusion,
ECG SIGNALS ENCRYPTION FOR TRANSMISSION 7
substitution, and chaotic permutation are the three processes of the
proposed cryptosystem for preserving secrecy and privacy. The first step
is to use the DWT fusion using the averaging fusion rule. The averaging
fusion rule was chosen because it simplifies ECG signal decryption. The
substitution is done in the second step using either DCT or DST. The third
step is chaotic cryptography, which causes the signal to become confused.
Conclusion
This software provides an end to end platform, right from capturing
the ECG data from the hardware device to providing the results on the
mobile application. The entire process of analyzing the ECG signals to
generate a report, is completely automated, and requires no manual
support. It is easy to use and provides accurate results because of the
use of highly efficient signal processing algorithms. The filter effectively
eliminates noise from the distorted ECG signal. After testing on various
patients, it can be concluded that the method is implementable on all kinds
Table 2
Results
Patient
PR
Interval
(ms)
QRS
width
(ms)
Amplitude
(mV) Axis (degrees) Diagnosis
Ali 133 96 2.81
0 to 90
(Normal axis) Healthy
Maher 109 107 1.92 90 to 180
(RAD)
Possibility of
Pre-excitation
syndromes,
Possibility
of Right
Ventricular
Hypertrophy
Dawoud 105 99 1.55 0 to 90
(Normal axis)
Possibility of
Pre-excitation
syndromes
Zaki 141 97 2.64 0 to 90
(Normalaxis) Healthy
Naser 112 93 1.57 0 to 90
(Normal axis) Healthy
8 A. S. ABDULBAQI, A. J. OBAID AND M. H. ABDULAMEER
of ECG waveforms. A proper diagnosis can be carried out by finding out
all the features and comparing it with the standard values, to find out if
the patient is Cardiologically healthy.
References
[1] Elgendi, M. (2018). Less is more in biosignal analysis: Compressed
data could open the door to faster and better diagnosis. Diseases.
[2] Kalaivani, S., & Tharini, C. (2018). Analysis and modification of rice
Golomb coding lossless compression algorithm for wireless sensor
networks. Journal of Theoretical And Applied Information Technology,
96(12), 3802–3814.
[3] Tan, C., Zhang, L., & Wu, H.-T. (2019). A novelBlaschke unwinding
adaptiveFourier-decomposition-based signal compression algorithm
with application on ECG signals. IEEE Journal of Biomedical and Health
Informatics, 23(2), 672–682
[4] Burguera, A. (2019). Fast QRS detection and ECG compression based
on signal structural analysis.
[5] Huang, H., Hu, S., & Sun, Y. (2018). ECG signal compression for low-
power sensor nodes using sparse frequency spectrum features. In
IEEE biomedical circuits and systems conference (BioCAS).
[6] Tan, C., Zhang, L., & Wu, H.-T. (2019). A novelBlaschke unwinding
adaptiveFourier-decomposition-based signal compression algorithm
with application on ECG signals. IEEE Journal of Biomedical and Health
Informatics, 23(2), 672–682.
[7] Burguera, A. (2019). Fast QRS detection and ECG compression based
on signal structural analysis, IEEE Journal of Biomedical and Health
Informatics, 23(1), 123–131.
[8] Abdulbaqi, A. S., Nejrs, S. M., Mahmood, S. D., & Panessai, I. Y.
(2020, December). A Tele Encephalopathy Diagnosis Based on EEG
Signal Compression and Encryption. InInternational Conference on
Advances in Cyber Security(pp. 148-166). Springer, Singapore.
[9] Huang, H., Hu, S., & Sun, Y. (2018). ECG signal compression for low-
power sensor nodes using sparse frequency spectrum features. In
IEEE biomedical circuits and systems conference (BioCAS).
ECG SIGNALS ENCRYPTION FOR TRANSMISSION 9
[10] Jha, C. K., & Kolekar, M. H. (2017). ECG data compression algorithm
for telemonitoring of cardiac patients. International Journal of
Telemedicine and Clinical Practices, 2(1), 31–41.
[11] Deepu, C. J., Heng, C.-H., & Lian, Y. (2017). A hybrid data
compression scheme for power reduction in wireless sensors for IoT.
IEEE Transactions on Biomedical Circuits and Systems, 11(2), 245–254.
[12] Abdulbaqi A.S. et al. (2019),” Recruitment Internet Of Things
For Medical Condition Assessment: Electrocardiogram Signal
Surveillance), Special Issue, AUS Journal, Institute of Architecture
and Urbanism, University of Austral de Chile, pp. 434-440.
[13] Tsai, T.-H., & Kuo, W.-T. (2018) An efficient ECG lossless compression
system for embedded platforms with telemedicine applications. In
IEEE.
[14] Aboul Ella Hassanien, Moataz Kilany and Essan H. Houssein,
Combining Support Vector Machine and Elephant Herding
Optimization for Cardiac Arrhythmias, arXiv:1806.08242v1[eee.SP],
June 20,2018.
[15] J. Dogra, M. Sood, S. Jain, N. Prashar, Segmentation of magnetic
resonance images of brain using thresholding techniques, 4th IEEE
International Conference on signal processing and control (ISPCC
2017), Jaypee University of Information technology, Waknaghat,
Solan, H.P, India, pp. 311-315, September 21-23, 2017.
[16] N. Prashar, S. Jain, M. Sood, J. Dogra, Review of biomedical system
for high performance applications ,4th IEEE International Conference
on signal processing and control (ISPCC 2017), Jaypee University of
Information technology, Waknaghat, Solan, H.P, India, pp 300-304,
September 21-23, 2017.
[17] Abdulbaqi, A.S., Najim, S.A.M., Mahdi R.H, “Robust multichannel
EEG Signals Compression Model Based on Hybridization Technique”,
International Journal of Engineering & Technology, 7 (4), (2018) 3402-
3405.
[18] Uthayakumar, J., Venkattaraman, T., & Dhayachelvan, P. (2018). A
survey on data compression techniques: From the perspective of data
quality, coding schemes, data types, and applications. Journal of King
Saud University- Computer and Information Sciences.
[19] Hirai, Y.; Matsuoka, T.; Tani, S.; Isami, S.; Tatsumi, K.; Ueda, M.;
Kamata, T.: A biomedical sensor system with stochastic A/D
10 A. S. ABDULBAQI, A. J. OBAID AND M. H. ABDULAMEER
conversion and error correction by machine learning. IEEE Access 7,
21990–22001 (2019)
[20] S. Eftekharifar, T.Y. Rezaii, S. Beheshti, S. Daneshvar, Block sparse
multi-lead ECG compression exploiting between-lead collaboration.
IET Sig. Process. (2018).
[21] Shubham Sharma & Ahmed J. Obaid (2020) Mathematical
modelling, analysis and design of fuzzy logic controller for
the control of ventilation systems using MATLAB fuzzy logic
toolbox, Journal of Interdisciplinary Mathematics, 23:4, 843-849, DOI:
10.1080/09720502.2020.1727611.
[22] Abdulbaqi, A. S., Obaid, A. J., & Mohammed, A. H. (2021). ECG
signals recruitment to implement a new technique for medical image
encryption. Journal of Discrete Mathematical Sciences and Cryptography,
1-11.
Received May, 2021
Revised May, 2021