Compression and encryption for ECG biomedical signal in healthcare system

,

Quantization and JPEG2000 codec) and coupled chaotic map mutation. In their scheme, they assume wireless transmission (using Rayleigh fading wireless channel) of ECG through OFDM (Orthogonal Frequency Division Multiplexing) and enhance it to correct impair samples using MMF (Moving Median Filtering). They show storage space minimization through 2D compression mechanism and combined it with chaotic based on mutation scheme to randomize ECG vector for maintaining shield to data confidentiality thus prevent from eavesdropping. As per Mahsa Raeiatibanadkooki [12] have propose a scheme that can compress the data without any loss of important information and also apply cryptographic scheme to preserve confidentiality from unauthorized access. In their work, they use mobile computing devise to eliminate usage of computers. They perform preprocessing such as removal of gaussian and baseline noise, detect peaks, do heart rate analysis and compress the ECG signal. At the compression they apply 3 level wavelet transformation (db04) and use threshold mechanisms. Next, Huffman coding technique is used to compress and encrypt the signal. They get the compression rate of 97.72% which is quite decent for any compression scheme. Further, the ECG signals are transmitted over TCP/IP to telemedicine clinic for specialist' assessment.
The study presented in [13] states the significance of compression with respect to ECG signals. According the researchers, ECG illustrates an individual's heart electrical movements. It helps in monitoring and diagnosis of heart related disease. Remote monitoring applications such as telemedicine necessitates storage of a big amount of data for assessment and diagnosis. Wireless transmission even consumes more energy while transmitting uncompressed data. Thus, compression of data is much required to reduce storage space, improve transmission rate and bandwidth usage. They compared diverse lossless compression schemes w.r.t ECG records and compared time efficiency and compression rate of those schemes. Through their study, they concluded that minimum variance Huffman coding is the best option to compress ECG signals. They considered MIT-BIH arrhythmia dataset for their study and MATLAB tool for simulations. As per their results, almost half of the storage memory can be saved with Minimum variance Huffman code having computational complexity of NLog2N. In their scheme they shown the better utilization of bandwidth with simple buffer design. Hence, the compression mechanism quality in reconstructed ECG needs to be measured by most popular function such as PRD (Percentage Root-mean-square Difference). Though, there are many chances that quality of reconstruction and the results may vary during evaluation of scheme due to different levels of data compressions. In their work they demonstrated that if efficiency of ECG compression scheme is tested alone in terms of quality through PRD method then variable outcomes may occur. Thus, they propose the use of multiple methods (PRD1 and CR) in order to achieve more accurate and reliable results and better conclusions during simulations. They performed simulations on MIT-BIH ECG (Arrythmia) dataset with different compression levels to analyze its influence on performance using PRD1 and CR (Compression Ratio) [14].
The study shows that, most of the previous works concentrate more on quality of signal based on peak detection but lacks security aspect. Though few works are found with security model along with filtering and compression schemes, but those schemes are not so efficient in terms of lossless compression or noise filtering. We propose a new system models based on lossless scheme such as Huffman coding for compression so that there is no information loss upon reconstruction. Also, to avoid the chances of data tampering we make use symmetric key of ciphering based on the AES-CBC algorithm with 256-bit key size. Remaining sections of this paper are organized as, section 1 contains Introduction section, 2 contains research method of proposed mechanisms, section 3 contains experimental results and section 4 summarizes the paper as conclusion.

Research Method
The block diagram of the proposed ECG compression and encryption method has been represented in the Figure 1. At first stage, the ECG biomedical signal has been loaded into proposed system. The second stage is the remove nosing from the signal using Discrete Wavelet Transform (DWT) combined with a Thresholding. The third stage is the block creation of ECG signal. Next to fourth stage the compression method is applied by use Huffman coding on each block of ECG signal. After completing the previous stage, the encryption method has been applying based on AES-CBC algorithm in the fifth stage and then transmission block ECG signal into monitoring. Finally, after receiving ECG signal block the decryption and decompress

DWT (Discrete Wavelet Transform)
Wavelets are arithmetic functions that work on signal data as per resolution or scale. DWT can be categorized as a type of wavelet that are discretely sampled the Figure 2 shown wavelet flow of operation. One of the key merits of DWT over fourier transforms is it analyses both frequency and time (location) in parallel. Soft or hard threshold methods define shrinkage rules [15]. Thresholding can be applied to the signal vector based on its characteristics. Majorly, there are two thresholding methods namely, soft and hard where hard is the easiest one. Hard thresholding: soft thresholding: with wthresh, hard or soft threshold can be applied. The daubechies (Db) wavelets are most popular discrete wavelet transforms in signal processing. It was developed in 1988 by Belgium based mathematician Ingrid Daubechies. Db has a range of wavelets, the first of which is the Db1 or Haar wavelet [16,17].

Compression
Compression is the process of compacting size of the data through formulas or arithmetic operations [18]. Compression ratio is calculated to measure the performance of compression scheme and compactness of data. There are two types of compression schemes, i.e. lossy and lossless. Lossless schemes recover compressed file to its original status without any loss of data while decompressed. Particularly in the applications such as critical medical records, financial statement files and other vital files are always processed with lossless scheme as any loss of single bit also may affect aversively. For compression performance evaluation, various metrices functions are used such as PRD, CR and QS. The Compression Ratio (CR) is the measure of compression achieved in signal through encoding mechanisms. It doesn't provide information on compressed signal quality but measures efficiency of algorithm in reducing storage space. Thus, the Percentage Root-mean-square Difference (PRD) is a measure to evaluate error or difference between original. The quality score (QS) is used to evaluate the compression performance while considering the compromised reconstruction errors.

Huffman Code
Lossless compression techniques are very useful in applications where each bit of data is very significant for analysis such as medical field [19]. ECG signals are quite complex to analyze due to the property that a slight variation in signal value may misrecognize the peak type. In Huffman coding, input string characters are assigned with variable length codes (bit sequences), frequency of the individual character determines the allocated code length. Smallest code is assigned to character having the maximum frequency and largest code is assigned to the minimum frequency character. These variable length codes are known as prefix codes [20]. These prefix codes are unique for each character assignment. Thus, it is ensured that there should not be any ambiguity at the time of decoding operation on encoded bit stream. In Huffman, if there exists unique characters to encode, then overall edge count ( ) would be:

Cryptography
Cryptographic mechanism is a process in which information is converted to prevent it from being recognized by attackers [21]. The cryptography includes two processes first is the encryption process which entails converting the intelligible data into unintelligible data using a cryptography algorithm and encryption key. The second process is decryption, which involves converting the unintelligible data into intelligible data using the same algorithm and a decryption key [22]. The cryptography is divided into two broad categories; symmetric key and asymmetric key cryptography. The first category, symmetric key cryptography (otherwise called secret-key cryptography) uses the same key at the source and destination. The second category, asymmetric key cryptography uses different keys (called the public key) at the source and destination [23].

AES Algorithm
AES was one among the finalists in NIST competition and won the title of most secure cryptographic algorithm in October, 2000. It is also known as Rijndael and can have a variable key size of 128 bits, 192 bits or 256 bits with a fixed block size of 128 bits. It is a symmetric algorithm that uses single secret key for both encryption and decryption. There are four basic stages in each round of AES encryption or decryption. Permutation stage is ShiftRows and remaining three substitution stages are Substitute byte, MixColumns and AddRoundKey [24]. The encryption and decryption procedures of the Advanced Encryption Standard algorithm can show in Figure 3.
can be elaborated in following steps: Let be the state and round be , AES works well with both hardware as well as software.There are five operational modes in AES i.e. ECB, CBC, CFB, OFB and CTR.

Cipher Block Chaining Mode Operation (CBC)
To each ciphertext block produced earlier, an XOR is added to each plaintext block. Ciphering through CBC mode of AES can be illustrated as Figure 4 show the encryption and procedure of the CBC mode operation. The outcome of each succeeding ciphertext block relies on the preceding one. The initial plaintext block is added XOR to an unsystematic initialization vector (IV). An advancement to the ancestral block level ciphering version of AES such as ECB is Cipher Block Chaining (CBC). In this ciphering scheme, there is a dependency of every encrypted block on all plaintext blocks which are operated up to that stage. Due to this procedure, an additional level of computation is required while generating the cipher text [25].

Results and Analysis
This portion reports and deliberates the results of the conducted investigations. In this work, we used DWT for clean signal with thresholding then compression signal used lossless method based on the Huffman coding algorithm and encryption the signal used symmetric key cryptography based on the AES-CBC algorithm block ciphering. The conducted experiments are performed on a computer with specifications (processor Intel(R) Core (TM) i5-4300U CPU@1.90GHz 2.49 GHz, RAM 4GB, under windows 10 professional 64-bit using MATLAB (R2018b). The execution of the proposed method was assessed using some parameters, for de-noise signal MSE, PSNR, SNR and CC the compression performance parameters are PRD and CR. In the end the timely execution and security level they are significant parameters for evaluation of proposed system performance. Therefore, the computational time of the system model can be defined as the time taken by each process in system. Performance parameter include the time taken by the algorithm for the compression and encryption of input ECG signal that is computational compression time and computational encryption time used for the processing on the ECG signal before transmutation to system monitoring. Subsequently, after received the file calculated the estimated time taken by the algorithm for the decryption and decompression of file receiving that is computational decryption time and computational decompression time used for the processing on the ECG signal. As shown in Table 1 the time for different number of blocks from the whole signal until 60 blocks in the input of ECG signal file, which is the execution time for key generation, compression, encryption, decryption, decompression and total time of system proposed respectively. Therefore, for the four blocks of ECG signal the execution time are 3.2808, 3.8548, 3.5344, 0.616, in second respectively for each block. However, the increase for number of blocks on the ECG signal leads to computational overhead at the time of execution hence, the results show it that the proposed system within four blocks are consumes less time compared with other number of blocks.
Thus, the Figures 5 (a) and (b) shows the efficiency of the system in terms of the execution time for encryption mechanism then compression mechanism, the compression then encryption. As the experimental results show that the encryption process then the compression consumes more execution time in the process of implemented because of the entropy of ECG signal increased after encryption process. In the Figure 6 represents mean of CR and PRD retrieved on selected five datasets with 0.5db, 1dB and 2dB noise. As the results barely show any difference while changing dataset and noise ratio, thus average of it is demonstrated shown in Figure 6.  The purpose of the ECG signal compression is to achieve high compression rates without changing the quality of the signal. The compression rate should be checked with the other parameters to evaluate the experimental results of the quality of the reconstructed signal. Table 2 comparison the performance of compression algorithm with other algorithms in previous studies. Figure 7 represents Denoising performance of HAAR wavelet on the noise ranges in between 0.5 dB to 6 dB. PSNR is relatively high in record no. 106 and 213 and lowest in record

Conclusion
This paper mainly aims to propose a new lightweight system model to process ECG signals efficiently and securely. To test the efficiency of proposed model, five distinguished datasets from MIT-BIH arrhythmia repository were processed through several mechanisms of Denoising, filtering, compression and encryption. The delay performance of compression algorithms is particularly important when time critical data transmission is required. As compressed signals take lesser time in computations compared to raw signal, thus Huffman lossless scheme is employed. Efficiency of those mechanisms are computed in terms of PRD, CR, PSNR, MSE, etc. The PRD outcome of proposed work comes as 0.41% and CR as 0.35%, which is quite better than existing schemes. The Experimental results prove the efficacy of algorithms used. Thus, the block level processing and encryption of signal using AES-CBC algorithm with 256-bit key size which could be prepare high level of security and quite novel in this work for further tested on real time embedded device.