New Ecg Signal Compression Model Based on Set Theory Applied to Images

Abstract

Cardiovascular diseases are the origin of many causes of death worldwide. They impose on practitioners optimal diagnostic methods such as telemedicine in order to be able to quickly detect anomalies for daily care and monitoring of patients. The Electrocardiogram (ECG) is an examination that can detect abnormal functioning of the heart and generates a large number of digital data which can be stored or transmitted for further analysis. For storage or transmission purposes, one of the challenges is to reduce the space occupied by ECG signal and for that, it is important to offer more and more efficient algorithms capable of achieving high compression rates, while offering a good quality of reconstruction in a relatively short time. We propose in this paper a new ECG compression scheme that is based on a subset of signal splitting and 2D processing, the wavelet transform (DWT) and SPIHT coding which has proved their worth in the field of signal processing and compression. They are exploited for decorrelation and coding of the signal. The results obtained are significant and offer many perspectives.

Share and Cite:

Kabiena, I.B., Djomadji, E.M.D. and Tonye, E. (2023) New Ecg Signal Compression Model Based on Set Theory Applied to Images. Journal of Computer and Communications, 11, 29-43. doi: 10.4236/jcc.2023.118003.

1. Introduction

Telemedicine and medical imagery now generate an impressive amount of data, which now requires making imperative use of powerful signal and image compression software for massive information backup and storage [1] . The transmission of this data by telecommunications channels would be more optimal as the size of the data to be transferred is minimal. The problem that we are trying to solve is that of improving the transmission times by reducing the size of the data to be transmitted as well as optimizing the available storage space. Compression is therefore an alternative to overcome this problem and this has been presented by Ntsama E.P and Kabiena in [2] and by Istepanian Robert and A. P. Arthur in [3] . The challenge is to have higher compression rates while offering a faithful reconstruction, and to avoid the slightest degradation which could lead to a fatal diagnostic error. There are several techniques in the literature for compressing biomedical signals, in [4] , S. Olmos, M. Millan, J. Garcia and P. Laguna have proposed the use of ECG data compression based on Karhunen-Loeve transform. K. Uyar and Y. Z. Ider in [5] proposed a development approach of a compression algorithm suitable for exercise ECG data. And in [6] L. V. Batista et al proposed the compression of ECG signals based on the optimum quantization of discrete cosine transform coefficients and Golomb-Rice coding. We will use in this test, the methods by transforms which make it possible to avoid the redundancy errors, and to approach the smallest element, they are therefore better suited for ECG signals [7] [8] . Also, we propose a new method of compressing the ECG signal by exploiting the change of the 1D signal in 2D. The image thus formed is processed by the TOD and then coded by the SPIHT algorithm. The new 2D layout model that we have implemented makes it possible to deal with the specificities and complexities of the ECG signal, (P wave, U wave, T wave, QRS complex, etc. Figure 1 is an illustration), with good prospects for local filtering and

Figure 1. ECG training based on heartbeat [9] .

reaching high compression ratios. The compression ratio, PRD and subjective criterion measurements allow us to appreciate the algorithm performance.

2. Material and Method

2.1. General Information on Electrocardiographic Signals

The electrocardiogram is the most effective examination for the diagnosis of cardiac pathologies, which affect the human heart [9] . This observation examination of the activity of the cardiac muscle tissue, given its limited function(its duration does not exceed a few seconds, carried out only during the subject’s rest, etc.), has evolved into a much more effective technique which is the Holter test. The Holter represents the recording of the electrocardiogram signal for 24 hours or more and therefore contains the maximum amount of information on the cardiac activity of the different patients.

A normal ECG recording represents a normal heart cycle; it is characterized by a spectrum of frequencies distributed below 40 - 50 Hz and by waves and time intervals which repeat in a quasi-periodic manner as presented in Figure 2.

This figure shows that a normal ECG has four maximums. It is this fundamental property that we will exploit for the development of our new model.

2.2. The Theory of Sets or the Interest of Consolidation in Subset

Cantor is the main creator of the set theory which he introduced in the early 1880s [11] . It was while working on problems of convergence of trigonometric series, in the 1870s, that he came to define a notion of derivation of sets of real numbers. His work has had several consequences and applications, particularly in algebra and signal processing.

Figure 2. Normal ECG recording: different waves, intervals and segments. [9] [10]

By applying the consequences of set theory to the ECG signal vector, we deduce that there exist within the set P elements of this vector, subsets that can be organized in windows of dimension M times N in accordance to their value (intensity of future pixels); So if we consider P consisting of four windows Fi, each window Fi grouping elements close to the four specificities of the ECG signal that are the P, T, U waves and the QRS complex, then:

C a r d { P } = i = 1 4 c a r d { F i } (1)

The windows will therefore consist of close values, which has the effect of increasing the inter-pixel correlation, with the possibility of performing filtering on complex parts of the signal (P, T, U, QRS waves), this is illustrated in Figure 3.

The noise is considered in this case as an integral part of the image and compressed in the high frequencies during the decompression operation; the effect of the noise is therefore seen lessened, justified by the triangular inequality. Indeed, the data of the vector ECG put in 2D is coded on 8 bits, that is to say values of positive pixels ranging between 0 and 255 (0 and 1 in certain cases), the positive variant of the inequality theorem triangular (F1 and F2 positive), defined by Cauchy allows us to write that:

F 1 2 + F 2 2 F 1 + F 2 2 (2)

By performing an algebraic extension of this equation, we obtain:

F 1 2 + F 2 2 < P 2 (3)

Because F 1 F 2 = P with F i (4)

If we note E { X } , the statistical error committed during the reconstruction (decompression) by the method implemented on a set or subset X, We deduce that:

c a r d E { F 1 } + c a r d E { F 2 } < c a r d E { P } (5)

This inequality shows that the probability of introducing errors or parasites in a process is reduced if one proceeds by processing piece by piece, rather than detrimental global processing; Hence the need for compression by windows or sub-set, with a quantizing effect on noise (reconstruction error) [12] .

Figure 3. Non-discriminated data set (left), subset of data discriminated by weight, with improved correlation (right).

2.3. Wavelet Transform

Discrete Wavelet Transform (DWT) is a multi-resolution/multi-frequency representation [13] [14] . It makes it possible to efficiently analyze signals where phenomena of very different scales combine. The stages of the transform follow a filtering hierarchy. We then obtain a decomposition of the image into sub-bands with different filters (low pass h, and high pass g), consequently the need for a bi-dimensional DWT. This requires the use of a separable two-dimensional DWT (rows + columns). The input image is broken down each time into four sub-images (approximate image CA, horizontal detail DH, vertical detail DV and diagonal detail DD) with different low-pass and high-pass filters. The reconstruction is done using quadrature mirror filters, represented by their impulse responses (h and g) [15] [16] . This principle is illustrated in Figure 4.

2.4. Spiht Coding

SPIHT coding (set partitioning in hierarchical trees), as presented in Figure 5 is an efficient coding and is currently widely used in the specialised literature. The principle is to use a comparison threshold to say a coefficient that is an approximation or a detail. A tree branch hierarchy (in the following, we will write to simplify that i = i, j) is thus set up from a zero coefficient or parent denote X(i). A set noted O(i) represents the first two sons from X(i), all descendants including O(i) belong to the set D(i) and the set L(i) is defined by L ( i ) = D ( i ) O ( i ) [17] [18] .

Thus, a coefficient resulting from the decorrelation will be considered as an approximation or detail depending on whether it is lower or higher than the comparison threshold given by:

k = log 2 ( max i | x i | ) , 0 i K (6)

k represents the number of decor-related samples.

Figure 4. Relationship between wavelet coefficients at different scales.

Figure 5. Correspondence tree between parents and descendants [17] .

The coding will be carried out gradually in the following manner:

s k ( x i ) = { 1 , if | x i | 2 k 0 if not (7)

2.5. Compression Scheme

To implement the new approach, we chose to split our ECG signal into four blocks or subsets, corresponding to the four critical parts of an ECG signal (P, T, U, QRS). Thus, the block or subset F1 will comprise as many P waves as the actual examination sequence will have.

Also, considering I the initial ECG vector, then I can be written as an empirical and non-matrix sum of four blocks or subsets:

I = I 1 + I 2 + I 3 + I 4 (8)

The algorithm first evaluates the maximums of the basic sequence noted, M1, M2, M3 and M4, corresponding to the different QRS, T, P, U waves. The data for the entire total sequence will therefore be classified into four blocks according to their proximity to the maximums Mi. To ensure the harmonization of the dimensions of the blocks, the following operation is carried out:

I = ( I 1 + R 1 ) + ( I 2 + R 2 ) + ( I 3 + R 3 ) + ( I 4 + R 4 ) (9)

with Rn number of zeros to be completed in block In to have matrices of the same dimensions. This choice depends on the matrix block having the largest number of data. Ultimately,

I = k = 1 4 I k + R k ( 0 ) (10)

If we set I k = i j X i j (11),

Then, we will get,

I = i j a i j + i j b i j + i j c i j + i j d i j (12)

with I i j = { a i j si I i j M 4 b i j si M 4 < I i j M 3 c i j si M 3 < I i j M 2 d i j si M 2 < I i j M 1 (13)

i and j being the lines and columns respectively representing an empirical sum in the sense of subsets and not arithmetic. Figure 6 presents the grouping into subsets of four blocks based on QRS, T, P and U. Figure 7 presents the new proposed algorithm and Figure 8 shows the 2D compression scheme using the model in subsets

3. Evaluation Method

Evaluating the quality of a signal or an image is to associate it with one or more qualifiers allowing the location of its relative position in a frame of reference defined by our sense and according to the envisaged application. The quality of the

Figure 6. Grouping into subsets of four blocks based on QRS, T, P and U waves with the addition of complementary zeros.

Figure 7. New proposed algorithm.

Figure 8. 2D compression scheme using the model in subsets.

signal is not only linked to visual appearance but also depends on the application and use. To assess the results obtained from the proposed new scheme, we used a subjective assessment model, which uses human observers (end users) to assess (or compare) the signal quality according to a well-defined protocol, associated with an objective evaluation which refers to methods based on the analysis and quantitative measurement of the level of degradation using metrics directly related to the physical signal [19] . The compression ratio (TC) is used to control the reduction of the data by reducing the size of the original signal. It plays on two parameters, the wavelet level (generally from 1 to 4) but especially on the bpp (bits per pixel) which takes a value between 0 and 1. The variations of the TC allow one to appreciate the performances of the new method by observing the results obtained from objective and subjective evaluations. The compression ratio is given by:

CR = ( 1 numberofcompressedsignalbits numberofbitsoriginalsignal ) 100 (14)

3.1. Subjective Evaluation

Considered the most reliable way to measure real quality, subjective evaluation directly involves the human observer. The latter is called upon to judge the quality of the images or signals presented to it according to an evaluation grid with several levels of appreciation. At the end of these tests, a subjective score called MOS (Mean Opinion Score) is obtained. We have chosen to implement the simple stimulus protocol in this trial as presented in Figure 9.

The single stimulus method, called “Single Stimulus Continuous Quality Scale (SSCQS)” is used to judge the quality of one stimulus at a time. The images are presented one by one with a lag time between two presentations. This time allows the observer to note the quality of the image or signal. Scales with 5, 6, 7 or 100 levels of appreciation can be used. Table 1 presents an example of a scale, this method is very widely used to validate a quantitative or objective metric [20] , and it is what was used in the context of this article.

3.2. Objective Evaluation

Compression fidelity was assessed by the percent roots meansquare difference which is proportional to the quality. Its definition and use come from the field of audio/video signals, it is defined as follows:

Figure 9. Simple stimulus method.

Table 1. Example of notation scale.

PRD = i = 1 N ( y i y i ) 2 i = 1 N y i 100 (15)

where, y i is the original sample and y i the reconstructed sample. Where N is the maximum signal length. A value of PRD tending towards 0 corresponds to a perfectly reconstructed signal, and it decreases as a function of the distortion. The PRD, therefore, links the mean square error to the maximum energy of the signal.

4. Results and Discussion

The proposed approach was evaluated on real ECG data from the MIT-BIH arrhythmia database [21] . The 4/4 bi-orthogonal wavelet was chosen for TOD. The results were obtained with the signals X100, 101, 219, and 222. The number of samples is 4000. In the following, we will study the variations of the PRD as a function of the compression rate, in order to obtain a synthesis. The reconstructed signals will be submitted to a doctor, and then compared with the results of recent literature. Figure 10 shows the ECG signal X219, reconstructed with a CR = 90%, PRD = 0.2. This is the ECG recording of a patient with a heart condition. Visually, the quality of reconstruction is good. At this rate, no degradation is observed in the reconstruction of the signal X219.

Compression of signal X101, at CR = 89% gives the following results (Figure 11).

Also for this signal, the degradation remains imperceptible to the human eye. The value of the PRD is 0.13%, which indicates a good quality of reconstruction. The amplitude is around 0.1mV for the error. However, by varying the compression rate from to 92% (Figure 12) to 93% (Figure 13) for the signal (X100) which is an ECG without anomalies but with its P and T waves less important than those of X101, we obtain.

Figure 10. X219 signal compression, CR = 90%, PRD = 0.2.

Figure 11. Compression of signal X101, CR = 89%, PRD = 0.13.

Figure 12. Compression of signal X100, CR = 92%, PRD = 1.2.

Figure 13. Compression of signal X100, CR = 93, PRD = 1.3.

At CR = 93%, the degradations become significant and perceptible for the SVH as shown in Figure 13.

The magnitude of the error is now around 180μV, significantly higher than CR = 92% the PRD has also increased. In the reconstructed signal, the P and T waves are for the most part difficult to distinguish, and the signal is highly noisy.

To identify the optimal compression rate, that is to say that for which the reconstruction is at the maximum limit for good visual quality, we tested several signals around CR = 93% ± ∆ (∆ ≤ 1). For signal X222, at TC = 94% the PRD is equal to 2.2. We have the result:

In Figure 14 below, it is clear that the signal is more degraded when the compression rate is increased. However, the extent of the degradation caused varies from signal to signal. Thus, the signal X222, has a better tolerance to the high compression ratio compared to the other signals used for example. Figure 14 and Figure 15 show the evolution of the PRD, as a function of the compression ratio for the records considered.

Figure 14. X222 signal compression, CR = 94%, PRD = 2.2.

Figure 15. Plotting of PRD as a function of CR.

Table 2. Summary of doctor’s observations.

Table 3. Comparison of results obtained with the one presented in the literature.

The lowest curve is that of X219, followed respectively by X101 and X100 for compression rates below 96%. The closer a curve is to the abscissa axis, the more it will have a good tolerance to our algorithm. According to the literature, PRD values lower than one reflect an excellent quality of reconstruction; The plot of the PRD as a function of the CR above shows us that below CR = 93%, and for all the signals considered, the PRD revolves around 1.

However, it remains essential to add to this mathematical analysis, the subjective criterion of the human eye. These results were therefore submitted to the appreciation of a doctor from the Central Hospital of the University of Yaounde (CHUY), according to the simple stimulus protocol and the observations made were recorded in Table 2, where different reconstructed signals were presented to the doctor without details. The goal is to see at what rate it will be unable to interpret the signals.

The result of these tests, allows us to make a comparison of the same signals with the results of other authors in the literature for different methods used. Here the PRD and CR criteria are compared in Table 3.

5. Conclusion

By exploiting the properties of set theory, we have implemented a robust algorithm for ECG compression which has the particularity of grouping signal data according to its main peaks before compression. This grouping into four subsets helps to reduce errors and introduce bias during reconstruction while increasing the correlation between signal data to achieve high compression rates. It has been presented also a comparison between the results obtained and some results from other researchers. The proposed solution by using PRD and CR criteria performs better than the ones from other authors in the field. In perspective, the model put in place can also allow the clinician to have filtering options for specific and critical parts of the ECG which are the P, T, U, QRS waves which contain the most relevant information.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Pascal, N.E. and Basile, K.I. (2012) ECG Compression by Discrete Cosine Associated Wavelet 2-D Transforms. International Journal of Computer and Information Technology, 1, 97-102.
[2] Istepanian, R.S.H. and Petrosian, A.A. (2000) Optimal Zonal Wavelet-Based ECG Data Compression for a Mobile Telecardiology System. IEEE Transactions on Biomedical Engineering, 4, 200-211.
https://doi.org/10.1109/4233.870030
[3] Addison, P.S. (2005) Wavelet Transforms and the ECG: A Review. Physiological Measurement, 26, R155-R199.
https://doi.org/10.1088/0967-3334/26/5/R01
[4] Olmos, S., Millan, M., Garcia, J. and Laguna, P. (1996) ECG Data Compression with the Karhunen-Loeve Transform. Computers in Cardiology 1996, Indianapolis, 8-11 September 1996, 253-256.
[5] Uyar, K. and Ider, Y.Z. (2001) Development of a Compression Algorithm Suitable for Exercise ECG Data. Proceedings of the 23rd Annual International Conferences of the IEEE Engineering in Medicine and Biology Society, Istanbul, 25-28 October 2001, 3521-3524.
[6] Batista, L.V., Carcalho, L.C. and Melcher, E.U.K. (2003) Compression of ECG Signals Based on Optimum Quantization of Discrete Cosine Transform Coefficients and Golomb-Rice Coding. Proceedings of the 25th Annual International Conferences of the IEEE Engineering in Medicine and Biology Society, Cancun, 17-21 September 2003, 2647-2650.
[7] Manai, L. and Bouzid, R. (2017) Analyse et classification des signaux ECG sous MATLAB et implémentation d’une solution embarquée. In: Conférence Internationale en Automatique et Traitement du Signal, Proceeding of Engineering and Technology, Vol. 24, IPCO & Co., Tunis, 13-17.
[8] Al-Busaidi, A., Khriji, L. and Hossen, Y. (2015) Cardiac Arrhythmias Classification and Compression Using a Hybrid Technique. Science and Technology Publications, Setúbal.
[9] Aziz, S., Ahmed, S. and Alouini, M.-S. (2021) ECG-Based Machine-Learning Algorithms for Heartbeat Classification. Scientific Reports, 11, Article No. 18738.
https://doi.org/10.1038/s41598-021-97118-5
[10] Clinical ECG Interpretation.
https://ecgwaves.com/topic/ecg-normal-p-wave-qrs-complex-st-segment-t-wave-j-point/
[11] Krivine, J. L. (1998) Set Theory. Cassini Edition, Paris.
[12] Kabiena, I.B. and Tonye, E. (2015) Simultaneous Iterative Reconstruction Technique by Selective Discrimination SIRT-DS. International Journal of Innovative Research in Science, Engineering and Technology, 4, 10367-10375.
[13] El B’charri, O., Latif, R., Jenkal, W. and Abenaou, A. (2016) The ECG Signal Compression Using an Efficient Algorithm Based on the DWT. International Journal of Advanced Computer Science and Applications, 7, 181-187.
https://doi.org/10.14569/IJACSA.2016.070325
[14] Tornekar, R.V. and Gajre, S.S. (2017) New Improved Methodology for ECG Signal Compression. Computing in Cardiology, 44, 1-4.
https://doi.org/10.22489/CinC.2017.094-238
[15] Daubechies, I. (1992) Ten Lectures on Wavelets. In: CBMS-NSF Regional Conference Series in Applied Mathematics, Society for Industrial and Applied Mathematics, Pensylvania, 46-50.
https://doi.org/10.1137/1.9781611970104
[16] Misiti, M., Misiti, Y., Oppenheim, G. and Poggi, J.M. (2008) Wavelet Toolbox, User’s Guide. The MathWorks, Natick.
http://cda.psych.uiuc.edu/matlab_pdf/wavelet_ug.pdf
[17] Khawaja, A. (2006) Automatic ECG Analysis Using Principal Component Analysis and Wavelet Transformation. Fakultät für Elektrotechnik und Informationstechnik. Institut für Biomedizinische Technik, Karlsruhe.
[18] Gutzwiller, J.L., Hariti, M., Barret, M., Christophe, E., Thiebaut, C. and Duhamel, P. (2009) Extension du codeur SPIHT au codage d’images hyperspectrales. In: Colloque CORESA, CNRS, Toulouse, 6 p.
https://liris.cnrs.fr/Documents/Liris-4087.pdf
[19] Ktata, S., Ouni, K. and Ellouze, N. (2009) A Novel Compression Algorithm for Electrocardiogram Signals Based on Wavelet Transform and SPIHT. International Journal of Signal Processing, 5, 145-152.
[20] Tonye, E. and Kabiena, I. (2017) Evaluation of Tomographic Brain Reconstruction Techniques: Case of the Shepp-Logan Phantom. International Journal of Biosensors & Bioelectronics, 2, 169-173.
https://doi.org/10.15406/ijbsbe.2017.02.00042
[21] Moody, G. and Mark, R. (2005) MIT-BIH Arrhythmia Database. PhysioNet.
https://www.physionet.org/content/mitdb/1.0.0/

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.