Hiding Secrets in Electrocardiogram Based on Integer Wavelet Transform with Coefficient Adjustment and LSB Substitution

In this paper, we present an efficient data hiding for electrocardiogram (ECG) hosts to solve the issues of existing ECG steganographic methods, which have less hiding capacity and insufficient signal-to-noise ratio (SNR)/ peak SNR (PSNR). Based on the integer wavelet transform (IWT), private (or sensitive) data such as patients’ diagnosis and personal information can be embedded in an ECG host via the IWT coefficient adjustment and the least significant bit (LSB) technique. Simulations indicated that the SNR (or PSNR), and payload of the proposed method outperform those of existing techniques. In addition, the proposed method is capable of resisting attacks, such as cropping, Gaussian noise-addition inversion, scaling, translation, and truncation attacks from third parties (or adversaries). Since the proposed method has low computational complexity, our method can be employed in portable biometric devices or wearable electronics.


Introduction
Recently, the COVID-19 pandemic has caused organizations and individuals to stay at home and work via the Internet. One of the important services provided by the Internet is the medical treatment of the elderly care and personal health maintenance. For example, elders who need help from families or individuals can evaluate their own biometric status, such as electrocardiogram (ECG), glucose, and blood pressure, and transmit the sensitive measurement data to community hospitals (medical centers) through intelligent networks. Because data packets are prone to be eavesdropped and tampered during transmissions between senders and receivers via public networks, care must be taken to ensure the security (or privacy) of the sensitive data. Typically, data hiding techniques provide an economic and easy way to achieve this goal. Data hiding can be classified into steganography and digital watermarking (Cox et al., 2008;Eielinska et al., 2014). One main goal of steganography (Hussain et al., 2018;Kadhim et al., 2019) is to embed a large volume of data in host multimedia, such as text, images, or video, while maintaining a good (or acceptable) perceived quality. Generally, a good perceived quality attracts no attention of third parties (or adversaries). By contrast, robust performance is one of the major aims of (robust) digital watermarking (Liu et al., 2017;Hsiao et al., 2018). The watermarked multimedia generated by a robust watermarking scheme often has good performance in resisting attacks. Thus, most watermarks extracted from the watermarked multimedia, which have undergone manipulation, can still be recognized. However, they often provide a limited payload size. Furthermore, some authors have proposed reversible (or lossless) data hiding techniques to completely restore the original content of (valuable) host media, such as medical or satellite images, after data extraction (Wu et al., 2020;Li & Huang 2020). Because the proposed ECG steganography is a lossy data hiding approach, only the related articles are surveyed in the following subsection.
percentage residual difference (PRD) ranged from 0.06 to 0.51 with a bit depth from 2 to 5, and was capable of introducing an optimal payload of approximately 6.5 Kb. Using the DWT with QR image decomposition, Sanivarapu et al. (2020) successfully embedded patient information in an ECG host. An input ECG was first converted to a two-dimensional (2D) ECG image using the Pan-Tompkins algorithm. The 2D image was subsequently decomposed by DWT. Then, data bits can be effectively hidden into the target coefficients via DWT and QR decomposition techniques. Simulations indicated that the method was tolerant of additive white Gaussian noise (AWGN) noise attacks. In addition, the average PRD and SNR were 0.0020 and 53.81 dB with a payload size of 4 Kb.
Based on curvelet transforms,  developed a data hiding technique for ECG signals. Demonstrations showed that the PRD was 0.11 with a payload size of 4 Kb, and the bit error rate (BER) was 31.84%. In addition, the BER linearly increased as the payload increased. Yang and Wang (2016) employed the coefficient adjustment technique and proposed two types of ECG steganography, namely, a high-perceived quality and a high-capacity ECG steganography. Simulations indicated that the average SNR and payload for the high-perceived quality and high-capacity ECG steganography were 54 and 43 dB with payload sizes of 7 and 14 Kb, respectively. Based on the DWT and singular value decomposition,  presented a continuous ant colony optimization skill to embed patient information in a 2D ECG signal. Simulations indicated that the PRD and PSNR were 0.0018 and 62.87 dB with a payload size of 0.89 Kbytes. In addition, the method was resistant from cropping and noise (or high-frequency) attacks. To design a suitable ECG steganography for wireless transmission, Pandey et al. (2017) employed a chaotic map and sample inversion technique to accomplish the goal. Experimental results revealed that the average PRD and PSNR were 0.26 and 55.49 dB with a payload size of 21 Kbytes (the input of all datasets took 20 min).
Without the use of auxiliary information, Yang and Wang (2018) utilized the absolute-value decision policy and proposed an ECG steganography. The number of input bits can be designed on-demand using host bundles in various sizes. Simulations indicated that the average payload and SNR of the method was approximately 19 Kb and 48 dB, respectively. In addition, the average SNR of 58 dB can be obtained with a payload size of 10 Kb. To further obtain a lower distortion and security, Pandey et al. (2019) used a fused coupled chaotic map with the LSB technique and presented an upgraded ECG steganography. Simulations confirmed that the average PRD and PSNR were 0.21 and 56.83 dB with a payload size of 21 Kbytes (the input of all datasets took 30 min). Furthermore, a good perceptual quality with a PSNR value of approximately 70 dB and payload size of 2.4 Kbytes can be achieved by the method. Christian et al. (2019) presented an ECG steganography based on the discrete cosine transform (DCT) domain. The method embedded secret bits in the second decimal place of the DCT coefficients and generated a very high perceptual quality. Although a high SNR with high payload can be obtained by their method, the size of the resultant ECG signal is increased by about two times larger than that of the original one, which may lead to the storage burden of the mobile measurement devices.
Based on a 2D bit-embedding and bit-extraction approach,  proposed an effective ECG steganography, where a patient's data can be hidden into the host blocks of an ECG. The performance of the method was demonstrated with host blocks in various sizes. Compared with existing techniques, the method with a 2 × 2 block generated the best SNR and payload values, that is, 53 dB and 14 Kb, respectively, whereas the 4 × 4 block provided the largest payload (21 Kb) among the compared methods. The method has a merit of resisting manipulations because it embedded data bits in the blocks of a 2D ECG host. To obtain high hiding capacity and robustness performance, Yang and Wang (2020) embedded data bits in the low sub-band (LB) and high sub-band (HB) coefficients of the integer wavelet transform (IWT) domain. First, an input ECG host was decomposed into the LB and HB using level 1 IWT. Then, the predetermined criteria for bit embedding/ extraction were employed to hide a secret message into both sub-bands. Simulations indicated that their average SNRs were 50 and 40 dB with payload sizes of size 21 and 25 Kb, respectively, when the control parameters τ = 9 and τ = 55 were used. From the above survey we can see that the major issues of existing steganographic methods for ECG hosts have less hiding capacity and insufficient SNR (or PSNR). Thus, the motivation of this study is to propose an improved ECG steganography for the protection of patients' data and personal privacy.
The major contributions of the study include: 1) The proposed method has merits of good perceived quality, high hiding capacity, and the support of robustness, which is rarely seen in conventional ECG steganography methods.
2) The hiding storage and SNR (or PSNR) provided by the proposed method are superior to those provided by existing techniques. 3) Due to the fast computation time, the proposed method can be employed in portable biometric devices or wearable electronics.
The remainder of the paper is organized as follows. Section 2 describes the proposed bit embedding and bit extraction technique and the capacity analysis. Section 3 presents the experimental results. Section 4 makes a discussion, and Section 5 concludes this work.

Method
To achieve high hiding capacity, good perceived quality, and robustness, an input ECG host was first decomposed into low sub-band coefficients (I L ) and high sub-band coefficients (I H ) via 1D IWT (Calderbank et al., 1998). Then, a series of host blocks with a size of n × n were sequentially derived from the I L and I H . The number of (n − 1) × (n − 1) bits can be virtually embedded in the IWT coefficients of the first (n − 1) rows of a host block according to the coefficient adjustment. In addition, the number of (2 × n) bits can be hidden into the IWT coefficients at the last row of the host block via the LSB technique. If a sub-block of the first (or the second) row of host block failed to be used for hiding bit after the adjustment, it is referred to as a skipped sub-block. Moreover, the skipped sub-blocks carry no data bits. Because a skipped sub-block can be easily detected by the receiver using the above criteria, no auxiliary information is required to record their positions. The major steps of bit embedding and bit extraction for our proposed method are summarized in the following sections.

Bit Embedding
The main procedure of bit embedding is described in the following algorithm.
Algorithm 1. Hiding data bits in the ECG host.
Input: Host ECG , Ω size of a host block n, a control integer τ, and a secret message W.
Step 1. Set parameter m = 0 and input a block E j = { ji } from I L (or I H ). If the end of input is encountered, then go to Step 10.
Step 2. If m < (n − 1), then set index r = m × n and go to the next step; otherwise, go to Step 9.
Step 3. Compute the offset α = s jr -s j(r+1) , if the condition |α| > τ is satisfied, which means that the sub-block carries no data bit, and then go to Step 6; otherwise, input a data bit b p from W.
Step 4. If both conditions of b p = 1 and -τ ≤ α < 0 are satisfied, which means that the sub-block carries data bit "1," and then go to Step 6. Otherwise, if b p = 1 is satisfied, which implies the occurrence of a violation, then repeatedly adjust the value of α by increasing s j(r+1) by 1 and decreasing s jr from 1 simultaneously until -τ ≤ α < 0 is achieved, and go to Step 6.
Step 5. If both conditions of b p = 0 and 0 ≤ α ≤ τ are satisfied, which means that the sub-block carries data bit "0," and then go to Step 6. If b p = 0 is satisfied, which implies the occurrence of a violation, and then repeatedly adjust the value of α by increasing s jr by 1 and decreasing s j(r+1) from 1 simultaneously until the condition 0 ≤ α ≤ τ is satisfied.
Step 7. If both conditions of b q = 1 and -τ ≤ β < 0 are satisfied, which means that the sub-block carries data bit "1," then set m = m + 1 and go to Step 2. Otherwise, if b q = 1 is satisfied, then repeatedly adjust the value of β by increasing s j(r+2) by 1 and decreasing both s jr and s j(r+1) from 1 simultaneously until the condition -τ ≤ β < 0 is satisfied. Set m = m + 1 and go to Step 2.
Step 8. If both conditions of b q = 0 and 0 ≤ β ≤ τ are satisfied, which means that the sub-block carries data bit "0," then set m = m + 1 and go to Step 2. Otherwise, if b q = 0 is satisfied, then repeatedly adjust the value of β by increasing s jr and s j(r+1) by 1 and decreasing s j(r+2) from 1 simultaneously, until the condition 0 ≤ β ≤ τ is met. Set m = m + 1 and go to Step 2.
Step 9. Embed (2 × n) bits in the three coefficients at the last row of E j via the LSB, and return to Step 1.
Step 10. Perform 1D inverse IWT from I L and I H to obtain mark ECG.

Bit Extraction
Bit extraction is considerably simpler than the proposed bit embedding. The major steps of bit extraction are listed in the following algorithm.
Algorithm 2. Extracting hidden bits from marked ECG.
Input: Marked ECG Ω′, size of a host block n, and an integer τ.
Step 1. Set m = 0 and input a block E j = If the end of input is encountered, then go to Step 8.
Step 2. If m < (n − 1), then set index r = m × n and go to the next step; otherwise, proceed to Step 7.
Step 7. Extract (2 × n) bits from the three coefficients of E j via the LSB technique, and return to Step 1.
Step 8. Assemble all extracted bits and rebuild the secret message W.
Notably, the value of the control parameter τ was not necessarily constant. When τ was small, SNR increased, and the PRD and payload size decreased. Moreover, the proposed method with a large τ provides more a robust performance than with any smaller τ. The block diagram of the bit embedding and bit extraction of the proposed method is summarized in Figure 1.

Capacity Analysis
If the number of skipped sub-blocks is null and an input ECG consists of K samples, then the optimal payload size of the proposed method is   for the number of host blocks. However, if we choose to embed n bits in the last row of a host block via the LSB technique, then the optimal payload of the proposed method would be In addition, our simulations have revealed that the distortion caused by embedding secret bits in I H was considerably less than that caused by embedding secret bits in I L . To further pursue high-perceived quality (or high SNR value), data bits can only be embedded in the I H sub-band with the constraint of embedding n bits in the last row of a host block via the LSB technique. However, in this case, the optimal payload (with no skipped sub-blocks) would be As compared with the aforementioned payload, the hiding capability of this version is no more than 50% of the original payload size. Actually, this version with a host block of size 3 × 3 introduced approximately 30% to 45% size of the aforementioned (optimal) payload when τ < 9 was used.
Furthermore, data bits can be forcedly hidden into the skipped sub-blocks via the LSB technique. Although the payload size can be slightly promoted, the resultant SNR and robustness performance would be significantly degraded. The authors did not employ this methodology in the proposed method.

Results
To evaluate the performance of our method, simulations were implemented on an Intel® Core™ i5 1.7 GHz laptop with 12 GB RAM. The average central processing unit (CPU) time for the proposed method, including I/O, was approximately 0.025 s. A total of 48 ECG host signals obtained from the MIT-BIH Arrhythmia Database (Moody & Mark 2001) were used as test data. After the preprocessing of an ECG signal, each ECG host consists of K = 30,000 samples. The size of a host block is 3 × 3. Several measurements, such as SNR, mean absolute error (MAE), PRD, and PSNR are used for performance evaluation and are defined as follows:  The SNR and payload generated by the proposed method used various τ, and the number of corresponding skipped blocks are shown in Figures 3(a) and 3(b). The larger the value of τ, the lower the number of skipped blocks, and the lower the SNR values, which means that a larger payload can be obtained by the proposed method, vice versa. Moreover, the distortions in terms of PRD and MAE are given in Figures 3(c) and 3(d). The average PRD and MAE for ECG116 and ECG213 were slightly higher than those of the other four ECGs. From Fig. 3 we can conclude that the proposed method embeds data bits in ECG100, ECG101, ECG102, and ECG232 with better efficiency than in ECG116 and ECG 213. To further examine the hiding capability of each ECG host by the proposed method, the resulting payloads of these ECGs with a lower and larger value of τ are illustrated in Fig. 4. The x-axis in both figures numbered from 1 to 48 stands for the 48 sets of ECG inputs. The corresponding name of the ECG input of the serial number is listed in Table 1. Figure 4(a) shows that the average hiding capacity provided by serial numbers of 1 (or ECG100), 20 (or ECG121), and 28 (or ECG205) with lower values of τ (≤ 8) was higher than that of other ECGs. On the contrary, the average hiding capacity provided by serial numbers of 8 (or ECG107), 27 (or ECG203), 30 (or ECG208), and 34 (or ECG213) was less than that of other ECGs. Figure 4(b) presents that the average hiding storage provided by serial numbers of 9 (or ECG108), 20 (or ECG121), 29 (or ECG207), and 46 (or ECG232) with larger values of τ (≥ 20) was higher than that of other ECGs, and the average hiding storage provided by serial numbers of 8 (or ECG107), 27 (or ECG203), and 34 (or ECG213) was less than that of other ECGs.  For a clear examination of the ECG hosts, their full waveforms and standard deviation (SD) and entropy values are given in Figure 5. The figure shows that the SD and entropy of ECG107, ECG203, and ECG213 were significantly larger than those of other ECGs. Moreover, the value of the y-axis in these figures ranges either between −2 and 1.2 or between −4 and 3. Generally, the larger the SD/entropy, the more drastic the variation of the waves, and the less the hiding capability obtained by the proposed method, and vice versa. The SD and entropy are defined as follows: where μ and ) ( i s p denote the mean and possibility of the coefficients in the ECG host. The distortions generated by the proposed method (in the first 5-s interval) from the marked ECG100 and ECG231 with various τ are shown in Figure 6. The marked signal introduced by our methods (red line) was approximately similar to the original one (blue line).

Performance Comparison
Performance comparison between various methods is illustrated in Figure 7. The (original version of the) proposed method (represented as OurLSB2) provided the largest payload among the compared methods, and the SNR of value 55.63 dB (with a payload size of around 25 Kb) is still better than that of Yang & Wang's technique (2020). In addition, the second version of the proposed method (represented as OurLSB) provided the best SNR performance in the payload between 15 Kb and 22 Kb among the various techniques. The other three methods (Yang & Wang, 2018;Yang & Wang, 2020) provided similar SNR values when the payload size is less than 15 Kb. The second version of the proposed method embedded only three data bits in the last row of a host block. The main difference between the proposed two versions is that the former method can be implemented in situations that require a payload greater than 25 Kb, whereas the latter method can be applied to environments where a good perceived quality (or high SNR) is an important indicator (or a concern factor). As specified in Section 2.3, in the third version of the proposed method, to further obtain good perceived quality (or high SNR value), data bits can only be embedded in the I H sub-band with the constraint of embedding n data bits in the last row of a host block via the LSB technique. Our experiments indicated that the average payload of 9 Kb with an average SNR of 64 dB was acquired by this approach. Compared with other existing schemes, the average payload and SNR provided by Yang & Wang's technique (2020) was 9 Kb and 60 dB, and those provided by Yang et al.'s approach (2020) was 8 Kb and 62 dB, respectively. Furthermore,  and Pandey et al.'s scheme (2019) used the PSNR as their perceived quality measurement, and the performance comparison in terms of the payload size and PSNR is given in Table 2. Evidently, the PSNR value of the proposed method (with our three versions) is the best among the methods, and our payload is still larger than that of the other two techniques. Figure 7 and Table 2 shows that the proposed method generates better perceived quality and higher payload than existing techniques.

Extra Functions
Several examples of survived watermarks from the manipulations of the marked ECG100 (with τ = 16) are given in Table 3. A binary image of size 180 × 180 was used as an input watermark. The resultant SNR of the marked ECG100 was approximately 52 dB. Table 3 indicates that both the values of PRD and bit error rate (BER) equal 0 for a "Null-attack," which meaning a marked ECG was not manipulated. The BER is the number of (the extracted) bit errors divided by the total number of input watermark bits. In general, the lower the BER, the better the perceived quality of the extracted watermarks. The fourth and sixth columns on the second row of the table indicated that the watermark extracted from the marked ECG and attacked by AWGN attacks of signal strengths 0.001 and 1 dB, respectively, were recognizable. Although the PRD of the survived watermarked (at the second column on the third row of the table) from the "cropping" attack was 0.8246 with BER = 0.5317, it was identified. Moreover, at the same row of the table, the survived watermarks manipulated by "Inversion" and "Scaling" were still recognized. In spite of the PRD and BER for the extracted watermark (at the second column on the last row of the table) were 0.8190 and 0.5244, respectively, it can be identified by squinting eyes. Besides, the last row of the table shows that our method has good performance against the "translation (with scale of +1500 and −1500)" attack. Table 3 shows that our method is capable of resisting several kinds of attacks. Table 3. Examples of survived watermarks from the manipulations of the marked ECG100  The last two bits of the marked data were truncated.

Discussion
As described in Section 2.3, the payload of our method was limited by (n 2 + 1) × K / n 2  with null skipped block. Although the optimal payload can be obtained by the proposed method with host block of size 2 × 2, the robustness performance was not better than that the method uses host block whose size being larger than 2 × 2.
In addition, one can use the coefficient adjustment and the LSB technique to embed data bits in the IWT coefficients of the first row and the second-/third-row the host blocks, respectively. It certainly enlarges hiding capacity. However, it increases the proportion of the LSB usage, and undermines the robustness of the proposed method. The study discovers that if we embed data bits in the first two rows and the last row of the host blocks of size 3 × 3 via the coefficient adjustment and the LSB technique, respectively, a high hiding capacity, good perceived quality, and robustness can be achieved by the proposed method. Moreover, the hiding performance of the method can be improved by analyzing the characteristic of each host block before bit embedding. Theoretically, a smooth block which encoded by the coefficient adjustment introduces less distortion, while a non-smooth block generates the larger payload by the LSB technique.
To evaluate hiding performance, several objective assessments such as SNR, PSNR, MAE, and PRD have been commonly used in ECG steganography (Yang & Wang, 2018;Yang & Wang, 2020;Pandey et al., 2019). Simulations have indicated that the less value of τ, the lower the MAE, the larger the SNR/PSNR, implying that a good perceived quality can be obtained by the proposed method, and vice versa. In addition, the average payload and SNR/PSNR of the proposed method outperforms existing techniques. Moreover, the proposed method has an extra characteristic of robustness, which is rarely existed in conventional ECG steganography.
In this article, we proposed an improved ECG steganography for the protection of the sensitive personal information of patients. Based on the IWT domain with coefficient offset and LSB technique, data bits can be effectively embedded in the host blocks of an ECG signal. Experiments confirmed that the average SNR (or PSNR) and payload of the proposed method are superior to those of the existing ECG steganography. Moreover, our method equipped with robustness performance was rarely seen in existing ECG steganography techniques. That is, the proposed method is tolerant of attacks, such as cropping, inversion, scaling, translation, truncation, and Gaussian noise-addition attacks. Because the processing time is fast, our method can be applied in mobile biometric devices or wearable electronics. To further promote hiding capacity and robustness, our future work will focus on an a priori analysis and statistics of each ECG input and performed steganography in other transform domain.

Compliance with Ethical Standards
 Conflicts of interest/ Competing Interests: The authors declare that they have no conflict of interest/ competing interests.
 Ethical approval: This article does not contain any studies with human participants performed by any of the authors.
 Informed consent: Not applicable.