| Literature DB >> 35884327 |
Jiguang Shi1, Fei Wang1, Moran Qin1, Aiyun Chen1, Wenhan Liu1, Jin He1, Hao Wang1, Sheng Chang1, Qijun Huang1.
Abstract
In the past few years, deep learning-based electrocardiogram (ECG) compression methods have achieved high-ratio compression by reducing hidden nodes. However, this reduction can result in severe information loss, which will lead to poor quality of the reconstructed signal. To overcome this problem, a novel quality-guaranteed ECG compression method based on a binary convolutional auto-encoder (BCAE) equipped with residual error compensation (REC) was proposed. In traditional compression methods, ECG signals are compressed into floating-point numbers. BCAE directly compresses the ECG signal into binary codes rather than floating-point numbers, whereas binary codes take up fewer bits than floating-point numbers. Compared with the traditional floating-point number compression method, the hidden nodes of the BCAE network can be artificially increased without reducing the compression ratio, and as many hidden nodes as possible can ensure the quality of the reconstructed signal. Furthermore, a novel optimization method named REC was developed. It was used to compensate for the residual between the ECG signal output by BCAE and the original signal. Complemented with the residual error, the restoration of the compression signal was improved, so the reconstructed signal was closer to the original signal. Control experiments were conducted to verify the effectiveness of this novel method. Validated by the MIT-BIH database, the compression ratio was 117.33 and the root mean square difference (PRD) was 7.76%. Furthermore, a portable compression device was designed based on the proposed algorithm using Raspberry Pi. It indicated that this method has attractive prospects in telemedicine and portable ECG monitoring systems.Entities:
Keywords: binary convolutional auto-encoder (BCAE); electrocardiogram (ECG); portable ECG monitoring system; residual error compensation (REC); signal compression
Mesh:
Year: 2022 PMID: 35884327 PMCID: PMC9312953 DOI: 10.3390/bios12070524
Source DB: PubMed Journal: Biosensors (Basel) ISSN: 2079-6374
Figure 1Structure of the proposed ECG compression method.
Figure 2Sketch map of the structure of BCAE.
Figure 3Sketch map of the structure of RECN (MLP).
Figure 4The compression method: (a) conventional CAE. (b) BCAE.
Figure 5Step function and modified step function.
Figure 6(a) Structure of the compression package. (b) Process of obtaining the reconstructed signal.
Detailed configuration information of BCAE.
| Section | No. | Layer Name |
| Pooling | Dropout | Activation | Output Size |
|---|---|---|---|---|---|---|---|
| Input | Original Signal |
| |||||
| Convolutional | 1 | 1D Conv |
| — |
| Tanh |
|
| 2 | 1D Conv + BN |
| — |
| Tanh |
| |
| 3 | Max Pooling | — | 2 |
| — |
| |
| 4 | 1D Conv + BN |
| — |
| Tanh |
| |
| 5 | 1D Conv + BN |
| — |
| Tanh |
| |
| 6 | Max Pooling | — | 2 |
| — |
| |
| 7 | 1D Conv + BN |
| — |
| Tanh |
| |
| 8 | 1D Conv + BN |
| — |
| Tanh |
| |
| 9 | Max Pooling | — | 2 |
| — |
| |
| 10 | 1D Conv + BN |
| — |
| Tanh |
| |
| 11 | 1D Conv + BN |
| — |
| Tanh |
| |
| 12 | Max Pooling | — | 2 |
| — |
| |
| 13 | 1D Conv + BN |
| — |
| Tanh |
| |
| 14 | BEL | — | — |
| Step |
| |
| Compressed code | Binary Compressed Code |
| |||||
| Convolutional | 15 | 1D TConv |
| — |
| Tanh |
|
| 16 | Up-sampling | — | 2 |
| — |
| |
| 17 | 1D TConv + BN |
| — |
| Tanh |
| |
| 18 | 1D TConv + BN |
| — |
| Tanh |
| |
| 19 | Up-sampling | — | 2 |
| — |
| |
| 20 | 1D TConv + BN |
| — |
| Tanh |
| |
| 21 | 1D TConv + BN |
| — |
| Tanh |
| |
| 22 | Up-sampling | — | 2 |
| — |
| |
| 23 | 1D TConv + BN |
| — |
| Tanh |
| |
| 24 | 1D TConv + BN |
| — |
| Tanh |
| |
| 25 | Up-sampling | — | 2 |
| — |
| |
| 26 | 1D TConv + BN |
| — |
| Tanh |
| |
| 27 | 1D TConv + BN |
| — |
| Tanh |
| |
| 28 | Linear layer | — | — |
| — |
| |
| Output | Reconstructed Signal |
| |||||
BN: Batch Normalization. 1D TConv: 1D Transposed convolutional layer. BEL: Binary encoding layer.
Detailed configuration information of RECN.
| Section | No. | Layer Name | Activation Function | Output Size |
|---|---|---|---|---|
| Input | Binary Compressed Code |
| ||
| Hidden | 1 | Hidden layer 1 | Relu |
|
| 2 | Hidden layer 2 | Relu |
| |
| 3 | Hidden layer 3 | Relu |
| |
| 4 | Hidden layer 4 | Relu |
| |
| 5 | Hidden layer 5 | Relu |
| |
| 6 | Linear layer | — |
| |
| Output | Residual Error |
| ||
Figure 7Graph of variation of the loss value versus epochs for BCAE and RECN.
Compression performance on the test set and each record in the MIT-BIH database.
| Record | PRD(%) | PRDN(%) | RMS | SNR (dB) | QS | Record | PRD(%) | PRDN(%) | RMS | SNR (dB) | QS |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 100 | 8.06 | 14.41 | 0.016 | 17.07 | 14.56 | 202 | 15.06 | 20.90 | 0.032 | 14.00 | 7.79 |
| 101 | 10.89 | 14.18 | 0.018 | 17.31 | 10.77 | 203 | 13.43 | 29.78 | 0.053 | 11.17 | 8.74 |
| 102 | 9.37 | 22.65 | 0.027 | 13.07 | 12.52 | 205 | 11.14 | 19.72 | 0.023 | 14.75 | 10.53 |
| 103 | 8.44 | 14.12 | 0.017 | 17.68 | 13.91 | 207 | 2.59 | 12.47 | 0.021 | 18.49 | 45.35 |
| 104 | 6.26 | 20.41 | 0.025 | 14.08 | 18.74 | 208 | 11.47 | 21.91 | 0.042 | 13.72 | 10.23 |
| 105 | 11.13 | 15.89 | 0.025 | 16.43 | 10.55 | 209 | 6.59 | 24.32 | 0.025 | 12.50 | 17.81 |
| 106 | 11.28 | 23.30 | 0.037 | 13.27 | 10.41 | 210 | 9.82 | 18.23 | 0.031 | 15.78 | 11.94 |
| 107 | 4.92 | 15.77 | 0.027 | 16.35 | 23.84 | 212 | 8.93 | 19.49 | 0.029 | 14.50 | 13.14 |
| 108 | 6.36 | 20.19 | 0.031 | 14.25 | 18.45 | 213 | 5.90 | 17.06 | 0.027 | 15.78 | 19.89 |
| 109 | 4.26 | 9.11 | 0.015 | 21.05 | 27.54 | 214 | 6.92 | 11.10 | 0.018 | 19.52 | 16.96 |
| 111 | 8.69 | 21.16 | 0.031 | 13.77 | 13.5 | 215 | 5.83 | 18.14 | 0.028 | 15.08 | 20.11 |
| 112 | 5.10 | 17.12 | 0.021 | 15.45 | 23.00 | 217 | 4.61 | 15.48 | 0.027 | 16.44 | 25.44 |
| 113 | 6.80 | 12.11 | 0.017 | 18.75 | 17.25 | 219 | 7.69 | 13.03 | 0.019 | 17.85 | 15.27 |
| 114 | 5.26 | 24.84 | 0.037 | 12.35 | 22.29 | 220 | 4.22 | 16.81 | 0.016 | 16.08 | 27.80 |
| 115 | 3.39 | 11.07 | 0.011 | 19.31 | 34.56 | 221 | 9.63 | 17.11 | 0.033 | 15.84 | 12.19 |
| 116 | 6.99 | 15.96 | 0.019 | 16.79 | 16.80 | 222 | 22.86 | 40.88 | 0.047 | 8.47 | 5.13 |
| 117 | 3.75 | 16.39 | 0.022 | 16.29 | 31.27 | 223 | 8.38 | 16.35 | 0.026 | 16.89 | 14.00 |
| 118 | 3.02 | 10.40 | 0.014 | 19.77 | 38.80 | 228 | 8.28 | 20.15 | 0.038 | 14.72 | 14.17 |
| 119 | 4.51 | 11.67 | 0.021 | 19.07 | 26.04 | 230 | 3.50 | 15.16 | 0.016 | 16.71 | 33.57 |
| 121 | 11.80 | 14.53 | 0.026 | 17.03 | 9.94 | 231 | 4.37 | 14.41 | 0.016 | 16.95 | 26.82 |
| 122 | 8.72 | 12.34 | 0.02 | 18.57 | 13.46 | 232 | 7.19 | 21.61 | 0.027 | 13.50 | 16.32 |
| 123 | 4.22 | 13.22 | 0.014 | 17.86 | 27.82 | 233 | 4.19 | 13.99 | 0.025 | 17.51 | 28.00 |
| 124 | 8.12 | 11.52 | 0.019 | 19.24 | 14.44 | 234 | 15.09 | 18.82 | 0.025 | 14.75 | 7.77 |
| 200 | 4.22 | 17.19 | 0.032 | 15.74 | 27.82 | Average of 48 records | 7.76 | 17.53 | 0.026 | 15.93 | 18.75 |
| 201 | 9.31 | 24.98 | 0.044 | 12.91 | 12.60 |
CR: 117.33 (320 × 11 bit/30 bit).
Figure 8The comparison of the compression performance. (a) The best compression quality: Record 207. (b) The worst compression quality: record 222. For ease of viewing, the loss signal is shifted down by one unit to the −1 position.
Rhythm and compression performance on records 100, 117, and 119.
| Record | PRD (%) | RMS | SNR (dB) | QS | Rhythm (Samples) |
|---|---|---|---|---|---|
| 100 | 8.06 | 0.016 | 17.07 | 14.56 | 286.05 |
| 117 | 3.75 | 0.022 | 16.29 | 31.27 | 422.85 |
| 119 | 4.51 | 0.021 | 19.07 | 26.04 | 327.02 |
| Average | 5.44 | 0.020 | 17.48 | 23.95 | 319.11 |
Input size: 320 samples. CR: 117.33 (320 × 11bit/30bit). Rhythm: the average of the RR interval.
Figure 9Compression performance of records 100, 117, and 119.
Figure 10The performance improvement of BCAE and RECN. CR: 117.33.
Comparison with previous work.
| No. | Year | Method | Data | Records | CR | PRD (%) | PRDN (%) | QS |
|---|---|---|---|---|---|---|---|---|
| 1 | 2005 | SPHIT [ | MITdb | 3 (100, 107, 119) | 21.4 | 7.27 | — | 3.21 |
| 2 | 2016 | PCA [ | MITdb | All records | 50.74 | 16.22 | 16.22 | 3.13 |
| 3 | 2017 | EZW [ | MITctdb | All records | 9.27 | 8.17 | — | 1.13 |
| 4 | 2018 | DCT [ | MITdb | All records | 6.27 | 5.37 | 7.95 | 1.49 |
| 5 | 2018 | CAE [ | MITdb | All records | 32.25 | 2.73 | 31.17 | 11.81 |
| 7 | 2019 | SCAE [ | MITdb | All records | 106.45 | 8.00 | — | 16.44 |
|
|
|
|
| All records |
|
|
|
|
SPHIT: set partitioning in hierarchical trees coding. PCA: principal component analysis. EZW: embedded zerotree wavelet. DCT: discrete cosine transform composition. CAE: convolutional auto-encoder. SCAE: spindle convolutional auto-encoder. MITdb: MIT-BIH database. QS:CR/PRD. MITctdb: MIT-BIH ECG Compression Test Database. CR: compression ratio. PRD: percentage RMS difference. PRDN: normalized version of PRD. QS: quality score. (The four evaluation indicators are defined in Section 3.1).
Figure 11Arrhythmia detection using original and reconstructed signals separately.
Classification results of original and reconstructed signals.
| Signal Type | Accuracy | F1_Score | F1_Score | ||||
|---|---|---|---|---|---|---|---|
| N | L | R | A | V | |||
| original signal | 96.34% | 93.05% | 97.50% | 98.50% | 98.19% | 79.23% | 91.81% |
| reconstructed signal | 95.77% | 92.15% | 97.13% | 95.96% | 97.42% | 79.03% | 91.18% |
Accuracy = (TP + TN)/(TP + TN + FP + FN) F1_score = 2 × TP/(2 × TP + TN + FP + FN) TP: true positive; TN: true negative; FP: false positive; FN: false negative.
Figure 12Structure of the portable ECG compression device.
Comparison of input signal time and signal processing time with Raspberry Pi.
| Time(s) | |
|---|---|
| Input heartbeat | 0.8889 |
| Compression | 0.0101 |