1 Introduction

Telemedicine is a significant tool in remote healthcare systems and is rapidly changing the dynamics of conventional healthcare systems. The patient centric approaches provide reliable emergency solutions to homebound patients and obtain expert opinions from globally available experienced healthcare providers. Biomedical signals such as electrocardiogram (ECG), electroencephalogram (EEG), electromyogram (EMG) etc. are the commonly used signals in tele-health services. To make this system more symptomatic, these signals are complimented by annotations, patient’s medical biography and history. It raises the concern of security and authentication of the sensitive information during its transmission and storage. Legal regulations like U.S. health insurance portability and accountability act (HIPAA) [8], the personal information protection and electronic document act, 2000 (PIPEDA) [42] and digital signature laws in many countries also demanded security and confidentiality of the personal information.

This paper addresses these security related issues through information hiding technique named steganography. In steganography, the confidential data is secured by concealing it inside the host media without loss of its intelligent information [15]. Additionally, it provides efficient memory utilization and also cuts the risk of mismatching between the patient’s physiological signal and his personal details. Various medical images [1, 24, 29] and physiological signals [27, 32, 37, 40] are observed in literature that were used as effective hosts to conceal confidential information. ECG signal is the widely considered tool in diagnosing cardiovascular diseases (CVD) as well as detecting and analysing issues related to autonomic nervous system [3, 4, 38, 43]. In this work time-series ECG signal is used as the host signal for concealing the patient’s confidential information.

1.1 Related work

Research has been carried out to perform steganography in multimedia applications, but its implementation in biomedical applications particularly in ECG signal is still in its infancy. The ECG data contains valuable diagnostic information and any alteration due to payload embedding reduces the signal fidelity which may lead to wrong diagnosis. Hence it has to be taken care that the diagnosability should not be lost while concealing data in these signals. Different approaches of steganography in ECG signal are discussed in the literature. Most of these techniques perform steganography in spatial domain [27, 28, 40, 45] and transform domain [13, 14] however few researchers introduced hybrid approaches to conceal the secret data [11, 12, 19]. Pandey et al. [27] presented chaotic maps and sample value differencing (CMSaVD) based spatial domain steganography. It has been found that embedding 21 kb in ECG signal of 20 mins duration results in percentage root mean square difference (PRD) of 0.26. In another spatial domain approach, Soni et al. [40], adopted an optimum location selection (OLS) algorithm based ECG steganography to select the embedding locations on the basis of thresholded RR peak amplitude. The method achieved embedding capacity (EC) of 0.45 at low PRD of 0.004. Yang [45] proposed lossy and lossless steganography techniques in spatial domain using coefficient alignment. The approaches achieved EC of 0.25 and 0.49 at signal to noise ratio (SNR) of 56.34 and 46.31 for lossless and lossy approaches respectively. In [11], Ibaida et al. performed discrete wavelet transform (DWT) and least significant bit (LSB) substitution based ECG steganography to embed encrypted secret bits in the selected subbands of wavelet coefficients. The performance was evaluated on normal and abnormal (ventricular tachycardia and ventricular fibrillation) ECG datasets. The author claimed the embedding of nearly 14 k bits in ECG segments of 10s and attained the average PRD of 0.47129, 0.2759 and 0.5671 in case of normal, ventricular tachycardia and ventricular fibrillation datasets respectively. However, the amount of bit error rate (BER) occurred during extraction of secret information was not discussed. In [12,13,14], numerous researchers explored inter and intra beat correlations to formulate two-dimensional (2D) ECG arrays for steganography. In [12] Jero et al. presented 2D hybrid approach using DWT and singular value decomposition (SVD) to embed the secret information in the selected subband. The approach generates PRD of 0.0059 at very low EC of 0.0365 only. In [13], the same research group presented discrete curvelet transform based 2D ECG steganography in which selected curvelet co-efficients are modified according to 0 and 1 of secret bits. The PRD 0.0132 is achieved after embedding 350 bytes in test signal of 128 trains from normal sinus rhythm (NSR) database. Further they proposed continuous ant colony optimization (CACO) based 2D ECG steganography technique [14] and identify multiple scaling factors that improves the trade-off between peak signal to noise ratio (PSNR) and robustness. Kozat et al. [19] applied a blend of discrete Fourier transform with spread spectrum approach to embed robust watermark and used least significant bit (LSB) substitution to embed fragile watermark in an ECG signal. The method is robust against any signal deformations but has very low embedding power of 0.04 at SNR of 20 dB.

Spatial domain techniques have high embedding capacity and good visual quality but are prone to stego attacks whereas transform domain techniques are robust with limited EC [10]. In the above discussed methods, single steganography approach (either spatial or transform) is applied on the entire ECG signal [13, 14, 27, 28, 40, 45]. Although in few cases hybrid (both spatial and transform) approaches are formulated [11, 12, 19], but that too on the whole signal. Since ECG signal consists of crucial QRS regions as well as less significant non-QRS regions [34] and employing same steganography approach on both the regions is not admissible. The proposed hybrid technique encourages feature specific integrated approach to hide information in ECG signal. It has been observed in literature that DCT and DWT based steganography methods are robust but show high PRD at low EC. The common reason for high PRD is the reconstruction error that occurs due to the filter coefficients [21]. The analysis filters used to decompose the signal into subbands generate floating point coefficients and synthesis filters truncate these coefficients during reconstruction. Truncation of floating point numbers at any level results in potential loss of information. One of the solutions to this problem is the use of lifting scheme based integer wavelet transform (IWT) which decomposes the signal in integer coefficients [5, 7, 20, 31]. It solves the problem of rounding error hence reduces PRD. Besides PRD, it is also required to improve the EC while maintaining the perceptibility of the ECG signal. Pixel value differencing (PVD) is a promising technique that ensures high EC in high frequency regions [17, 36, 44]. Although the non-QRS region of ECG signal has nearly flat surface but inverting adjacent sample in each pair converts the low frequency non-QRS region into high frequency region and makes the region suitable to implement PVD scheme [27]. Thus according to the morphological features of the host ECG signal, IWT based modified LSB (IWT-mLSB) steganography is applied in the sensitive QRS region of an ECG beat while pixel inverted PVD (PI-PVD) based spatial domain steganography is performed in the non-QRS region. The proposed hybrid approach recuperates the EC without distorting its visual as well as clinical quality. Further, to intensify the security of the confidential information, chaotic maps are employed. Chaotic maps are the non-linear equations used to generate random sequences with very attractive properties of unpredictability, ergodicity and sensitivity to initial conditions that makes them suitable for designing steganographic applications [9, 23, 46]. The steganography in medical data acutely demands minimum deterioration in its morphological features while accomplishing its other traits viz. EC and robustness. The proposed technique is competent to accomplish all these attributes of steganography.

The rest of the paper includes: Section 2 discusses the preliminaries used in proposed method. The proposed methodology describing the embedding and extraction processes is detailed in section 3. Section 4 includes results and discussion. The proposed work is concluded in section 5.

2 Preliminaries and materials

ECG signal is a quasi-periodic, non-stationary signal that can be characterized in terms of both time and frequency. Wavelet transform is a mathematical tool that performs translation and dilation of basic shapes (e.g. Fourier transformation) to build space–frequency relations in such signals. In this work, lifting scheme based IWT is employed to exploit the correlation between the neighbouring samples and frequencies to build a sparse approximation [5, 7].

2.1 Lifting scheme based integer wavelet transform

Lifting scheme is a flexible technique used to design wavelets through an iterative process of predicting and updating a set of samples (subband) from an appropriate linear combination of the other set (subband). The output of IWT consists of detailed coefficients (D) and approximate coefficients (A). IWT can be expressed in three steps; split, predict and update as shown in Fig. 1.

Fig. 1
figure 1

Lifting scheme for level 1 in (a) Integer Wavelet Transform (b) Inverse Integer Wavelet Transform

Split: The input signal S = (Sk) k∈z, SkR, is split up into two disjoint sets; even (Se) and odd (So) indexed samples [7].

$$ {\displaystyle \begin{array}{c}{S}_e={\left({S}_{2k}\right)}_{\mathrm{k}\in \mathrm{z}}\\ {}{S}_o={\left({S}_{2\mathrm{k}+1}\right)}_{\mathrm{k}\in \mathrm{z}}\end{array}} $$

Predict: Since the two sets are closely correlated, therefore it is possible to build a predictor (Pr) for one set from the other set. As the predictor does not give the exact value, the difference between the original value and predicted value is recorded. This difference forms the detailed coefficients (D) and is calculated as.

$$ \mathrm{D}={S}_e-\mathit{\Pr}\left({S}_o\right) $$

From D and the odd samples, even samples can be recovered as.

$$ {S}_e=\mathit{\Pr}\left({S}_o\right)+\mathrm{D} $$

The simplest predictor (Pr) considered for an odd sample S2k + 1 is the average of its two even neighbours, hence D is written as.

$$ {\mathrm{D}}_k={S}_{2k+1}-\left({S}_{2k}+{S}_{2k+2}\right)/2 $$

A good predictor generates negligible values of D. This process of computing predictor and recording the difference is called as lifting.

Update: The lifting stage transforms the even and odd samples (Se, So) into (Se, D). Since Se is obtained by subsampling the signal, it causes serious aliasing problem. Therefore a second lifting stage is required to replace the even samples with smoothed values by applying update operator (U) to the detailed coefficients as [7].

$$ \mathrm{A}={S}_e+U\ \left(\mathrm{D}\right) $$

The updated coefficients are called approximate coefficients. Given A and D, Se can be recovered as.

$$ {S}_e=\mathrm{A}-U\left(\mathrm{D}\right) $$

The update operator restores the correct running average and reduces aliasing. Daubechies et al. proposed that one-quarter of the wavelet coefficient (Dk/4) has to be added to the even samples as updated operation [7].

$$ {\mathrm{A}}_k={S}_{2k}+\left({\mathrm{D}}_{k-1}+{\mathrm{D}}_k\right)/4 $$

2.2 LSB steganography

LSB steganography is one of the simplest technique to hide secret data in the LSBs of the signal samples [16]. Since, the human eye is imperceptible to the minor changes at LSB level, hence it is an effective method of steganography. But embedding the secret bits directly at the LSB positions are prone to stego attacks. In the proposed method, the secret data is embedded in the LSBs of the transformed ECG coefficients that makes it invulnerable to stego attacks as well as reduce the distortion to many folds.

2.3 Pixel value differencing (PVD)

PVD is a steganography technique originally implemented in images where the absolute difference between the two consecutive pixels is explored to store the secret bits [17, 36, 44]. Higher the difference, more will be the payload capacity and vice versa. For instance, higher number of data bits can be concealed at edges (high frequency) as compared to smoother (low frequency) regions. Further, the number of bits embedded is calculated by mapping the difference with the sub-range in the pre-defined range table. The table consists of non-overlapping dyadic-ranges Wj, j = 1, 2…. . n such that each sub-range (Wj) has a lower bound (lj), upper bound (uj) and the width (wj) [36] i.e.

$$ {W}_j=\left[{l}_j,{u}_j\right],\kern0.5em j=1,2\dots ..\mathrm{n} $$

where

$$ {l}_j=\left\{\begin{array}{c}\ 1,\kern4.25em j=1\\ {}{2}^{j-1},\kern1.75em j>1\end{array}\right. $$
(1)
$$ {u}_j={2}^j-1 $$
(2)
$$ {w}_j={u}_j-{l}_j+1 $$
(3)

The procedure to embed long stream of secret bits using PVD approach is explained as:

Step 1. Partition the signal samples into non-overlapping pixel pairs.

If P2p(i)is the ith even sample, the pixel pair will be.

$$ \kern3.75em {P}_{2p(i)}\mathrm{and}\ {P}_{2p(i)+1} $$
(4)

Step 2. Calculate absolute difference between sample values.

$$ \kern3.5em {d}_i=\mid {P}_{2p(i)}-{P}_{2p(i)+1}\mid $$
(5)

Step 3. The number of secret bits that can be embedded in each pair varies and is decided by the width of the sub-range to which di belongs. For that, compute range Wj = [lj, uj] such that.

lj ≤ di && di ≥ uj and hence calculate wj (using (3)).

Step 4. Compute the hiding capacity of the pixel pair as [17].

$$ {r}_i=\left\lfloor {\mathit{\log}}_2{w}_j\right\rfloor\ \mathrm{and}{k}_i=\left\lfloor {\mathit{\log}}_2{r}_i^2\right\rfloor \mathrm{where}\ {k}_i\ \mathrm{is}\ \mathrm{the}\ \mathrm{number}\ \mathrm{of}\ \mathrm{secret}\ \mathrm{bits}\ \mathrm{to}\ \mathrm{be}\ \mathrm{concealed}\ \mathrm{in}\ {W}_j $$
(6)

[36]

⌊⌋ represents the greatest integer factor.

Step 5. Select next ki bits from the secret bit stream and convert them into decimal value mi.

Step 6. Compute the extraction function F such that its value lies between \( \left(0,{r}_i^2-1\right) \) [17, 36]

$$ \kern5.25em F\left({P}_{2p(i)},{P}_{2p(i)+1}\right)=\left({P}_{2p(i)}\ast \left({r}_i-1\right)+{P}_{2p(i)+1}\ast {r}_i\right)\mathit{\operatorname{mod}}\ {r}_i^2 $$
(7)

Step 7. Based on the decimal value mi,the selected pixel pair of the cover media is modified to form the stego-pixel pair (P2p(i), P2p(i) + 1). The secret data is embedded in the pixel pair such that the overflow and underflow conditions are to be avoided. For that, the absolute difference (di’) between the stego pixel pair (P2p(i), P2p(i) + 1) must lie in the same sub-range (Wj) as that of the original pixel pair(P2p(i), P2p(i) + 1). The embedding is done according to the following criteria:

figure k

To extract the embedded information from the stego pixel pair (P2p(i), P2p(i) + 1), compute di, wj, ri, ki and F in the similar way as computed during embedding. The value of F is the extracted secret information from the stego-pair. The process of concealing and extraction of secret information using PVD method is explained below with the help of an example.

$$ {\displaystyle \begin{array}{c}\mathrm{Assume}\ {P}_{2p(i)},{P}_{2p(i)+1}=\left(945,-944\right)\\ {}{d}_i=\mid {P}_{2p(i)}-{P}_{2p(i)+1}\mid =945-\left(-944\right)=1889\end{array}} $$

 Sub-range to which difference di belongs is

$$ {W}_j=\left[{l}_j,{u}_j\right]=\left(1024,2047\right) $$

Width of the sub-range wj = uj − lj + 1 = (2047 − 1024 + 1) = 1024

The number of secret bits to be selected for embedding is

$$ {r}_i=\left\lfloor {\mathit{\log}}_2{w}_j\right\rfloor =\left\lfloor {\mathit{\log}}_21024\right\rfloor =10 $$
$$ {k}_i=\left\lfloor {\mathit{\log}}_2{r}_i^2\right\rfloor =\left\lfloor {\mathit{\log}}_2{10}^2\right\rfloor =6 $$

Let the first six secret data bits are

$$ {m}_i={(110110)}_2 $$

And its decimal equivalent is 5410

The extraction function F is calculated as

$$ {\displaystyle \begin{array}{c}F\left({P}_{2p(i)},{P}_{2p(i)+1}\right)=\left({P}_{2p(i)}\ast \left({r}_i-1\right)+{P}_{2p(i)+1}\ast {r}_i\right)\mathit{\operatorname{mod}}\ {r}_i^2\\ {}=\mathit{\operatorname{mod}}\left(\left(945\ast 9+\left(-944\right)\ast 10\right),100\right)=65\end{array}} $$

Because mi < F

$$ P{\prime}_{2p(i)}={P}_{2p(i)}+\left(F-{m}_i\right)\mathit{\operatorname{mod}}\ {r}_i=945+\operatorname{mod}\left(\left(65-54\right),10\right)=946 $$
$$ P{\prime}_{2p(i)+1}={P}_{2p(i)+1}-\left\lfloor \frac{F-{m}_i}{r_i}\right\rfloor -\left(F-{m}_i\right)\ \mathit{\operatorname{mod}}\ {r}_i=\left(-944\right)-\left\lfloor \frac{65-54}{10}\right\rfloor -\mathit{\operatorname{mod}}\left(\left(65-54\right),10\right)=-946 $$

Hence pixel pair (945,-944) is modified to (946,-946) after embedding.

During extraction of secret bits from the pixel pair (946, −946)

Compute di=946-(−946) = 1892

Sub-range to which di belongs to is

$$ {W}_j=\left[{l}_j,{u}_j\right]=\left(1024,2047\right) $$
$$ \mathrm{And}\ \mathrm{hence}\ {w}_j={u}_j-{l}_j+1=\left(2047-1024+1\right)=1024 $$
$$ {r}_i=\left\lfloor {\mathit{\log}}_2{w}_j\right\rfloor =10 $$
$$ {k}_i=\left\lfloor {\mathit{\log}}_2{r}_i^2\right\rfloor =6 $$
$$ {m}_i=\kern0.5em F\left({P}_{2p(i)},{P}_{2p(i)+1}\right)=\left({P}_{2p(i)}\ast \left({r}_i-1\right)+{P}_{2p(i)+1}\ast {r}_i\right)\mathit{\operatorname{mod}}\ {r}_i^2 $$
$$ =\mathit{\operatorname{mod}}\left(\ 946\ast 9+\left(-946\right)\ast 10\right),{10}^2\Big)=54 $$

This 54 is converted into binary format to obtain the secret message bits.

2.4 Chaotic maps

In an effort to provide intense security to patient’s confidential information, chaos theory is introduced. The chaotic systems produce random yet deterministic signals that are much suitable for steganographic applications [23, 27, 40]. Various algorithms have been developed to produce N-dimensional chaotic sequences however, in this work the focus is on 1D combined logistic-sine (CLS) chaotic map. Individually logistic and sine maps exhibits chaotic properties in limited range only [9, 23, 46]. To overcome this drawback, these seed maps are combined linearly to generate a new 1D chaotic sequence that displays excellent behaviour over the entire range within (0,4] as illustrated through the bifurcation diagram in Fig. 2. The mathematical expression to generate CLS based chaotic sequence [40] is given as:

$$ \kern0.1em H\left({x}_{o,}\ {y}_{o,}l\right):{x}_{n+1}=\left({y}_o{x}_n\left(1-{x}_n\right)+\left(4-{y}_o\right)\sin \left(\frac{\pi {x}_n}{4}\right)\right)\mathit{\operatorname{mod}}1 $$
(8)
Fig. 2
figure 2

The bifurcation diagrams of (a) logistic (b) sine and (c) CLS maps

where yo is the control parameter that lies within (0, 4] and xn + 1 and xn are the (n + 1)th and nth states of chaotic sequence respectively. In order to generate random integer values from the sequence H, it is sorted and the original indices of the sorted sequence are preserved and used as chaotic sequence (X) with integer values as [40]

$$ \left(V,X\right)=\mathit{\operatorname{int}}\_ sort(H) $$
(9)

where array V contains the sorted magnitudes of H while array X contains the original positions of these magnitudes. The random sequence X consists of integer values and is used to conceal secret bits in ECG signal.

2.5 ECG database

Standard databases available online [25] are used to evaluate and compare the performance of the proposed algorithm with the existing ECG steganography techniques. The databases used have the following specifications:

  1. 1.

    Massachusetts Institute of Technology-Beth Israel Hospital (MIT-BIH) Arrhythmia database: The two-channel ambulatory ECG recordings of 47 subjects (both normal and abnormal) are approximately 30 min long. Each ECG signal is recorded at sampling frequency of 360 Hz per channel with 11-bit resolution over 10 mV range. The results are evaluated on the first channel of all the 48 records of 5 min duration.

  2. 2.

    MIT-BIH Normal Sinus Rhythm (MIT-BIH NSR) database: This database includes 18 long term recordings of 5 males aged 26 to 45 and 13 females aged 20 to 50 that have no significant arrhythmias. The performance is evaluated on all 18 records of 5 min duration.

  3. 3.

    Beth Israel Deaconess Medical Centre Congestive Heart Failure (BIDMC-CHF) database is used to test the proposed algorithm on recordings with acute abnormality. The database comprises of 15 ECG recordings that includes 11 men aged 22 to 71 and 4 women aged 54 to 63 suffered with stern cardiac failure. The recordings contain two ECG signals; each of about 20 h long duration and sampled at 250 Hz, 12-bit resolution over a range of ±10 mV. Results are evaluated on all 15 recordings of duration 1.5 min.

  4. 4.

    Self-recorded database: This database consists of ECG signals recorded in the Biomedical Signal Processing laboratory at Department of Electronics and Communication Engineering, Dr. B.R. Ambedkar National Institute of Technology, Jalandhar, India on lead II using BIOPAC® MP150. The signals were recorded from the local population under standard conditions in a quiet room, at comfortable light and temperature levels and sampled at 500 Hz, 12-bit resolution. The written consent from 20 different subjects was taken prior to the recording.

3 Proposed methodology

The steganography technique proposed in this work explores both transform and spatial domain approaches to embed confidential information in 2D ECG (Im). The 2D ECG is divided into three non-overlapping fragments such that the side fragments occupies the pivotal QRS region while the intermediate part comprises relatively less significant non-QRS region of ECG signal. Different embedding algorithms are designed to conceal information in these fragments. The secret bits are embedded in the order of first, second and then third block respectively as per their maximum embedding capacities. The proposed methodology involves the following steps 1) Pre-processing of ECG signal 2) Conversion of 1D ECG signal into 2D ECG matrix (Im) 3) Generation of chaotic sequences 4) Encryption of patient’s personal information. 5) Embedding process 6) Reconvert 2D stego-ECG (sIm) back to 1D stego-ECG (sECG) signal which is then transmitted over the channel. The embedded information is extracted at the receiver following the reverse procedure. The detailed diagram to demonstrate the process of embedding and retrieving the secret information is shown in Fig. 3.

Fig. 3
figure 3

(a) Embedding process (b) Extraction process involved in proposed methodology

3.1 Pre-processing of input ECG signal

The ECG signals available at standard databases are already processed to filter the noises and artefacts induced during acquisition whereas the self-recorded ECG signals are corrupted with different noises like; baseline drift, electrode contact noise, powerline interference muscle contractions, electrosurgical noise, instrumentation noise etc. These noises are attenuated from the ECG signal using different filters prior to embedding the secret information [4].

3.2 Conversion of 1D ECG signal into 2D ECG matrix

ECG signal has both inter-beat and intra-beat correlation properties and based on these properties 1D ECG signal is converted into 2D ECG matrix. The samples between two consecutive R-peaks of ECG are considered as one segment and all such segments are cut and aligned vertically to form 2D ECG (Im). Among several methods reported in the literature to detect R-peaks [26, 33, 39], k-NN method of QRS detection is used to remove noises and to identify R-peaks [33]. The length of each segment is normalised with zero padding [6]. The resultant 2D ECG formed with 1 min of ECG record 100 of MIT-BIH database is illustrated in Fig. 4.

Fig. 4
figure 4

Illustration of vertical stacking of beats to form 2D ECG matrix of 1 min duration of record 100 from MIT-BIH database

3.3 Generation of chaotic sequences

Chaotic sequences are employed in the proposed steganography approach for two reasons; (i) to cipher the confidential information and (ii) to generate randomness in the selection process of ciphered bits embedding. For this, three sets of initial conditions (x01, y01), (x02, y02) and (x03, y03) are used to generate chaotic sequences H1, H2 and H3 respectively using (8). Further these sequences are sorted to generate random sequences with integer values using (9). The initialization values and control parameters used to generate different chaotic sequences are mentioned in Table 1.

Table 1 List of initialization values and control parameters used to generate chaotic sequences

3.4 Encryption of confidential information into ciphertext

Though steganography secures patient’s personal information from illegitimate access but to strengthen the security of the information, the confidential information (C) is initially converted into cipher text (E) before entrenching into ECG signal. The encryption process involves the XOR operation between chaotic sequence (X1) and C. The process of converting confidential information into cipher text is explained in algorithm 1

figure d

3.5 Embedding process

The focus of the proposed technique is to improve the payload capacity without disturbing the diagnosability of an ECG signal. To accomplish this aim, QRS and non-QRS regions of 2D ECG are segregated into three non-overlapping blocks and specific steganography technique is applied in each block. The embedding is performed in two steps:

i) Disintegration of 2D ECG in three non-overlapping blocks

2D ECG (Im) is partitioned into three fragments; θqrs1, θnqrs and θqrs2 where θqrs1 and θqrs2 comprises of R-peaks of crucial QRS complex region while θnqrs holds the non-QRS region of Im as shown in Fig. 5. The number of samples embodying QRS region (Sqrs) depends on the sampling frequency (fs) of the signal and duration of QRS complex (tqrs) which is calculated as

$$ {\mathrm{S}}_{\mathrm{qrs}}=\left\lceil {f}_s\ast {t}_{qrs}\right\rceil $$
Fig. 5
figure 5

Illustration of embedding regions in three fragments of an ECG image formed from 1 min of samples of record 100 of MIT-BIH arrhythmia database

Samples occupied by R-peaks each in blocks θqrs1 and θqrs2 are

SR= ⌈Sqrs/2⌉ // QRS complex region is divided in two equal parts

The duration of normal QRS complex lies in range of 0.08 s to 0.12 s [34], but in case of pathological disorders it can be widened or narrowed. For experimentation, QRS complex of 0.15 s is considered in this work. This duration is wide enough to include cases of abnormal ECGs. The proposed approach has been analysed on both normal (MIT-BIH NSR) and abnormal (MIT-BIH arrhythmia, BIDMC-CHF) databases. None of the evaluated signals have QRS complex wider than 0.15 s. But if any abnormal case with QRS complex wider than 0.15 s is observed, then that QRS complex can be excluded from data embedding.

Further to avoid any deviation in amplitude of R-peaks, θR samples ( ⌈2 % of fs⌉ ) that includes these peaks are excluded from the embedding portions. Finally, the fragments in 2D ECG used for hiding the ciphered bits are organised as:

Fragment I (θ’qrs1): θR + 1 to SR

II(θ’nqrs): SR + 1 to Imin - θR // Imin is the index of the shortest beat in Im.

III(θ’qrs2): Imin + 1 to (end’ - θR) // end’ depicts that each row has variable number of ECG samples and θ’qrs2 varies according to the length of individual beat.

⌈⌉ represents the least integer function

Figure 5 displays the embedding regions (θ’qrs1, θ’nqrs and θ’qrs2) of 2D ECG formed from record 100 of MIT-BIH arrhythmia database of 1 min duration. The ECG record is sampled at fs of 360 Hz, accordingly SR is calculated as (360*0.15/2) i.e. 27. θR is 8 and the shortest peak (Imin) determined in Im lies at 236. Hence the first two fragments; θ’qrs1 and θ’nqrs suitable for embedding the secret bits lies from 9 to 27 and 28 to 229 respectively whereas in third fragment i.e. θ’qrs2, the embedding region varies from beat to beat depending upon number of ECG samples left in each beat after excluding θR.

ii) Blockwise embedding of encrypted data and side information

As displayed in Fig. 5 the image is fragmented on the basis of morphological features of an ECG signal and hence assorted approaches are applied in these fragments to embed secret data.

  • Case 1: IWT based modified-LSB (m-LSB) steganography in θ’qrs1

This segment of Im consists of subtle information and afford minimal deviation only. Hence LSB based IWT steganography is pragmatic in this section. The approximate coefficients (A) are obtained by applying first level 2D-IWT on θ’qrs1 with db4 as the mother wavelet. The LSBs of the chaotically selected approximate coefficients are replaced with the ciphered bits using m-LSB steganography approach as discussed in algorithm 2.

figure e
  • Case 2: Embedding in θ’nqrs using pixel inverted-PVD (PI-PVD) technique

As discussed in section 2, PVD is suitable in high frequency regions where the difference between the pixel pair is large enough to proliferate the EC. In the proposed method, this approach is applied on less sensitive non-QRS (θ’nqrs) section of ECG beats. This section is like a flat terrain that consists of low frequencies only. To apply PVD in this region, high frequency region is created by inverting the amplitude of every alternate ECG pixel in this fragment. It increases the difference between adjacent samples and hence improves embedding capacity [27]. The secret bits are stored at chaotically chosen even pixel pairs (S2p) in order to fully utilize the EC. PI-PVD is applied row-wise in θ’nqrs and to generate randomness, both rows as well as sample pairs are selected chaotically. The implementation process is explained in algorithm 3 that follows the same procedure as discussed in section 2 The table consists of 12 dyadic-ranges varying between 20 and 212 with lower (lj= 2j-1) and upper (uj =2j-1) bounds for the sub ranges are given as

$$ {W}_j=\left[{l}_j,{u}_j\right];j=0,1,2\dots ..\mathrm{12} $$

The width wj for range Wj is same as lj [27, 36]. The procedure to embed secret information (E) using PI-PVD approach is explained in algorithm 3.

figure f
  • Case 3: m-LSB based embedding in θ’ qrs2

ECG signal being quasi periodic, the duration is different for every heart beat and so are the number of ECG samples. Therefore in fragment θ’qrs2 of Im, 1D IWT embedding is performed row-wise on the chaotically selected row and m-LSB based embedding is done at the LSBs of randomly chosen approximate coefficients. The embedding process is explained in algorithm 4

figure g

3.6 Reconstruction of stego-image and stego-ECG

The stego-blocks (sθ’qrs1, sθ’nqrs and sθ’qrs2) are arranged back to their locations to obtain the complete 2D stego-ECG (sIm) which is further converted into 1D stego-ECG (sECG) and finally transmitted over the channel.

$$ sIm=\left[{\mathrm{s}\uptheta}_{\mathrm{qrs}1}\ {\mathrm{s}\uptheta}_{\mathrm{nqrs}}\ {\mathrm{s}\uptheta}_{\mathrm{qrs}2}\right] $$

3.7 Receiver side

At receiver, the stego-ECG signal is received and forwarded to the concerned doctor for diagnosis while the administrative personnel who has the key (section 4.4.1), extracts the hidden information. The extraction process at receiver follows the reverse procedure as demonstrated in Fig. 3(b). Following steps are used to extract the hidden information:

  1. Step 1:

    Convert sECG into 2D stego ECG (sIm).

  2. Step 2:

    Divide sIm into blocks sθqrs1, sθnqrs and sθqrs2 as was done on transmitter side.

  3. Step 3:

    Apply similar methodology on sθ’qrs1, sθ’nqrs and sθ’qrs2 to extract the hidden information from respective fragments as implemented at transmitter but in reverse order. The complete procedures followed to obtain secret bits are well explained in algorithms 5, 6 and 7.

figure h
figure i
figure j
  1. Step 4:

    Extracted bits = [Ex_1 Ex_2 Ex_3]

4 Results and discussion

The technique proposed in this work has successfully achieved the prime goals of steganography viz. imperceptibility, robustness and payload capacity. Although steganography causes irreparable loss to the ECG signal but the proposed technique aims to restrain the loss to its minimal. This is evidently demonstrated in Fig. 6 that the amount of error occurred in the stego ECG is trivial even after embedding secret information to their maximum capacity (4996 bits) in 3000 samples of record 100 of MIT-BIH arrhythmia database. The proposed steganography approach is blend of both spatial and transform domain techniques and shows impeccable performance with high embedding capacity and minimal deterioration in signal quality. Various statistical parameters such as PRD, PRD1024, normalised PRD (PRDN), mean square error (MSE), root mean square error (RMS), SNR, PSNR, kullback leibler divergence (KL-Divergence) [27, 40] are computed to analyse its efficacy. Clinically critical metrics such as weighted percentage root mean square difference (WWPRD) [2] and wavelet energy based diagnostic distortion (WEDD) [22] are also measured to evaluate the performance of the proposed technique. The results are computed with two bits embedded at the LSB positions of the approximate coefficients obtained from IWT in blocks θ’qrs1 and θ’qrs2 while PI-PVD based steganography is applied in θ’nqrs region. The overall results in terms of statistical and diagnostic errors as well as measures regarding the payload capacity and BER on all 48 records of MIT-BIH arrhythmia database of 5 mins duration, 18 records of MIT-BIH NSR database of 5 mins duration, 15 records of BIDMC-CHF of 1.5 mins duration and 20 records of self-recorded data of 5 mins duration are displayed in Tables 2, 3, 4 and 5 respectively. Average PRD, PRD1024, PRDN, SNR, PSNR, KL-Divergence, WWPRD and WEDD obtained in case of MIT-BIH arrhythmia database of 5 mins duration are 4.32 × 10−3, 4.52 × 10−2, 0.066, 48.27, 51.51, 9.42 × 10−6, 0.152 and 0.042 respectively at EC of 1.58 and zero BER; in MIT-BIH NSR database 1.8 × 10−2,4.8 × 10−3, 0.0628,35.28, 44.71, 2.2 × 10−4, 0.062 and 0.051 respectively at EC of 1.69 and zero BER; in BIDMC-CHF database 1.77 × 10−2, 7.5 × 10−3, 0.073, 37.53, 44.174, 3.37 × 10−4, 0.1595, 0.044 respectively at EC of 1.38 and zero BER and in self-recorded database 8.63 × 10−3, 0.01046, 0.02563, 41.5497, 52.10, 4.15 × 10−5, 0.06588 and 0.01623 respectively with average EC calculated as 1.9572 at zero BER.

Fig. 6
figure 6

Original and stego ECG signals alongwith the amount of error occurred when embedding secret information to their maximum capacity in 3000 samples of record 100 of MIT-BIH arrhythmia database

Table 2 Performance evaluation measures on all 48 records of MIT-BIH arrhythmia database of 5 mins duration
Table 3 Performance evaluation measures on all records of MIT-BIH NSR database of 5 mins duration
Table 4 Performance evaluation measures on all records of BIDMC-CHF database of 1.5 mins duration
Table 5 Performance evaluation measures on self-recorded database of 20 subject each of 5 mins duration

4.1 Effect of ECG duration on the performance metrics

The effect of ECG duration on the performance of the proposed algorithm is studied. Table 6 shows the average of performance metrics when determined on all 48 records of MIT-BIH arrhythmia database at varying durations. An average PRD, PSNR, KL-Divergence, WWPRD, WEDD and EC when measured for ECG signal of (i) short duration (5 mins) are 4.32 × 10−3, 51.515, 9.42 × 10−6, 0.152, 0.0429 and 1.5869 (ii) medium duration (20 mins) are 4.12 × 10−3, 50.06, 9.43 × 10−6, 0.1409, 0.0438 and 1.5632 (iii) long duration (30mins) are 4.32 × 103, 51.065, 9.77 × 10−6, 0.154, 0.0423 and 1.573 respectively. It has been observed that the performance is nearly same for ECG signals of all durations which shows that the increase in length of ECG signal increases the number of bits embedded in the signal while the impact is minimal on other parameters. Based on the amount of secret data to be embedded, the minimum length of the ECG signal required can be decided in advance.

Table 6 Average of all the performance metrics when measured on different durations of MIT-BIH arrhythmia databases

4.2 Impact of embedding on ECG signal with unique approaches

The proposed approach applies ECG feature specific steganography techniques on clinically separated QRS and non-QRS region based ECG blocks, possessing different embedding capacities. Table 7 displays the number of bits embedded in individual blocks of all 48 records of MIT-BIH arrhythmia database of 5 min duration when 2-bits are embedded in each coefficient obtained in regions θ’qrs1 and θ’qrs2 using IWT-mLSB approach and embedding multiple secret bits in all the possible ECG sample pairs obtained in θ’nqrs region using PI-PVD approach. The average number of bits embedded in blocks θ’qrs1, θ’nqrs and θ’qrs2 are 3448.5, 118,884.6 and 49,057.42 respectively with average total bits embedded in the complete signals are 171,390.5. The influence of applying integrated approaches on the ECG signal is demonstrated in Fig. 7. The amplitudes of original and stego-ECG of record 100 after embedding 2-LSB bits in approximate coefficients of regions θ’qrs1 and θ’qrs2 and embedding multiple bits in all possible ECG sample pairs in region θ’nqrs of 2D ECG image are analysed. It has been found that IWT-LSB approach efficaciously hides the secret bits with negligible distortion, however embedding in non-QRS region through PI-PVD technique improves the EC to manifolds. To further extend this analysis, the performance evaluation metrics are computed for variable embedding techniques. For this, the number of LSB bits embedded in QRS regions (θ’qrs1 and θ’qrs2) with IWT-mLSB approach and the percentage of possible ECG pairs selected to embed secret bits in non-QRS region (θ’nqrs) are varied. The bar graphs in Fig. 8 displays the amount of variation occured in EC, number of bits embedded, PRD, PSNR, KL-Divergence, WWPRD and WEDD when LSB bits of approximate coefficients in blocks θ’qrs1 and θ’qrs2 vary as 1-bit, 2-bits, 3-bits and 4-bits and the percentage of possible ECG sample pairs selected to embed secret bits in θ’nqrs block vary from 25% to 100% of possible sample pairs with an increment of 25%. It is found that increase in percentage of embedding in non-QRS region has huge impact on the embedding capacity and other parameters also.

Table 7 Amount of bits embedded in individual blocks of all 48 records of MIT-BIH arrhythmia database of 5 mins
Fig. 7
figure 7

Impact of embedding secret bits in blocks θ’qrs1 and θ’nqrs of row 2 of original and stego 2D ECG using IWT-LSB and PI-PVD approaches respectively

Fig. 8
figure 8

Bar graph plots of (a) EC (b) Bits Embedded (c) PRD (d) PSNR (e) KL-Divergence (f) WWPRD (g) WEDD with varying amount of selected sample pair in θ’nqrs region and number of bits selected for embedding in θ’qrs1 and θ’qrs2 regions of all the 48 records of MIT-BIH arrhythmia database of 5 mins

4.3 HRV analysis of original and stego-ECG

HRV is an important parameter that provides meaningful information about the cardiovascular system [41]. The impact of embedding the secret information on the HRV is analysed in terms of time domain (standard deviation of NN-interval (SDNN), standard deviation of the averages NN interval for 5mins segment (SDANN), root mean square of successive RR-interval differences (RMSSD), NN50 and percentage of successive RR intervals that differ by more than 50 ms (pNN50) and non-linear measurements (SD1, SD2 and SD1/SD2) [18, 35]. Table 8 shows the aggregated time scale parameters when measured on all the 48 original and stego-ECG records of MIT-BIH arrhythmia database. The percentage error is calculated as the difference between the parameters obtained from the original and stego-ECG divided by the original average and is given as:

$$ Error\left(\%\right)=\frac{original- stego}{original}\mathrm{x}\ 100 $$
Table 8 Average of time scale HRV parameters and percentage error over all the 48 ECG records of MIT-BIH arrhythmia database of 5mins duration

As observed in Table 8, the amount of error caused in the ECG signal due to embedding is inconsequential to affect the diagnosis [18].

4.4 Security analysis

4.4.1 Key space

The length of the key is an important parameter that makes the system invulnerable to stego attacks. Therefore in the proposed steganography approach, the key length is kept sufficiently large to curtail the risk of illicit access of sensitive information by intruders. The key consists of the three sets of initial parameters (x01, y01, x02, y02, x03, y03) used to generate three chaotic maps used in the steganography technique, length of confidential information Lc and values of shifting factors (r1 and r2) used in regions θ’qrs1 and θ’qrs2. The format of key is shown in Fig. 9. If the initial parameters are set to precision of 14 decimals then as per IEEE 754 standard of converting decimal numbers into binary [30], the length of the key is calculated as 264*6 + 16 + 3*2 = 2406 bits which is sufficiently large to avoid any malicious attack.

Fig. 9
figure 9

Structure of key space

4.4.2 Key sensitivity

Key sensitivity is another security parameter that measures the strength of the key. It shows the amount of variation occur in the secret information when extracted with the wrong key. The key space in the proposed algorithm consists of initial and control parameters of three chaotic maps, length of the confidential information and shifting factors. The chaotic maps are so sensitive to initial conditions that even a small change at 14th decimal point alter the whole chaotic sequence. It results in wrong selection of embedded locations at the receiver and hence extraction of erroneous secret information. It is demonstrated in Fig. 10 that extraction with correct key results in correct information retrieval whereas a small change in value of y01 at 14th decimal place results in extraction of corrupted information. However the impact of varying the key is insignificant on the stego ECG.

Fig. 10
figure 10

(a) Extraction of patient’s confidential information with correct and incorrect keys (b) Original ECG signal (c) stego-signal recovered with correct key (d) stego-signal recovered with incorrect key

For example as per the key space, structure the correct (Y1) and incorrect keys (Y2) are

Correct key Y 1 :

{0.897655762990, 3.9953461356011, 0.933453564978, 3.886954532619, 0.994357334262, 3.973256778521, 5000, 5, 5}

Incorrect key Y 2 :

{0.897655762990, 3.9953461356018, 0.933453564978, 3.886954532619, 0.994357334262, 3.973256778521, 5000, 5, 5}

4.5 Comparative analysis of the proposed work

The efficacy of the proposed work is evaluated by comparing its results with the state of the art techniques. In comparison to the outcomes shown by the currently published papers, the proposed technique surpasses in terms of payload capacity and PSNR at very low PRD, KL-Divergence, WWPRD and WEDD. The figures in Table 9 evidently show that the PRD and KL-Divergence of 4.2 × 10−3 and 8.95 × 10−6 respectively achieved in proposed method are too low at payload capacity of 11.2 k bits as compared to PRD and KL-Divergence of 5.9 × 10−3 and 0.15 respectively achieved in [12] at payload capacity of 2800 bits. The PRD, KL-Divergence and PSNR computed in [13] are 0.0132, 0.144 and 43.44 respectively for 4016 bits embedded as compared to 0.017, 2.28 × 10−4 and 44.85 respectively after embedding 28.6 k bits by proposed algorithm. Besides, the relative amount of error occurred in proposed method is trivial as compared to the techniques discussed in [27, 28] for considerable difference in their ECs. Therefore, from the comprehensive analysis it is apparent that the proposed algorithm is much competent as compared to the recently published state of the art techniques.

Table 9 Performance comparison of the proposed technique with other state-of-the-art techniques

5 Conclusion

In comparison to the existing techniques in which single common approach of steganography is applied over the complete ECG signal, a feature specific hybrid approach for data hiding in 2D ECG is proposed. An integration of IWT and modified LSB technique is applied to embed information in the pivotal QRS regions whereas PI-PVD method is used to incorporate secret information in the non-QRS region. The blend of spatial and transform domain approaches used in the proposed algorithm significantly outperforms other ECG steganography techniques by achieving low PRD, PRD1024, PRDN,KL-Divergence, WWPRD and WEDD at high EC. An average PRD, PRD1024, PRDN, SNR, PSNR, KL-Divergence, WWPRD and WEDD evaluated on typically 5mins duration of ECG signal of MIT-BIH arrhythmia database are 4.32 × 10−3, 0.0452, 0.066, 48.27, 51.51, 9.42 × 10−6, 0.152 and 0.042 respectively. The number of bits embedded and EC achieved for the same set of data are 1.58 and 171,390.5 respectively at zero BER which is exorbitantly high as compared to the techniques reported in literature. Further, the efficiency of the proposed algorithm is measured on both normal (MIT-BIH NSR) and abnormal (BIDMC-CHF) ECG databases as well as on self-recorded data of 20 subjects. In addition to statistical and clinical parameters, the impact of steganography is measured on HRV in which both time domain and non-linear parameters are analysed. The results show negligible error in HRVs of original and stego ECG. The performance is studied for different durations with variable number of bits embedded in QRS regions at varying percentage of data embedded in the non QRS regions. The performance is evaluated with maximum QRS complex duration of 0.15 s. The limitation of the proposed technique is that if the duration of any QRS complex exceeds this value then that QRS complex has to be excluded from embedding to avoid error. The effect of excluding the QRS region is however minimal on the overall performance of the proposed technique. To ensure the security of the embedded information, chaotic maps are incorporated that provides sufficiently large key space and high key sensitivity. The comprehensive analysis of the proposed approach of feature based data hiding in ECG signal yields excellent results and recommended as a proficient and authentic approach for ECG steganography. The program code can be shared with the reader on request to the corresponding author.